geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r330111 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core: ./ META-INF/ src/org/apache/geronimo/core/internal/ src/org/apache/geronimo/core/operations/
Date Tue, 01 Nov 2005 19:54:11 GMT
Author: sppatel
Date: Tue Nov  1 11:54:05 2005
New Revision: 330111

URL: http://svn.apache.org/viewcvs?rev=330111&view=rev
Log:
change op extensions to *FacetOperation
add dependency to wtp.jca
use export ops until WTP implementation of PublishUtils is complete

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/META-INF/MANIFEST.MF
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/plugin.xml
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/DeploymentPlanCreationOperation.java

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/META-INF/MANIFEST.MF?rev=330111&r1=330110&r2=330111&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/META-INF/MANIFEST.MF
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/META-INF/MANIFEST.MF
Tue Nov  1 11:54:05 2005
@@ -17,6 +17,7 @@
  org.eclipse.jst.j2ee.core,
  org.eclipse.jst.j2ee.web,
  org.eclipse.jst.j2ee.ejb,
+ org.eclipse.jst.j2ee.jca,
  org.eclipse.jst.server.generic.core,
  org.eclipse.emf.ecore.xmi,
  org.eclipse.wst.common.modulecore,

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/plugin.xml?rev=330111&r1=330110&r2=330111&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/plugin.xml
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/plugin.xml
Tue Nov  1 11:54:05 2005
@@ -61,24 +61,24 @@
    
    <extension id="GeronimoOpExtensions" name="GeronimoOpExtensions" point="org.eclipse.wst.common.frameworks.OperationExtension">
								
 		<operationExtension
-			id="org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationOperation"
+			id="org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationFacetOperation"
 			postOperationClass="org.apache.geronimo.core.operations.DeploymentPlanCreationOperation">
		
 	    </operationExtension>	   
 	    <operationExtension
-			id="org.eclipse.jst.j2ee.internal.ejb.archiveoperations.EjbComponentCreationOperation"
+			id="org.eclipse.jst.j2ee.internal.ejb.archiveoperations.EjbComponentCreationFacetOperation"
 			postOperationClass="org.apache.geronimo.core.operations.DeploymentPlanCreationOperation">
 		</operationExtension>		
 		<operationExtension
-			id="org.eclipse.jst.j2ee.application.internal.operations.EARComponentCreationOperation"
+			id="org.eclipse.jst.j2ee.application.internal.operations.EARComponentCreationFacetOperation"
 			postOperationClass="org.apache.geronimo.core.operations.DeploymentPlanCreationOperation">
 		</operationExtension>	
 	    <operationExtension
-			id="org.eclipse.jst.j2ee.internal.jca.operations.ConnectorComponentCreationOperation"
+			id="org.eclipse.jst.j2ee.internal.jca.operations.ConnectorComponentCreationFacetOperation"
 			postOperationClass="org.apache.geronimo.core.operations.DeploymentPlanCreationOperation">
 		</operationExtension>
 		
 		<operationExtension
-			id="org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentImportOperation"
+			id="org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentImportFacetOperation"
 			postOperationClass="org.apache.geronimo.core.operations.ImportDeploymentPlanOperation">
 		</operationExtension>		
    </extension>

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java?rev=330111&r1=330110&r2=330111&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
Tue Nov  1 11:54:05 2005
@@ -54,14 +54,26 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.jmx.KernelDelegate;
+import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.j2ee.application.internal.operations.EARComponentExportDataModelProvider;
+import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentExportDataModelProvider;
 import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
+import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBComponentExportDataModelProvider;
+import org.eclipse.jst.j2ee.internal.jca.operations.ConnectorComponentExportDataModelProvider;
+import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportDataModelProvider;
 import org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IServer;
 
@@ -82,8 +94,9 @@
 	private IProgressMonitor _monitor = null;
 
 	private Kernel kernel = null;
+	
 
-	public GeronimoServerBehaviour() {
+	public GeronimoServerBehaviour() {		
 		super();
 	}
 
@@ -401,9 +414,9 @@
 			waitForCompletion(po, listener, CommandType.START, module
 					.getProject());
 			if (po.getDeploymentStatus().isCompleted()) {
-				//TODO
+				// TODO
 			} else if (po.getDeploymentStatus().isFailed()) {
-				//TODO
+				// TODO
 			}
 		} else if (po.getDeploymentStatus().isFailed()) {
 			IStatus status = new Status(
@@ -428,9 +441,9 @@
 			waitForCompletion(po, listener, CommandType.REDEPLOY, module
 					.getProject());
 			if (po.getDeploymentStatus().isCompleted()) {
-				//TODO
+				// TODO
 			} else if (po.getDeploymentStatus().isFailed()) {
-				//TODO
+				// TODO
 			}
 		}
 	}
@@ -445,9 +458,9 @@
 			waitForCompletion(po, listener, CommandType.UNDEPLOY, module
 					.getProject());
 			if (po.getDeploymentStatus().isCompleted()) {
-				//TODO
+				// TODO
 			} else if (po.getDeploymentStatus().isFailed()) {
-				//TODO
+				// TODO
 			}
 		}
 	}
@@ -480,8 +493,54 @@
 		}
 		return null;
 	}
-
+	
 	private File createJarFile(IModule module) {
+		IDataModel model = getExportDataModel(module);
+		
+		IVirtualComponent comp = ComponentCore.createComponent(module
+				.getProject());		
+		
+		IPath path = GeronimoPlugin.getInstance().getStateLocation();
+		
+		model.setProperty(J2EEComponentExportDataModelProvider.PROJECT_NAME,
+				module.getProject());
+		model.setProperty(
+				J2EEComponentExportDataModelProvider.ARCHIVE_DESTINATION,
+				path.append(module.getName()) + ".zip");
+		model.setProperty(J2EEComponentExportDataModelProvider.COMPONENT, comp);
+		model.setBooleanProperty(J2EEComponentExportDataModelProvider.OVERWRITE_EXISTING, true);
+		
+		if (model != null) {
+			try {
+				model.getDefaultOperation().execute(_monitor, null);
+				return new File(model.getStringProperty(J2EEComponentExportDataModelProvider.ARCHIVE_DESTINATION));
+			} catch (ExecutionException e) {
+				e.printStackTrace();
+			}
+		}
+		
+		return null;
+	}
+
+	private IDataModel getExportDataModel(IModule module) {
+		String type = module.getModuleType().getId();
+		if (IModuleConstants.JST_WEB_MODULE.equals(type)) {
+			return DataModelFactory
+					.createDataModel(new WebComponentExportDataModelProvider());
+		} else if (IModuleConstants.JST_EJB_MODULE.equals(type)) {
+			return DataModelFactory
+					.createDataModel(new EJBComponentExportDataModelProvider());
+		} else if (IModuleConstants.JST_EAR_MODULE.equals(type)) {
+			return DataModelFactory
+					.createDataModel(new EARComponentExportDataModelProvider());
+		} else if (IModuleConstants.JST_CONNECTOR_MODULE.equals(type)) {
+			return DataModelFactory
+					.createDataModel(new ConnectorComponentExportDataModelProvider());
+		}
+		return null;
+	}
+
+	/*private File createJarFile2(IModule module) {
 		J2EEFlexProjDeployable j2eeModule = (J2EEFlexProjDeployable) module
 				.loadAdapter(J2EEFlexProjDeployable.class, null);
 
@@ -513,9 +572,10 @@
 			Trace.trace(Trace.SEVERE, "Error creating zip file", e);
 			return null;
 		}
-	}
+	}*/
+
 
-	private void addToJar(String namePrefix, File dir, JarOutputStream jos)
+	/*private void addToJar(String namePrefix, File dir, JarOutputStream jos)
 			throws IOException {
 		File[] contents = dir.listFiles();
 		for (int i = 0; i < contents.length; i++) {
@@ -537,7 +597,7 @@
 				}
 			}
 		}
-	}
+	}*/
 
 	public Map getServerInstanceProperties() {
 		return getRuntimeDelegate().getServerInstanceProperties();

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/DeploymentPlanCreationOperation.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/DeploymentPlanCreationOperation.java?rev=330111&r1=330110&r2=330111&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/DeploymentPlanCreationOperation.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/DeploymentPlanCreationOperation.java
Tue Nov  1 11:54:05 2005
@@ -60,7 +60,7 @@
 	public IStatus execute(IProgressMonitor monitor, IAdaptable info)
 			throws ExecutionException {
 
-		if (isGeronimoRuntimeTarget()) {
+		if (/*isGeronimoRuntimeTarget()*/ true /*TODO need bugzilla fix*/) {
 
 			IVirtualComponent comp = ComponentCore
 					.createComponent(getProject());



Mime
View raw message