/** * Finds the parent module where to add the selected component. * * @param component * the component to add as module object. * @param context * the action context. * @return the parent module to add the new module to. */ @SuppressWarnings("UnusedParameters") protected Module findDestinationModule(Object component, Map<String, Object> context) { Workspace workspace = getParentWorkspace(context); String moduleName = getParentModuleName(context); if (workspace == null || moduleName == null) { return getCurrentModule(context); } for (Module m : workspace.getModules()) { Module m2 = findModule(m, moduleName, null); if (m2 != null) { return m2; } } return null; }
context); if (parentModule == null) { Workspace parentWorkspace = getParentWorkspace(context); String parentWorkspaceName = parentWorkspace!=null ? parentWorkspace.getName() : "null"; throw new BackendException("Destination module not found for workpace '" + parentWorkspaceName + "' and module '" + getParentModuleName(context) + "'");