geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r452878 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ org.apache.geronimo.st.ui/META-INF/ org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/ org.a...
Date Wed, 04 Oct 2006 13:07:46 GMT
Author: sppatel
Date: Wed Oct  4 06:07:45 2006
New Revision: 452878

URL: http://svn.apache.org/viewvc?view=rev&rev=452878
Log:
prompt to run schema conversion on non-qualified plan

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanDataModelProvider.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanDataModelProvider.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanDataModelProvider.java?view=auto&rev=452878
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanDataModelProvider.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/ImportDeploymentPlanDataModelProvider.java
Wed Oct  4 06:07:45 2006
@@ -0,0 +1,31 @@
+package org.apache.geronimo.st.core.operations;
+
+import java.util.Set;
+
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+
+public class ImportDeploymentPlanDataModelProvider extends AbstractDataModelProvider {
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#getPropertyNames()
+	 */
+	public Set getPropertyNames() {
+		Set names = super.getPropertyNames();
+		names.add(IFacetDataModelProperties.FACET_PROJECT_NAME);
+		names.add(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
+		return names;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#getDefaultOperation()
+	 */
+	public IDataModelOperation getDefaultOperation() {
+		return new ImportDeploymentPlanOperation(model);
+	}
+
+}

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

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

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

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF?view=diff&rev=452878&r1=452877&r2=452878
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF
Wed Oct  4 06:07:45 2006
@@ -25,7 +25,10 @@
  org.eclipse.jst.server.core,
  org.eclipse.wst.common.project.facet.core,
  org.eclipse.debug.ui,
- org.eclipse.jdt.debug.ui
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.jst.common.project.facet.core
 Eclipse-LazyStart: true
 Export-Package: org.apache.geronimo.st.ui,
  org.apache.geronimo.st.ui.actions,

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java?view=diff&rev=452878&r1=452877&r2=452878
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/editors/AbstractGeronimoDeploymentPlanEditor.java
Wed Oct  4 06:07:45 2006
@@ -5,10 +5,16 @@
 import java.util.ArrayList;
 import java.util.Collections;
 
+import org.apache.geronimo.st.core.operations.ImportDeploymentPlanDataModelProvider;
+import org.apache.geronimo.st.core.operations.ImportDeploymentPlanOperation;
 import org.apache.geronimo.st.ui.internal.Messages;
 import org.apache.geronimo.st.ui.internal.Trace;
+import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Display;
@@ -20,6 +26,13 @@
 import org.eclipse.ui.forms.IManagedForm;
 import org.eclipse.ui.forms.editor.FormEditor;
 import org.eclipse.ui.forms.editor.IFormPage;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
 
 public abstract class AbstractGeronimoDeploymentPlanEditor extends FormEditor {
 
@@ -144,14 +157,35 @@
 	 * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
 	 *      org.eclipse.ui.IEditorInput)
 	 */
-	public void init(IEditorSite site, IEditorInput input)
-			throws PartInitException {
+	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
 		super.init(site, input);
 		if (input instanceof IFileEditorInput) {
 			IFileEditorInput fei = (IFileEditorInput) input;
 			deploymentPlan = loadDeploymentPlan(fei.getFile());
-			if (deploymentPlan == null) {
-				MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Error Opening Editor",
"Could not open the deployment plan editor.  Opening the default text editor.");
+			
+			boolean fix = false;
+			if(deploymentPlan == null) {
+				fix = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), Messages.errorOpenDialog,
Messages.editorCorrect);
+			}
+			
+			if(fix) {
+				IProject project = fei.getFile().getProject();
+				IDataModel model = DataModelFactory.createDataModel(new ImportDeploymentPlanDataModelProvider());
+				model.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project.getName());
+				try {
+					IFacetedProject facetedProject = ProjectFacetsManager.create(project);
+					model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, facetedProject.getPrimaryRuntime());
+					IDataModelOperation op = new ImportDeploymentPlanOperation(model);
+					op.execute(new NullProgressMonitor(), null);
+				} catch (Exception e) {
+					//ingnore
+				}
+				
+				deploymentPlan = loadDeploymentPlan(fei.getFile());
+				
+				if (deploymentPlan == null) {	
+					MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.errorOpenDialog,
Messages.editorDefault);
+				}
 			}
 		}
 	}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java?view=diff&rev=452878&r1=452877&r2=452878
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.java
Wed Oct  4 06:07:45 2006
@@ -190,4 +190,8 @@
 	public static String doasCurrentCaller;
 	public static String useContextHandler;
 	public static String defaultRole;
+	
+	public static String editorCorrect;
+	public static String editorDefault;
+	public static String errorOpenDialog;
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties?view=diff&rev=452878&r1=452877&r2=452878
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/internal/Messages.properties
Wed Oct  4 06:07:45 2006
@@ -183,4 +183,8 @@
 adminPassword=Administrator password:
 specifyPorts=Specify the configured ports for this server.
 portName=Port Name
-portValue=Port Value
\ No newline at end of file
+portValue=Port Value
+
+editorCorrect=There was an error opening the editor.  The elements in the plan may not be
qualified, do you want to try to auto-correct this? Otherwise the default text editor will
be opened.
+editorDefault=
+errorOpenDialog=Error opening editor.
\ No newline at end of file



Mime
View raw message