Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 67626 invoked from network); 6 Sep 2006 20:46:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Sep 2006 20:46:48 -0000 Received: (qmail 83549 invoked by uid 500); 6 Sep 2006 20:46:47 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 83514 invoked by uid 500); 6 Sep 2006 20:46:47 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 83503 invoked by uid 99); 6 Sep 2006 20:46:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 13:46:47 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 13:46:46 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id ADF081A981A; Wed, 6 Sep 2006 13:46:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r440861 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java Date: Wed, 06 Sep 2006 20:46:26 -0000 To: scm@geronimo.apache.org From: sppatel@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060906204626.ADF081A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sppatel Date: Wed Sep 6 13:46:25 2006 New Revision: 440861 URL: http://svn.apache.org/viewvc?view=rev&rev=440861 Log: sharedLib to sharedlib typo, and don't pass in version Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java?view=diff&rev=440861&r1=440860&r2=440861 ============================================================================== --- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java (original) +++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java Wed Sep 6 13:46:25 2006 @@ -54,14 +54,16 @@ import org.openejb.xml.ns.openejb.jar.util.JarResourceFactoryImpl; public class V11DeploymentPlanCreationOperation extends DeploymentPlanCreationOperation { - + DeploymentPlanInstallConfig cfg; public V11DeploymentPlanCreationOperation(IDataModel model, Object config) { super(model, config); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createGeronimoApplicationDeploymentPlan(org.eclipse.core.resources.IFile) */ public EObject createGeronimoApplicationDeploymentPlan(IFile dpFile) { @@ -90,7 +92,9 @@ return root; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createGeronimoWebDeploymentPlan(org.eclipse.core.resources.IFile) */ public EObject createGeronimoWebDeploymentPlan(IFile dpFile) { @@ -113,7 +117,8 @@ root.setEnvironment(getConfigEnvironment()); root.setContextRoot("/" + getProject().getName()); - //root.setContextPriorityClassloader(false); //TODO Replace this with inverse-classloading + // root.setContextPriorityClassloader(false); //TODO Replace this with + // inverse-classloading documentRoot.setWebApp(root); resource.getContents().add(documentRoot); @@ -123,7 +128,9 @@ return root; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createOpenEjbDeploymentPlan(org.eclipse.core.resources.IFile) */ public EObject createOpenEjbDeploymentPlan(IFile dpFile) { @@ -154,7 +161,9 @@ return root; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createConnectorDeploymentPlan(org.eclipse.core.resources.IFile) */ public EObject createConnectorDeploymentPlan(IFile dpFile) { @@ -180,7 +189,7 @@ return root; } - + public EObject createServiceDeploymentPlan(IFile dpFile) { URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString()); @@ -202,49 +211,58 @@ return root; } - + public EnvironmentType getConfigEnvironment() { - if(config != null && config instanceof DeploymentPlanInstallConfig) { + if (config != null && config instanceof DeploymentPlanInstallConfig) { cfg = (DeploymentPlanInstallConfig) config; } - - String groupId = cfg != null && hasValue(cfg.getGroupId()) ? cfg.getGroupId() : "default"; - String artifactId = cfg != null && hasValue(cfg.getArtifactId()) ? cfg.getArtifactId() : getProject().getName(); - String version = cfg != null && hasValue(cfg.getVersion()) ? cfg.getVersion() : "1.0"; - String type = cfg != null && hasValue(cfg.getType()) ? cfg.getType() : "car"; - + + String groupId = cfg != null && hasValue(cfg.getGroupId()) ? cfg.getGroupId() + : "default"; + String artifactId = cfg != null && hasValue(cfg.getArtifactId()) ? cfg.getArtifactId() + : getProject().getName(); + String version = cfg != null && hasValue(cfg.getVersion()) ? cfg.getVersion() + : "1.0"; + String type = cfg != null && hasValue(cfg.getType()) ? cfg.getType() + : "car"; + ArtifactType artifact = createArtifactType(groupId, artifactId, version, type); EnvironmentType env = DeploymentFactory.eINSTANCE.createEnvironmentType(); env.setModuleId(artifact); - - if(cfg != null && cfg.isSharedLib()) { + + if (cfg != null && cfg.isSharedLib()) { DependenciesType dt = DeploymentFactory.eINSTANCE.createDependenciesType(); - ArtifactType sharedLib = createDependencyType("geronimo", "sharedLib", "1.1", "car"); + ArtifactType sharedLib = createDependencyType("geronimo", "sharedlib", null, "car"); dt.getDependency().add(sharedLib); env.setDependencies(dt); } - + return env; } - + private ArtifactType createArtifactType(String groupId, String artifactId, String version, String type) { ArtifactType artifact = DeploymentFactory.eINSTANCE.createArtifactType(); - artifact.setGroupId(groupId); - artifact.setArtifactId(artifactId); - artifact.setVersion(version); - artifact.setType(type); + if (groupId != null) + artifact.setGroupId(groupId); + if (artifactId != null) + artifact.setArtifactId(artifactId); + if (version != null) + artifact.setVersion(version); return artifact; } - + private ArtifactType createDependencyType(String groupId, String artifactId, String version, String type) { DependencyType artifact = DeploymentFactory.eINSTANCE.createDependencyType(); - artifact.setGroupId(groupId); - artifact.setArtifactId(artifactId); - artifact.setVersion(version); + if (groupId != null) + artifact.setGroupId(groupId); + if (artifactId != null) + artifact.setArtifactId(artifactId); + if (version != null) + artifact.setVersion(version); artifact.setType(type); return artifact; } - + private static boolean hasValue(String attribute) { return attribute != null && attribute.trim().length() != 0; }