/** * Return true if super returns true, or return whether the app dd contains a module having the * uri */ public boolean isNestedArchive(String aUri) { if (super.isNestedArchive(aUri)) return true; return getDeploymentDescriptor().getFirstModule(aUri) != null; }
for (Iterator referenceItr = implicitUtilityReferences.iterator(); referenceItr.hasNext(); ) { reference = (IVirtualReference) referenceItr.next(); module = application.getFirstModule(reference.getArchiveName()); if(module != null) referenceItr.remove();
/** * Determine if the component is nested J2EE module on the application.xml of this EAR * @param aComponent * @return boolean is passed in component a nested J2EE module on this EAR */ private boolean isNestedJ2EEModule(IVirtualComponent aComponent, IVirtualReference[] references, EARArtifactEdit edit) { if (edit==null) return false; Application app = edit.getApplication(); if (app == null) { // if no application.xml, return false return false; } IVirtualReference reference = getReferenceNamed(references,aComponent.getName()); // Ensure module URI exists on EAR DD for binary archive return app.getFirstModule(reference.getArchiveName()) != null; }
/** * @see com.ibm.etools.commonarchive.Archive */ public Archive openNestedArchive(String aUri) throws OpenFailureException { Module m = getDeploymentDescriptor().getFirstModule(aUri); if (m == null) return super.openNestedArchive(aUri); try { ArchiveOptions archiveOptions = getOptionsForOpening(aUri); return openNestedArchive(m, archiveOptions); } catch (java.io.IOException ex) { //Probably the file did not exist; silently fail, per request from WS runtime //More than likely a failure is going to occur down the road when a ModuleFile for a // Module //in the dd is requested } return null; }
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; }
/** * @see com.ibm.etools.commonarchive.Archive */ public Archive openNestedArchive(LooseArchive loose) throws OpenFailureException { Module m = getDeploymentDescriptor().getFirstModule(loose.getUri()); if (m == null) return super.openNestedArchive(loose); try { ArchiveOptions archiveOptions = getOptionsForOpening(loose); return openNestedArchive(m, archiveOptions); } catch (java.io.IOException ex) { //Probably the file did not exist; silently fail, per request from WS runtime //More than likely a failure is going to occur down the road when a ModuleFile for a // Module //in the dd is requested } return null; }
private void updateEARContextRoot(final IProject ear, final IProject project, final String newContextRoot, final IProgressMonitor monitor) { EARArtifactEdit earEdit = null; try { earEdit = EARArtifactEdit.getEARArtifactEditForWrite(ear); if (earEdit != null) { final Application application = earEdit.getApplication(); final IVirtualComponent comp = ComponentCore.createComponent(project); if (comp == null) { return; } final String moduleURI = earEdit.getModuleURI(comp); final Module module = application.getFirstModule(moduleURI); if (module != null && module instanceof WebModule) { ((WebModule) module).setContextRoot(newContextRoot); } earEdit.saveIfNecessary(monitor); } } finally { if (earEdit != null) { earEdit.dispose(); } } }
org.eclipse.jst.j2ee.application.Application application = (org.eclipse.jst.j2ee.application.Application)earArchive.getModelObject(); String moduleName = archive.getPath().toString(); org.eclipse.jst.j2ee.application.WebModule module = (org.eclipse.jst.j2ee.application.WebModule)application.getFirstModule(moduleName); if(module == null){ cachedWebContextRoot[0] = null;
Module j2eeModule = app.getFirstModule(references[i].getArchiveName());
Module j2eeModule = app.getFirstModule(references[i].getArchiveName());