You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by mc...@apache.org on 2008/01/12 03:38:27 UTC
svn commit: r611355 [3/5] - in
/geronimo/devtools/eclipse-plugin/trunk/plugins: ./
org.apache.geronimo.runtime.v21/ org.apache.geronimo.runtime.v21/META-INF/
org.apache.geronimo.st.core/ org.apache.geronimo.st.ui/
org.apache.geronimo.st.ui/src/org/apac...
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core;
+
+import java.net.URL;
+import java.util.Set;
+
+import javax.management.MBeanServerConnection;
+import javax.naming.directory.NoSuchAttributeException;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.InternalKernelException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.PersistentConfigurationList;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.st.core.Activator;
+import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
+import org.apache.geronimo.st.v21.core.internal.Trace;
+import org.apache.geronimo.system.jmx.KernelDelegate;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.IModulePublishHelper;
+
+/**
+ * @version $Rev: 540136 $ $Date: 2007-05-21 09:15:31 -0400 (Mon, 21 May 2007) $
+ */
+public class GeronimoServerBehaviour extends GeronimoServerBehaviourDelegate implements IModulePublishHelper {
+
+ private Kernel kernel = null;
+
+ public GeronimoServerBehaviour() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate#stopKernel()
+ */
+ protected void stopKernel() {
+ if (kernel != null) {
+ kernel.shutdown();
+ kernel = null;
+ }
+ }
+
+ /**
+ * @return
+ * @throws SecurityException
+ */
+ protected Kernel getKernel() throws SecurityException {
+ if (kernel == null) {
+ try {
+ MBeanServerConnection connection = getServerConnection();
+ if (connection != null)
+ kernel = new KernelDelegate(connection);
+ } catch (SecurityException e) {
+ throw e;
+ } catch (Exception e) {
+ Trace.trace(Trace.WARNING, "Kernel connection failed. "
+ + e.getMessage());
+ }
+ }
+ return kernel;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.IGeronimoServerBehavior#isKernelAlive()
+ */
+ public boolean isKernelAlive() {
+ try {
+ return getKernel() != null && kernel.isRunning();
+ } catch (SecurityException e) {
+ Activator.log(Status.ERROR, "Invalid username and/or password.", e);
+ pingThread.interrupt();
+ if (getServer().getServerState() != IServer.STATE_STOPPED) {
+ stop(true);
+ }
+ } catch (Exception e) {
+ Activator.log(Status.WARNING, "Geronimo Server may have been terminated manually outside of workspace.", e);
+ kernel = null;
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.IGeronimoServerBehavior#isFullyStarted()
+ */
+ public boolean isFullyStarted() {
+ if (isKernelAlive()) {
+ AbstractNameQuery query = new AbstractNameQuery(PersistentConfigurationList.class.getName());
+ Set configLists = kernel.listGBeans(query);
+ if (!configLists.isEmpty()) {
+ AbstractName on = (AbstractName) configLists.toArray()[0];
+ try {
+ Boolean b = (Boolean) kernel.getAttribute(on, "kernelFullyStarted");
+ return b.booleanValue();
+ } catch (GBeanNotFoundException e) {
+ // ignore
+ } catch (NoSuchAttributeException e) {
+ // ignore
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else {
+ Trace.trace(Trace.INFO, "configLists is empty");
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate#getRuntimeClass()
+ */
+ public String getRuntimeClass() {
+ return "org.apache.geronimo.cli.daemon.DaemonCLI";
+ }
+
+ public IPath getPublishDirectory(IModule[] module) {
+ if (module == null || module.length == 0)
+ return null;
+
+ if (getGeronimoServer().isRunFromWorkspace()) {
+ // TODO fix me, see if project root, component root, or output
+ // container should be returned
+ return module[module.length - 1].getProject().getLocation();
+ } else {
+ ClassLoader old = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getContextClassLoader());
+ String configId = getConfigId(module[0]);
+ Artifact artifact = Artifact.create(configId);
+ AbstractName name = Configuration.getConfigurationAbstractName(artifact);
+ GBeanData data = kernel.getGBeanData(name);
+ URL url = (URL) data.getAttribute("baseURL");
+ return getModulePath(module, url);
+ } catch (InvalidConfigException e) {
+ e.printStackTrace();
+ } catch (GBeanNotFoundException e) {
+ e.printStackTrace();
+ } catch (InternalKernelException e) {
+ e.printStackTrace();
+ } finally {
+ Thread.currentThread().setContextClassLoader(old);
+ }
+ }
+
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.GenericGeronimoServerBehaviour#getContextClassLoader()
+ */
+ protected ClassLoader getContextClassLoader() {
+ return Kernel.class.getClassLoader();
+ }
+}
\ No newline at end of file
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,239 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core;
+
+import java.io.IOException;
+
+import org.apache.geronimo.deployment.xbeans.EnvironmentDocument;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.st.core.GeronimoUtils;
+import org.apache.geronimo.xml.ns.deployment.ArtifactType;
+import org.apache.geronimo.xml.ns.deployment.DeploymentPackage;
+import org.apache.geronimo.xml.ns.deployment.EnvironmentType;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationPackage;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationType;
+import org.apache.geronimo.xml.ns.j2ee.application.util.ApplicationResourceFactoryImpl;
+import org.apache.geronimo.xml.ns.j2ee.connector.ConnectorPackage;
+import org.apache.geronimo.xml.ns.j2ee.connector.ConnectorType;
+import org.apache.geronimo.xml.ns.j2ee.connector.util.ConnectorResourceFactoryImpl;
+import org.apache.geronimo.xml.ns.j2ee.web.DocumentRoot;
+import org.apache.geronimo.xml.ns.j2ee.web.WebAppType;
+import org.apache.geronimo.xml.ns.j2ee.web.WebPackage;
+import org.apache.geronimo.xml.ns.j2ee.web.util.WebResourceFactoryImpl;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
+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.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.server.core.IModule;
+import org.openejb.xml.ns.openejb.jar.JarPackage;
+import org.openejb.xml.ns.openejb.jar.OpenejbJarType;
+import org.openejb.xml.ns.openejb.jar.util.JarResourceFactoryImpl;
+
+/**
+ * @version $Rev: 533836 $ $Date: 2007-04-30 15:39:14 -0400 (Mon, 30 Apr 2007) $
+ */
+public class GeronimoV21Utils extends GeronimoUtils {
+
+ public static EObject getDeploymentPlan(IFile file) {
+ if (!file.exists())
+ return null;
+
+ if (file.getName().equals(GeronimoUtils.APP_PLAN_NAME))
+ return getApplicationDeploymentPlan(file);
+ else if (file.getName().equals(GeronimoUtils.OPENEJB_PLAN_NAME))
+ return getOpenEjbDeploymentPlan(file);
+ else if (file.getName().equals(GeronimoUtils.WEB_PLAN_NAME))
+ return getWebDeploymentPlan(file);
+ else if (file.getName().equals(GeronimoUtils.CONNECTOR_PLAN_NAME))
+ return getConnectorDeploymentPlan(file);
+
+ return null;
+ }
+
+ public static String getConfigId2(IModule module) {
+
+ IFile planFile = null;
+ IVirtualComponent comp = ComponentCore.createComponent(module.getProject());
+ if (isWebModule(module)) {
+ planFile = GeronimoUtils.getWebDeploymentPlanFile(comp);
+ } else if (isEjbJarModule(module)) {
+ planFile = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
+ } else if (isEarModule(module)) {
+ planFile = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
+ } else if (isRARModule(module)) {
+ planFile = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
+ }
+
+ if(planFile != null) {
+ try {
+ XmlObject xmlObject = XmlBeansUtil.parse(planFile.getLocation().toFile());
+ XmlCursor cursor = xmlObject.newCursor();
+ cursor.toFirstChild();
+ xmlObject = cursor.getObject();
+ XmlObject result[] = xmlObject.selectChildren(QNameSet.singleton(EnvironmentDocument.type.getDocumentElementName()));
+ if(result != null && result.length > 0) {
+ org.apache.geronimo.deployment.xbeans.EnvironmentType env = (org.apache.geronimo.deployment.xbeans.EnvironmentType) result[0].changeType(org.apache.geronimo.deployment.xbeans.EnvironmentType.type);
+ org.apache.geronimo.deployment.xbeans.ArtifactType moduleId = env.getModuleId();
+ return getQualifiedConfigID(moduleId);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (XmlException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+
+ public static String getConfigId(IModule module) {
+
+ EnvironmentType environment = null;
+ if (isWebModule(module)) {
+ WebAppType plan = getWebDeploymentPlan(module);
+ if (plan != null)
+ environment = plan.getEnvironment();
+ } else if (isEjbJarModule(module)) {
+ OpenejbJarType plan = getOpenEjbDeploymentPlan(module);
+ if (plan != null)
+ environment = plan.getEnvironment();
+ } else if (isEarModule(module)) {
+ ApplicationType plan = getApplicationDeploymentPlan(module);
+ if (plan != null)
+ environment = plan.getEnvironment();
+ } else if (isRARModule(module)) {
+ ConnectorType plan = getConnectorDeploymentPlan(module);
+ if (plan != null)
+ environment = plan.getEnvironment();
+ }
+
+ if (environment != null
+ && environment.eIsSet(DeploymentPackage.eINSTANCE.getEnvironmentType_ModuleId())) {
+ return getQualifiedConfigID(environment.getModuleId());
+ }
+
+ return getId(module);
+ }
+
+ public static String getQualifiedConfigID(ArtifactType artifact) {
+ return getQualifiedConfigID(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
+ }
+
+ public static String getQualifiedConfigID(org.apache.geronimo.deployment.xbeans.ArtifactType artifact) {
+ return getQualifiedConfigID(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
+ }
+
+ public static String getContextRoot(IModule module) {
+ String contextRoot = null;
+
+ WebAppType deploymentPlan = getWebDeploymentPlan(module);
+ if (deploymentPlan != null)
+ contextRoot = deploymentPlan.getContextRoot();
+
+ if (contextRoot == null)
+ contextRoot = GeronimoUtils.getContextRoot(module);
+
+ return contextRoot;
+ }
+
+ public static WebAppType getWebDeploymentPlan(IModule module) {
+ return getWebDeploymentPlan(getVirtualComponent(module));
+ }
+
+ public static ApplicationType getApplicationDeploymentPlan(IModule module) {
+ return getApplicationDeploymentPlan(getVirtualComponent(module));
+ }
+
+ public static OpenejbJarType getOpenEjbDeploymentPlan(IModule module) {
+ return getOpenEjbDeploymentPlan(getVirtualComponent(module));
+ }
+
+ public static ConnectorType getConnectorDeploymentPlan(IModule module) {
+ return getConnectorDeploymentPlan(getVirtualComponent(module));
+ }
+
+ public static ApplicationType getApplicationDeploymentPlan(IVirtualComponent comp) {
+ return getApplicationDeploymentPlan(getApplicationDeploymentPlanFile(comp));
+ }
+
+ public static WebAppType getWebDeploymentPlan(IVirtualComponent comp) {
+ return getWebDeploymentPlan(getWebDeploymentPlanFile(comp));
+ }
+
+ public static OpenejbJarType getOpenEjbDeploymentPlan(IVirtualComponent comp) {
+ return getOpenEjbDeploymentPlan(getOpenEjbDeploymentPlanFile(comp));
+ }
+
+ public static ConnectorType getConnectorDeploymentPlan(IVirtualComponent comp) {
+ return getConnectorDeploymentPlan(getConnectorDeploymentPlanFile(comp));
+ }
+
+ public static ApplicationType getApplicationDeploymentPlan(IFile file) {
+ if (file.getName().equals(APP_PLAN_NAME) && file.exists()) {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ register(resourceSet, new ApplicationResourceFactoryImpl(), ApplicationPackage.eINSTANCE, ApplicationPackage.eNS_URI);
+ Resource resource = load(file, resourceSet);
+ if (resource != null) {
+ return ((org.apache.geronimo.xml.ns.j2ee.application.DocumentRoot) resource.getContents().get(0)).getApplication();
+ }
+ }
+ return null;
+ }
+
+ public static WebAppType getWebDeploymentPlan(IFile file) {
+ if (file.getName().equals(WEB_PLAN_NAME) && file.exists()) {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ register(resourceSet, new WebResourceFactoryImpl(), WebPackage.eINSTANCE, WebPackage.eNS_URI);
+ Resource resource = load(file, resourceSet);
+ if (resource != null) {
+ return ((DocumentRoot) resource.getContents().get(0)).getWebApp();
+ }
+ }
+ return null;
+ }
+
+ public static OpenejbJarType getOpenEjbDeploymentPlan(IFile file) {
+ if (file.getName().equals(OPENEJB_PLAN_NAME) && file.exists()) {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ register(resourceSet, new JarResourceFactoryImpl(), JarPackage.eINSTANCE, JarPackage.eNS_URI);
+ Resource resource = load(file, resourceSet);
+ if (resource != null) {
+ return ((org.openejb.xml.ns.openejb.jar.DocumentRoot) resource.getContents().get(0)).getOpenejbJar();
+ }
+ }
+ return null;
+ }
+
+ public static ConnectorType getConnectorDeploymentPlan(IFile file) {
+ if (file.getName().equals(CONNECTOR_PLAN_NAME) && file.exists()) {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ register(resourceSet, new ConnectorResourceFactoryImpl(), ConnectorPackage.eINSTANCE, ConnectorPackage.eNS_URI);
+ Resource resource = load(file, resourceSet);
+ if (resource != null) {
+ return ((org.apache.geronimo.xml.ns.j2ee.connector.DocumentRoot) resource.getContents().get(0)).getConnector();
+ }
+ }
+ return null;
+ }
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21VersionHandler.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21VersionHandler.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21VersionHandler.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/GeronimoV21VersionHandler.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core;
+
+import javax.enterprise.deploy.spi.TargetModuleID;
+
+import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
+import org.apache.geronimo.st.core.IGeronimoVersionHandler;
+import org.eclipse.wst.server.core.IModule;
+
+/**
+ * @version $Rev: 513891 $ $Date: 2007-03-02 14:09:25 -0500 (Fri, 02 Mar 2007) $
+ */
+public class GeronimoV21VersionHandler implements IGeronimoVersionHandler {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.IGeronimoVersionHandler#getConfigID(org.eclipse.wst.server.core.IModule)
+ */
+ public String getConfigID(IModule module) {
+ return GeronimoV21Utils.getConfigId2(module);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.geronimo.st.core.IGeronimoVersionHandler#createTargetModuleId(java.lang.String)
+ */
+ public TargetModuleID createTargetModuleId(String configId) {
+ return new TargetModuleIDImpl(null, configId);
+ }
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/internal/Trace.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/internal/Trace.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/internal/Trace.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core.internal;
+
+import org.apache.geronimo.st.v21.core.Activator;
+
+/**
+ * Helper class to route trace output.
+ *
+ * @version $Rev: 589873 $ $Date: 2007-10-29 17:48:35 -0400 (Mon, 29 Oct 2007) $
+ */
+public class Trace {
+
+ /**
+ * Finest trace event.
+ */
+ public static byte INFO = 0;
+
+ /**
+ * Warning trace event.
+ */
+ public static byte WARNING = 1;
+
+ /**
+ * Severe trace event.
+ */
+ public static byte SEVERE = 2;
+
+ /**
+ * Trace constructor comment.
+ */
+ private Trace() {
+ super();
+ }
+
+ /**
+ * Trace the given text.
+ *
+ * @param level
+ * the trace level
+ * @param s
+ * a message
+ */
+ public static void trace(byte level, String s) {
+ trace(level, s, null);
+ }
+
+ /**
+ * Trace the given message and exception.
+ *
+ * @param level
+ * the trace level
+ * @param s
+ * a message
+ * @param t
+ * a throwable
+ */
+ public static void trace(byte level, String s, Throwable t) {
+ if (!Activator.getDefault().isDebugging())
+ return;
+
+ System.out.println(Activator.PLUGIN_ID + ": " + s);
+ if (t != null)
+ t.printStackTrace();
+ }
+
+ /**
+ * Trace the given message
+ *
+ * @param tracePoint
+ * The trace point (e.g., "Exit", "Entry", "Constructor", etc....
+ *
+ * @param classDotMethod
+ * The class name + method name (e.g., "Class.method()")
+ *
+ * @param parm1,2,3,4,5
+ * Method parameters if the trace point is an "Entry"
+ * or
+ * Return value if the trace point is an "Exit"
+ */
+ public static void trace(String tracePoint, String classDotMethod) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "] )" );
+ }
+
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "] )" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+ "parm3=[" + (parm3 == null ? null : parm3.toString()) + "] )" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+ "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
+ "parm4=[" + (parm4 == null ? null : parm4.toString()) + "] )" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+ "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
+ "parm4=[" + (parm4 == null ? null : parm4.toString()) + "], " +
+ "parm5=[" + (parm5 == null ? null : parm5.toString()) + "] )" );
+ }
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/GeronimoV21FacetInstallDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/GeronimoV21FacetInstallDelegate.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/GeronimoV21FacetInstallDelegate.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/GeronimoV21FacetInstallDelegate.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core.operations;
+
+import org.apache.geronimo.st.core.GeronimoFacetInstallDelegate;
+import org.apache.geronimo.st.v21.core.internal.Trace;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.common.project.facet.JavaProjectFacetCreationDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+
+/**
+ * @version $Rev: 471551 $ $Date: 2006-11-05 17:47:11 -0500 (Sun, 05 Nov 2006) $
+ */
+public class GeronimoV21FacetInstallDelegate extends GeronimoFacetInstallDelegate {
+
+ public IDataModelOperation createDeploymentPlanCreationOp(IProject project, Object config) {
+ Trace.trace("Entry", "GeronimoV21FacetInstallDelegate.createDeploymentPlanCreationOp", project, config);
+
+ IDataModel model = DataModelFactory.createDataModel(new JavaProjectFacetCreationDataModelProvider());
+ model.setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project.getName());
+
+ Trace.trace("Exit", "GeronimoV21FacetInstallDelegate.createDeploymentPlanCreationOp");
+ return new V21DeploymentPlanCreationOperation(model, config);
+ }
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,305 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core.operations;
+
+import org.apache.geronimo.st.core.GeronimoSchemaNS;
+import org.apache.geronimo.st.core.operations.DeploymentPlanCreationOperation;
+import org.apache.geronimo.st.v21.core.DeploymentPlanInstallConfig;
+import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
+import org.apache.geronimo.st.v21.core.internal.Trace;
+import org.apache.geronimo.xml.ns.deployment.ArtifactType;
+import org.apache.geronimo.xml.ns.deployment.DependenciesType;
+import org.apache.geronimo.xml.ns.deployment.DependencyType;
+import org.apache.geronimo.xml.ns.deployment.DeploymentFactory;
+import org.apache.geronimo.xml.ns.deployment.DeploymentPackage;
+import org.apache.geronimo.xml.ns.deployment.DocumentRoot;
+import org.apache.geronimo.xml.ns.deployment.EnvironmentType;
+import org.apache.geronimo.xml.ns.deployment.ModuleType;
+import org.apache.geronimo.xml.ns.deployment.util.DeploymentResourceFactoryImpl;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationFactory;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationPackage;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationType;
+import org.apache.geronimo.xml.ns.j2ee.application.util.ApplicationResourceFactoryImpl;
+import org.apache.geronimo.xml.ns.j2ee.connector.ConnectorFactory;
+import org.apache.geronimo.xml.ns.j2ee.connector.ConnectorPackage;
+import org.apache.geronimo.xml.ns.j2ee.connector.ConnectorType;
+import org.apache.geronimo.xml.ns.j2ee.connector.util.ConnectorResourceFactoryImpl;
+import org.apache.geronimo.xml.ns.j2ee.web.WebAppType;
+import org.apache.geronimo.xml.ns.j2ee.web.WebFactory;
+import org.apache.geronimo.xml.ns.j2ee.web.WebPackage;
+import org.apache.geronimo.xml.ns.j2ee.web.util.WebResourceFactoryImpl;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+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.wst.common.frameworks.datamodel.IDataModel;
+import org.openejb.xml.ns.openejb.jar.JarFactory;
+import org.openejb.xml.ns.openejb.jar.JarPackage;
+import org.openejb.xml.ns.openejb.jar.OpenejbJarType;
+import org.openejb.xml.ns.openejb.jar.util.JarResourceFactoryImpl;
+
+/**
+ * @version $Rev: 509704 $ $Date: 2007-02-20 13:42:24 -0500 (Tue, 20 Feb 2007) $
+ */
+public class V21DeploymentPlanCreationOperation extends DeploymentPlanCreationOperation {
+
+ DeploymentPlanInstallConfig cfg;
+
+ public V21DeploymentPlanCreationOperation(IDataModel model, Object config) {
+ super(model, config);
+ Trace.trace("Constructor Entry/Exit", "V21DeploymentPlanCreationOperation", model, config);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createGeronimoApplicationDeploymentPlan(org.eclipse.core.resources.IFile)
+ */
+ public EObject createGeronimoApplicationDeploymentPlan(IFile dpFile) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.createGeronimoApplicationDeploymentPlan", dpFile);
+
+ URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString(), false);
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ GeronimoV21Utils.register(resourceSet, new ApplicationResourceFactoryImpl(), ApplicationPackage.eINSTANCE, ApplicationPackage.eNS_URI);
+
+ Resource resource = resourceSet.createResource(uri);
+ org.apache.geronimo.xml.ns.j2ee.application.DocumentRoot documentRoot = ApplicationFactory.eINSTANCE.createDocumentRoot();
+ ApplicationType root = ApplicationFactory.eINSTANCE.createApplicationType();
+
+ EMap map = documentRoot.getXMLNSPrefixMap();
+ map.put("", GeronimoSchemaNS.GERONIMO_APP_NS_1_1);
+ map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS_1_1);
+ map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS_1_1);
+
+ root.setApplicationName(getProject().getName());
+ root.setEnvironment(getConfigEnvironment());
+
+ documentRoot.setApplication(root);
+ resource.getContents().add(documentRoot);
+
+ save(resource);
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.createGeronimoApplicationDeploymentPlan", root);
+ return root;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createGeronimoWebDeploymentPlan(org.eclipse.core.resources.IFile)
+ */
+ public EObject createGeronimoWebDeploymentPlan(IFile dpFile) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.createGeronimoWebDeploymentPlan", dpFile);
+
+ URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString(), false);
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ GeronimoV21Utils.register(resourceSet, new WebResourceFactoryImpl(), WebPackage.eINSTANCE, WebPackage.eNS_URI);
+
+ Resource resource = resourceSet.createResource(uri);
+ org.apache.geronimo.xml.ns.j2ee.web.DocumentRoot documentRoot = WebFactory.eINSTANCE.createDocumentRoot();
+
+ EMap map = documentRoot.getXMLNSPrefixMap();
+ map.put("", GeronimoSchemaNS.GERONIMO_WEB_NS_1_1);
+ map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS_1_1);
+ map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS_1_1);
+ map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS_1_1);
+
+ WebAppType root = WebFactory.eINSTANCE.createWebAppType();
+
+ root.setEnvironment(getConfigEnvironment());
+ root.setContextRoot("/" + getProject().getName());
+ // root.setContextPriorityClassloader(false); //TODO Replace this with
+ // inverse-classloading
+
+ documentRoot.setWebApp(root);
+ resource.getContents().add(documentRoot);
+
+ save(resource);
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.createGeronimoWebDeploymentPlan", root);
+ return root;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createOpenEjbDeploymentPlan(org.eclipse.core.resources.IFile)
+ */
+ public EObject createOpenEjbDeploymentPlan(IFile dpFile) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.createOpenEjbDeploymentPlan", dpFile);
+
+ URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString(), false);
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ GeronimoV21Utils.register(resourceSet, new JarResourceFactoryImpl(), JarPackage.eINSTANCE, JarPackage.eNS_URI);
+
+ Resource resource = resourceSet.createResource(uri);
+ org.openejb.xml.ns.openejb.jar.DocumentRoot documentRoot = JarFactory.eINSTANCE.createDocumentRoot();
+ OpenejbJarType root = JarFactory.eINSTANCE.createOpenejbJarType();
+
+ EMap map = documentRoot.getXMLNSPrefixMap();
+ map.put("", GeronimoSchemaNS.GERONIMO_OPENEJB_NS_2_1);
+ map.put("sec", GeronimoSchemaNS.GERONIMO_SECURITY_NS_1_1);
+ map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS_1_1);
+ map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS_1_1);
+ map.put("pkgen", GeronimoSchemaNS.GERONIMO_PKGEN_NS_2_0);
+
+ root.setEnvironment(getConfigEnvironment());
+ root.setEnterpriseBeans(JarFactory.eINSTANCE.createEnterpriseBeansType());
+
+ documentRoot.setOpenejbJar(root);
+ resource.getContents().add(documentRoot);
+
+ save(resource);
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.createOpenEjbDeploymentPlan", root);
+ return root;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createConnectorDeploymentPlan(org.eclipse.core.resources.IFile)
+ */
+ public EObject createConnectorDeploymentPlan(IFile dpFile) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.createConnectorDeploymentPlan", dpFile);
+
+ URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString(), false);
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ GeronimoV21Utils.register(resourceSet, new ConnectorResourceFactoryImpl(), ConnectorPackage.eINSTANCE, ConnectorPackage.eNS_URI);
+
+ Resource resource = resourceSet.createResource(uri);
+ org.apache.geronimo.xml.ns.j2ee.connector.DocumentRoot documentRoot = ConnectorFactory.eINSTANCE.createDocumentRoot();
+ ConnectorType root = ConnectorFactory.eINSTANCE.createConnectorType();
+
+ EMap map = documentRoot.getXMLNSPrefixMap();
+ map.put("", GeronimoSchemaNS.GERONIMO_CONNECTOR_NS_1_1);
+ map.put("nam", GeronimoSchemaNS.GERONIMO_NAMING_NS_1_1);
+ map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS_1_1);
+
+ root.setEnvironment(getConfigEnvironment());
+ documentRoot.setConnector(root);
+ resource.getContents().add(documentRoot);
+
+ save(resource);
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.createConnectorDeploymentPlan", root);
+ return root;
+ }
+
+ public EObject createServiceDeploymentPlan(IFile dpFile) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.createServiceDeploymentPlan", dpFile);
+
+ URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString(), false);
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ GeronimoV21Utils.register(resourceSet, new DeploymentResourceFactoryImpl(), DeploymentPackage.eINSTANCE, DeploymentPackage.eNS_URI);
+
+ Resource resource = resourceSet.createResource(uri);
+ DocumentRoot documentRoot = DeploymentFactory.eINSTANCE.createDocumentRoot();
+ ModuleType root = DeploymentFactory.eINSTANCE.createModuleType();
+
+ EMap map = documentRoot.getXMLNSPrefixMap();
+ map.put("sys", GeronimoSchemaNS.GERONIMO_DEPLOYMENT_NS_1_1);
+
+ root.setEnvironment(getConfigEnvironment());
+ documentRoot.setModule(root);
+ resource.getContents().add(documentRoot);
+
+ save(resource);
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.createServiceDeploymentPlan", root);
+ return root;
+ }
+
+ public EnvironmentType getConfigEnvironment() {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.getConfigEnvironment");
+
+ 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";
+
+ ArtifactType artifact = createArtifactType(groupId, artifactId, version, type);
+ EnvironmentType env = DeploymentFactory.eINSTANCE.createEnvironmentType();
+ env.setModuleId(artifact);
+
+ if (cfg != null && cfg.isSharedLib()) {
+ DependenciesType dt = DeploymentFactory.eINSTANCE.createDependenciesType();
+ ArtifactType sharedLib = createDependencyType("org.apache.geronimo.configs", "sharedlib", null, "car");
+ dt.getDependency().add(sharedLib);
+ env.setDependencies(dt);
+ }
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.getConfigEnvironment", env);
+ return env;
+ }
+
+ public static ArtifactType createArtifactType(String groupId, String artifactId, String version, String type) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.createArtifactType", groupId, artifactId, version, type);
+
+ ArtifactType artifact = DeploymentFactory.eINSTANCE.createArtifactType();
+ if (groupId != null)
+ artifact.setGroupId(groupId);
+ if (artifactId != null)
+ artifact.setArtifactId(artifactId);
+ if (version != null)
+ artifact.setVersion(version);
+ artifact.setType(type);
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.createArtifactType", artifact);
+ return artifact;
+ }
+
+ public static ArtifactType createDependencyType(String groupId, String artifactId, String version, String type) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.createDependencyType", groupId, artifactId, version, type);
+
+ DependencyType artifact = DeploymentFactory.eINSTANCE.createDependencyType();
+ if (groupId != null)
+ artifact.setGroupId(groupId);
+ if (artifactId != null)
+ artifact.setArtifactId(artifactId);
+ if (version != null)
+ artifact.setVersion(version);
+ artifact.setType(type);
+
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.createDependencyType", artifact);
+ return artifact;
+ }
+
+ private static boolean hasValue(String attribute) {
+// Trace.trace("Entry", "V21DeploymentPlanCreationOperation.hasValue", attribute);
+// Trace.trace("Exit", "V21DeploymentPlanCreationOperation.hasValue", (attribute != null && attribute.trim().length() != 0) );
+
+ return attribute != null && attribute.trim().length() != 0;
+ }
+
+}
\ No newline at end of file
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.classpath
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.classpath?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.classpath (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.classpath Fri Jan 11 18:38:22 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.options
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.options?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.options (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.options Fri Jan 11 18:38:22 2008
@@ -0,0 +1 @@
+org.apache.geronimo.st.v21.ui/debug=true
\ No newline at end of file
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.project
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.project?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.project (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/.project Fri Jan 11 18:38:22 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.geronimo.st.v21.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/META-INF/MANIFEST.MF Fri Jan 11 18:38:22 2008
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Geronimo Server Tools V21 UI Plug-in
+Bundle-SymbolicName: org.apache.geronimo.st.v21.ui;singleton:=true
+Bundle-Version: 2.1.0
+Bundle-Activator: org.apache.geronimo.st.v21.ui.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.apache.geronimo.st.v21.core,
+ org.apache.geronimo.st.ui,
+ org.eclipse.ui.forms,
+ org.eclipse.core.resources,
+ org.apache.geronimo.v11.deployment.model.edit,
+ org.apache.geronimo.v11.deployment.model,
+ org.eclipse.wst.common.project.facet.ui,
+ org.apache.geronimo.st.v11.ui
+Eclipse-LazyStart: true
+Bundle-Vendor: Apache.org
+Export-Package: org.apache.geronimo.st.v21.ui,
+ org.apache.geronimo.st.v21.ui.editors,
+ org.apache.geronimo.st.v21.ui.internal,
+ org.apache.geronimo.st.v21.ui.pages,
+ org.apache.geronimo.st.v21.ui.sections,
+ org.apache.geronimo.st.v21.ui.wizards
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml Fri Jan 11 18:38:22 2008
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<!-- $Rev: 570837 $ $Date: 2007-08-29 11:25:39 -0400 (Wed, 29 Aug 2007) $ -->
+
+<plugin>
+ <extension point="org.apache.geronimo.st.ui.loader">
+ <loader class="org.apache.geronimo.st.v21.ui.editors.GeronimoFormContentLoader" version="1.1"/>
+ </extension>
+
+ <extension point="org.apache.geronimo.st.ui.loader">
+ <loader class="org.apache.geronimo.st.v21.ui.editors.GeronimoFormContentLoader" version="1.2"/>
+ </extension>
+
+ <extension point="org.apache.geronimo.st.ui.loader">
+ <loader class="org.apache.geronimo.st.v21.ui.editors.GeronimoFormContentLoader" version="2.0"/>
+ </extension>
+
+ <extension point="org.apache.geronimo.st.ui.loader">
+ <loader class="org.apache.geronimo.st.v21.ui.editors.GeronimoFormContentLoader" version="2.1"/>
+ </extension>
+
+
+ <!-- ======================================================================================= -->
+ <!-- -->
+ <!-- Map the <runtime-component> (defined in org.apache.geronimo.st.core\plugin.xml) to a -->
+ <!-- specific version of the "Geronimo Deployment" <project-facet>. Note that the 1.1 -->
+ <!-- version is the only supported <project-facet-version> for the 2.1 Geronimo server. -->
+ <!-- -->
+ <!-- ======================================================================================= -->
+ <extension point="org.eclipse.wst.common.project.facet.ui.wizardPages">
+ <wizard-pages action="geronimo.plan.install">
+ <page class="org.apache.geronimo.st.v11.ui.wizards.FacetInstallPage"/>
+ </wizard-pages>
+ </extension>
+
+</plugin>
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/pom.xml?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/pom.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/pom.xml Fri Jan 11 18:38:22 2008
@@ -0,0 +1,109 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<!-- $Rev: 581072 $ $Date: 2007-10-01 17:11:46 -0400 (Mon, 01 Oct 2007) $ -->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.apache.geronimo.st.v21.ui</artifactId>
+ <packaging>jar</packaging>
+ <name>${artifactId}</name>
+ <parent>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>eclipse-plugins-parent</artifactId>
+ <version>2.1.0</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <build>
+ <resources>
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>plugin.xml</include>
+ <include>plugin.properties</include>
+ <include>.options</include>
+ </includes>
+ </resource>
+ <resource>
+ <targetPath>org/apache/geronimo/st/v21/ui/internal</targetPath>
+ <directory>src/org/apache/geronimo/st/v21/ui/internal</directory>
+ <includes>
+ <include>Messages.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <targetPath>META-INF</targetPath>
+ <directory>..</directory>
+ <includes>
+ <include>LICENSE</include>
+ <include>NOTICE</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>maven-eclipsepde-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>eclipse</artifactId>
+ <version>${version}</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>org.apache.geronimo.v11.deployment.model</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>org.apache.geronimo.v11.deployment.model.edit</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>org.apache.geronimo.st.core</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>org.apache.geronimo.st.v21.core</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>org.apache.geronimo.st.ui</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.devtools</groupId>
+ <artifactId>org.apache.geronimo.st.v11.ui</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+</project>
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/Activator.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/Activator.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/Activator.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.apache.geronimo.st.v21.ui";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.apache.geronimo.st.v21.ui", path);
+ }
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.editors;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader;
+import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
+import org.apache.geronimo.st.v21.ui.pages.AppGeneralPage;
+import org.apache.geronimo.st.v21.ui.pages.ConnectorOverviewPage;
+import org.apache.geronimo.st.v21.ui.pages.DeploymentPage;
+import org.apache.geronimo.st.v21.ui.pages.EjbOverviewPage;
+import org.apache.geronimo.st.v21.ui.pages.NamingFormPage;
+import org.apache.geronimo.st.v21.ui.pages.SecurityPage;
+import org.apache.geronimo.st.v21.ui.pages.WebGeneralPage;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationFactory;
+import org.apache.geronimo.xml.ns.j2ee.application.ApplicationPackage;
+import org.apache.geronimo.xml.ns.j2ee.connector.ConnectorFactory;
+import org.apache.geronimo.xml.ns.j2ee.web.WebFactory;
+import org.apache.geronimo.xml.ns.j2ee.web.WebPackage;
+import org.apache.geronimo.xml.ns.j2ee.web.impl.WebPackageImpl;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.openejb.xml.ns.openejb.jar.JarFactory;
+import org.openejb.xml.ns.openejb.jar.JarPackage;
+
+public class GeronimoFormContentLoader extends AbstractGeronimoFormContentLoader {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addApplicationPlanPages(org.eclipse.ui.forms.editor.FormEditor)
+ */
+ public void addApplicationPlanPages(FormEditor editor) throws PartInitException {
+ editor.addPage(new AppGeneralPage(editor, "appgeneralpage", CommonMessages.editorTabGeneral));
+ editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity, ApplicationPackage.eINSTANCE.getApplicationType_Security()));
+ editor.addPage(getApplicationDeploymentPage(editor));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addConnectorPlanPages(org.eclipse.ui.forms.editor.FormEditor)
+ */
+ public void addConnectorPlanPages(FormEditor editor) throws PartInitException {
+ editor.addPage(new ConnectorOverviewPage(editor, "connectoroverview", CommonMessages.editorTabGeneral));
+ editor.addPage(getConnectorDeploymentPage(editor));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addOpenEjbPlanPages()
+ */
+ public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException {
+ editor.addPage(new EjbOverviewPage(editor, "ejboverview", CommonMessages.editorTabGeneral));
+ // TODO Add naming page but broken down for each bean type
+ editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity, JarPackage.eINSTANCE.getOpenejbJarType_Security()));
+ editor.addPage(getEjbJarDeploymentPage(editor));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader#addWebPlanPages()
+ */
+ public void addWebPlanPages(FormEditor editor) throws PartInitException {
+ editor.addPage(new WebGeneralPage(editor, "generalpage", CommonMessages.editorTabGeneral));
+ editor.addPage(getWebNamingPage(editor));
+ editor.addPage(new SecurityPage(editor, "securitypage", CommonMessages.editorTabSecurity, WebPackageImpl.eINSTANCE.getWebAppType_Security()));
+ editor.addPage(getWebDeploymentPage(editor));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.st.ui.editors.IGeronimoFormContentLoader#loadDeploymentPlan(org.eclipse.core.resources.IFile)
+ */
+ public EObject loadDeploymentPlan(IFile file) {
+ return GeronimoV21Utils.getDeploymentPlan(file);
+ }
+
+ protected FormPage getWebNamingPage(FormEditor editor) {
+ NamingFormPage formPage = createNamingFormPage(editor);
+ WebPackage pkg = WebFactory.eINSTANCE.getWebPackage();
+ formPage.ejbLocalRef = pkg.getWebAppType_EjbLocalRef();
+ formPage.ejbRef = pkg.getWebAppType_EjbRef();
+ formPage.resEnvRef = pkg.getWebAppType_ResourceEnvRef();
+ formPage.resRef = pkg.getWebAppType_ResourceRef();
+ formPage.gbeanRef = pkg.getWebAppType_GbeanRef();
+ formPage.serviceRef = pkg.getWebAppType_ServiceRef();
+ return formPage;
+ }
+
+ protected FormPage getWebDeploymentPage(FormEditor editor) {
+ DeploymentPage formPage = createDeploymentFormPage(editor);
+ formPage.environment = WebFactory.eINSTANCE.getWebPackage().getWebAppType_Environment();
+ formPage.gbeanERef = WebFactory.eINSTANCE.getWebPackage().getWebAppType_Gbean();
+ return formPage;
+ }
+
+ private FormPage getEjbJarDeploymentPage(FormEditor editor) {
+ DeploymentPage formPage = createDeploymentFormPage(editor);
+ formPage.environment = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Environment();
+ formPage.gbeanERef = JarFactory.eINSTANCE.getJarPackage().getOpenejbJarType_Gbean();
+ return formPage;
+ }
+
+ protected FormPage getApplicationDeploymentPage(FormEditor editor) {
+ DeploymentPage formPage = createDeploymentFormPage(editor);
+ formPage.environment = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Environment();
+ formPage.gbeanERef = ApplicationFactory.eINSTANCE.getApplicationPackage().getApplicationType_Gbean();
+ return formPage;
+ }
+
+ private FormPage getConnectorDeploymentPage(FormEditor editor) {
+ DeploymentPage formPage = createDeploymentFormPage(editor);
+ formPage.environment = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Environment();
+ formPage.gbeanERef = ConnectorFactory.eINSTANCE.getConnectorPackage().getConnectorType_Gbean();
+ return formPage;
+ }
+
+ private NamingFormPage createNamingFormPage(FormEditor editor) {
+ return new NamingFormPage(editor, "namingpage", CommonMessages.editorTabNaming);
+ }
+
+ private DeploymentPage createDeploymentFormPage(FormEditor editor) {
+ return new DeploymentPage(editor, "deploymentpage", CommonMessages.editorTabDeployment);
+ }
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/EMFEditorContext.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/EMFEditorContext.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/EMFEditorContext.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/EMFEditorContext.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.geronimo.xml.ns.deployment.provider.DeploymentItemProviderAdapterFactory;
+import org.apache.geronimo.xml.ns.j2ee.application.client.provider.ClientItemProviderAdapterFactory;
+import org.apache.geronimo.xml.ns.j2ee.application.provider.ApplicationItemProviderAdapterFactory;
+import org.apache.geronimo.xml.ns.j2ee.connector.provider.ConnectorItemProviderAdapterFactory;
+import org.apache.geronimo.xml.ns.j2ee.web.provider.WebItemProviderAdapterFactory;
+import org.apache.geronimo.xml.ns.naming.provider.NamingItemProviderAdapterFactory;
+import org.apache.geronimo.xml.ns.security.provider.SecurityItemProviderAdapterFactory;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.openejb.xml.ns.openejb.jar.provider.JarItemProviderAdapterFactory;
+import org.openejb.xml.ns.pkgen.provider.PkgenItemProviderAdapterFactory;
+
+public class EMFEditorContext {
+
+ private static ComposedAdapterFactory factory;
+
+ static {
+ List<AdapterFactoryImpl> factories = new ArrayList<AdapterFactoryImpl>();
+ factories.add(new DeploymentItemProviderAdapterFactory());
+ factories.add(new ClientItemProviderAdapterFactory());
+ factories.add(new ApplicationItemProviderAdapterFactory());
+ factories.add(new ConnectorItemProviderAdapterFactory());
+ factories.add(new WebItemProviderAdapterFactory());
+ factories.add(new NamingItemProviderAdapterFactory());
+ factories.add(new SecurityItemProviderAdapterFactory());
+ factories.add(new JarItemProviderAdapterFactory());
+ factories.add(new PkgenItemProviderAdapterFactory());
+ factory = new ComposedAdapterFactory(factories);
+ }
+
+ public static ComposedAdapterFactory getFactory() {
+ return factory;
+ }
+
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.internal;
+
+import org.apache.geronimo.st.v21.ui.Activator;
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ static {
+ NLS.initializeMessages(Activator.PLUGIN_ID + ".internal.Messages", Messages.class);
+ }
+
+ public static String artifactId;
+ public static String gBeanLink;
+ public static String groupId;
+ public static String moduleId;
+ public static String name;
+ public static String seeRestrictions;
+
+ public static String useGBeanLink;
+ public static String useGBeanPattern;
+ public static String artifactType;
+ public static String inverseClassloading;
+ public static String supressDefaultEnv;
+ public static String sharedLibDepends;
+
+ public static String addSharedLib;
+ public static String version;
+ public static String webContainerSection;
+ public static String webContainerSectionDescription;
+
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.properties?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.properties (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Messages.properties Fri Jan 11 18:38:22 2008
@@ -0,0 +1,33 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+seeRestrictions=This feature currently has restrictions. See the release notes for more details.
+
+groupId=Group Id:
+artifactId=Artifact Id:
+version=Version:
+artifactType=Artifact Type:
+inverseClassloading=Inverse classloading
+supressDefaultEnv=Suppress default environment
+sharedLibDepends=Add a runtime dependency to Geronimo's shared library
+addSharedLib=Add a runtime dependency to Geronimo's shared library
+webContainerSection=Web Container
+webContainerSectionDescription=Web Container Configuration
+useGBeanLink=Specify as GBean Link
+gBeanLink=GBean Link:
+useGBeanPattern=Specify as GBean Pattern
+moduleId=Module Id:
+name=Name:
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Trace.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Trace.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/internal/Trace.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.internal;
+
+import org.apache.geronimo.st.v21.ui.Activator;
+
+/**
+ * Helper class to route trace output.
+ *
+ * @version $Rev: 471551 $ $Date: 2006-11-05 17:47:11 -0500 (Sun, 05 Nov 2006) $
+ */
+public class Trace {
+
+ /**
+ * Finest trace event.
+ */
+ public static byte INFO = 0;
+
+ /**
+ * Warning trace event.
+ */
+ public static byte WARNING = 1;
+
+ /**
+ * Severe trace event.
+ */
+ public static byte SEVERE = 2;
+
+ /**
+ * Trace constructor comment.
+ */
+ private Trace() {
+ super();
+ }
+
+ /**
+ * Trace the given text.
+ *
+ * @param level
+ * the trace level
+ * @param s
+ * a message
+ */
+ public static void trace(byte level, String s) {
+ trace(level, s, null);
+ }
+
+ /**
+ * Trace the given message and exception.
+ *
+ * @param level
+ * the trace level
+ * @param s
+ * a message
+ * @param t
+ * a throwable
+ */
+ public static void trace(byte level, String s, Throwable t) {
+ if (!Activator.getDefault().isDebugging())
+ return;
+
+ System.out.println(Activator.PLUGIN_ID + ": " + s);
+ if (t != null)
+ t.printStackTrace();
+ }
+
+ /**
+ * Trace the given message
+ *
+ * @param tracePoint
+ * The trace point (e.g., "Exit", "Entry", "Constructor", etc....
+ *
+ * @param classDotMethod
+ * The class name + method name (e.g., "Class.method()")
+ *
+ * @param parm1,2,3,4,5
+ * Method parameters if the trace point is an "Entry"
+ * or
+ * Return value if the trace point is an "Exit"
+ */
+ public static void trace(String tracePoint, String classDotMethod) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "] )" );
+ }
+
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "] )" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+ "parm3=[" + (parm3 == null ? null : parm3.toString()) + "] )" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+ "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
+ "parm4=[" + (parm4 == null ? null : parm4.toString()) + "] )" );
+ }
+ public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
+ "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
+ "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
+ "parm4=[" + (parm4 == null ? null : parm4.toString()) + "], " +
+ "parm5=[" + (parm5 == null ? null : parm5.toString()) + "] )" );
+ }
+}
\ No newline at end of file
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/AppGeneralPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/AppGeneralPage.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/AppGeneralPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/AppGeneralPage.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.pages;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
+import org.apache.geronimo.st.v21.ui.sections.AppGeneralSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+public class AppGeneralPage extends AbstractGeronimoFormPage {
+
+ public AppGeneralPage(FormEditor editor, String id, String title) {
+ super(editor, id, title);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
+ */
+ protected void fillBody(IManagedForm managedForm) {
+ managedForm.addPart(new AppGeneralSection(body, toolkit, getStyle(), getDeploymentPlan()));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+ */
+ public String getFormTitle() {
+ return CommonMessages.appGeneralPageTitle;
+ }
+
+}
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/ConnectorOverviewPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/ConnectorOverviewPage.java?rev=611355&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/ConnectorOverviewPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/org/apache/geronimo/st/v21/ui/pages/ConnectorOverviewPage.java Fri Jan 11 18:38:22 2008
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.pages;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
+import org.apache.geronimo.st.v21.ui.sections.ConnectorGeneralSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+public class ConnectorOverviewPage extends AbstractGeronimoFormPage {
+
+ public ConnectorOverviewPage(FormEditor editor, String id, String title) {
+ super(editor, id, title);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#fillBody(org.eclipse.ui.forms.IManagedForm)
+ */
+ protected void fillBody(IManagedForm managedForm) {
+ managedForm.addPart(new ConnectorGeneralSection(body, toolkit, getStyle(), getDeploymentPlan()));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.ui.pages.AbstractGeronimoFormPage#getFormTitle()
+ */
+ public String getFormTitle() {
+ return CommonMessages.connectorOverViewPageTitle;
+ }
+
+}