[jboss-svn-commits] JBL Code SVN: r14135 - in labs/jbossesb/trunk/product/tools/esbwizard: META-INF and 4 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Aug 9 22:46:19 EDT 2007


Author: kurt.stam at jboss.com
Date: 2007-08-09 22:46:19 -0400 (Thu, 09 Aug 2007)
New Revision: 14135

Added:
   labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ProfileFieldEditor.java
Modified:
   labs/jbossesb/trunk/product/tools/esbwizard/
   labs/jbossesb/trunk/product/tools/esbwizard/.classpath
   labs/jbossesb/trunk/product/tools/esbwizard/META-INF/MANIFEST.MF
   labs/jbossesb/trunk/product/tools/esbwizard/build.properties
   labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferenceConstants.java
   labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferencePage.java
   labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/template/Activator.java
   labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/util/ESBUtils.java
   labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBNewWizard.java
   labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBServerPage.java
Log:
JBESB-785 applying profileSelection2.txt


Property changes on: labs/jbossesb/trunk/product/tools/esbwizard
___________________________________________________________________
Name: svn:ignore
   + bin


Modified: labs/jbossesb/trunk/product/tools/esbwizard/.classpath
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/.classpath	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/.classpath	2007-08-10 02:46:19 UTC (rev 14135)
@@ -1,7 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry exported="true" kind="lib" path="bin" sourcepath="bin"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.jboss.ide.eclipse.jdt.core.classpath.j2ee-1.4"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Modified: labs/jbossesb/trunk/product/tools/esbwizard/META-INF/MANIFEST.MF
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/META-INF/MANIFEST.MF	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/META-INF/MANIFEST.MF	2007-08-10 02:46:19 UTC (rev 14135)
@@ -1,17 +1,19 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Esbwizard Plug-in
-Bundle-SymbolicName: org.jboss.soa.esb.eclipse.template; singleton:=true
-Bundle-Version: 1.1.1
-Bundle-Activator: org.jboss.soa.esb.eclipse.template.Activator
-Bundle-Vendor: JBoss
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.ui.ide,
- org.eclipse.jdt.core,
- org.eclipse.jdt.launching,
- org.eclipse.core.filesystem
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Esbwizard Plug-in
+Bundle-SymbolicName: org.jboss.soa.esb.eclipse.template; singleton:=true
+Bundle-Version: 1.1.1
+Bundle-Activator: org.jboss.soa.esb.eclipse.template.Activator
+Bundle-Vendor: JBoss
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.core.filesystem
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-ClassPath: .,
+ bin/

Modified: labs/jbossesb/trunk/product/tools/esbwizard/build.properties
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/build.properties	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/build.properties	2007-08-10 02:46:19 UTC (rev 14135)
@@ -1,9 +1,12 @@
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
-               META-INF/,\
-               .,\
-               icons/,\
-               template/,\
-               lib/
-jars.compile.order = .
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               .,\
+               icons/,\
+               template/,\
+               lib/,\
+               bin/
+jars.compile.order = .,\
+                     bin/org/
+src.includes = bin/,\
+               lib/

Modified: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferenceConstants.java
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferenceConstants.java	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferenceConstants.java	2007-08-10 02:46:19 UTC (rev 14135)
@@ -33,4 +33,8 @@
      * The Application Server location.
      */
     public static final String AS_LOCATION = "asLocation";
+    /**
+     * The Application Server Profile location.
+     */
+    public static final String AS_PROFILE_LOCATION = "asProfileLocation";
 }

Modified: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferencePage.java
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferencePage.java	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ESBPreferencePage.java	2007-08-10 02:46:19 UTC (rev 14135)
@@ -22,8 +22,10 @@
 
 import org.eclipse.jface.preference.*;
 import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.eclipse.ui.IWorkbench;
@@ -46,6 +48,10 @@
      * The as field editor.
      */
     private ASDirectoryFieldEditor asEditor ;
+    /**
+     * The profile field editor.
+     */
+    private ProfileFieldEditor profileEditor;
     
     /**
      * Construct the ESB preference page.
@@ -63,6 +69,7 @@
     public void createFieldEditors()
     {
         final String esbLocation = getPreferenceStore().getString(ESBPreferenceConstants.ESB_LOCATION) ;
+        
         final boolean enabled = !ESBUtils.isESBServerLocation(esbLocation) ;
         
         final Composite parent = getFieldEditorParent() ;
@@ -81,7 +88,12 @@
         addField(asEditor) ;
         asEditor.setEnabled(enabled, parent) ;
         asEditor.getTextControl(parent).addModifyListener(validator) ;
-    }
+        
+        profileEditor = new ProfileFieldEditor(parent) ;
+        addField(profileEditor) ;
+        profileEditor.setEnabled(enabled, parent) ;
+        profileEditor.getTextControl(parent).addModifyListener(validator) ;
+   }
     
     /**
      * Handle a property change event.
@@ -104,10 +116,11 @@
      */
     private void validateEditors()
     {
-        final String newLocation = esbEditor.getStringValue() ;
-        final boolean enabled = !ESBUtils.isESBServerLocation(newLocation) ;
-        asEditor.setEnabled(enabled, getFieldEditorParent()) ;
-        checkState() ;
+       final String newLocation = esbEditor.getStringValue() ;
+       final boolean enabled = !ESBUtils.isESBServerLocation(newLocation) ;
+       asEditor.setEnabled(enabled, getFieldEditorParent()) ;
+       profileEditor.setEnabled(enabled, getFieldEditorParent());
+       checkState() ;
     }
 
     /**

Added: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ProfileFieldEditor.java
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ProfileFieldEditor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ProfileFieldEditor.java	2007-08-10 02:46:19 UTC (rev 14135)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2007
+ */
+
+package org.jboss.soa.esb.eclipse.preferences;
+
+import org.eclipse.jface.preference.DirectoryFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * The Application Server Profile Directory field editor.
+ * 
+ * @author johnathon
+ */
+public class ProfileFieldEditor extends DirectoryFieldEditor
+{
+    /**
+     * The enabled flag.
+     */
+    private boolean enabled ;
+    
+    /**
+     * Construct the Application Server Directory Field Editor.
+     * @param parent The parent composite.
+     */
+    public ProfileFieldEditor(Composite parent)
+    {
+        super(ESBPreferenceConstants.AS_PROFILE_LOCATION, "&Application Server Profile Location:", parent);
+        setEmptyStringAllowed(false) ;
+        setErrorMessage("Application Server Profile location does not specify a valid Application Server profile");
+    }
+    
+    /**
+     * Check the state after a change.
+     * Combo read only drop down limits to valid selections (assuming only directories are in the server dir.)
+     * @return true if valid, false otherwise.
+     */
+    protected boolean doCheckState()
+    {
+        return true ;
+    }
+    
+    /**
+     * Enable or disable the component.
+     * @param enabled true if the component is enabled, false otherwise.
+     * @param parent The parent composite.
+     */
+    public void setEnabled(final boolean enabled, final Composite parent)
+    {
+        this.enabled = enabled ;
+        super.setEnabled(enabled, parent);
+        setEmptyStringAllowed(!enabled) ;
+        if (!enabled)
+        {
+            setStringValue("") ;
+        }
+        refreshValidState() ;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/preferences/ProfileFieldEditor.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/template/Activator.java
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/template/Activator.java	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/template/Activator.java	2007-08-10 02:46:19 UTC (rev 14135)
@@ -1,73 +1,75 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2007
- */
-
-package org.jboss.soa.esb.eclipse.template;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-	// The plug-in ID
-	public static final String PLUGIN_ID = "org.jboss.soa.esb.eclipse.template";
-	// The shared instance
-	private static Activator plugin;
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#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;
-	}
-	
-	/**
-	 * Returns an image descriptor for the image file at the given
-	 * plug-in relative path
-	 *
-	 * @param path the path
-	 * @return the image descriptor
-	 */
-	public static ImageDescriptor getImageDescriptor(String path) {
-		return imageDescriptorFromPlugin(PLUGIN_ID, path);
-	}
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2007
+ */
+
+package org.jboss.soa.esb.eclipse.template;
+
+//import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.jboss.soa.esb.eclipse.template";
+	// The shared instance
+	private static Activator plugin;
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+		//plugin.getLog().log(new Status(Status.INFO, Activator.PLUGIN_ID, Status.OK, "plugin-msg-start", null));
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#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;
+	}
+	
+	/**
+	 * Returns an image descriptor for the image file at the given
+	 * plug-in relative path
+	 *
+	 * @param path the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
+}

Modified: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/util/ESBUtils.java
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/util/ESBUtils.java	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/util/ESBUtils.java	2007-08-10 02:46:19 UTC (rev 14135)
@@ -53,12 +53,23 @@
     } ;
     
     /**
-     * Does the specified location represent an ESB Server installation?
+     * Does the specified location represent an ESB Server installation with a default profile?
      * @param location The specified location.
      * @return true if it is an ESB installation, false otherwise.
      */
     public static boolean isESBServerLocation(final String location)
     {
+        return isESBServerLocation(location,"default");
+    }
+    
+    /**
+     * Does the specified location represent an ESB Server installation?
+     * @param location The specified location.
+     * @param profile 
+     * @return true if it is an ESB installation, false otherwise.
+     */
+    public static boolean isESBServerLocation(final String location, String profile)
+    {
         // esb installation has EULA, quickstarts and lib esb files
         final String normalisedLocation = normalise(location) ;
         if (normalisedLocation != null)
@@ -66,7 +77,7 @@
             final IPath path = Path.fromOSString(normalisedLocation) ;
             final IFileStore esbFileStore = EFS.getLocalFileSystem().getStore(path) ;
             return (isDirectory(esbFileStore) && hasEULA(esbFileStore) &&
-                hasQuickstarts(esbFileStore) && hasDeployESBDirs(esbFileStore)) ;
+                hasQuickstarts(esbFileStore) && hasDeployESBDirs(esbFileStore, profile)) ;
         }
         return false ;
     }
@@ -78,6 +89,17 @@
      */
     public static boolean isESBServerOrESBLocation(final String location)
     {
+    	return isESBServerOrESBLocation(location, "default");
+    }
+    
+    /**
+     * Does the specified location represent an ESB server or ESB deployment?
+     * @param location The specified location.
+     * @param profileLocation 
+     * @return true if it is an App Server or ESB deployment, false otherwise.
+     */
+    public static boolean isESBServerOrESBLocation(final String location, String profileLocation)
+    {
         // esb server installation has EULA, quickstarts and server/default/deploy esb files
         final String normalisedLocation = normalise(location) ;
         if (normalisedLocation != null)
@@ -86,7 +108,7 @@
             final IFileStore esbFileStore = EFS.getLocalFileSystem().getStore(path) ;
             return (isDirectory(esbFileStore) && hasEULA(esbFileStore) &&
                 hasQuickstarts(esbFileStore) &&
-                (hasDeployESBDirs(esbFileStore) || hasLibESBDirs(esbFileStore))) ;
+                (hasDeployESBDirs(esbFileStore, profileLocation) || hasLibESBDirs(esbFileStore))) ;
         }
         return false ;
     }
@@ -165,16 +187,27 @@
     }
     
     /**
-     * Are the ESB artifacts in the deploy directory?
+     * Are the ESB artifacts in the "default" deploy directory?
      * @param location The base location to check.
      * @return true if the ESB artifacts are in deploy, false otherwise.
      */
     private static boolean hasDeployESBDirs(final IFileStore location)
     {
-        final IFileStore serverDir = location.getChild("server") ;
-        if (isDirectory(serverDir))
-        {
-            final IFileStore defaultDir = serverDir.getChild("default") ;
+    	return hasDeployESBDirs(location,"default");
+    }
+    
+    /**
+     * Are the ESB artifacts in the deploy directory?
+     * @param location The base location to check.
+     * @param profile 
+     * @return true if the ESB artifacts are in deploy, false otherwise.
+     */
+    private static boolean hasDeployESBDirs(final IFileStore location, String profile)
+    {
+    	final IFileStore serverDir = location.getChild("server") ;
+    	if (isDirectory(serverDir))
+    	{
+        	final IFileStore defaultDir = serverDir.getChild(profile) ;
             if (isDirectory(defaultDir))
             {
                 final IFileStore deployDir = defaultDir.getChild("deploy") ;
@@ -245,18 +278,31 @@
     }
 
     /**
+     * Get the artifact classpath for the ESB server using default profile.
+     * @param esbLocation The ESB location.
+     * @return The classpath entries for the artifact classpath.
+     * @throws CoreException 
+     * @throws CoreException for errors.
+     */
+    public static IClasspathEntry[] getESBServerArtifactClasspath(final String esbLocation) throws CoreException
+    {
+    	return getESBServerArtifactClasspath(esbLocation,"default");
+    }
+    
+    /**
      * Get the artifact classpath for the ESB server.
      * @param esbLocation The ESB location.
+     * @param asProfileLocation The AS Profile location.
      * @return The classpath entries for the artifact classpath.
      * @throws CoreException for errors.
      */
-    public static IClasspathEntry[] getESBServerArtifactClasspath(final String esbLocation)
+    public static IClasspathEntry[] getESBServerArtifactClasspath(final String esbLocation, final String asProfileLocation)
         throws CoreException
     {
         final ArrayList classpathEntries = new ArrayList() ;
         final HashSet jarEntries = new HashSet() ;
         final IPath esbLocationPath = Path.fromOSString(esbLocation) ;
-        final IPath deployPath = esbLocationPath.append("server/default/deploy") ;
+        final IPath deployPath = esbLocationPath.append("server/" + asProfileLocation + "/deploy") ;
         
         addSARArtifactJars(classpathEntries, jarEntries, deployPath, ESB_SAR) ;
         addESBArtifactJars(classpathEntries, jarEntries, deployPath, ESB_ARTIFACTS) ;
@@ -377,4 +423,19 @@
             classpathEntries.add(JavaCore.newLibraryEntry(jarPath, null, null)) ;
         }
     }
+
+	public static String[] getValidProfiles(final String location) {
+		final String normalisedLocation = normalise(location) ;
+        if (normalisedLocation != null){
+            final IPath path = Path.fromOSString(normalisedLocation) ;
+            final IFileStore serverDir = EFS.getLocalFileSystem().getStore(path) ;
+            try {
+				return serverDir.getChild("server").childNames(EFS.NONE, null);
+			} catch (CoreException e) {
+				e.printStackTrace();
+			}
+         }	
+			
+		return null;
+	}
 }

Modified: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBNewWizard.java
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBNewWizard.java	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBNewWizard.java	2007-08-10 02:46:19 UTC (rev 14135)
@@ -1,271 +1,277 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2007
- */
-
-package org.jboss.soa.esb.eclipse.wizards;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.jboss.soa.esb.eclipse.preferences.ESBPreferenceConstants;
-import org.jboss.soa.esb.eclipse.template.Activator;
-
-/**
- * This is a new wizard which creates a very simple ESB project.    The
- * wizard copies over the requisite files, sets the classpath, and refreshes.
- * Using the default WizardNewProjectCreationPage for now because all
- * that is needed to start is a project name.     If we want to customize
- * the class names or the package names we're going to have to extend that a bit.
- */
-public class ESBNewWizard extends Wizard implements INewWizard {
-	private WizardNewProjectCreationPage m_page;
-        private ESBServerPage m_serverPage;
-	private IProject m_project;
-	private IWorkbench m_workbench;
-	
-	/**
-	 * Constructor for ESBNewWizard.
-	 */
-	public ESBNewWizard() {
-		super();
-		setNeedsProgressMonitor(true);
-	}
-	
-	/**
-	 * Adding the default new project wizard page to the wizard.
-	 */
-	public void addPages() {
-		super.addPages();
-		setWindowTitle("New ESB Package Project");
-                
-		m_page = new WizardNewProjectCreationPage("WizardNewProjectCreationPage");
-		m_page.setTitle("ESB Package Project");
-		m_page.setDescription("Create a new ESB package project");
-		addPage(m_page);
-                
-                m_serverPage = new ESBServerPage("ESBServerPage") ;
-                m_serverPage.setTitle("ESB Server Location") ;
-                m_serverPage.setDescription("Specify location of ESB installation and Application Server") ;
-                
-                final IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore() ;
-                
-                final String esbLocation = preferenceStore.getString(ESBPreferenceConstants.ESB_LOCATION) ;
-                final String asLocation = preferenceStore.getString(ESBPreferenceConstants.AS_LOCATION) ;
-                m_serverPage.setInitialESBLocation(esbLocation) ;
-                m_serverPage.setInitialASLocation(asLocation) ;
-                
-                addPage(m_serverPage) ;
-	}
-
-	/**
-	 * Create the project, start and complete the monitor progress.
-	 */
-	private void createProject(IProgressMonitor monitor) throws InterruptedException, CoreException, InvocationTargetException
-	{
-		if (monitor == null) {
-			monitor= new NullProgressMonitor();
-		}
-		try {		
-			String strName = m_page.getProjectName();
-			monitor.beginTask("Creating "+ strName + " ESB Project", 3);
-	
-			IProject project= m_page.getProjectHandle();
-			IPath locationPath= m_page.getLocationPath();
-			
-			// create the project
-			IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName());
-			if (!m_page.useDefaults()) {
-				desc.setLocation(locationPath);
-			}
-
-			ESBProjectCreator esbpc = new ESBProjectCreator();
-                        try {
-                            esbpc.createJavaProject(m_page, m_serverPage, project, m_workbench, monitor);
-                        } catch (final IOException ioe) {
-                            throw new InvocationTargetException(ioe) ;
-                        }
-		} finally {
-			monitor.done();
-		}
-	}
-	
-	/**
-	 * performFinish is called when the user hits the "Finish" button.
-	 */
-	public boolean performFinish() {
-                m_project = m_page.getProjectHandle();
-                WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
-                    protected void execute(IProgressMonitor monitor)
-                        throws CoreException, InterruptedException, InvocationTargetException {
-                        try {
-                                createProject(monitor);
-                                selectAndReveal(m_project, m_workbench.getActiveWorkbenchWindow());
-                        } finally {
-                                monitor.done();
-                        }
-                    }
-                };
-                try {
-                        getContainer().run(false, true, op);
-                } catch (InvocationTargetException ite) {
-                    final Throwable targetException = ite.getTargetException() ;
-                    if (targetException instanceof CoreException) {
-                        ErrorDialog.openError(getShell(), "Error creating project",
-                            null, ((CoreException)targetException).getStatus());
-                    } else {
-                        final String targetMessage = targetException.getMessage() ;
-                        final String message = (targetMessage != null ? targetMessage : targetException.toString()) ;
-                        final IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, message, targetException);
-                        Activator.getDefault().getLog().log(status) ;
-                        MessageDialog.openError(getShell(), "Error creating project", targetException.getMessage()) ;
-                    }
-                } catch (InterruptedException e) {
-                        return false ;
-                }
-                selectAndReveal(m_project, m_workbench.getActiveWorkbenchWindow());
-                return true;
-	}
-	
-	/**
-	 * Refresh the workbench.
-	 * @param resource resource
-	 * @param window window
-	 */
-    private void selectAndReveal(IResource resource,
-	           IWorkbenchWindow window) {
-		if (!inputValid(resource, window)) return;   
-		Iterator itr = getParts(window.getActivePage()).iterator();
-		while (itr.hasNext()) {
-		    selectAndRevealTarget(
-					window, 
-					new StructuredSelection(resource), 
-					getTarget((IWorkbenchPart)itr.next()));
-		}
-	}
-	
-	/**
-	 * Return a target from a IWorkbenchPart.
-	 * @param part workbench part
-	 * @return target
-	 */
-    private ISetSelectionTarget getTarget(IWorkbenchPart part) {
-        ISetSelectionTarget target = null;
-        if (part instanceof ISetSelectionTarget) {
-            target = (ISetSelectionTarget)part;
-        }
-        else {
-            target = (ISetSelectionTarget)part.getAdapter(ISetSelectionTarget.class);
-        }
-		return target;		
-	}
-    
-    /**
-     * Check whether the window / resource combination is valid.
-     * @param resource
-     * @param window
-     * @return
-     */
-	private boolean inputValid(IResource resource, IWorkbenchWindow window) {
-		if (window == null || resource == null) return false;
-		else if (window.getActivePage() == null) return false;
-		else return true;
-	}
-
-	/**
-	 * Call select reveal.
-	 * @param window window
-	 * @param selection selection
-	 * @param target target
-	 */private void selectAndRevealTarget(IWorkbenchWindow window, final ISelection selection, ISetSelectionTarget target) {
-		if (target == null) return;
-		final ISetSelectionTarget finalTarget = target;
-		window.getShell().getDisplay().asyncExec(new Runnable() {
-		    public void run() {
-		        finalTarget.selectReveal(selection);
-		    }
-		});
-	}
-    
-	 /**
-	  * Return a list of parts to iterate over.
-	  * @param page
-	  * @return list of parts
-	  */
-	private List getParts(IWorkbenchPage page) {
-		ArrayList result = new ArrayList();
-		addParts(result, page.getViewReferences());
-		addParts(result, page.getEditorReferences());
-		return result;
-	}
-	
-	/**
-	 * Copy all of the workbench part references into the list.
-	 * @param parts list of parts
-	 * @param refs workbench part references
-	 */
-	private void addParts(ArrayList parts, IWorkbenchPartReference[] refs) {
-		for (int i = 0; i < refs.length; i++) {
-           IWorkbenchPart part = refs[i].getPart(false);
-           if (part != null) {
-               parts.add(part);
-           }
-	    }		
-	}
-	
-	/**
-	 * We will accept the selection in the workbench to see if
-	 * we can initialize from it.
-	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
-	 */
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-		this.m_workbench = workbench;
-		this.m_project = null;
-		setNeedsProgressMonitor(true);
-	}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2007
+ */
+
+package org.jboss.soa.esb.eclipse.wizards;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
+import org.eclipse.ui.part.ISetSelectionTarget;
+import org.jboss.soa.esb.eclipse.preferences.ESBPreferenceConstants;
+import org.jboss.soa.esb.eclipse.template.Activator;
+
+
+/**
+ * This is a new wizard which creates a very simple ESB project.    The
+ * wizard copies over the requisite files, sets the classpath, and refreshes.
+ * Using the default WizardNewProjectCreationPage for now because all
+ * that is needed to start is a project name.     If we want to customize
+ * the class names or the package names we're going to have to extend that a bit.
+ */
+public class ESBNewWizard extends Wizard implements INewWizard {
+	private WizardNewProjectCreationPage m_page;
+        private ESBServerPage m_serverPage;
+	private IProject m_project;
+	private IWorkbench m_workbench;
+	
+	/**
+	 * Constructor for ESBNewWizard.
+	 */
+	public ESBNewWizard() {
+		super();
+		//If you are writing an Eclipse plug-in, you can use the services provided by org.eclipse.core.runtime.ILog 
+		//that is accessed through the method getLog() from your Plugin class. 
+		//Just create an instance of org.eclipse.core.runtime.Status with the right information and call the log() method on ILog.
+		setNeedsProgressMonitor(true);
+		Activator.getDefault().getLog().log(new Status(Status.INFO, Activator.PLUGIN_ID, Status.OK, "JRL-plugin-msg-onESBNewWizard", null));
+	}
+	
+	/**
+	 * Adding the default new project wizard page to the wizard.
+	 */
+	public void addPages() {
+		super.addPages();
+		setWindowTitle("New ESB Package Project");
+                
+		m_page = new WizardNewProjectCreationPage("WizardNewProjectCreationPage");
+		m_page.setTitle("ESB Package Project");
+		m_page.setDescription("Create a new ESB package project");
+		addPage(m_page);
+                
+                m_serverPage = new ESBServerPage("ESBServerPage") ;
+                m_serverPage.setTitle("ESB Server Location") ;
+                m_serverPage.setDescription("Specify location of ESB installation and Application Server") ;
+                
+                final IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore() ;
+                
+                final String esbLocation = preferenceStore.getString(ESBPreferenceConstants.ESB_LOCATION) ;
+                final String asLocation = preferenceStore.getString(ESBPreferenceConstants.AS_LOCATION) ;
+                final String asProfileLocation = preferenceStore.getString(ESBPreferenceConstants.AS_PROFILE_LOCATION);
+                m_serverPage.setInitialESBLocation(esbLocation) ;
+                m_serverPage.setInitialASLocation(asLocation) ;
+                m_serverPage.setInitialASProfileLocation(asProfileLocation);
+                addPage(m_serverPage) ;
+	}
+
+	/**
+	 * Create the project, start and complete the monitor progress.
+	 */
+	private void createProject(IProgressMonitor monitor) throws InterruptedException, CoreException, InvocationTargetException
+	{
+		if (monitor == null) {
+			monitor= new NullProgressMonitor();
+		}
+		try {		
+			String strName = m_page.getProjectName();
+			monitor.beginTask("Creating "+ strName + " ESB Project", 3);
+	
+			IProject project= m_page.getProjectHandle();
+			IPath locationPath= m_page.getLocationPath();
+			
+			// create the project
+			IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName());
+			if (!m_page.useDefaults()) {
+				desc.setLocation(locationPath);
+			}
+
+			ESBProjectCreator esbpc = new ESBProjectCreator();
+                        try {
+                            esbpc.createJavaProject(m_page, m_serverPage, project, m_workbench, monitor);
+                        } catch (final IOException ioe) {
+                            throw new InvocationTargetException(ioe) ;
+                        }
+		} finally {
+			monitor.done();
+		}
+	}
+	
+	/**
+	 * performFinish is called when the user hits the "Finish" button.
+	 */
+	public boolean performFinish() {
+                m_project = m_page.getProjectHandle();
+                WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+                    protected void execute(IProgressMonitor monitor)
+                        throws CoreException, InterruptedException, InvocationTargetException {
+                        try {
+                                createProject(monitor);
+                                selectAndReveal(m_project, m_workbench.getActiveWorkbenchWindow());
+                        } finally {
+                                monitor.done();
+                        }
+                    }
+                };
+                try {
+                        getContainer().run(false, true, op);
+                } catch (InvocationTargetException ite) {
+                    final Throwable targetException = ite.getTargetException() ;
+                    if (targetException instanceof CoreException) {
+                        ErrorDialog.openError(getShell(), "Error creating project",
+                            null, ((CoreException)targetException).getStatus());
+                    } else {
+                        final String targetMessage = targetException.getMessage() ;
+                        final String message = (targetMessage != null ? targetMessage : targetException.toString()) ;
+                        final IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, message, targetException);
+                        Activator.getDefault().getLog().log(status) ;
+                        MessageDialog.openError(getShell(), "Error creating project", targetException.getMessage()) ;
+                    }
+                } catch (InterruptedException e) {
+                        return false ;
+                }
+                selectAndReveal(m_project, m_workbench.getActiveWorkbenchWindow());
+                return true;
+	}
+	
+	/**
+	 * Refresh the workbench.
+	 * @param resource resource
+	 * @param window window
+	 */
+    private void selectAndReveal(IResource resource,
+	           IWorkbenchWindow window) {
+		if (!inputValid(resource, window)) return;   
+		Iterator itr = getParts(window.getActivePage()).iterator();
+		while (itr.hasNext()) {
+		    selectAndRevealTarget(
+					window, 
+					new StructuredSelection(resource), 
+					getTarget((IWorkbenchPart)itr.next()));
+		}
+	}
+	
+	/**
+	 * Return a target from a IWorkbenchPart.
+	 * @param part workbench part
+	 * @return target
+	 */
+    private ISetSelectionTarget getTarget(IWorkbenchPart part) {
+        ISetSelectionTarget target = null;
+        if (part instanceof ISetSelectionTarget) {
+            target = (ISetSelectionTarget)part;
+        }
+        else {
+            target = (ISetSelectionTarget)part.getAdapter(ISetSelectionTarget.class);
+        }
+		return target;		
+	}
+    
+    /**
+     * Check whether the window / resource combination is valid.
+     * @param resource
+     * @param window
+     * @return
+     */
+	private boolean inputValid(IResource resource, IWorkbenchWindow window) {
+		if (window == null || resource == null) return false;
+		else if (window.getActivePage() == null) return false;
+		else return true;
+	}
+
+	/**
+	 * Call select reveal.
+	 * @param window window
+	 * @param selection selection
+	 * @param target target
+	 */private void selectAndRevealTarget(IWorkbenchWindow window, final ISelection selection, ISetSelectionTarget target) {
+		if (target == null) return;
+		final ISetSelectionTarget finalTarget = target;
+		window.getShell().getDisplay().asyncExec(new Runnable() {
+		    public void run() {
+		        finalTarget.selectReveal(selection);
+		    }
+		});
+	}
+    
+	 /**
+	  * Return a list of parts to iterate over.
+	  * @param page
+	  * @return list of parts
+	  */
+	private List getParts(IWorkbenchPage page) {
+		ArrayList result = new ArrayList();
+		addParts(result, page.getViewReferences());
+		addParts(result, page.getEditorReferences());
+		return result;
+	}
+	
+	/**
+	 * Copy all of the workbench part references into the list.
+	 * @param parts list of parts
+	 * @param refs workbench part references
+	 */
+	private void addParts(ArrayList parts, IWorkbenchPartReference[] refs) {
+		for (int i = 0; i < refs.length; i++) {
+           IWorkbenchPart part = refs[i].getPart(false);
+           if (part != null) {
+               parts.add(part);
+           }
+	    }		
+	}
+	
+	/**
+	 * We will accept the selection in the workbench to see if
+	 * we can initialize from it.
+	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+	 */
+	public void init(IWorkbench workbench, IStructuredSelection selection) {
+		this.m_workbench = workbench;
+		this.m_project = null;
+		setNeedsProgressMonitor(true);
+	}
 }
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBServerPage.java
===================================================================
--- labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBServerPage.java	2007-08-09 20:14:51 UTC (rev 14134)
+++ labs/jbossesb/trunk/product/tools/esbwizard/src/org/jboss/soa/esb/eclipse/wizards/ESBServerPage.java	2007-08-10 02:46:19 UTC (rev 14135)
@@ -34,6 +34,7 @@
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.DirectoryDialog;
 import org.eclipse.swt.widgets.Label;
@@ -64,7 +65,13 @@
      * The initial value of the AS location.
      */
     private String initialASLocation ;
+    
     /**
+     * The initial value of the AS Profile location.
+     */
+    private String initialASProfileLocation ;
+    
+    /**
      * The ESB location label.
      */
     private Label esbLocationLabel ;
@@ -72,7 +79,13 @@
      * The AS location label.
      */
     private Label asLocationLabel ;
+    
     /**
+     * The AS Configlocation label.
+     */
+    private Label asProfileLocationLabel ;
+    
+    /**
      * The ESB location text field.
      */
     private Text esbLocationField ;
@@ -81,6 +94,11 @@
      */
     private Text asLocationField ;
     /**
+     * The AS Profile location combo
+     */
+    private Combo asProfileLocationCombo;
+    
+    /**
      * The ESB browse button.
      */
     private Button esbLocationButton ;
@@ -88,20 +106,22 @@
      * The AS browse button.
      */
     private Button asLocationButton ;
-    
     /**
      * Is the ESB location valid?
      */
-    private boolean esbLocationValid ;
+    private boolean esbLocationValid = false;
     /**
+     * Is the AS location enabled?
+     */
+    private boolean asEnabled = true ;
+    /**
      * Is the AS location valid?
      */
-    private boolean asLocationValid ;
+    private boolean asLocationValid = false;
     /**
-     * Is the AS location enabled?
+     * Is the profile selected?
      */
-    private boolean asEnabled = true ;
-    
+    private boolean asProfileSelected = false;
     /**
      * Construct the wizard page.
      * @param pageName The page name.
@@ -128,63 +148,129 @@
         dataComposite.setLayout(new GridLayout(3, false)) ;
         dataComposite.setLayoutData(new GridData(SWT.FILL, GridData.CENTER, true, false)) ;
         
-        esbLocationLabel = new Label(dataComposite, SWT.NONE) ;
-        esbLocationLabel.setFont(parent.getFont()) ;
-        esbLocationLabel.setText("ESB Install Location:") ;
+        addEsbLocation(parent, dataComposite);
         
-        esbLocationField = new Text(dataComposite, SWT.BORDER) ;
-        esbLocationField.setLayoutData(new GridData(TEXT_WIDTH, SWT.DEFAULT)) ;
-        esbLocationField.setFont(parent.getFont()) ;
-        esbLocationField.addModifyListener(new ModifyListener() {
-            public void modifyText(final ModifyEvent event) {
-                validateESBLocation() ;
-            }
-        }) ;
+        addAsLocation(parent, dataComposite);
         
-        esbLocationButton = new Button(dataComposite, SWT.PUSH) ;
-        esbLocationButton.setText(BROWSE_TEXT) ;
-        esbLocationButton.addSelectionListener(new SelectionAdapter() {
-            public void widgetSelected(final SelectionEvent event) {
-                handleBrowse(esbLocationField, "ESB Install Location") ;
+        addProfileLocation(parent, dataComposite);
+        
+        setErrorMessage(null);
+        setMessage(null);
+        
+        if (initialESBLocation != null)
+        {
+            esbLocationField.setText(initialESBLocation) ;
+        }
+        if (asEnabled && (initialASLocation != null))
+        {
+        	asLocationField.setText(initialASLocation) ;
+        	// validation occured in the pref pane
+        	asLocationValid = true;
+        	asLocationField.setEnabled(asLocationValid);
+        }
+        if (initialASProfileLocation != null){
+        	asProfileLocationCombo.setText(initialASProfileLocation);
+        	// validation occured in the pref pane
+        	asProfileSelected = true;
+        	asProfileLocationLabel.setVisible(asProfileSelected);
+        	asProfileLocationCombo.setVisible(asProfileSelected);
+        	asProfileLocationCombo.setEnabled(asProfileSelected);
+        }
+        dataComposite.pack(true);
+        pageComposite.pack(true);
+        setControl(pageComposite); 
+    }
+    
+    /**
+     * Add the AS Profile widgets
+     * @param parent
+     * @param dataComposite
+     */
+	private void addProfileLocation(final Composite parent, final Composite dataComposite) {
+		asProfileLocationLabel = new Label(dataComposite, SWT.NONE) ;
+		asProfileLocationLabel.setVisible(asLocationValid);
+		asProfileLocationLabel.setFont(parent.getFont()) ;
+        asProfileLocationLabel.setText("Application Server Profile Location:") ;
+        
+        asProfileLocationCombo = new Combo(dataComposite, SWT.READ_ONLY);
+        asProfileLocationCombo.setVisible(asLocationValid);
+        asProfileLocationCombo.setFont(parent.getFont());
+        asProfileLocationCombo.pack();
+        asProfileLocationCombo.addSelectionListener(new SelectionAdapter() {
+        	public void widgetSelected(final SelectionEvent event) {
+        		asProfileSelected() ;
             }
-        }) ;
-        
-        asLocationLabel = new Label(dataComposite, SWT.NONE) ;
+        	
+        });
+	}
+	
+	/**
+	 * Add the Application Server widgets
+	 * @param parent
+	 * @param dataComposite
+	 */
+	private void addAsLocation(final Composite parent, final Composite dataComposite) {
+		asLocationLabel = new Label(dataComposite, SWT.NONE) ;
         asLocationLabel.setFont(parent.getFont()) ;
         asLocationLabel.setText("Application Server Location:") ;
         
         asLocationField = new Text(dataComposite, SWT.BORDER) ;
         asLocationField.setLayoutData(new GridData(TEXT_WIDTH, SWT.DEFAULT)) ;
         asLocationField.setFont(parent.getFont()) ;
+        asLocationField.setEnabled(asEnabled);
+        asLocationField.setText("Please choose esb location first");
         asLocationField.addModifyListener(new ModifyListener() {
             public void modifyText(final ModifyEvent event) {
                 validateASLocation() ;
             }
         }) ;
         
-        
         asLocationButton = new Button(dataComposite, SWT.PUSH) ;
         asLocationButton.setText(BROWSE_TEXT) ;
+        asLocationButton.setEnabled(asEnabled);
         asLocationButton.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(final SelectionEvent event) {
                 handleBrowse(asLocationField, "Application Server Location") ;
             }
         }) ;
+	}
+
+	/**
+	 * Add the ESB Server widgets
+	 * @param parent
+	 * @param dataComposite
+	 */
+	private void addEsbLocation(final Composite parent, final Composite dataComposite) {
+		esbLocationLabel = new Label(dataComposite, SWT.NONE) ;
+        esbLocationLabel.setFont(parent.getFont()) ;
+        esbLocationLabel.setText("ESB Install Location:") ;
         
-        setErrorMessage(null);
-        setMessage(null);
+        esbLocationField = new Text(dataComposite, SWT.BORDER) ;
+        esbLocationField.setLayoutData(new GridData(TEXT_WIDTH, SWT.DEFAULT)) ;
+        esbLocationField.setFont(parent.getFont()) ;
+        esbLocationField.addModifyListener(new ModifyListener() {
+            public void modifyText(final ModifyEvent event) {
+                validateESBLocation() ;
+            }
+        }) ;
         
-        if (initialESBLocation != null)
-        {
-            esbLocationField.setText(initialESBLocation) ;
-        }
-        if (asEnabled && (initialASLocation != null))
-        {
-            asLocationField.setText(initialASLocation) ;
-        }
-        
-        setControl(pageComposite); ;
-    }
+        esbLocationButton = new Button(dataComposite, SWT.PUSH) ;
+        esbLocationButton.setText(BROWSE_TEXT) ;
+        esbLocationButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(final SelectionEvent event) {
+                handleBrowse(esbLocationField, "ESB Install Location") ;
+            }
+        }) ;
+	}
+    
+    /**
+     * Get the AS Location
+	 * populate from folders under the servers directory 
+     **/
+    public void populateProfileSelection() {
+		asProfileLocationCombo.setItems(ESBUtils.getValidProfiles(asLocationField.getText()));
+		asProfileLocationCombo.pack();
+	}
 
     /**
      * Set the initial value of the ESB location.
@@ -251,7 +337,7 @@
             
             if (esbLocationValid)
             {
-                setPageComplete(asLocationValid) ;
+            	populateProfileSelection();
                 
                 if (!asLocationValid)
                 {
@@ -259,6 +345,8 @@
                 }
                 else
                 {
+                	asProfileLocationCombo.setVisible(asLocationValid);
+                	asProfileLocationLabel.setVisible(asLocationValid);
                     setErrorMessage(null) ;
                 }
             }
@@ -267,6 +355,21 @@
     }
     
     /**
+     * Indicate the AS Profile location has been selected.
+     */
+    private void asProfileSelected()
+    {
+    	asProfileSelected = true;
+        if (asEnabled)
+        {
+        	
+            setPageComplete(asProfileSelected) ;
+            setErrorMessage(null) ;
+        }
+        
+    }    
+    
+    /**
      * Handle the browse button for the specified location field.
      * @param locationField The location field.
      */
@@ -330,4 +433,26 @@
         }
         return null ;
     }
+    
+    
+    /**
+     * Get the value of the AS Profile location.
+     * @return The AS Profile location or null if not valid.
+     */
+    public String getASProfileLocation()
+    {
+        if (asProfileLocationCombo != null)
+        {
+            return asProfileLocationCombo.getText() ;
+        }
+        return null ;
+    }
+
+	public String getInitialASProfileLocation() {
+		return initialASProfileLocation;
+	}
+
+	public void setInitialASProfileLocation(String initialASProfileLocation) {
+		this.initialASProfileLocation = initialASProfileLocation;
+	}
 }




More information about the jboss-svn-commits mailing list