geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r393587 [4/7] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/ org.apache.geronimo.st.core/META-INF/ org.apache.geronimo.st.core/src/ org.apache.geronimo.st.core/src/org/ org.apache.geronimo.st.core/src/org...
Date Wed, 12 Apr 2006 20:03:02 GMT
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,161 @@
+package org.apache.geronimo.st.ui.wizards;
+
+import org.apache.geronimo.st.ui.Activator;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+public abstract class AbstractTableWizard extends Wizard implements TableWizard {
+
+	protected AbstractTableSection section;
+
+	protected EObject eObject;
+
+	protected ImageDescriptor descriptor = Activator.imageDescriptorFromPlugin("org.apache.geronimo.ui", "icons/bigG.gif");
+
+	/**
+	 * 
+	 */
+	public AbstractTableWizard(AbstractTableSection section) {
+		super();
+		this.section = section;
+		setWindowTitle(getAddWizardWindowTitle());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
+	 */
+	public boolean performFinish() {
+
+		if (eObject == null) {
+			eObject = getEFactory().create(section.getTableEntryObjectType());
+			EObject plan = section.getPlan();
+			((EList) plan.eGet(section.getEReference())).add(eObject);
+		}
+
+		processEAttributes(getPages()[0]);
+
+		return true;
+	}
+
+	public void processEAttributes(IWizardPage page) {
+		if (page instanceof DynamicWizardPage) {
+			for (int i = 0; i < getTableColumnEAttributes().length; i++) {
+				String value = ((DynamicWizardPage) page).textEntries[i].getText();
+				EAttribute attribute = getTableColumnEAttributes()[i];
+				if (attribute.getEContainingClass().equals(eObject.eClass())) {
+					if (value != null && value.trim().length() != 0)
+						eObject.eSet(attribute, value);
+				} else {
+					// TODO
+				}
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.wizard.IWizard#addPages()
+	 */
+	public void addPages() {
+		WizardPage page = new DynamicWizardPage("Page0");
+		page.setImageDescriptor(descriptor);
+		addPage(page);
+	}
+
+	/**
+	 * @param section
+	 */
+	public void setSection(AbstractTableSection section) {
+		this.section = section;
+	}
+
+	/**
+	 * @param object
+	 */
+	public void setEObject(EObject object) {
+		eObject = object;
+	}
+
+	public class DynamicWizardPage extends WizardPage {
+
+		Text[] textEntries = new Text[getTableColumnEAttributes().length];
+
+		public DynamicWizardPage(String pageName) {
+			super(pageName);
+			setTitle(getWizardFirstPageTitle());
+			setDescription(getWizardFirstPageDescription());
+		}
+
+		public DynamicWizardPage(String pageName, String title,
+				ImageDescriptor titleImage) {
+			super(pageName, title, titleImage);
+		}
+
+		public void createControl(Composite parent) {
+			Composite composite = createComposite(parent);
+			for (int i = 0; i < section.getTableColumnNames().length; i++) {
+				Label label = new Label(composite, SWT.LEFT);
+				String columnName = section.getTableColumnNames()[i];
+				if (!columnName.endsWith(":"))
+					columnName = columnName.concat(":");
+				label.setText(columnName);
+				GridData data = new GridData();
+				data.horizontalAlignment = GridData.FILL;
+				label.setLayoutData(data);
+
+				Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
+				data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+						| GridData.VERTICAL_ALIGN_FILL);
+				data.grabExcessHorizontalSpace = true;
+				data.widthHint = 100;
+				text.setLayoutData(data);
+
+				if (eObject != null) {
+					String value = (String) eObject.eGet(getTableColumnEAttributes()[i]);
+					if (value != null) {
+						text.setText(value);
+					}
+				}
+				textEntries[i] = text;
+			}
+
+			doCustom(composite);
+			setControl(composite);
+			textEntries[0].setFocus();
+		}
+
+		public Composite createComposite(Composite parent) {
+			Composite composite = new Composite(parent, SWT.NULL);
+			GridLayout layout = new GridLayout();
+			layout.numColumns = 2;
+			composite.setLayout(layout);
+			GridData data = new GridData();
+			data.verticalAlignment = GridData.FILL;
+			data.horizontalAlignment = GridData.FILL;
+			data.widthHint = 300;
+			composite.setLayoutData(data);
+			return composite;
+		}
+
+		public void doCustom(Composite parent) {
+
+		}
+
+	}
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/TableWizard.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/TableWizard.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/TableWizard.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/TableWizard.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,20 @@
+package org.apache.geronimo.st.ui.wizards;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EFactory;
+
+public interface TableWizard {
+
+	public EFactory getEFactory();
+
+	public EAttribute[] getTableColumnEAttributes();
+
+	public String getAddWizardWindowTitle();
+
+	public String getEditWizardWindowTitle();
+
+	public String getWizardFirstPageTitle();
+
+	public String getWizardFirstPageDescription();
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/TableWizard.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/TableWizard.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/wizards/TableWizard.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/.classpath
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/.classpath?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/.classpath (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/.classpath Wed Apr 12 13:02:48 2006
@@ -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.v1.core/.project
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/.project?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/.project (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/.project Wed Apr 12 13:02:48 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.apache.geronimo.st.v1.core</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.v1.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/META-INF/MANIFEST.MF?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/META-INF/MANIFEST.MF (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/META-INF/MANIFEST.MF Wed Apr 12 13:02:48 2006
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Geronimo V1 Server Tools Core Plug-in
+Bundle-SymbolicName: org.apache.geronimo.st.v1.core;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.apache.geronimo.st.v1.core.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.apache.geronimo.st.core,
+ org.apache.geronimo.runtime.v1,
+ org.apache.geronimo.deployment.model,
+ org.eclipse.jdt.core,
+ org.eclipse.jst.server.core,
+ org.eclipse.jst.server.generic.core,
+ org.eclipse.wst.server.core,
+ org.eclipse.emf.mapping.xsd2ecore.editor,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.debug.core,
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.web,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.frameworks
+Eclipse-AutoStart: true
+Bundle-Vendor: Apache
+Export-Package: org.apache.geronimo.st.v1.core.operations,
+ org.apache.geronimo.st.v1.core.internal,
+ org.apache.geronimo.st.v1.core

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/build.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/build.properties?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/build.properties (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/build.properties Wed Apr 12 13:02:48 2006
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/build.properties
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/build.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.properties?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.properties (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.properties Wed Apr 12 13:02:48 2006
@@ -0,0 +1,20 @@
+pluginName=Geronimo Server Tools V1 Core Plug-in
+providerName=Apache Software Foundation
+
+runtimeTypeName=Apache Geronimo v1.0
+runtimeTypeDescription=Apache Geronimo supports J2EE 1.2, 1.3 and 1.4.
+runtimeTypeVendor=Apache
+
+serverTypeName=Apache Geronimo v1.0 Server
+serverTypeDescription=Apache Geronimo v1.0 Server
+
+serverRootDirectory=Application Server Directory:
+port=Port:
+rmiport=RMI Naming Port:
+ejbport=EJB Port:
+adminId=Ad&ministrator Id:
+adminPassword=Administrator Password:
+classPath=Classpath Variable:
+
+geronimo-facet-label=Geronimo Deployment Plans
+geronimo-facet-description=Creates Geronimo specific deployment plan file(s).
\ No newline at end of file

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.properties
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.xml?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.xml Wed Apr 12 13:02:48 2006
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+    
+    <extension point="org.eclipse.wst.server.core.runtimeTypes">
+        <runtimeType id="org.apache.geronimo.generic.runtime.10"
+            name="%runtimeTypeName" description="%runtimeTypeDescription"
+            vendor="%runtimeTypeVendor" version="1.0"
+            class="org.eclipse.jst.server.generic.core.internal.GenericServerRuntime">
+            <moduleType types="jst.web" versions="2.2, 2.3, 2.4"/>
+            <moduleType types="jst.ejb" versions="1.1, 2.0, 2.1"/>
+            <moduleType types="jst.connector" versions="1.0, 1.5"/>
+            <moduleType types="jst.ear" versions="1.2, 1.3, 1.4"/>
+        </runtimeType>
+    </extension>
+    
+    <extension point="org.eclipse.wst.server.core.serverTypes">
+        <serverType id="org.apache.geronimo.generic.server.10"
+            name="%serverTypeName" description="%serverTypeDescription"
+            runtime="true"
+            class="org.apache.geronimo.st.v1.core.GeronimoServer"
+            initialState="stopped" supportsRemoteHosts="true"
+            startTimeout="240000" stopTimeout="30000" startBeforePublish="true"
+            runtimeTypeId="org.apache.geronimo.generic.runtime.10"
+            launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
+            behaviourClass="org.apache.geronimo.st.v1.core.GeronimoServerBehaviour"
+            hasConfiguration="false" launchModes="run,debug">
+        </serverType>
+    </extension>
+    
+    <extension point="org.eclipse.wst.server.core.installableRuntimes">
+        <installableRuntime id="org.apache.geronimo.runtime.tomcat.10"
+            featureVersion="1.0.0"
+            featureId="org.apache.geronimo.installableruntime.tomcat.feature"
+            featureSite="http://www.apache.org/dist/geronimo/eclipse/updates/"
+            bundleId="org.apache.geronimo.tomcat.j2ee.server.v1"
+            path="zips/geronimo-tomcat-j2ee-1.0.zip">
+        </installableRuntime>
+        <installableRuntime id="org.apache.geronimo.runtime.jetty.10"
+            featureVersion="1.0.0"
+            featureId="org.apache.geronimo.installableruntime.jetty.feature"
+            featureSite="http://www.apache.org/dist/geronimo/eclipse/updates/"
+            bundleId="org.apache.geronimo.jetty.j2ee.server.v1"
+            path="zips/geronimo-jetty-j2ee-1.0.zip">
+        </installableRuntime>
+    </extension>
+    
+    <extension point="org.eclipse.jst.server.generic.core.serverdefinition">
+        <serverdefinition id="org.apache.geronimo.generic.runtime.10"
+            definitionfile="/serverdef/geronimo10.serverdef">
+        </serverdefinition>
+    </extension>
+    
+    <extension point="org.eclipse.wst.server.core.runtimeTargetHandlers">
+        <runtimeTargetHandler id="org.eclipse.jst.server.geronimo.runtimeTarget"
+            runtimeTypeIds="org.apache.geronimo.generic.runtime.*"
+            class="org.apache.geronimo.st.v1.core.GeronimoServerRuntimeTargetHandler"/>
+    </extension>
+    
+    <extension point="org.eclipse.jst.server.core.runtimeClasspathProviders">
+        <runtimeClasspathProvider id="org.apache.geronimo.generic.runtime.10"
+            runtimeTypeIds="org.apache.geronimo.generic.runtime.10"
+            class="org.apache.geronimo.st.v1.core.GeronimoServerRuntimeTargetHandler"/>
+    </extension>
+    
+    <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
+        <runtime-component-type id="org.apache.geronimo.runtime"/>
+        
+        <runtime-component-version type="org.apache.geronimo.runtime"
+            version="1.0"/>
+        
+        <adapter>
+            <runtime-component id="org.apache.geronimo.runtime"/>
+            <factory
+                class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory"/>
+            <type
+                class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+        </adapter>
+        
+        <supported>
+            <runtime-component id="org.apache.geronimo.runtime" version="1.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.0"/>
+            <facet id="jst.web" version="2.2,2.3,2.4"/>
+            <facet id="jst.ejb" version="1.1,2.0,2.1"/>
+            <facet id="jst.ear" version="1.2,1.3,1.4"/>
+            <facet id="jst.connector" version="1.0,1.5"/>
+            <facet id="jst.appclient" version="1.2,1.3,1.4"/>
+        </supported>
+    </extension>
+    
+    <extension point="org.eclipse.jst.server.core.runtimeFacetMappings">
+        <runtimeFacetMapping
+            runtimeTypeId="org.apache.geronimo.generic.runtime.10"
+            runtime-component="org.apache.geronimo.runtime" version="1.0"/>
+    </extension>
+    
+    <extension point="org.eclipse.wst.common.project.facet.core.facets">
+        
+        <project-facet id="org.apache.geronimo.facet">
+            <label>%geronimo-facet-label</label>
+            <description>%geronimo-facet-description</description>
+        </project-facet>
+        
+        <project-facet-version facet="org.apache.geronimo.facet" version="1.0">
+            <action type="install">
+                <delegate class="org.apache.geronimo.st.v1.core.operations.GeronimoV1FacetInstallDelegate"/>
+            </action>
+            <constraint>
+                <or>
+                    <requires facet="jst.ear" version="1.2"/>
+                    <requires facet="jst.ear" version="1.3"/>
+                    <requires facet="jst.ear" version="1.4"/>
+                    <requires facet="jst.appclient" version="1.2"/>
+                    <requires facet="jst.appclient" version="1.3"/>
+                    <requires facet="jst.appclient" version="1.4"/>
+                    <requires facet="jst.connector" version="1.0"/>
+                    <requires facet="jst.connector" version="1.5"/>
+                    <requires facet="jst.ejb" version="1.1"/>
+                    <requires facet="jst.ejb" version="2.0"/>
+                    <requires facet="jst.ejb" version="2.1"/>
+                    <requires facet="jst.web" version="2.2"/>
+                    <requires facet="jst.web" version="2.3"/>
+                    <requires facet="jst.web" version="2.4"/>
+                </or>
+            </constraint>
+        </project-facet-version>
+    </extension>
+    
+    <extension id="org.apache.geronimo.defaultFacets"
+        name="Geronimo Default Facets"
+        point="org.eclipse.wst.common.project.facet.core.defaultFacets">
+        <default-facets>
+            <runtime-component id="org.apache.geronimo.runtime" version="1.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.0"/>
+        </default-facets>
+    </extension>
+
+</plugin>

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/serverdef/geronimo10.serverdef
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/serverdef/geronimo10.serverdef?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/serverdef/geronimo10.serverdef (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/serverdef/geronimo10.serverdef Wed Apr 12 13:02:48 2006
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tns:ServerRuntime
+	xmlns:tns="http://eclipse.org/jst/server/generic/ServerTypeDefinition"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://eclipse.org/jst/server/generic/ServerTypeDefinition ServerTypeDefinitionSchema.xsd "
+	name="Apache Geronimo 1.0" version="v1.0">
+	
+	<property id="serverRootDirectory"
+		label="%serverRootDirectory"
+		type="directory"
+		context="runtime"
+		default=""/>
+	<property id="port"
+		label="%port"
+		type="string"
+		context="server"
+		default="8080"/>
+	<property id="rmiport"
+		label="%rmiport"
+		type="string"
+		context="server"
+		default="1099"/>
+	<property id="ejbport"
+		label="%ejbport"
+		type="string"
+		context="server"
+		default="4201"/>
+	<property id="adminID"
+		label="%adminId"
+		type="string"
+		context="server"
+		default="system"/>
+	<property id="adminPassword"
+		label="%adminPassword"
+		type="string"
+		context="server"
+		default="manager"/>
+
+	<port>
+		<no>${port}</no>
+		<name>Http</name>
+		<protocol>http</protocol>
+	</port>
+	<port>
+		<no>${rmiport}</no>
+		<name>Naming</name>
+		<protocol>iiop</protocol>
+	</port>
+	<port>
+		<no>${ejbport}</no>
+		<name>Ejb</name>
+		<protocol>iiop</protocol>
+	</port>
+
+	<module>
+		<type>jst.web</type>
+		<publishDir>${serverRootDirectory}/server/deploy</publishDir>
+		<publisherReference>org.eclipse.jst.server.geronimo.internal.GeronimoPublisher</publisherReference>
+	</module>
+	<module>
+		<type>jst.ejb</type>
+		<publishDir>${serverRootDirectory}/server/deploy</publishDir>
+		<publisherReference>org.eclipse.jst.server.geronimo.internal.GeronimoPublisher</publisherReference>
+	</module>
+	<module>
+		<type>jst.connector</type>
+		<publishDir>${serverRootDirectory}/server/deploy</publishDir>
+		<publisherReference>org.eclipse.jst.server.geronimo.internal.GeronimoPublisher</publisherReference>
+	</module>
+    <module>
+		<type>jst.ear</type>
+		<publishDir>${serverRootDirectory}/server/deploy</publishDir>
+		<publisherReference>org.eclipse.jst.server.geronimo.internal.GeronimoPublisher</publisherReference>
+	</module>
+
+	<project>
+		<classpathReference>geronimo.project</classpathReference>
+	</project>
+	
+	<start>
+		<mainClass>org.apache.geronimo.system.main.Daemon</mainClass>
+		<workingDirectory>${serverRootDirectory}/bin</workingDirectory>
+		<programArguments>-v</programArguments>
+		<vmParameters></vmParameters>
+		<classpathReference>geronimo.server</classpathReference>
+	</start>
+
+	<classpath id="geronimo.server">
+		<archive path="${serverRootDirectory}/bin/server.jar" />
+	</classpath>
+
+	<classpath id="geronimo.deploy">
+		<archive path="${serverRootDirectory}/bin/deployer.jar" />
+	</classpath>
+
+	<classpath id="geronimo.project">
+		<archive path="${serverRootDirectory}/repository/org.apache.geronimo.specs/jars" />
+		<archive path="${serverRootDirectory}/lib" />
+	</classpath>
+	
+	<jndiConnection>
+		<providerUrl>localhost:${ejbport}</providerUrl>
+		<initialContextFactory>org.openejb.client.RemoteInitialContextFactory</initialContextFactory>
+		<jndiProperty>
+			<name>java.naming.security.principal</name>
+			<value>${adminID}</value>
+		</jndiProperty>
+		<jndiProperty>
+			<name>java.naming.security.credentials</name>
+			<value>${adminPassword}</value>
+		</jndiProperty>
+	</jndiConnection>
+</tns:ServerRuntime>
\ No newline at end of file

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/Activator.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/Activator.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/Activator.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/Activator.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,57 @@
+package org.apache.geronimo.st.v1.core;
+
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.apache.geronimo.st.v1.core";
+
+	// The shared instance
+	private static Activator plugin;
+
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.Plugin#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;
+	}
+
+	public static void log(int severity, String message, Throwable throwable) {
+		plugin.getLog().log(new Status(severity, PLUGIN_ID, 0, message, throwable));
+	}
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/Activator.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/Activator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,116 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+
+import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager;
+import org.apache.geronimo.st.core.GenericGeronimoServer;
+import org.apache.geronimo.st.core.IGeronimoVersionHandler;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.server.core.IModule;
+
+public class GeronimoServer extends GenericGeronimoServer {
+
+	private static IGeronimoVersionHandler versionHandler = null;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.GenericGeronimoServer#getContextRoot(org.eclipse.wst.server.core.IModule)
+	 */
+	public String getContextRoot(IModule module) {
+		return GeronimoV1Utils.getContextRoot(module);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.GenericGeronimoServer#getAdminID()
+	 */
+	public String getAdminID() {
+		return (String) getServerInstanceProperties().get(PROPERTY_ADMIN_ID);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.GenericGeronimoServer#getAdminPassword()
+	 */
+	public String getAdminPassword() {
+		return (String) getServerInstanceProperties().get(PROPERTY_ADMIN_PW);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.GenericGeronimoServer#getRMINamingPort()
+	 */
+	public String getRMINamingPort() {
+		return (String) getServerInstanceProperties().get(PROPERTY_RMI_PORT);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#getDeployerURL()
+	 */
+	public String getDeployerURL() {
+		return "deployer:geronimo:jmx://" + getServer().getHost() + ":"
+				+ getRMINamingPort();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#getJMXServiceURL()
+	 */
+	public String getJMXServiceURL() {
+		String host = getServer().getHost();
+		return "service:jmx:rmi://" + host + "/jndi/rmi://" + host + ":"
+				+ getRMINamingPort() + "/JMXConnector";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#getJSR88DeployerJar()
+	 */
+	public IPath getJSR88DeployerJar() {
+		return getServer().getRuntime().getLocation().append("/lib/geronimo-deploy-jsr88-1.0.jar");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#configureDeploymentManager(javax.enterprise.deploy.spi.DeploymentManager)
+	 */
+	public void configureDeploymentManager(DeploymentManager dm) {
+		((JMXDeploymentManager) dm).setLogConfiguration(true, true);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.IGeronimoServer#getVersionHandler()
+	 */
+	public IGeronimoVersionHandler getVersionHandler() {
+		if (versionHandler == null)
+			versionHandler = new GeronimoV1VersionHandler();
+		return versionHandler;
+	}
+
+}
\ No newline at end of file

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,438 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core;
+
+import java.net.MalformedURLException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Timer;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.directory.NoSuchAttributeException;
+
+import org.apache.geronimo.gbean.GBeanQuery;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.PersistentConfigurationList;
+import org.apache.geronimo.kernel.jmx.KernelDelegate;
+import org.apache.geronimo.st.core.DeploymentUtils;
+import org.apache.geronimo.st.core.GenericGeronimoServerBehaviour;
+import org.apache.geronimo.st.core.GeronimoConnectionFactory;
+import org.apache.geronimo.st.core.IGeronimoServer;
+import org.apache.geronimo.st.core.PingThread;
+import org.apache.geronimo.st.core.UpdateServerStateTask;
+import org.apache.geronimo.st.core.commands.DeploymentCommandFactory;
+import org.apache.geronimo.st.core.commands.IDeploymentCommand;
+import org.apache.geronimo.st.core.commands.TargetModuleIdNotFoundException;
+import org.apache.geronimo.st.v1.core.internal.Messages;
+import org.apache.geronimo.st.v1.core.internal.Trace;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jst.server.generic.core.internal.CorePlugin;
+import org.eclipse.jst.server.generic.core.internal.GenericServerCoreMessages;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerListener;
+import org.eclipse.wst.server.core.ServerEvent;
+import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.wst.server.core.util.SocketUtil;
+
+public class GeronimoServerBehaviour extends GenericGeronimoServerBehaviour {
+
+	private static final String ATTR_STOP = "stop-server";
+
+	private static final int TIMER_TASK_INTERVAL = 10;
+
+	private IProgressMonitor _monitor = null;
+
+	private Kernel kernel = null;
+
+	private Timer timer = null;
+	PingThread pingThread;
+
+	public GeronimoServerBehaviour() {
+		super();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#stop(boolean)
+	 */
+	public synchronized void stop(boolean force) {
+
+		Trace.trace(Trace.INFO, "--> stop()");
+
+		if (getServer().getServerState() != IServer.STATE_STOPPED) {
+			setServerState(IServer.STATE_STOPPING);
+			if (kernel != null) {
+				kernel.shutdown();
+			}
+		}
+
+		GeronimoConnectionFactory.getInstance().destroy(getServer());
+		kernel = null;
+
+		// kill the process
+		super.stop(true);
+
+		Trace.trace(Trace.INFO, "<-- stop()");
+	}
+
+	private Kernel getKernel() throws SecurityException {
+
+		if (kernel == null) {
+			Map map = new HashMap();
+			String user = getGeronimoServer().getAdminID();
+			String password = getGeronimoServer().getAdminPassword();
+			map.put("jmx.remote.credentials", new String[] { user, password });
+			try {
+				String url = getGeronimoServer().getJMXServiceURL();
+				Trace.trace(Trace.INFO, "URL = " + url);
+				if (url == null)
+					return null;
+				JMXServiceURL address = new JMXServiceURL(url);
+				try {
+					JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
+					MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
+					kernel = new KernelDelegate(mbServerConnection);
+					Trace.trace(Trace.INFO, "Connected to kernel.");
+				} catch (SecurityException e) {
+					throw e;
+				} catch (Exception e) {
+					Trace.trace(Trace.WARNING, "Kernel connection failed.");
+				}
+			} catch (MalformedURLException e) {
+				e.printStackTrace();
+			}
+		}
+
+		return kernel;
+	}
+
+	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;
+	}
+
+	public boolean isFullyStarted() {
+		if (isKernelAlive()) {
+			Set configLists = kernel.listGBeans(new GBeanQuery(null, PersistentConfigurationList.class.getName()));
+			if (!configLists.isEmpty()) {
+				ObjectName on = (ObjectName) 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.eclipse.wst.server.core.model.ServerBehaviourDelegate#publishModule(int,
+	 *      int, org.eclipse.wst.server.core.IModule[],
+	 *      org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void publishModule(int kind, int deltaKind, IModule[] module,
+			IProgressMonitor monitor) throws CoreException {
+		Trace.trace(Trace.INFO, ">> publishModule(), deltaKind = " + deltaKind);
+		Trace.trace(Trace.INFO, Arrays.asList(module).toString());
+		_monitor = monitor;
+
+		if (module.length == 1 && (deltaKind == ADDED || deltaKind == REMOVED)) {
+			invokeCommand(deltaKind, module[0]);
+		} else if (deltaKind == CHANGED) {
+			// TODO This case is flawed due to WTP Bugzilla 123676
+			invokeCommand(deltaKind, module[0]);
+		}
+
+		setModulePublishState(module, IServer.PUBLISH_STATE_NONE);
+
+		Trace.trace(Trace.INFO, "<< publishModule()");
+	}
+
+	private void invokeCommand(int deltaKind, IModule module)
+			throws CoreException {
+		try {
+			switch (deltaKind) {
+			case ADDED: {
+				doDeploy(module);
+				break;
+			}
+			case CHANGED: {
+				doRedeploy(module);
+				break;
+			}
+			case REMOVED: {
+				doUndeploy(module);
+				break;
+			}
+			default:
+				throw new IllegalArgumentException();
+			}
+		} catch (CoreException e) {
+			throw e;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	private void doDeploy(IModule module) throws Exception {
+		Trace.trace(Trace.INFO, ">> doDeploy() " + module.toString());
+
+		DeploymentManager dm = DeploymentCommandFactory.getDeploymentManager(getServer());
+
+		if (!DeploymentUtils.configurationExists(module, dm)) {
+			IStatus status = distribute(module);
+			if (!status.isOK()) {
+				doFail(status, Messages.DISTRIBUTE_FAIL);
+			}
+
+			status = start(module);
+			if (!status.isOK()) {
+				doFail(status, Messages.START_FAIL);
+			}
+		} else {
+			String id = GeronimoV1Utils.getConfigId(module);
+			String message = id
+					+ "already exists.  Existing configuration will be overwritten.";
+			Activator.log(Status.ERROR, message, null);
+			doRedeploy(module);
+		}
+
+		Trace.trace(Trace.INFO, "<< doDeploy() " + module.toString());
+	}
+
+	private void doRedeploy(IModule module) throws Exception {
+		Trace.trace(Trace.INFO, ">> doRedeploy() " + module.toString());
+
+		try {
+			IStatus status = reDeploy(module);
+			if (!status.isOK()) {
+				doFail(status, Messages.REDEPLOY_FAIL);
+			}
+		} catch (TargetModuleIdNotFoundException e) {
+			Activator.log(Status.WARNING, "Module may have been uninstalled outside the workspace.", e);
+			doDeploy(module);
+		}
+
+		Trace.trace(Trace.INFO, "<< doRedeploy() " + module.toString());
+	}
+
+	private void doUndeploy(IModule module) throws Exception {
+		Trace.trace(Trace.INFO, ">> doUndeploy() " + module.toString());
+
+		IStatus status = stop(module);
+		if (!status.isOK()) {
+			doFail(status, Messages.STOP_FAIL);
+		}
+
+		status = unDeploy(module);
+		if (!status.isOK()) {
+			doFail(status, Messages.UNDEPLOY_FAIL);
+		}
+
+		Trace.trace(Trace.INFO, "<< doUndeploy()" + module.toString());
+	}
+
+	private void doRestart(IModule module) throws Exception {
+		Trace.trace(Trace.INFO, ">> doRestart() " + module.toString());
+
+		IStatus status = stop(module);
+		if (!status.isOK()) {
+			doFail(status, Messages.STOP_FAIL);
+		}
+
+		status = start(module);
+		if (!status.isOK()) {
+			doFail(status, Messages.START_FAIL);
+		}
+
+		Trace.trace(Trace.INFO, ">> doRestart() " + module.toString());
+	}
+
+	private void doFail(IStatus status, String message) throws CoreException {
+		throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, message, new Exception(status.getMessage())));
+	}
+
+	private IStatus distribute(IModule module) throws Exception {
+		IDeploymentCommand cmd = DeploymentCommandFactory.createDistributeCommand(module, getServer());
+		return cmd.execute(_monitor);
+	}
+
+	private IStatus start(IModule module) throws Exception {
+		TargetModuleID id = DeploymentUtils.getTargetModuleID(module, DeploymentCommandFactory.getDeploymentManager(getServer()));
+		IDeploymentCommand cmd = DeploymentCommandFactory.createStartCommand(new TargetModuleID[] { id }, module, getServer());
+		return cmd.execute(_monitor);
+	}
+
+	private IStatus stop(IModule module) throws Exception {
+		IDeploymentCommand cmd = DeploymentCommandFactory.createStopCommand(module, getServer());
+		return cmd.execute(_monitor);
+	}
+
+	private IStatus unDeploy(IModule module) throws Exception {
+		IDeploymentCommand cmd = DeploymentCommandFactory.createUndeployCommand(module, getServer());
+		return cmd.execute(_monitor);
+	}
+
+	private IStatus reDeploy(IModule module) throws Exception {
+		IDeploymentCommand cmd = DeploymentCommandFactory.createRedeployCommand(module, getServer());
+		return cmd.execute(_monitor);
+	}
+
+	public Map getServerInstanceProperties() {
+		return getRuntimeDelegate().getServerInstanceProperties();
+	}
+
+	public IGeronimoServer getGeronimoServer() {
+		return (IGeronimoServer) getServer().loadAdapter(IGeronimoServer.class, null);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#setupLaunchConfiguration(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy,
+	 *      org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public void setupLaunchConfiguration(
+			ILaunchConfigurationWorkingCopy workingCopy,
+			IProgressMonitor monitor) throws CoreException {
+		String defaultArgs = getServerDefinition().getResolver().resolveProperties(getServerDefinition().getStart().getProgramArgumentsAsString());
+		String existingPrgArgs = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, defaultArgs);
+		super.setupLaunchConfiguration(workingCopy, monitor);
+		if (existingPrgArgs != null) {
+			workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, existingPrgArgs);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour#setupLaunch(org.eclipse.debug.core.ILaunch,
+	 *      java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	protected void setupLaunch(ILaunch launch, String launchMode,
+			IProgressMonitor monitor) throws CoreException {
+		Trace.trace(Trace.INFO, "--> GeronimoServerBehavior.setupLaunch()");
+
+		if ("true".equals(launch.getLaunchConfiguration().getAttribute(ATTR_STOP, "false")))
+			return;
+
+		if (!SocketUtil.isLocalhost(getServer().getHost()))
+			return;
+
+		ServerPort[] ports = getServer().getServerPorts(null);
+		for (int i = 0; i < ports.length; i++) {
+			ServerPort sp = ports[i];
+			if (SocketUtil.isPortInUse(ports[i].getPort(), 5))
+				throw new CoreException(new Status(IStatus.ERROR, CorePlugin.PLUGIN_ID, 0, GenericServerCoreMessages.bind(GenericServerCoreMessages.errorPortInUse, Integer.toString(sp.getPort()), sp.getName()), null));
+		}
+
+		stopUpdateServerStateTask();
+		setServerState(IServer.STATE_STARTING);
+		setMode(launchMode);
+
+		IServerListener listener = new IServerListener() {
+			public void serverChanged(ServerEvent event) {
+				int eventKind = event.getKind();
+				if (eventKind == (ServerEvent.SERVER_CHANGE | ServerEvent.STATE_CHANGE)) {
+					IServer server = event.getServer();
+					int state = server.getServerState();
+					if (state == IServer.STATE_STARTED
+							|| state == IServer.STATE_STOPPED) {
+						GeronimoServerBehaviour.this.getServer().removeServerListener(this);
+						startUpdateServerStateTask();
+					}
+				}
+			}
+		};
+
+		getServer().addServerListener(listener);
+		pingThread = new PingThread(this, getServer());
+		pingThread.start();
+		Trace.trace(Trace.INFO, "<-- GeronimoServerBehavior.setupLaunch()");
+	}
+
+	private void startUpdateServerStateTask() {
+		Trace.trace(Trace.INFO, "startUpdateServerStateTask() "
+				+ getServer().getName());
+		timer = new Timer(true);
+		timer.schedule(new UpdateServerStateTask(this, getServer()), 10000, TIMER_TASK_INTERVAL * 1000);
+	}
+
+	private void stopUpdateServerStateTask() {
+		Trace.trace(Trace.INFO, "stopUpdateServerStateTask() "
+				+ getServer().getName());
+		if (timer != null)
+			timer.cancel();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#initialize(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	protected void initialize(IProgressMonitor monitor) {
+		Trace.trace(Trace.INFO, "GeronimoServerBehavior.initialize()");
+		startUpdateServerStateTask();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#dispose()
+	 */
+	public void dispose() {
+		stopUpdateServerStateTask();
+	}
+
+}
\ No newline at end of file

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerRuntimeTargetHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerRuntimeTargetHandler.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerRuntimeTargetHandler.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerRuntimeTargetHandler.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,203 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IAccessRule;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jst.server.generic.core.internal.GenericServerRuntimeTargetHandler;
+import org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionUtil;
+import org.eclipse.jst.server.generic.servertype.definition.ArchiveType;
+import org.eclipse.jst.server.generic.servertype.definition.Classpath;
+import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
+import org.eclipse.wst.server.core.IRuntime;
+
+public class GeronimoServerRuntimeTargetHandler extends
+		GenericServerRuntimeTargetHandler {
+
+	private static final String EXTENSION_RUNTIME_ACCESS = "discouragedRuntimeAccess";
+
+	String cachedArchiveString = null;
+	IClasspathEntry[] cachedClasspath = null;
+	private static Map map;
+	private IPath runtimeLoc;
+	private String runtimeTypeId;
+
+	static {
+		loadExtensions();
+	}
+
+	private static synchronized void loadExtensions() {
+		map = new HashMap();
+		IExtensionRegistry registry = Platform.getExtensionRegistry();
+		IConfigurationElement[] cf = registry.getConfigurationElementsFor(Activator.PLUGIN_ID, EXTENSION_RUNTIME_ACCESS);
+		for (int i = 0; i < cf.length; i++) {
+			IConfigurationElement element = cf[i];
+			if ("restriction".equals(element.getName())) {
+				String runtimeId = element.getAttribute("id");
+				if (runtimeId != null) {
+					IConfigurationElement[] children = element.getChildren();
+					for (int j = 0; j < children.length; j++) {
+						String path = children[j].getAttribute("value");
+						if (path != null) {
+							Collection c = (Collection) map.get(runtimeId);
+							if (c == null) {
+								c = new ArrayList();
+								map.put(runtimeId, c);
+							}
+							c.add(new Path(path));
+						}
+					}
+				}
+			}
+
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see ClasspathRuntimeTargetHandler#resolveClasspathContainer(IRuntime,
+	 *      java.lang.String)
+	 */
+	public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime,
+			String id) {
+		this.runtimeTypeId = runtime.getRuntimeType().getId();
+		return getServerClassPathEntry(runtime);
+	}
+
+	public IClasspathEntry[] getServerClassPathEntry(IRuntime runtime) {
+		this.runtimeLoc = runtime.getLocation();
+		ServerRuntime serverDefinition = ServerTypeDefinitionUtil.getServerTypeDefinition(runtime);
+		String ref = serverDefinition.getProject().getClasspathReference();
+		Classpath cp = serverDefinition.getClasspath(ref);
+		List archives = cp.getArchive();
+
+		// It's expensive to keep searching directories, so try to cache the
+		// result
+		IClasspathEntry[] savedClasspath = getCachedClasspathFor(serverDefinition, archives);
+		if (savedClasspath != null)
+			return savedClasspath;
+
+		Iterator archiveIter = archives.iterator();
+		ArrayList entryList = new ArrayList();
+		while (archiveIter.hasNext()) {
+			ArchiveType archive = (ArchiveType) archiveIter.next();
+			String item = serverDefinition.getResolver().resolveProperties(archive.getPath());
+			IPath path = new Path(item);
+			File file = path.toFile();
+			if (file.isDirectory()) {
+				boolean discourageAccess = isAccessDiscouraged(path);
+				File[] list = file.listFiles();
+				for (int i = 0; i < list.length; i++) {
+					if (!list[i].isDirectory()) {
+						Path p = new Path(list[i].getAbsolutePath());
+						if (!discourageAccess)
+							discourageAccess = isAccessDiscouraged(p);
+						addLibEntry(entryList, p, discourageAccess);
+					}
+				}
+			} else {
+				addLibEntry(entryList, path, isAccessDiscouraged(path));
+			}
+		}
+
+		IClasspathEntry[] classpath = (IClasspathEntry[]) entryList.toArray(new IClasspathEntry[entryList.size()]);
+		setCachedClasspath(classpath);
+
+		return classpath;
+	}
+
+	private boolean isAccessDiscouraged(IPath path) {
+		Collection c = (Collection) map.get(runtimeTypeId);
+		if (c == null || c.isEmpty())
+			return false;
+
+		Iterator i = c.iterator();
+		while (i.hasNext()) {
+			IPath xPath = (IPath) i.next();
+			if (path.toFile().isDirectory()
+					&& runtimeLoc.append(xPath).isPrefixOf(path)) {
+				return true;
+			} else if (runtimeLoc.append(xPath).equals(path)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	private void addLibEntry(ArrayList entryList, IPath path,
+			boolean discourageAccess) {
+		IClasspathEntry entry = null;
+		if (discourageAccess) {
+			IAccessRule rule = JavaCore.newAccessRule(new Path("**"), IAccessRule.K_DISCOURAGED);
+			IAccessRule rules[] = new IAccessRule[] { rule };
+			entry = JavaCore.newLibraryEntry(path, null, null, rules, new IClasspathAttribute[] {}, false);
+		} else {
+			entry = JavaCore.newLibraryEntry(path, null, null);
+		}
+		entryList.add(entry);
+	}
+
+	private IClasspathEntry[] getCachedClasspathFor(
+			ServerRuntime serverDefinition, List archives) {
+
+		// Need to iterate through the list, and expand the variables (in case
+		// they have changed)
+		// The simplest approach is to construct/cache a string for this
+		// That will still save the overhead of going to the filesystem
+
+		StringBuffer buffer = new StringBuffer();
+		Iterator archiveIter = archives.iterator();
+		while (archiveIter.hasNext()) {
+			ArchiveType archive = (ArchiveType) archiveIter.next();
+			String item = serverDefinition.getResolver().resolveProperties(archive.getPath());
+			buffer.append(item);
+			buffer.append(File.pathSeparatorChar);
+		}
+
+		String archiveString = buffer.toString();
+
+		if (cachedArchiveString != null
+				&& cachedArchiveString.equals(archiveString))
+			return cachedClasspath;
+
+		// This is a cache miss - ensure the data is null (to be safe), but save
+		// the key (archiveString) now
+		// The data will be set once it's calculated
+		cachedClasspath = null;
+		cachedArchiveString = archiveString;
+		return null;
+	}
+
+	private void setCachedClasspath(IClasspathEntry[] classpath) {
+		cachedClasspath = classpath;
+	}
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerRuntimeTargetHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerRuntimeTargetHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerRuntimeTargetHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1Utils.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1Utils.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1Utils.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1Utils.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,194 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core;
+
+import org.apache.geronimo.st.core.GeronimoUtils;
+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.eclipse.core.resources.IFile;
+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.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
+import org.eclipse.jst.server.core.IWebModule;
+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;
+
+public class GeronimoV1Utils extends GeronimoUtils {
+
+	public static String getConfigId(IModule module) {
+
+		if (isWebModule(module)) {
+			WebAppType plan = getWebDeploymentPlan(module);
+			if (plan != null
+					&& plan.eIsSet(WebPackage.eINSTANCE.getWebAppType_ConfigId())) {
+				return plan.getConfigId();
+			}
+		} else if (isEjbJarModule(module)) {
+			OpenejbJarType plan = getOpenEjbDeploymentPlan(module);
+			if (plan != null
+					&& plan.eIsSet(JarPackage.eINSTANCE.getOpenejbJarType_ConfigId())) {
+				return plan.getConfigId();
+			}
+		} else if (isEarModule(module)) {
+			ApplicationType plan = getApplicationDeploymentPlan(module);
+			if (plan != null
+					&& plan.eIsSet(ApplicationPackage.eINSTANCE.getApplicationType_ConfigId())) {
+				return plan.getConfigId();
+			}
+		} else if (isRARModule(module)) {
+			ConnectorType plan = getConnectorDeploymentPlan(module);
+			if (plan != null
+					&& plan.eIsSet(ConnectorPackage.eINSTANCE.getConnectorType_ConfigId())) {
+				return plan.getConfigId();
+			}
+		}
+
+		return getId(module);
+	}
+
+	public static String getContextRoot(IModule module) {
+		String contextRoot = null;
+
+		WebAppType deploymentPlan = getWebDeploymentPlan(module);
+		if (deploymentPlan != null)
+			contextRoot = deploymentPlan.getContextRoot();
+
+		if (contextRoot == null) {
+			J2EEFlexProjDeployable j2eeModule = (J2EEFlexProjDeployable) module.loadAdapter(J2EEFlexProjDeployable.class, null);
+			contextRoot = ((IWebModule) j2eeModule).getContextRoot();
+		}
+
+		if (contextRoot == null)
+			contextRoot = getId(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();
+			registerAppFactoryAndPackage(resourceSet);
+			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();
+			registerWebFactoryAndPackage(resourceSet);
+			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();
+			registerEjbFactoryAndPackage(resourceSet);
+			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();
+			registerConnectorFactoryAndPackage(resourceSet);
+			Resource resource = load(file, resourceSet);
+			if (resource != null) {
+				return ((org.apache.geronimo.xml.ns.j2ee.connector.DocumentRoot) resource.getContents().get(0)).getConnector();
+			}
+		}
+		return null;
+	}
+
+	public static void registerWebFactoryAndPackage(ResourceSet resourceSet) {
+		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new WebResourceFactoryImpl());
+		resourceSet.getPackageRegistry().put(WebPackage.eNS_URI, WebPackage.eINSTANCE);
+	}
+
+	public static void registerEjbFactoryAndPackage(ResourceSet resourceSet) {
+		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new JarResourceFactoryImpl());
+		resourceSet.getPackageRegistry().put(JarPackage.eNS_URI, JarPackage.eINSTANCE);
+	}
+
+	public static void registerAppFactoryAndPackage(ResourceSet resourceSet) {
+		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new ApplicationResourceFactoryImpl());
+		resourceSet.getPackageRegistry().put(ApplicationPackage.eNS_URI, ApplicationPackage.eINSTANCE);
+	}
+
+	public static void registerConnectorFactoryAndPackage(
+			ResourceSet resourceSet) {
+		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new ConnectorResourceFactoryImpl());
+		resourceSet.getPackageRegistry().put(ConnectorPackage.eNS_URI, ConnectorPackage.eINSTANCE);
+	}
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1Utils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1Utils.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1Utils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1VersionHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1VersionHandler.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1VersionHandler.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1VersionHandler.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,31 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core;
+
+import org.apache.geronimo.st.core.IGeronimoVersionHandler;
+import org.eclipse.wst.server.core.IModule;
+
+public class GeronimoV1VersionHandler implements IGeronimoVersionHandler {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.geronimo.st.core.IGeronimoVersionHandler#getConfigID(org.eclipse.wst.server.core.IModule)
+	 */
+	public String getConfigID(IModule module) {
+		return GeronimoV1Utils.getConfigId(module);
+	}
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1VersionHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1VersionHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoV1VersionHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Messages.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Messages.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Messages.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,36 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Translated messages.
+ */
+public class Messages extends NLS {
+
+	static {
+		NLS.initializeMessages("org.apache.geronimo.core.internal.Messages", Messages.class);
+	}
+
+	public static String DISTRIBUTE_FAIL;
+	public static String START_FAIL;
+	public static String STOP_FAIL;
+	public static String UNDEPLOY_FAIL;
+	public static String REDEPLOY_FAIL;
+	public static String DM_CONNECTION_FAIL;
+
+}
\ No newline at end of file

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Messages.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Messages.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Messages.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Trace.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Trace.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Trace.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Trace.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,77 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core.internal;
+
+import org.apache.geronimo.st.core.Activator;
+
+/**
+ * Helper class to route trace output.
+ */
+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();
+	}
+}
\ No newline at end of file

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Trace.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Trace.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/internal/Trace.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/GeronimoV1FacetInstallDelegate.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/GeronimoV1FacetInstallDelegate.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/GeronimoV1FacetInstallDelegate.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/GeronimoV1FacetInstallDelegate.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core.operations;
+
+import org.apache.geronimo.st.core.GeronimoFacetInstallDelegate;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.j2ee.internal.archive.operations.JavaComponentCreationDataModelProvider;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IComponentCreationDataModelProperties;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+
+public class GeronimoV1FacetInstallDelegate extends
+		GeronimoFacetInstallDelegate {
+
+	public IDataModelOperation createDeploymentPlanCreationOp(IProject project) {
+		IVirtualComponent comp = ComponentCore.createComponent(project);
+		IDataModel model = DataModelFactory.createDataModel(new JavaComponentCreationDataModelProvider());
+		model.setStringProperty(IComponentCreationDataModelProperties.COMPONENT_NAME, comp.getName());
+		model.setStringProperty(IComponentCreationDataModelProperties.PROJECT_NAME, project.getName());
+		return new V1DeploymentPlanCreationOperation(model);
+	}
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/GeronimoV1FacetInstallDelegate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/GeronimoV1FacetInstallDelegate.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/GeronimoV1FacetInstallDelegate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/ImportDeploymentPlanOperation.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/ImportDeploymentPlanOperation.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/ImportDeploymentPlanOperation.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/ImportDeploymentPlanOperation.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,153 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.v1.core.operations;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.st.core.GeronimoUtils;
+import org.apache.geronimo.st.core.operations.AbstractGeronimoJ2EEComponentOperation;
+import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
+import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
+import org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationDocument;
+import org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationType;
+import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+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;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.openejb.xbeans.ejbjar.OpenejbOpenejbJarDocument;
+import org.openejb.xbeans.ejbjar.OpenejbOpenejbJarType;
+
+public class ImportDeploymentPlanOperation extends
+		AbstractGeronimoJ2EEComponentOperation {
+
+	/**
+	 * 
+	 */
+	public ImportDeploymentPlanOperation() {
+		super();
+	}
+
+	/**
+	 * @param model
+	 */
+	public ImportDeploymentPlanOperation(IDataModel model) {
+		super(model);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor,
+	 *      org.eclipse.core.runtime.IAdaptable)
+	 */
+	public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+			throws ExecutionException {
+		if (!isGeronimoRuntimeTarget())
+			return Status.OK_STATUS;
+
+		IVirtualComponent comp = ComponentCore.createComponent(getProject());
+		String type = J2EEProjectUtilities.getJ2EEProjectType(getProject());
+
+		try {
+			if (type.equals(IModuleConstants.JST_WEB_MODULE)) {
+				importWebDeploymentPlan(GeronimoUtils.getWebDeploymentPlanFile(comp));
+			} else if (type.equals(IModuleConstants.JST_EJB_MODULE)) {
+				importEjbDeploymentPlan(GeronimoUtils.getOpenEjbDeploymentPlanFile(comp));
+			} else if (type.equals(IModuleConstants.JST_EAR_MODULE)) {
+				importEarDeploymentPlan(GeronimoUtils.getApplicationDeploymentPlanFile(comp));
+			} else if (type.equals(IModuleConstants.JST_CONNECTOR_MODULE)) {
+				importConnectorDeploymentPlan(GeronimoUtils.getConnectorDeploymentPlanFile(comp));
+			}
+		} catch (XmlException e) {
+			e.printStackTrace();
+		}
+
+		return Status.OK_STATUS;
+	}
+
+	public void importWebDeploymentPlan(IFile dpFile) throws XmlException {
+		XmlObject plan = getXmlObject(dpFile);
+		if (plan != null) {
+			SchemaConversionUtils.fixGeronimoSchema(plan, GerWebAppDocument.type.getDocumentElementName(), GerWebAppType.type);
+			save(plan, dpFile);
+		}
+	}
+
+	public void importEarDeploymentPlan(IFile dpFile) throws XmlException {
+		XmlObject plan = getXmlObject(dpFile);
+		if (plan != null) {
+			SchemaConversionUtils.fixGeronimoSchema(plan, GerApplicationDocument.type.getDocumentElementName(), GerApplicationType.type);
+			save(plan, dpFile);
+		}
+	}
+
+	public void importEjbDeploymentPlan(IFile dpFile) throws XmlException {
+		XmlObject plan = getXmlObject(dpFile);
+		if (plan != null) {
+			SchemaConversionUtils.fixGeronimoSchema(plan, OpenejbOpenejbJarDocument.type.getDocumentElementName(), OpenejbOpenejbJarType.type);
+			save(plan, dpFile);
+		}
+	}
+
+	public void importConnectorDeploymentPlan(IFile dpFile) throws XmlException {
+		XmlObject plan = getXmlObject(dpFile);
+		if (plan != null) {
+			SchemaConversionUtils.fixGeronimoSchema(plan, GerConnectorDocument.type.getDocumentElementName(), GerConnectorType.type);
+			save(plan, dpFile);
+		}
+	}
+
+	private XmlObject getXmlObject(IFile dpFile) {
+		if (dpFile.exists()) {
+			try {
+				return XmlBeansUtil.parse(dpFile.getLocation().toFile().toURL());
+			} catch (MalformedURLException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			} catch (XmlException e) {
+				e.printStackTrace();
+			}
+		}
+		return null;
+	}
+
+	private void save(XmlObject object, IFile file) {
+		try {
+			object.save(file.getLocation().toFile());
+			file.refreshLocal(IFile.DEPTH_ONE, null);
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+	}
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/ImportDeploymentPlanOperation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/ImportDeploymentPlanOperation.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/operations/ImportDeploymentPlanOperation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message