geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bjr...@apache.org
Subject svn commit: r707162 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/ org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/ org.apache.geronimo.st.v21....
Date Wed, 22 Oct 2008 19:06:55 GMT
Author: bjreed
Date: Wed Oct 22 12:06:55 2008
New Revision: 707162

URL: http://svn.apache.org/viewvc?rev=707162&view=rev
Log:
GERONIMODEVTOOLS-524 added a menu item to the Geronimo Server and a dialog for creating a
custom server assembly

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoCustomServerAssembly.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/LaunchGeronimoServerAssemblyAction.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTreeWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleMappingWizard.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRunAsSubjectWizard.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/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/main/java/org/apache/geronimo/st/ui/internal/Messages.java?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
Wed Oct 22 12:06:55 2008
@@ -281,6 +281,11 @@
     public static String wizardPageTitle_RunAsSubject;
     public static String wizardPageDescription_RunAsSubject;
     //
+    public static String wizardNewTitle_ServerCustomAssembly;
+    public static String wizardEditTitle_ServerCustomAssembly;
+    public static String wizardPageTitle_ServerCustomAssembly;
+    public static String wizardPageDescription_ServerCustomAssembly;
+    //
     public static String wizardNewTitle_Dependency;
     public static String wizardEditTitle_Dependency;
     public static String wizardPageTitle_Dependency;
@@ -395,6 +400,7 @@
     public static String ejb;
     public static String java;
     public static String web;
+    public static String plugin;
 
     public static String licenseAgreement;
     public static String acceptLicenseAgreement;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/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/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
Wed Oct 22 12:06:55 2008
@@ -257,6 +257,11 @@
 wizardPageTitle_RunAsSubject=Run As Subject Details
 wizardPageDescription_RunAsSubject=Provide details for this run-as subject.
 
+wizardNewTitle_ServerCustomAssembly=New Server Custom Assembly
+wizardEditTitle_ServerCustomAssembly=Edit Server Custom Assembly
+wizardPageTitle_ServerCustomAssembly=Server Custom Assembly Details
+wizardPageDescription_ServerCustomAssembly=Provide details for this server custom assembly.
+
 securityCredentialStore=Credential Store:
 securityDefaultSubject=Default Subject:
 securityDefaultSubjectRealmName=Realm Name
@@ -398,6 +403,7 @@
 ejb=EJB
 java=Java
 web=Web
+plugin=Plugin
 
 savePageTitle=Save Resource
 savePageMessage=Please save the page before proceeding to the Source page.

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.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/wizards/AbstractTableWizard.java?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTableWizard.java
Wed Oct 22 12:06:55 2008
@@ -20,7 +20,7 @@
 
 import org.apache.geronimo.st.core.jaxb.JAXBObjectFactory;
 import org.apache.geronimo.st.core.jaxb.JAXBUtils;
-import org.apache.geronimo.st.ui.sections.AbstractListSection;
+import org.apache.geronimo.st.ui.sections.AbstractTableSection;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
@@ -30,8 +30,11 @@
  */
 public abstract class AbstractTableWizard extends AbstractWizard {
 
-    public AbstractTableWizard(AbstractListSection section) {
-        super(section);
+    protected AbstractTableSection section;
+    
+    public AbstractTableWizard(AbstractTableSection section) {
+        super();
+        this.section = section;
     }
 
     public abstract JAXBObjectFactory getEFactory();

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTreeWizard.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/wizards/AbstractTreeWizard.java?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTreeWizard.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractTreeWizard.java
Wed Oct 22 12:06:55 2008
@@ -32,6 +32,8 @@
  */
 public abstract class AbstractTreeWizard extends AbstractWizard {
 
+    protected AbstractTreeSection section;
+    
     protected String[] elementTypes = null;
     protected int maxTextFields;
 
@@ -49,7 +51,8 @@
      * to allow the appropriate fields to be used.
      */
     public AbstractTreeWizard(AbstractTreeSection section, int elementTypeCount, int maxTextFields)
{
-        super(section);
+        super();
+        this.section = section;
         elementTypes = new String[elementTypeCount];
         this.maxTextFields = maxTextFields;
         textList = new ArrayList<Text>(maxTextFields);

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractWizard.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/wizards/AbstractWizard.java?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractWizard.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/wizards/AbstractWizard.java
Wed Oct 22 12:06:55 2008
@@ -17,7 +17,6 @@
 package org.apache.geronimo.st.ui.wizards;
 
 import org.apache.geronimo.st.ui.Activator;
-import org.apache.geronimo.st.ui.sections.AbstractListSection;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.jface.wizard.WizardPage;
@@ -35,13 +34,10 @@
  */
 public abstract class AbstractWizard extends Wizard {
 
-    protected AbstractListSection section;
-
     protected Object eObject;
 
-    public AbstractWizard(AbstractListSection section) {
+    public AbstractWizard() {
         super();
-        this.section = section;
         setWindowTitle(getAddWizardWindowTitle());
     }
 

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoCustomServerAssembly.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoCustomServerAssembly.java?rev=707162&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoCustomServerAssembly.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoCustomServerAssembly.java
Wed Oct 22 12:06:55 2008
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.core.operations;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.geronimo.deployment.plugin.jmx.RemoteDeploymentManager;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.st.core.GeronimoConnectionFactory;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+import org.eclipse.wst.server.core.IServer;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class GeronimoCustomServerAssembly {
+
+    private IServer server;
+    private RemoteDeploymentManager remoteDM;
+    private PluginListType data;
+    private List<String> pluginList;
+    
+    public GeronimoCustomServerAssembly () {
+    }
+    
+    public boolean serverChanged (Object aServer, String serverPrefix) {
+        server = (IServer)aServer;
+
+        boolean enabled = server != null && 
+                server.getServerType().getId().startsWith(serverPrefix) &&
+                server.getServerState() == IServer.STATE_STARTED;
+
+        return enabled;
+    }
+    
+    public List<String> getPluginList () {
+        String name;
+        boolean added;
+        try {
+            GeronimoConnectionFactory gcFactory = GeronimoConnectionFactory.getInstance();
+            remoteDM = (RemoteDeploymentManager)gcFactory.getDeploymentManager(server);
+            data = remoteDM.createPluginListForRepositories(null);
+            List<PluginType> aList = data.getPlugin();
+            pluginList = new ArrayList<String>(aList.size());
+            for (int i = 0; i < aList.size(); i++) {
+                name = aList.get(i).getName();
+                added = false;
+                for (int j = 0; j < pluginList.size() && added == false; j++)
{
+                    if (name.compareTo(pluginList.get(j)) < 0) {
+                        pluginList.add(j, name);
+                        added = true;
+                    }
+                }
+                if (added == false) {
+                    pluginList.add(name);
+                }
+            }
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+        return pluginList;
+    }
+
+    public void assembleServer (String group, String artifact, String version,
+                        String format, String relativeServerPath, int[] selected) {
+        PluginListType selectedPlugins = new PluginListType();
+        String name;
+        boolean found;
+        
+        for (int i = 0; i < selected.length; i++) {
+            name = pluginList.get(selected[i]);
+            found = false;
+            for (int j = 0 ; j < data.getPlugin().size() && found == false; j++)
{
+                if (name.equals(data.getPlugin().get(j).getName())) {
+                    selectedPlugins.getPlugin().add(data.getPlugin().get(j));
+                    found = true;
+                }
+            }
+        }
+        
+        try {
+            remoteDM.installPluginList("repository", relativeServerPath, selectedPlugins);
+            remoteDM.archive(relativeServerPath, "var/temp", new Artifact(group, artifact,
(String)version, format));
+        }
+        catch (Exception e) {
+        }
+    }
+}

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

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoCustomServerAssembly.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

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

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
Wed Oct 22 12:06:55 2008
@@ -1,39 +1,57 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<!-- $Rev: 570837 $ $Date: 2007-08-29 11:25:39 -0400 (Wed, 29 Aug 2007) $ -->
-
-<plugin>
-
-    <extension point="org.apache.geronimo.st.ui.loader">
- 	  	<loader class="org.apache.geronimo.st.v21.ui.editors.GeronimoFormContentLoader" version="2.1"/>
-    </extension>
-
-    <!-- 
-     |
-     | Map the action defined for the "Geronimo Deployment" project-facet to a specific class
-     |
-     -->
-    <extension point="org.eclipse.wst.common.project.facet.ui.wizardPages">
-  		<wizard-pages action="geronimo.plan.install.v21">
-    		<page class="org.apache.geronimo.st.v21.ui.wizards.FacetInstallPage"/>
-  		</wizard-pages>
-	</extension>  
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<!-- $Rev: 570837 $ $Date: 2007-08-29 11:25:39 -0400 (Wed, 29 Aug 2007) $ -->
+
+<plugin>
+
+    <extension point="org.apache.geronimo.st.ui.loader">
+ 	  	<loader class="org.apache.geronimo.st.v21.ui.editors.GeronimoFormContentLoader" version="2.1"/>
+    </extension>
+
+    <!-- 
+     |
+     | Map the action defined for the "Geronimo Deployment" project-facet to a specific class
+     |
+     -->
+    <extension point="org.eclipse.wst.common.project.facet.ui.wizardPages">
+  		<wizard-pages action="geronimo.plan.install.v21">
+    		<page class="org.apache.geronimo.st.v21.ui.wizards.FacetInstallPage"/>
+  		</wizard-pages>
+	</extension>  
+
+	<extension point="org.eclipse.ui.popupMenus">
+		<objectContribution
+	      		adaptable="true"
+	      		id="org.apache.geronimo.ui.serveractions"
+	      		objectClass="org.eclipse.wst.server.core.IServer">
+	      	<enablement>
+	        	<test forcePluginActivation="true"
+	            	property="org.eclipse.wst.server.ui.serverType"
+	           		value="org.apache.geronimo.*" />
+	      	</enablement>
+	        <action id="org.apache.geronimo.ui.launchServerAssembly"
+        	label="Launch Custom Server Assembly" icon="icons/obj16/littleG.gif"
+	            class="org.apache.geronimo.st.v21.ui.actions.LaunchGeronimoServerAssemblyAction"
+	           	enablesFor="1">
+	        </action>
+    	</objectContribution>
+    </extension>
+
+</plugin>

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/LaunchGeronimoServerAssemblyAction.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/actions/LaunchGeronimoServerAssemblyAction.java?rev=707162&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/LaunchGeronimoServerAssemblyAction.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/LaunchGeronimoServerAssemblyAction.java
Wed Oct 22 12:06:55 2008
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.actions;
+
+import org.apache.geronimo.st.v21.core.operations.GeronimoCustomServerAssembly;
+import org.apache.geronimo.st.ui.internal.Trace;
+import org.apache.geronimo.st.v21.ui.wizards.ServerCustomAssemblyWizard;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IActionDelegate;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class LaunchGeronimoServerAssemblyAction implements IActionDelegate {
+
+    private GeronimoCustomServerAssembly customAssembly;
+
+    private String serverPrefix;
+
+    public LaunchGeronimoServerAssemblyAction() {
+        super();
+        IExtensionRegistry reg = Platform.getExtensionRegistry();
+        IConfigurationElement[] extensions = reg
+                .getConfigurationElementsFor("org.apache.geronimo.st.ui.actionURLs");
+        for (IConfigurationElement element : extensions) {
+            Trace.trace(Trace.INFO, element.getName() + " = "
+                    + element.getValue() + ".");
+            if (element.getName().equals("server_prefix")) {
+                serverPrefix = element.getValue();
+                Trace
+                        .trace(Trace.INFO, "server_prefix = " + serverPrefix
+                                + ".");
+            }
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+     */
+    public void run(IAction action) {
+
+        // bring up new dialog
+        ServerCustomAssemblyWizard wizard = new ServerCustomAssemblyWizard (customAssembly);
+        WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+        dialog.open();
+        if (dialog.getReturnCode() == Dialog.OK) {
+            
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+     *      org.eclipse.jface.viewers.ISelection)
+     */
+    public void selectionChanged(IAction action, ISelection selection) {
+
+        customAssembly = new GeronimoCustomServerAssembly();
+        boolean enable = customAssembly.serverChanged (((StructuredSelection) selection).getFirstElement(),
serverPrefix);
+
+        action.setEnabled(enable);
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/LaunchGeronimoServerAssemblyAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/LaunchGeronimoServerAssemblyAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/actions/LaunchGeronimoServerAssemblyAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleMappingWizard.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/SecurityRoleMappingWizard.java?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleMappingWizard.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRoleMappingWizard.java
Wed Oct 22 12:06:55 2008
@@ -52,6 +52,7 @@
     private final String[] ROLE_MAPPING_TYPES = {
             "Distinguished Name", "Principal", "Login Domain Principal", "Realm Principal"
};
 
+    protected AbstractTreeSection section;
     protected Combo type;
     protected Text name;
     protected Combo clazz;
@@ -59,7 +60,8 @@
     protected Combo realmName;
     
     public SecurityRoleMappingWizard(AbstractTreeSection section) {
-        super(section);
+        super();
+        this.section = section;
     }
 
     protected static String[] getSecurityRealms() {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRunAsSubjectWizard.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/SecurityRunAsSubjectWizard.java?rev=707162&r1=707161&r2=707162&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRunAsSubjectWizard.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/SecurityRunAsSubjectWizard.java
Wed Oct 22 12:06:55 2008
@@ -33,9 +33,11 @@
     protected Combo role;
     protected Text realm;
     protected Text id;
+    protected AbstractTableSection section;
 
     public SecurityRunAsSubjectWizard(AbstractTableSection section) {
-        super(section);
+        super();
+        this.section = section;
     }
 
     public class SecurityRunAsSubjectAddWizardPage extends AbstractWizardPage {

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.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/ServerCustomAssemblyWizard.java?rev=707162&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java
Wed Oct 22 12:06:55 2008
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v21.ui.wizards;
+
+import java.util.List;
+
+import org.apache.geronimo.st.ui.CommonMessages;
+import org.apache.geronimo.st.ui.wizards.AbstractWizard;
+import org.apache.geronimo.st.v21.core.operations.GeronimoCustomServerAssembly;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ServerCustomAssemblyWizard extends AbstractWizard {
+
+    private Table pluginTable;
+    
+    protected Text group;
+    protected Text artifact;
+    protected Text version;
+    protected Text type;
+    protected Text serverPath;
+
+    protected GeronimoCustomServerAssembly customAssembly;
+
+    public ServerCustomAssemblyWizard(GeronimoCustomServerAssembly customAssembly) {
+        super();
+        this.customAssembly = customAssembly;
+    }
+
+    public void addPages() {
+        addPage(new ServerCustomAssemblyWizardPage("page0"));
+    }
+
+    public class ServerCustomAssemblyWizardPage extends AbstractWizardPage {
+
+        public ServerCustomAssemblyWizardPage(String pageName) {
+            super(pageName);
+        }
+
+        public void createControl(Composite parent) {
+            parent.setLayoutData(createGridData());
+            Composite composite = createComposite(parent);
+
+            createLabel(composite, CommonMessages.groupId);
+            group = createTextField(composite, "");
+            createLabel(composite, CommonMessages.artifactId);
+            artifact = createTextField(composite, "");
+            createLabel(composite, CommonMessages.version);
+            version = createTextField(composite, "1.0");
+            createLabel(composite, CommonMessages.type);
+            type = createTextField(composite, "tar.gz");
+            createLabel(composite, CommonMessages.path);
+            serverPath = createTextField(composite, "var/temp/assembly");
+            createTable(composite);
+            populateTable();
+
+            setControl(composite);
+        }
+
+        public GridData createGridData() {
+            GridData data = new GridData();
+            data.verticalAlignment = GridData.FILL;
+            data.horizontalAlignment = GridData.FILL;
+            data.grabExcessVerticalSpace = true;
+            data.grabExcessHorizontalSpace = true;
+            data.heightHint = 400;
+            data.widthHint = 300;
+            return data;
+        }
+
+        private void createTable(Composite composite) {
+            int style = SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
+
+            pluginTable = new Table(composite, style);
+            GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
+            data.grabExcessHorizontalSpace = true;
+            data.grabExcessVerticalSpace = true;
+            data.horizontalSpan = 2;
+            data.horizontalAlignment = GridData.FILL;
+            data.heightHint = 250;
+            data.widthHint = 350;
+            pluginTable.setLayoutData(data);
+            pluginTable.setLinesVisible(false);
+            pluginTable.setHeaderVisible(true);
+
+            final TableColumn[] column = new TableColumn[1];
+            column[0] = new TableColumn(pluginTable, SWT.LEFT, 0);
+            column[0].setText(CommonMessages.plugin);
+            column[0].setWidth(400);
+        }
+
+        public void populateTable() {
+            List<String> pluginList = customAssembly.getPluginList();
+             
+            for (int i = 0; i < pluginList.size(); ++i) {
+                TableItem tableItem = new TableItem(pluginTable, SWT.NONE);
+                String tableEntry = pluginList.get(i);
+                tableItem.setData(tableEntry);
+                tableItem.setText(new String[] {tableEntry});
+            }
+        }
+    }
+
+    public boolean performFinish() {
+        if (isEmpty(group.getText()) || isEmpty(artifact.getText()) ||
+            isEmpty(version.getText()) || isEmpty(type.getText()) ||
+            isEmpty(serverPath.getText()) || pluginTable.getSelectionCount() == 0) {
+            return false;
+        }
+        customAssembly.assembleServer(group.getText(), artifact.getText(), version.getText(),
type.getText(), 
+                serverPath.getText(), pluginTable.getSelectionIndices());
+        return true;
+    }
+
+    @Override
+    protected String getAddWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_ServerCustomAssembly;
+    }
+
+    @Override
+    protected String getEditWizardWindowTitle() {
+        return CommonMessages.wizardNewTitle_ServerCustomAssembly;
+    }
+
+    @Override
+    protected String getWizardPageTitle() {
+        return CommonMessages.wizardPageTitle_ServerCustomAssembly;
+    }
+
+    @Override
+    protected String getWizardPageDescription() {
+        return CommonMessages.wizardPageDescription_ServerCustomAssembly;
+    }
+}

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

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

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



Mime
View raw message