geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanhongf...@apache.org
Subject svn commit: r1124649 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/ org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/ org.apache.geronimo....
Date Thu, 19 May 2011 09:50:50 GMT
Author: hanhongfang
Date: Thu May 19 09:50:50 2011
New Revision: 1124649

URL: http://svn.apache.org/viewvc?rev=1124649&view=rev
Log:
GERONIMODEVTOOLS-741 Geronimo deployment plan file could not work correctly, Thanks Yi Xiao
for the patch.

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/editors/GeronimoFormContentLoader.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityAdvancedSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRealmWizard.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java?rev=1124649&r1=1124648&r2=1124649&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
Thu May 19 09:50:50 2011
@@ -65,7 +65,7 @@ public abstract class DeploymentPlanCrea
 
 	public void execute() throws Exception {
 		IVirtualComponent comp = ComponentCore.createComponent(getProject());
-
+		@SuppressWarnings({ "restriction", "deprecation" })
 		String type = J2EEProjectUtilities.getJ2EEProjectType(getProject());
 
 		if (IModuleConstants.JST_WEB_MODULE.equals(type)) {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java?rev=1124649&r1=1124648&r2=1124649&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
Thu May 19 09:50:50 2011
@@ -23,11 +23,18 @@ import javax.xml.bind.JAXBException;
 
 import org.apache.geronimo.jaxbmodel.common.operations.JAXBUtils;
 import org.apache.geronimo.st.core.GeronimoUtils;
+import org.apache.geronimo.st.ui.internal.Trace;
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jst.server.core.FacetUtil;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IRuntime;
 
 /**
  * @version $Rev$ $Date$
@@ -38,7 +45,8 @@ public abstract class AbstractGeronimoFo
 	 * @see org.apache.geronimo.st.ui.editors.IGeronimoFormContentLoader#doAddPages(org.eclipse.ui.forms.editor.FormEditor)
 	 */
 	public void doAddPages(FormEditor editor) throws PartInitException{
-        triggerGeronimoServerInfoUpdate();
+		String version = getVersion(editor);
+        triggerGeronimoServerInfoUpdate(version);
 		IEditorInput input = editor.getEditorInput();
 		if(input instanceof IFileEditorInput) {
 			String planFileName = ((IFileEditorInput) input).getFile().getName();
@@ -58,6 +66,8 @@ public abstract class AbstractGeronimoFo
 	
 	abstract public void triggerGeronimoServerInfoUpdate() throws PartInitException;
 	
+	abstract public void triggerGeronimoServerInfoUpdate(String version) throws PartInitException;
+	
 	abstract public void addWebPlanPages(FormEditor editor) throws PartInitException;
 	
 	abstract public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException;
@@ -71,5 +81,26 @@ public abstract class AbstractGeronimoFo
 	public void saveDeploymentPlan(JAXBElement deploymentPlan, IFile file) throws Exception
{
 		JAXBUtils.marshalDeploymentPlan(deploymentPlan, file);
 	}
-
+	
+	private String getVersion(FormEditor editor) {
+		String version = null;
+		IEditorInput input = editor.getEditorInput();
+		if (input instanceof IFileEditorInput) {
+			IProject project = ((IFileEditorInput) input).getFile().getProject();
+			try {
+				IFacetedProject fp = ProjectFacetsManager.create(project);
+				if (fp == null) return null;
+				IRuntime runtime = FacetUtil.getRuntime(fp.getPrimaryRuntime());
+				if (runtime == null) return null;
+				version = runtime.getRuntimeType().getVersion();
+			} catch (CoreException e) {
+                Trace.tracePoint("CoreException", this.getClass().getSimpleName() + ".getVersion");
+				e.printStackTrace();
+			} catch (IllegalArgumentException ie) {
+                Trace.tracePoint("IllegalArgumentException", this.getClass().getSimpleName()
+ ".getVersion");
+			    throw new IllegalArgumentException("The project [" + project.getName() + "] does not
have a Targeted Runtime specified.");
+            }
+		}
+		return version;
+	}
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/editors/GeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/editors/GeronimoFormContentLoader.java?rev=1124649&r1=1124648&r2=1124649&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/editors/GeronimoFormContentLoader.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/editors/GeronimoFormContentLoader.java
Thu May 19 09:50:50 2011
@@ -124,4 +124,11 @@ public class GeronimoFormContentLoader e
     public void triggerGeronimoServerInfoUpdate() {
         GeronimoServerInfo.getInstance().updateInfo();
     }
+
+	@Override
+	public void triggerGeronimoServerInfoUpdate(String version)
+			throws PartInitException {
+		
+	}
+    
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java?rev=1124649&r1=1124648&r2=1124649&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
Thu May 19 09:50:50 2011
@@ -22,8 +22,10 @@ import org.apache.geronimo.jaxbmodel.com
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader;
 import org.apache.geronimo.st.ui.editors.AbstractGeronimoJAXBBasedEditor;
+import org.apache.geronimo.st.v21.core.GeronimoServerInfoManager;
 import org.apache.geronimo.st.v21.core.GeronimoV21ServerInfo;
 import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
+import org.apache.geronimo.st.v21.core.IGeronimoServerInfo;
 import org.apache.geronimo.st.v21.ui.pages.AppClientGeneralPage;
 import org.apache.geronimo.st.v21.ui.pages.AppClientSecurityPage;
 import org.apache.geronimo.st.v21.ui.pages.AppGeneralPage;
@@ -127,4 +129,12 @@ public class GeronimoFormContentLoader e
     public void triggerGeronimoServerInfoUpdate() {
         GeronimoV21ServerInfo.getInstance().updateInfo();
     }
+
+	@Override
+	public void triggerGeronimoServerInfoUpdate(String version)
+			throws PartInitException {
+		 IGeronimoServerInfo serverInfo = GeronimoServerInfoManager.getProvider(version);
+		 serverInfo.updateInfo();
+	}
+    
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityAdvancedSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityAdvancedSection.java?rev=1124649&r1=1124648&r2=1124649&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityAdvancedSection.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityAdvancedSection.java
Thu May 19 09:50:50 2011
@@ -71,7 +71,7 @@ public class SecurityAdvancedSection ext
 
     protected Button useContextHandler;
     
-    protected String runtimeVersionNumber;
+    protected static String runtimeVersionNumber;
     
     private HashMap<Pattern,HashMap<String,ArrayList<String>>> credentialStoreAttributes;
 
@@ -526,4 +526,13 @@ public class SecurityAdvancedSection ext
             getSecurity().setUseContextHandler(useContextHandler.getSelection());
         }
     }
+
+	public static String getRuntimeVersionNumber() {
+		return runtimeVersionNumber;
+	}
+
+	public static void setRuntimeVersionNumber(String runtimeVersionNumber) {
+		SecurityAdvancedSection.runtimeVersionNumber = runtimeVersionNumber;
+	}
+    
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRealmWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRealmWizard.java?rev=1124649&r1=1124648&r2=1124649&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRealmWizard.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRealmWizard.java
Thu May 19 09:50:50 2011
@@ -43,7 +43,9 @@ import org.apache.geronimo.st.ui.CommonM
 import org.apache.geronimo.st.ui.internal.Messages;
 import org.apache.geronimo.st.ui.sections.AbstractTableSection;
 import org.apache.geronimo.st.ui.wizards.AbstractTableWizard;
-import org.apache.geronimo.st.v21.core.GeronimoV21ServerInfo;
+import org.apache.geronimo.st.v21.core.GeronimoServerInfoManager;
+import org.apache.geronimo.st.v21.core.IGeronimoServerInfo;
+import org.apache.geronimo.st.v21.ui.sections.SecurityAdvancedSection;
 import org.apache.geronimo.jee.jaxbmodel.operations.JAXBObjectFactoryImpl;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -847,8 +849,8 @@ public class SecurityRealmWizard extends
 	}
 
 	private void populateList(Combo combo) {
-	    ArrayList<Pattern> dbPool = GeronimoV21ServerInfo.getInstance()
-		    .getJdbcConnectionPools();
+		IGeronimoServerInfo serverInfo = GeronimoServerInfoManager.getProvider(SecurityAdvancedSection.getRuntimeVersionNumber());
+	    ArrayList<Pattern> dbPool = serverInfo.getJdbcConnectionPools();
 	    for (int i = 0; i < dbPool.size(); i++) {
 		String str = dbPool.get(i).getName();
 		combo.add(str);



Mime
View raw message