geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r328372 - 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, 25 Oct 2005 14:44:16 GMT
Author: sppatel
Date: Tue Oct 25 07:43:59 2005
New Revision: 328372

URL: http://svn.apache.org/viewcvs?rev=328372&view=rev
Log:
fix compile errors due to new WTP build api changes

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/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/internal/GeronimoUtils.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/AbstractGeronimoJ2EEComponentOperation.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/DeploymentPlanCreationOperation.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ImportDeploymentPlanOperation.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=328372&r1=328371&r2=328372&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 Oct 25 07:43:59 2005
@@ -6,27 +6,28 @@
 Bundle-Activator: org.apache.geronimo.core.internal.GeronimoPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.debug.core,
- org.eclipse.jdt.core,
- org.eclipse.jdt.launching,
- org.eclipse.wst.server.core,
- org.eclipse.jst.server.core,
- org.eclipse.jst.j2ee,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jst.j2ee.web,
- org.eclipse.jst.j2ee.ejb,
- org.eclipse.jst.server.generic.core,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.wst.common.modulecore,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.apache.geronimo.runtime.v1,
- org.eclipse.wst.common.frameworks,
- org.eclipse.core.commands,
- org.apache.geronimo.deployment.model,
- org.eclipse.jem.util,
- org.eclipse.wst.server.core
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.wst.server.core,
+ org.eclipse.jst.server.core,
+ org.eclipse.jst.j2ee,
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.jst.j2ee.web,
+ org.eclipse.jst.j2ee.ejb,
+ org.eclipse.jst.server.generic.core,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.apache.geronimo.runtime.v1,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.core.commands,
+ org.apache.geronimo.deployment.model,
+ org.eclipse.jem.util,
+ org.eclipse.wst.server.core,
+ org.eclipse.jst.common.frameworks
 Eclipse-AutoStart: true
 Export-Package: org.apache.geronimo.core.internal;x-friends:="org.apache.geronimo.ui"

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=328372&r1=328371&r2=328372&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 Oct 25 07:43:59 2005
@@ -59,8 +59,9 @@
 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.server.core.IJ2EEModule;
+import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
 import org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IServer;
@@ -383,11 +384,11 @@
     private void doDeploy(IModule module) throws CoreException,
             DeploymentManagerCreationException {
 
-        IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(
-                IJ2EEModule.class, null);
+    	J2EEFlexProjDeployable j2eeModule = (J2EEFlexProjDeployable) module.loadAdapter(
+    			J2EEFlexProjDeployable.class, null);
 
-        Target[] targets = getDeploymentManager().getTargets();
-        File jarFile = createJarFile(j2eeModule.getLocation());
+        Target[] targets = getDeploymentManager().getTargets();      
+        File jarFile = createJarFile(new Path(j2eeModule.getURI(module)));
 
         GeronimoDeploymentProgressListener listener = createAndStartListener();
 
@@ -421,12 +422,12 @@
     private void doRedeploy(IModule module) throws CoreException,
             DeploymentManagerCreationException {
 
-        IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(
-                IJ2EEModule.class, null);
+    	J2EEFlexProjDeployable j2eeModule = (J2EEFlexProjDeployable) module.loadAdapter(
+    			J2EEFlexProjDeployable.class, null);
 
         TargetModuleID id = getTargetModuleID(module);
         if (id != null) {
-            File jarFile = createJarFile(j2eeModule.getLocation());
+            File jarFile = createJarFile(new Path(j2eeModule.getURI(module)));
             GeronimoDeploymentProgressListener listener = createAndStartListener();
             ProgressObject po = getDeploymentManager().redeploy(
                     new TargetModuleID[] { id }, jarFile, null);

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.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/GeronimoUtils.java?rev=328372&r1=328371&r2=328372&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java
Tue Oct 25 07:43:59 2005
@@ -31,19 +31,17 @@
 import org.apache.geronimo.xml.ns.web.WebPackage;
 import org.apache.geronimo.xml.ns.web.util.WebResourceFactoryImpl;
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
 import org.eclipse.emf.ecore.xmi.XMIResource;
 import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
-import org.eclipse.jst.server.core.IJ2EEModule;
 import org.eclipse.jst.server.core.IWebModule;
 import org.eclipse.wst.common.componentcore.ArtifactEdit;
 import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IFlexibleProject;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
 import org.eclipse.wst.server.core.IModule;
 import org.openejb.xml.ns.openejb.jar.JarPackage;
@@ -136,16 +134,13 @@
         // use the module ID
         String moduleId = module.getId();
 
-        IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(
-                IJ2EEModule.class, null);
-        if (j2eeModule != null && j2eeModule instanceof J2EEFlexProjDeployable) {
-            J2EEFlexProjDeployable j2eeFlex = (J2EEFlexProjDeployable) j2eeModule;
+        J2EEFlexProjDeployable j2eeModule = (J2EEFlexProjDeployable) module.loadAdapter(
+        		J2EEFlexProjDeployable.class, null);
+        if (j2eeModule != null) {                 
             // j2eeFlex
             ArtifactEdit edit = null;
-
             try {
-                edit = ArtifactEdit.getArtifactEditForRead(j2eeFlex
-                        .getComponentHandle());
+                edit = ArtifactEdit.getArtifactEditForRead(j2eeModule.getProject());
                 XMIResource res = (XMIResource) edit.getContentModelRoot()
                         .eResource();
                 moduleId = res.getID(edit.getContentModelRoot());
@@ -160,7 +155,7 @@
 
         // ...but if there is no defined module ID, pick the best alternative
 
-        IPath moduleLocation = j2eeModule.getLocation();
+        IPath moduleLocation = new Path(j2eeModule.getURI(module));
         if (moduleLocation != null) {
             moduleId = moduleLocation.removeFileExtension().lastSegment();
         }
@@ -295,14 +290,8 @@
         return getConnectorDeploymentPlan(getVirtualComponent(module));
     }
 
-    private static IVirtualComponent getVirtualComponent(IModule module) {
-        IProject project = module.getProject();
-
-        IFlexibleProject flexProject = ComponentCore
-                .createFlexibleProject(project);
-        IVirtualComponent component = flexProject
-                .getComponent(module.getName());
-        return component;
+    private static IVirtualComponent getVirtualComponent(IModule module) {        
+        return ComponentCore.createComponent(module.getProject());
     }
 
     private static Resource load(IFile dpFile, ResourceSet resourceSet) {

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/AbstractGeronimoJ2EEComponentOperation.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/AbstractGeronimoJ2EEComponentOperation.java?rev=328372&r1=328371&r2=328372&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/AbstractGeronimoJ2EEComponentOperation.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/AbstractGeronimoJ2EEComponentOperation.java
Tue Oct 25 07:43:59 2005
@@ -22,9 +22,9 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.wst.common.componentcore.datamodel.properties.IComponentCreationDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFlexibleProjectCreationDataModelProperties;
 import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.properties.IFlexibleProjectCreationDataModelProperties;
 import org.eclipse.wst.server.core.IRuntime;
 import org.eclipse.wst.server.core.ServerCore;
 

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=328372&r1=328371&r2=328372&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 Oct 25 07:43:59 2005
@@ -39,6 +39,7 @@
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
 import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
 import org.eclipse.wst.common.componentcore.ComponentCore;
 import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -47,171 +48,169 @@
 import org.openejb.xml.ns.openejb.jar.OpenejbJarType;
 
 public class DeploymentPlanCreationOperation extends
-        AbstractGeronimoJ2EEComponentOperation {
+		AbstractGeronimoJ2EEComponentOperation {
 
-    public DeploymentPlanCreationOperation() {
-    }
+	public DeploymentPlanCreationOperation() {
+	}
 
-    public DeploymentPlanCreationOperation(IDataModel model) {
-        super(model);
-    }
+	public DeploymentPlanCreationOperation(IDataModel model) {
+		super(model);
+	}
 
-    public IStatus execute(IProgressMonitor monitor, IAdaptable info)
-            throws ExecutionException {
+	public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+			throws ExecutionException {
 
-        if (isGeronimoRuntimeTarget()) {
+		if (isGeronimoRuntimeTarget()) {
 
-            IVirtualComponent comp = ComponentCore.createComponent(
-                    getProject(), getComponentName());
+			IVirtualComponent comp = ComponentCore
+					.createComponent(getProject());
 
-            if (comp.getComponentTypeId().equals(
-                    IModuleConstants.JST_WEB_MODULE)) {
-                createGeronimoWebDeploymentPlan(GeronimoUtils
-                        .getWebDeploymentPlanFile(comp));
-            } else if (comp.getComponentTypeId().equals(
-                    IModuleConstants.JST_EJB_MODULE)) {
-                createOpenEjbDeploymentPlan(GeronimoUtils
-                        .getOpenEjbDeploymentPlanFile(comp));
-            } else if (comp.getComponentTypeId().equals(
-                    IModuleConstants.JST_EAR_MODULE)) {
-                createGeronimoApplicationDeploymentPlan(GeronimoUtils
-                        .getApplicationDeploymentPlanFile(comp));
-            } else if (comp.getComponentTypeId().equals(
-                    IModuleConstants.JST_CONNECTOR_MODULE)) {
-                createConnectorDeploymentPlan(GeronimoUtils
-                        .getConnectorDeploymentPlanFile(comp));
-            }
-        }
+			String type = J2EEProjectUtilities.getJ2EEProjectType(getProject());
 
-        return Status.OK_STATUS;
-    }
+			if (IModuleConstants.JST_WEB_MODULE.equals(type)) {
+				createGeronimoWebDeploymentPlan(GeronimoUtils
+						.getWebDeploymentPlanFile(comp));
+			} else if (IModuleConstants.JST_EJB_MODULE.equals(type)) {
+				createOpenEjbDeploymentPlan(GeronimoUtils
+						.getOpenEjbDeploymentPlanFile(comp));
+			} else if (IModuleConstants.JST_EAR_MODULE.equals(type)) {
+				createGeronimoApplicationDeploymentPlan(GeronimoUtils
+						.getApplicationDeploymentPlanFile(comp));
+			} else if (IModuleConstants.JST_CONNECTOR_MODULE.equals(type)) {
+				createConnectorDeploymentPlan(GeronimoUtils
+						.getConnectorDeploymentPlanFile(comp));
+			}
+		}
 
-    public ApplicationType createGeronimoApplicationDeploymentPlan(IFile dpFile) {
-        URI uri = URI
-                .createPlatformResourceURI(dpFile.getFullPath().toString());
+		return Status.OK_STATUS;
+	}
 
-        ResourceSet resourceSet = new ResourceSetImpl();
-        GeronimoUtils.registerAppFactoryAndPackage(resourceSet);
+	public ApplicationType createGeronimoApplicationDeploymentPlan(IFile dpFile) {
+		URI uri = URI
+				.createPlatformResourceURI(dpFile.getFullPath().toString());
 
-        Resource resource = resourceSet.createResource(uri);
-        org.apache.geronimo.xml.ns.j2ee.application.DocumentRoot documentRoot = ApplicationFactory.eINSTANCE
-                .createDocumentRoot();
-        ApplicationType root = ApplicationFactory.eINSTANCE
-                .createApplicationType();
+		ResourceSet resourceSet = new ResourceSetImpl();
+		GeronimoUtils.registerAppFactoryAndPackage(resourceSet);
 
-        EMap map = documentRoot.getXMLNSPrefixMap();
-        map.put("", GeronimoSchemaNS.GERONIMO_APP_NS);
-        map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS);
-        map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
+		Resource resource = resourceSet.createResource(uri);
+		org.apache.geronimo.xml.ns.j2ee.application.DocumentRoot documentRoot = ApplicationFactory.eINSTANCE
+				.createDocumentRoot();
+		ApplicationType root = ApplicationFactory.eINSTANCE
+				.createApplicationType();
 
-        root.setApplicationName(getComponentName());
-        root.setConfigId(getProject().getName() + "/" + getComponentName());
+		EMap map = documentRoot.getXMLNSPrefixMap();
+		map.put("", GeronimoSchemaNS.GERONIMO_APP_NS);
+		map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS);
+		map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
 
-        documentRoot.setApplication(root);
-        resource.getContents().add(documentRoot);
+		root.setApplicationName(getComponentName());
+		root.setConfigId(getProject().getName() + "/" + getComponentName());
 
-        doSave(resource);
+		documentRoot.setApplication(root);
+		resource.getContents().add(documentRoot);
 
-        return root;
-    }
+		doSave(resource);
 
-    public WebAppType createGeronimoWebDeploymentPlan(IFile dpFile) {
+		return root;
+	}
 
-        URI uri = URI
-                .createPlatformResourceURI(dpFile.getFullPath().toString());
+	public WebAppType createGeronimoWebDeploymentPlan(IFile dpFile) {
 
-        ResourceSet resourceSet = new ResourceSetImpl();
-        GeronimoUtils.registerWebFactoryAndPackage(resourceSet);
+		URI uri = URI
+				.createPlatformResourceURI(dpFile.getFullPath().toString());
 
-        Resource resource = resourceSet.createResource(uri);
-        DocumentRoot documentRoot = WebFactory.eINSTANCE.createDocumentRoot();
+		ResourceSet resourceSet = new ResourceSetImpl();
+		GeronimoUtils.registerWebFactoryAndPackage(resourceSet);
 
-        EMap map = documentRoot.getXMLNSPrefixMap();
-        map.put("", GeronimoSchemaNS.GERONIMO_WEB_NS);
-        map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS);
-        map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS);
-        map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
+		Resource resource = resourceSet.createResource(uri);
+		DocumentRoot documentRoot = WebFactory.eINSTANCE.createDocumentRoot();
 
-        WebAppType root = WebFactory.eINSTANCE.createWebAppType();
+		EMap map = documentRoot.getXMLNSPrefixMap();
+		map.put("", GeronimoSchemaNS.GERONIMO_WEB_NS);
+		map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS);
+		map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS);
+		map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
 
-        root.setConfigId(getProject().getName() + "/" + getComponentName());
-        root.setContextRoot("/" + getComponentName());
-        root.setContextPriorityClassloader(false);
+		WebAppType root = WebFactory.eINSTANCE.createWebAppType();
 
-        documentRoot.setWebApp(root);
-        resource.getContents().add(documentRoot);
+		root.setConfigId(getProject().getName() + "/" + getComponentName());
+		root.setContextRoot("/" + getComponentName());
+		root.setContextPriorityClassloader(false);
 
-        doSave(resource);
+		documentRoot.setWebApp(root);
+		resource.getContents().add(documentRoot);
 
-        return root;
-    }
+		doSave(resource);
 
-    public OpenejbJarType createOpenEjbDeploymentPlan(IFile dpFile) {
-        URI uri = URI
-                .createPlatformResourceURI(dpFile.getFullPath().toString());
+		return root;
+	}
 
-        ResourceSet resourceSet = new ResourceSetImpl();
-        GeronimoUtils.registerEjbFactoryAndPackage(resourceSet);
+	public OpenejbJarType createOpenEjbDeploymentPlan(IFile dpFile) {
+		URI uri = URI
+				.createPlatformResourceURI(dpFile.getFullPath().toString());
 
-        Resource resource = resourceSet.createResource(uri);
-        org.openejb.xml.ns.openejb.jar.DocumentRoot documentRoot = JarFactory.eINSTANCE
-                .createDocumentRoot();
-        OpenejbJarType root = JarFactory.eINSTANCE.createOpenejbJarType();
+		ResourceSet resourceSet = new ResourceSetImpl();
+		GeronimoUtils.registerEjbFactoryAndPackage(resourceSet);
 
-        EMap map = documentRoot.getXMLNSPrefixMap();
-        map.put("", GeronimoSchemaNS.GERONIMO_OPENEJB_NS);
-        map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS);
-        map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS);
-        map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
-        map.put("pkgen", GeronimoSchemaNS.GERONIMO_PKGEN_NS);
+		Resource resource = resourceSet.createResource(uri);
+		org.openejb.xml.ns.openejb.jar.DocumentRoot documentRoot = JarFactory.eINSTANCE
+				.createDocumentRoot();
+		OpenejbJarType root = JarFactory.eINSTANCE.createOpenejbJarType();
 
-        root.setConfigId(getProject().getName() + "/" + getComponentName());
+		EMap map = documentRoot.getXMLNSPrefixMap();
+		map.put("", GeronimoSchemaNS.GERONIMO_OPENEJB_NS);
+		map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS);
+		map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS);
+		map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
+		map.put("pkgen", GeronimoSchemaNS.GERONIMO_PKGEN_NS);
 
-        documentRoot.setOpenejbJar(root);
-        resource.getContents().add(documentRoot);
+		root.setConfigId(getProject().getName() + "/" + getComponentName());
 
-        doSave(resource);
+		documentRoot.setOpenejbJar(root);
+		resource.getContents().add(documentRoot);
 
-        return root;
-    }
+		doSave(resource);
 
-    public ConnectorType createConnectorDeploymentPlan(IFile dpFile) {
-        URI uri = URI
-                .createPlatformResourceURI(dpFile.getFullPath().toString());
+		return root;
+	}
 
-        ResourceSet resourceSet = new ResourceSetImpl();
-        GeronimoUtils.registerEjbFactoryAndPackage(resourceSet);
+	public ConnectorType createConnectorDeploymentPlan(IFile dpFile) {
+		URI uri = URI
+				.createPlatformResourceURI(dpFile.getFullPath().toString());
 
-        Resource resource = resourceSet.createResource(uri);
-        org.apache.geronimo.xml.ns.j2ee.connector.DocumentRoot documentRoot = ConnectorFactory.eINSTANCE
-                .createDocumentRoot();
-        ConnectorType root = ConnectorFactory.eINSTANCE.createConnectorType();
+		ResourceSet resourceSet = new ResourceSetImpl();
+		GeronimoUtils.registerEjbFactoryAndPackage(resourceSet);
 
-        EMap map = documentRoot.getXMLNSPrefixMap();
-        map.put("", GeronimoSchemaNS.GERONIMO_CONNECTOR_NS);
-        map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS);
-        map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
+		Resource resource = resourceSet.createResource(uri);
+		org.apache.geronimo.xml.ns.j2ee.connector.DocumentRoot documentRoot = ConnectorFactory.eINSTANCE
+				.createDocumentRoot();
+		ConnectorType root = ConnectorFactory.eINSTANCE.createConnectorType();
 
-        root.setConfigId(getProject().getName() + "/" + getComponentName());
+		EMap map = documentRoot.getXMLNSPrefixMap();
+		map.put("", GeronimoSchemaNS.GERONIMO_CONNECTOR_NS);
+		map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS);
+		map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS);
 
-        documentRoot.setConnector(root);
-        resource.getContents().add(documentRoot);
+		root.setConfigId(getProject().getName() + "/" + getComponentName());
 
-        doSave(resource);
+		documentRoot.setConnector(root);
+		resource.getContents().add(documentRoot);
 
-        return root;
-    }
+		doSave(resource);
 
-    private void doSave(Resource resource) {
-        if (resource instanceof XMLResource) {
-            ((XMLResource) resource).setEncoding("UTF-8");
-        }
+		return root;
+	}
 
-        try {
-            resource.save(Collections.EMPTY_MAP);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
+	private void doSave(Resource resource) {
+		if (resource instanceof XMLResource) {
+			((XMLResource) resource).setEncoding("UTF-8");
+		}
+
+		try {
+			resource.save(Collections.EMPTY_MAP);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.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/ExportDeploymentPlanOperation.java?rev=328372&r1=328371&r2=328372&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java
Tue Oct 25 07:43:59 2005
@@ -23,9 +23,8 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit;
-import org.eclipse.jst.j2ee.ejb.componentcore.util.EJBArtifactEdit;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
+import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
 import org.eclipse.wst.common.componentcore.ComponentCore;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
 import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
@@ -64,10 +63,9 @@
         IProject project = ProjectUtilities.getProject(model
                 .getStringProperty(GeronimoDataModelProperties.PROJECT_NAME));
 
-        IVirtualComponent component = ComponentCore.createComponent(project,
-                GeronimoDataModelProperties.COMPONENT_NAME);
-
-        if (component.getComponentTypeId().equals(EARArtifactEdit.TYPE_ID)) {
+        IVirtualComponent component = ComponentCore.createComponent(project);
+        String type = J2EEProjectUtilities.getJ2EEProjectType(project);
+        if (IJ2EEModuleConstants.JST_EAR_MODULE.equals(type)) {
             IVirtualReference[] refs = component.getReferences();
             for (int i = 0; i < refs.length; i++) {
                 IVirtualComponent refComp = refs[i].getReferencedComponent();
@@ -87,16 +85,17 @@
     }
 
     private EObject getDeploymentPlanForComponent(IVirtualComponent comp) {
-
-        if (comp.getComponentTypeId().equals(EARArtifactEdit.TYPE_ID)) {
+    	
+    	String type = J2EEProjectUtilities.getJ2EEProjectType(comp.getProject());    	
+        if (IJ2EEModuleConstants.JST_EAR_MODULE.equals(type)) {
             return GeronimoUtils.getApplicationDeploymentPlan(comp);
         }
 
-        if (comp.getComponentTypeId().equals(WebArtifactEdit.TYPE_ID)) {
+        if (IJ2EEModuleConstants.JST_WEB_MODULE.equals(type)) {
             return GeronimoUtils.getWebDeploymentPlan(comp);
         }
 
-        if (comp.getComponentTypeId().equals(EJBArtifactEdit.TYPE_ID)) {
+        if (IJ2EEModuleConstants.JST_EJB_MODULE.equals(type)) {
             return GeronimoUtils.getOpenEjbDeploymentPlan(comp);
         }
         return null;

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ImportDeploymentPlanOperation.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/ImportDeploymentPlanOperation.java?rev=328372&r1=328371&r2=328372&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ImportDeploymentPlanOperation.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/ImportDeploymentPlanOperation.java
Tue Oct 25 07:43:59 2005
@@ -33,6 +33,7 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
 import org.eclipse.wst.common.componentcore.ComponentCore;
 import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -67,23 +68,23 @@
         if (!isGeronimoRuntimeTarget())
             return Status.OK_STATUS;
 
-        IVirtualComponent comp = ComponentCore.createComponent(getProject(),
-                getComponentName());
+        IVirtualComponent comp = ComponentCore.createComponent(getProject());
+        String type = J2EEProjectUtilities.getJ2EEProjectType(getProject());
 
         try {
-            if (comp.getComponentTypeId().equals(
+            if (type.equals(
                     IModuleConstants.JST_WEB_MODULE)) {
                 importWebDeploymentPlan(GeronimoUtils
                         .getWebDeploymentPlanFile(comp));
-            } else if (comp.getComponentTypeId().equals(
+            } else if (type.equals(
                     IModuleConstants.JST_EJB_MODULE)) {
                 importEjbDeploymentPlan(GeronimoUtils
                         .getOpenEjbDeploymentPlanFile(comp));
-            } else if (comp.getComponentTypeId().equals(
+            } else if (type.equals(
                     IModuleConstants.JST_EAR_MODULE)) {
                 importEarDeploymentPlan(GeronimoUtils
                         .getApplicationDeploymentPlanFile(comp));
-            } else if (comp.getComponentTypeId().equals(
+            } else if (type.equals(
                     IModuleConstants.JST_CONNECTOR_MODULE)) {
                 importConnectorDeploymentPlan(GeronimoUtils
                         .getConnectorDeploymentPlanFile(comp));



Mime
View raw message