geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r491843 - in /geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins: org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/ org.apache.geronimo.st.v11.cor...
Date Tue, 02 Jan 2007 16:36:26 GMT
Author: sppatel
Date: Tue Jan  2 08:36:25 2007
New Revision: 491843

URL: http://svn.apache.org/viewvc?view=rev&rev=491843
Log:
GERONIMODEVTOOLS-119 call fixGeronimoSchema on plan import operation

Modified:
    geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java
    geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoRuntime.java
    geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoRuntime.java

Modified: geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java?view=diff&rev=491843&r1=491842&r2=491843
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java
Tue Jan  2 08:36:25 2007
@@ -74,20 +74,16 @@
 		try {
 			if (type.equals(IModuleConstants.JST_WEB_MODULE)) {
 				planFile = GeronimoUtils.getWebDeploymentPlanFile(comp);
-				plan = runtime.fixGeronimoWebSchema(planFile);
+				runtime.fixGeronimoWebSchema(planFile);	
 			} else if (type.equals(IModuleConstants.JST_EJB_MODULE)) {
 				planFile = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
 				runtime.fixGeronimoEjbSchema(planFile);
 			} else if (type.equals(IModuleConstants.JST_EAR_MODULE)) {
 				planFile = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
-				plan = runtime.fixGeronimoEarSchema(planFile);
+				runtime.fixGeronimoEarSchema(planFile);
 			} else if (type.equals(IModuleConstants.JST_CONNECTOR_MODULE)) {
 				planFile = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
-				plan = runtime.fixGeronimoConnectorSchema(planFile);
-			}
-			
-			if (planFile != null && plan != null) {
-				save(plan, planFile);
+				runtime.fixGeronimoConnectorSchema(planFile);
 			}
 		} catch (XmlException e) {
 			throw new ExecutionException("Error fixing plan., e");

Modified: geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoRuntime.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoRuntime.java?view=diff&rev=491843&r1=491842&r2=491843
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoRuntime.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoRuntime.java
Tue Jan  2 08:36:25 2007
@@ -31,6 +31,7 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
 import org.openejb.xbeans.ejbjar.OpenejbOpenejbJarDocument;
 import org.openejb.xbeans.ejbjar.OpenejbOpenejbJarType;
 
@@ -45,7 +46,13 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoConnectorSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoConnectorSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), GerConnectorDocument.type.getDocumentElementName(),
GerConnectorType.type);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, GerConnectorDocument.type.getDocumentElementName(),
+                    GerConnectorType.type);
+                save(xmlplan, plan);
+            }	
+            return xmlplan;
 	}
 
 	/*
@@ -54,7 +61,13 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoEarSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoEarSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), GerApplicationDocument.type.getDocumentElementName(),
GerApplicationType.type);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, GerApplicationDocument.type.getDocumentElementName(),
+                    GerApplicationType.type);
+                save(xmlplan, plan);
+            }
+            return xmlplan;
 	}
 
 	/*
@@ -63,7 +76,13 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoEjbSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoEjbSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), OpenejbOpenejbJarDocument.type.getDocumentElementName(),
OpenejbOpenejbJarType.type);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, OpenejbOpenejbJarDocument.type.getDocumentElementName(),
+                    OpenejbOpenejbJarType.type);
+                save(xmlplan, plan);
+            }
+            return xmlplan;
 	}
 
 	/*
@@ -72,7 +91,13 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoWebSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoWebSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), GerWebAppDocument.type.getDocumentElementName(),
GerWebAppType.type);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, GerWebAppDocument.type.getDocumentElementName(),
+                    GerWebAppType.type);
+                save(xmlplan, plan);
+            }
+            return xmlplan; 
 	}
 
 	private XmlObject getXmlObject(IFile plan) {
@@ -89,4 +114,15 @@
 		}
 		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();
+ 	    }
+ 	}
 }

Modified: geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoRuntime.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoRuntime.java?view=diff&rev=491843&r1=491842&r2=491843
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoRuntime.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/1.2.1/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoRuntime.java
Tue Jan  2 08:36:25 2007
@@ -31,6 +31,7 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
 import org.openejb.xbeans.ejbjar.OpenejbOpenejbJarDocument;
 import org.openejb.xbeans.ejbjar.OpenejbOpenejbJarType;
 
@@ -45,7 +46,13 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoConnectorSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoConnectorSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), GerConnectorDocument.type.getDocumentElementName(),
GerConnectorType.type);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, GerConnectorDocument.type.getDocumentElementName(),
+                    GerConnectorType.type);
+                save(xmlplan, plan);
+            }	
+            return xmlplan;
 	}
 
 	/*
@@ -54,8 +61,14 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoEarSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoEarSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), GerApplicationDocument.type.getDocumentElementName(),
GerApplicationType.type);
-	}
+            XmlObject xmlplan = getXmlObject(plan);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, GerApplicationDocument.type.getDocumentElementName(),
+                    GerApplicationType.type);
+                save(xmlplan, plan);
+            }
+            return xmlplan;
 
 	/*
 	 * (non-Javadoc)
@@ -63,7 +76,13 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoEjbSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoEjbSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), OpenejbOpenejbJarDocument.type.getDocumentElementName(),
OpenejbOpenejbJarType.type);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, OpenejbOpenejbJarDocument.type.getDocumentElementName(),
+                    OpenejbOpenejbJarType.type);
+                save(xmlplan, plan);
+            }
+            return xmlplan;
 	}
 
 	/*
@@ -72,7 +91,13 @@
 	 * @see org.apache.geronimo.st.core.IGeronimoRuntime#fixGeronimoWebSchema(org.eclipse.core.resources.IFile)
 	 */
 	public XmlObject fixGeronimoWebSchema(IFile plan) throws XmlException {
-		return SchemaConversionUtils.fixGeronimoSchema(getXmlObject(plan), GerWebAppDocument.type.getDocumentElementName(),
GerWebAppType.type);
+            XmlObject xmlplan = getXmlObject(plan);
+            if (plan != null) {
+                SchemaConversionUtils.fixGeronimoSchema(xmlplan, GerWebAppDocument.type.getDocumentElementName(),
+                    GerWebAppType.type);
+                save(xmlplan, plan);
+            }
+            return xmlplan; 
 	}
 	
 	private XmlObject getXmlObject(IFile plan) {
@@ -90,4 +115,14 @@
 		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();
+ 	    }
+ 	}
 }



Mime
View raw message