geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r453053 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java
Date Wed, 04 Oct 2006 22:30:48 GMT
Author: sppatel
Date: Wed Oct  4 15:30:47 2006
New Revision: 453053

URL: http://svn.apache.org/viewvc?view=rev&rev=453053
Log:
sharedlib process on ear child modules

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java?view=diff&rev=453053&r1=453052&r2=453053
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java
Wed Oct  4 15:30:47 2006
@@ -51,6 +51,8 @@
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
+import org.eclipse.jst.server.core.IEnterpriseApplication;
 import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
 import org.eclipse.wst.server.core.IModule;
@@ -83,8 +85,26 @@
 		IModule module = (IModule) model.getProperty(MODULE);
 		this.server = (IServer) model.getProperty(SERVER);
 		
-		//TODO process child modules if ear project
+		boolean recycle = false;
 		
+		J2EEFlexProjDeployable j2eeModule = (J2EEFlexProjDeployable) module.loadAdapter(J2EEFlexProjDeployable.class,
null);
+		if(j2eeModule instanceof IEnterpriseApplication) {
+			IModule[] modules = j2eeModule.getChildModules();
+			for(int i = 0; i < modules.length; i++) {
+				IStatus status = process(modules[i], monitor);
+				if(status.isOK()) {
+					recycle = true;
+				}
+			}
+		} else {
+			return process(module, monitor);
+		}
+		
+		return recycle ? Status.OK_STATUS : Status.CANCEL_STATUS;
+	}
+	
+	private IStatus process(IModule module, IProgressMonitor monitor) throws ExecutionException
{
+		Trace.trace(Trace.INFO, "SharedLibEntryCreationOperation.process() " + module.getName());
 		IProject project = module.getProject();
 		try {
 			
@@ -164,7 +184,7 @@
 		} catch (Exception e) {
 			throw new ExecutionException("Failed to update shared lib.", e);
 		}
-
+		
 		return Status.OK_STATUS;
 	}
 



Mime
View raw message