if( visitedWebContext.containsKey( webModule.getContextRoot() ) ) { WebModule tempWebModule = (WebModule)visitedWebContext.get( webModule.getContextRoot() ); String[] params = new String[3]; params[0] = webModule.getContextRoot(); params[1] = webModule.getUri(); params[2] = tempWebModule.getUri(); visitedWebContext.put( webModule.getContextRoot(), webModule );
private boolean currentRootEqualsEARRoot(final IProject earProject, final IProject moduleProject) { EARArtifactEdit earEdit = null; try { earEdit = EARArtifactEdit.getEARArtifactEditForRead(earProject); if (earEdit == null) { return false; } final Application app = earEdit.getApplication(); final IVirtualComponent comp = ComponentCore.createComponent(moduleProject); if (app == null || comp == null) { return false; } final String moduleURI = earEdit.getModuleURI(comp); final Module module = app.getFirstModule(moduleURI); if (module != null && module instanceof WebModule) { final Properties props = comp.getMetaProperties(); if ((props != null) && (props.containsKey(J2EEConstants.CONTEXTROOT))) { return ((WebModule) module).getContextRoot().equals(props.getProperty(J2EEConstants.CONTEXTROOT)); } } } finally { if (earEdit != null) { earEdit.dispose(); } } return false; }
/** * This method will return the context root in this application for the passed in web project. * * @param webProject * @return contextRoot String */ public String getWebContextRoot(IProject webProject) { verifyOperationSupported(); if (webProject == null || !J2EEProjectUtilities.isDynamicWebProject(webProject)) return null; IVirtualComponent webComp = ComponentCore.createComponent(webProject); String webModuleURI = getModuleURI(webComp); if (webModuleURI != null) { WebModule webModule = (WebModule) getApplication().getModule(webModuleURI, null); if (webModule != null) return webModule.getContextRoot(); } return null; }
cachedWebContextRoot[0] = ((WebModule) ((EARFile) commonArchive.getContainer()).getModule(commonArchive.getURI(), null)).getContextRoot(); return cachedWebContextRoot[0]; cachedWebContextRoot[0] = null; } else { cachedWebContextRoot[0] = module.getContextRoot();