return;
}
List moduleDetails = new ArrayList();
ConfigurationManager configManager = ConfigurationUtil.getConfigurationManager(kernel);
DependencyManager depMgr = kernel.getDependencyManager();
List infos = configManager.listConfigurations();
for (Iterator j = infos.iterator(); j.hasNext();) {
ConfigurationInfo info = (ConfigurationInfo) j.next();
if (shouldListConfig(info)) {
ModuleDetails details = new ModuleDetails(info.getConfigID(), info.getType(), info.getState());
if (info.getType().getValue()== ConfigurationModuleType.WAR.getValue()){
WebModule webModule = (WebModule) PortletManager.getModule(renderRequest, info.getConfigID());
if (webModule != null) {
details.setContextPath(webModule.getContextPath());
details.setUrlFor(webModule.getURLFor());
}
}
try {
AbstractName configObjName = Configuration.getConfigurationAbstractName(info.getConfigID());
boolean flag = false;
// Check if the configuration is loaded. If not, load it to get information.
if(!kernel.isLoaded(configObjName)) {
try {
configManager.loadConfiguration(configObjName.getArtifact());
flag = true;
} catch (NoSuchConfigException e) {
// Should not occur
e.printStackTrace();
} catch (LifecycleException e) {
// config could not load because one or more of its dependencies
// has been removed. cannot load the configuration in this case,
// so don't rely on that technique to discover its parents or children
if (e.getCause() instanceof MissingDependencyException) {
// do nothing
} else {
e.printStackTrace();
}
}
}
java.util.Set parents = depMgr.getParents(configObjName);
for(Iterator itr = parents.iterator(); itr.hasNext(); ) {
AbstractName parent = (AbstractName)itr.next();
details.getParents().add(parent.getArtifact());
}
java.util.Set children = depMgr.getChildren(configObjName);
for(Iterator itr = children.iterator(); itr.hasNext(); ) {
AbstractName child = (AbstractName)itr.next();
//if(configManager.isConfiguration(child.getArtifact()))
if(child.getNameProperty("configurationName") != null) {
details.getChildren().add(child.getArtifact());