Author: rob.stryker(a)jboss.com
Date: 2009-01-30 06:53:32 -0500 (Fri, 30 Jan 2009)
New Revision: 13396
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.eap.43.default.ports.properties
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-3641 - separating org from eap.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2009-01-30
11:46:18 UTC (rev 13395)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2009-01-30
11:53:32 UTC (rev 13396)
@@ -39,6 +39,15 @@
<factory
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
<type
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
</adapter>
+
+ <adapter>
+ <runtime-component
+ id="org.jboss.ide.eclipse.eap.runtime.component"
version="4.3"/>
+ <factory
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
+ <type
class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+ </adapter>
+
+
</extension>
<extension
@@ -53,7 +62,7 @@
<extension
point="org.eclipse.jst.server.core.runtimeClasspathProviders">
<runtimeClasspathProvider
id="org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget"
- runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32,
org.jboss.ide.eclipse.as.runtime.40,
org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50"
+ runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32,
org.jboss.ide.eclipse.as.runtime.40,
org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.eap.43"
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ClientAllRuntimeClasspathProvider"/>
</extension>
<extension
@@ -62,13 +71,13 @@
class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$RuntimeClasspathContainerInitializer"
id="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer">
</classpathContainerInitializer>
- </extension>
-
-
-
+ </extension>
+
+
+
<!-- J2EE Libraries -->
- <extension
- point="org.eclipse.jdt.core.classpathContainerInitializer">
+ <extension
+ point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE13ClasspathContainerInitializer"
id="org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3">
@@ -102,6 +111,6 @@
id="org.jboss.ide.eclipse.as.classpath.core.DirectoryLibraryContainer">
</classpathContainerInitializer>
</extension>
- -->
+ -->
</plugin>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-01-30
11:46:18 UTC (rev 13395)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-01-30
11:53:32 UTC (rev 13396)
@@ -64,15 +64,12 @@
IPath loc = runtime.getLocation();
String config = jbsrt.getJBossConfiguration();
- String version = runtime.getRuntimeType().getVersion();
- if( "3.2".equals(version))
- return get32(loc, config);
- if( "4.0".equals(version))
- return get40(loc,config);
- if("4.2".equals(version))
- return get42(loc,config);
- if("5.0".equals(version))
- return get50(loc,config);
+ String rtID = runtime.getRuntimeType().getId();
+ if("org.jboss.ide.eclipse.as.runtime.32".equals(rtID)) return get32(loc,
config);
+ if("org.jboss.ide.eclipse.as.runtime.40".equals(rtID)) return
get40(loc,config);
+ if("org.jboss.ide.eclipse.as.runtime.42".equals(rtID)) return
get42(loc,config);
+ if("org.jboss.ide.eclipse.as.runtime.50".equals(rtID)) return
get50(loc,config);
+ if("org.jboss.ide.eclipse.as.runtime.eap.43".equals(rtID)) return
getEAP43(loc,config);
return null;
}
@@ -99,18 +96,13 @@
}
protected IClasspathEntry[] get42(IPath location, String config) {
- ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath configPath = location.append("server").append(config);
- IPath deployPath = configPath.append("deploy");
- addEntries(location.append("client"), list);
- addEntries(location.append("lib"), list);
- addEntries(configPath.append("lib"), list);
- addEntries(deployPath.append("jboss-web.deployer").append("jsf-libs"),
list);
- addEntries(deployPath.append("jboss-aop-jdk50.deployer"), list);
- addEntries(deployPath.append("ejb3.deployer"), list);
- return list.toArray(new IClasspathEntry[list.size()]);
+ return get40(location, config);
}
+ protected IClasspathEntry[] getEAP43(IPath location, String config) {
+ return get40(location, config);
+ }
+
protected IClasspathEntry[] get50(IPath location, String config) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
IPath configPath = location.append("server").append(config);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2009-01-30
11:46:18 UTC (rev 13395)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2009-01-30
11:53:32 UTC (rev 13396)
@@ -1,364 +1,365 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.extensions.descriptors;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
-import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
-import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-
-/**
- * The class representing the model for all xpath storage and searching
- * Also API entrance point.
- * @author rob.stryker(a)redhat.com
- *
- */
-public class XPathModel extends UnitedServerListener {
-
- public static final String EMPTY_STRING =
"org.jboss.ide.eclipse.as.core.model.descriptor.EmptyString";
- public static final String PORTS_CATEGORY_NAME = "Ports";
- private static final String DELIMITER = ",";
- private static final String CATEGORY_LIST =
- "org.jboss.ide.eclipse.as.core.model.descriptor.Categories";
- private static final String QUERY_LIST =
- "org.jboss.ide.eclipse.as.core.model.descriptor.QueryList";
- private static final String QUERY =
- "org.jboss.ide.eclipse.as.core.model.descriptor.Query";
- private static final String DEFAULTS_SET =
"org.jboss.ide.eclipse.as.core.model.descriptor.DefaultsSet";
-
- /* Singleton */
- private static XPathModel instance;
- public static XPathModel getDefault() {
- if( instance == null )
- instance = new XPathModel();
- return instance;
- }
-
- protected HashMap<String, ArrayList<XPathCategory>> serverToCategories;
-
- public XPathModel() {
- serverToCategories = new HashMap<String, ArrayList<XPathCategory>>();
- }
-
- public void serverAdded(IServer server) {
- final ServerAttributeHelper helper = new ServerAttributeHelper(server,
server.createWorkingCopy());
- if( !helper.getAttribute(DEFAULTS_SET, false)) {
- final IServer server2 = server;
- new Job("Add Server XPath Details") {
- protected IStatus run(IProgressMonitor monitor) {
-
- if(server2==null || server2.getRuntime()==null) {
- return Status.OK_STATUS; // server has no runtime so we can't set this up.
- }
-
- LocalJBossServerRuntime ajbsr = (LocalJBossServerRuntime)
- server2.getRuntime().loadAdapter(LocalJBossServerRuntime.class, null);
- if(ajbsr != null ) {
- IPath loc = server2.getRuntime().getLocation();
- IPath configFolder =
loc.append(IJBossServerConstants.SERVER).append(ajbsr.getJBossConfiguration());
- loadDefaults(server2, configFolder.toOSString());
- helper.setAttribute(DEFAULTS_SET, true);
- helper.save();
- save(server2);
- }
- return Status.OK_STATUS;
- }
-
- }.schedule();
- }
- }
-
- public XPathQuery getQuery(IServer server, IPath path) {
- XPathCategory cat = getCategory(server, path.segment(0));
- if( cat != null )
- return cat.getQuery(path.segment(1));
- return null;
- }
-
- protected ArrayList<XPathCategory> getCategoryCollection(IServer server) {
- if( serverToCategories.get(server.getId()) == null ) {
- ArrayList<XPathCategory> val = new
ArrayList<XPathCategory>(Arrays.asList(load(server)));
- serverToCategories.put(server.getId(), val);
- }
- return (ArrayList<XPathCategory>)serverToCategories.get(server.getId());
- }
-
- public XPathCategory[] getCategories(IServer jbs) {
- ArrayList<XPathCategory> val = getCategoryCollection(jbs);
- return (XPathCategory[]) val.toArray(new XPathCategory[val.size()]);
- }
-
- public boolean containsCategory(IServer jbs, String name) {
- return getCategory(jbs, name) == null ? false : true;
- }
-
- public XPathCategory getCategory(IServer jbs, String name) {
- ArrayList<XPathCategory> list = getCategoryCollection(jbs);
- Iterator<XPathCategory> i = list.iterator();
- XPathCategory c;
- while(i.hasNext()) {
- c = (XPathCategory)i.next();
- if( c.getName().equals(name))
- return c;
- }
- return null;
- }
-
- public XPathCategory addCategory(IServer jbs, String name) {
- if( !containsCategory(jbs, name)) {
- XPathCategory c = new XPathCategory(name, jbs);
- getCategoryCollection(jbs).add(c);
- return c;
- }
- return getCategory(jbs, name);
- }
-
- public void addCategory(IServer server, XPathCategory category) {
- if( !containsCategory(server, category.getName())) {
- getCategoryCollection(server).add(category);
- }
- }
-
- public void removeCategory(IServer server, String name) {
- ArrayList<XPathCategory> list = getCategoryCollection(server);
- Iterator<XPathCategory> i = list.iterator();
- while(i.hasNext()) {
- XPathCategory cat = (XPathCategory)i.next();
- if( cat.getName().equals(name)) {
- i.remove();
- return;
- }
- }
- }
-
- /*
- * Loading and saving is below
- */
- private XPathCategory[] load(IServer server) {
- ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
- String list = helper.getAttribute(CATEGORY_LIST, (String)null);
- if( list == null )
- return new XPathCategory[] {};
- String[] byName = list.split(DELIMITER);
- XPathCategory[] cats = new XPathCategory[byName.length];
- for( int i = 0; i < byName.length; i++ ) {
- cats[i] = new XPathCategory(byName[i], server);
- }
- return cats;
- }
-
- public void save(IServer server) {
- if( !serverToCategories.containsKey(server.getId()))
- return;
-
- ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
- XPathCategory[] categories = getCategories(server);
- String list = "";
- for( int i = 0; i < categories.length; i++ ) {
- if( i != 0 )
- list += DELIMITER;
- list += categories[i].getName();
- saveCategory(categories[i], server, helper);
- }
- helper.setAttribute(CATEGORY_LIST, list);
- helper.save();
- }
-
- public void saveCategory(XPathCategory category, IServer server, ServerAttributeHelper
helper) {
- if( category.queriesLoaded()) {
- XPathQuery[] queries = category.getQueries();
- String val = "";
- for( int i = 0; i < queries.length; i++ ) {
- if( i != 0 )
- val += DELIMITER;
- val += category.getName() + Path.SEPARATOR + queries[i].getName();
- saveQuery(queries[i], category, server, helper);
- }
- helper.setAttribute(QUERY_LIST + "." + category.getName().replace('
', '_'), val);
- }
- }
-
- private void saveQuery(XPathQuery query, XPathCategory category, IServer server,
ServerAttributeHelper helper) {
- ArrayList<String> list = new ArrayList<String>();
- list.add(query.getBaseDir());
- list.add(query.getFilePattern() == null ? EMPTY_STRING : query.getFilePattern());
- list.add(query.getXpathPattern() == null ? EMPTY_STRING : query.getXpathPattern());
- list.add(query.getAttribute() == null ? EMPTY_STRING : query.getAttribute());
- helper.setAttribute(QUERY + "." + category.getName().replace(' ',
'_') + Path.SEPARATOR + query.getName().replace(' ', '_'), list);
- }
-
- public XPathQuery[] loadQueries(XPathCategory category, IServer server) {
- ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
- String list = helper.getAttribute(QUERY_LIST + "." +
category.getName().replace(' ', '_'), (String)null);
- if( list == null )
- return new XPathQuery[] {};
- String[] queriesByName = list.split(DELIMITER);
- List<String> queryAsStringValues;
- ArrayList<XPathQuery> returnList = new ArrayList<XPathQuery>();
- for( int i = 0; i < queriesByName.length; i++ ) {
- queryAsStringValues = helper.getAttribute(QUERY + "." +
queriesByName[i].replace(' ', '_'), (List)null);
- if( queryAsStringValues != null ) {
- XPathQuery q =new
XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1),
queryAsStringValues);
- q.setCategory(category);
- returnList.add(q);
- }
- }
- return (XPathQuery[]) returnList.toArray(new XPathQuery[returnList.size()]);
- }
-
-
-
- /*
- * Loading the defaults for the server
- * returns the category created
- */
- private static HashMap<String, IPath> rtToPortsFile;
- private static final String ATTRIBUTE_SUFFIX = "_ATTRIBUTE";
- private static final String FILE_SUFFIX = "_FILE";
- static {
- rtToPortsFile = new HashMap<String, IPath>();
- rtToPortsFile.put("3.2", new
Path("properties").append("jboss.32.default.ports.properties"));
- rtToPortsFile.put("4.0", new
Path("properties").append("jboss.40.default.ports.properties"));
- rtToPortsFile.put("4.2", new
Path("properties").append("jboss.42.default.ports.properties"));
- rtToPortsFile.put("5.0", new
Path("properties").append("jboss.50.default.ports.properties"));
- }
-
- public void loadDefaults(IServer server, String configFolder) {
- ArrayList<XPathCategory> retVal = new ArrayList<XPathCategory>();
- Path p = (Path)rtToPortsFile.get(server.getRuntime().getRuntimeType().getVersion());
- if( p == null ) return;
- URL url = FileLocator.find(JBossServerCorePlugin.getDefault().getBundle(), p, null);
- if( url == null ) return;
-
- Properties pr = new Properties();
- try {
- pr.load(url.openStream());
- XPathCategory ports = new XPathCategory(PORTS_CATEGORY_NAME, server);
- Iterator i = pr.keySet().iterator();
- String name, xpath, attributeName, file;
- XPathQuery query;
- while(i.hasNext()) {
- name = (String)i.next();
- if( !name.endsWith(ATTRIBUTE_SUFFIX) && !name.endsWith(FILE_SUFFIX)) {
- xpath = pr.getProperty(name);
- attributeName = pr.getProperty(name+ATTRIBUTE_SUFFIX);
- file = pr.getProperty(name + FILE_SUFFIX);
- query = new XPathQuery(name.replace('_', ' '), configFolder, file,
xpath, attributeName);
- ports.addQuery(query);
- }
- }
- retVal.add(ports);
- } catch (IOException e) {
- JBossServerCorePlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- "Error loading default xpaths", e));
- }
-
- serverToCategories.put(server.getId(), retVal);
- }
-
-
- /*
- * Namespace map
- */
- public Properties namespaceMap = null;
- public Properties getNamespaceMap() {
- if( namespaceMap == null )
- loadNamespaceMap();
- return (Properties)namespaceMap.clone();
- }
- protected void loadNamespaceMap() {
- // TODO load from preferenes.
- //If nothing's there, load from default
- IPath p = new
Path("properties").append("namespaceMap.properties");
- if( p != null ) {
- URL url = FileLocator.find(JBossServerCorePlugin.getDefault().getBundle(), p, null);
- if( url != null ) {
- Properties pr = new Properties();
- try {
- pr.load(url.openStream());
- namespaceMap = pr;
- return;
- } catch(IOException ioe) {
- }
- }
- }
- namespaceMap = new Properties();
- }
- public void setNamespaceMap(Properties map) {
- namespaceMap = map;
- // TODO save to preferences
- }
-
- /*
- * Static utility methods
- */
-
-
- public static XPathResultNode getResultNode(Object data) {
- // if we are the node to change, change me
- if( data instanceof XPathResultNode ) {
- return (XPathResultNode)data;
- }
-
- // if we're a node which represents a file, but only have one matched node, thats
the node.
- if( data instanceof XPathFileResult &&
((XPathFileResult)data).getChildren().length == 1 ) {
- return (XPathResultNode) (((XPathFileResult)data).getChildren()[0]);
- }
-
- // if we're a top level tree item (JNDI), with one file child and one mbean
grandchild, the grandchild is the node
- if( data instanceof XPathQuery && ((XPathQuery)data).getResults().length == 1 )
{
- XPathFileResult item = ((XPathFileResult) ((XPathQuery)data).getResults()[0]);
- if( item.getChildren().length == 1 )
- return (XPathResultNode)item.getChildren()[0];
- }
- return null;
- }
-
- public static XPathResultNode[] getResultNodes(XPathQuery query) {
- ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
- XPathFileResult[] files = query.getResults();
- for( int i = 0; i < files.length; i++ ) {
- l.addAll(Arrays.asList(files[i].getChildren()));
- }
- return l.toArray(new XPathResultNode[l.size()]);
- }
-}
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.core.extensions.descriptors;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import
org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
+import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+
+/**
+ * The class representing the model for all xpath storage and searching
+ * Also API entrance point.
+ * @author rob.stryker(a)redhat.com
+ *
+ */
+public class XPathModel extends UnitedServerListener {
+
+ public static final String EMPTY_STRING =
"org.jboss.ide.eclipse.as.core.model.descriptor.EmptyString";
+ public static final String PORTS_CATEGORY_NAME = "Ports";
+ private static final String DELIMITER = ",";
+ private static final String CATEGORY_LIST =
+ "org.jboss.ide.eclipse.as.core.model.descriptor.Categories";
+ private static final String QUERY_LIST =
+ "org.jboss.ide.eclipse.as.core.model.descriptor.QueryList";
+ private static final String QUERY =
+ "org.jboss.ide.eclipse.as.core.model.descriptor.Query";
+ private static final String DEFAULTS_SET =
"org.jboss.ide.eclipse.as.core.model.descriptor.DefaultsSet";
+
+ /* Singleton */
+ private static XPathModel instance;
+ public static XPathModel getDefault() {
+ if( instance == null )
+ instance = new XPathModel();
+ return instance;
+ }
+
+ protected HashMap<String, ArrayList<XPathCategory>> serverToCategories;
+
+ public XPathModel() {
+ serverToCategories = new HashMap<String, ArrayList<XPathCategory>>();
+ }
+
+ public void serverAdded(IServer server) {
+ final ServerAttributeHelper helper = new ServerAttributeHelper(server,
server.createWorkingCopy());
+ if( !helper.getAttribute(DEFAULTS_SET, false)) {
+ final IServer server2 = server;
+ new Job("Add Server XPath Details") {
+ protected IStatus run(IProgressMonitor monitor) {
+
+ if(server2==null || server2.getRuntime()==null) {
+ return Status.OK_STATUS; // server has no runtime so we can't set this up.
+ }
+
+ LocalJBossServerRuntime ajbsr = (LocalJBossServerRuntime)
+ server2.getRuntime().loadAdapter(LocalJBossServerRuntime.class, null);
+ if(ajbsr != null ) {
+ IPath loc = server2.getRuntime().getLocation();
+ IPath configFolder =
loc.append(IJBossServerConstants.SERVER).append(ajbsr.getJBossConfiguration());
+ loadDefaults(server2, configFolder.toOSString());
+ helper.setAttribute(DEFAULTS_SET, true);
+ helper.save();
+ save(server2);
+ }
+ return Status.OK_STATUS;
+ }
+
+ }.schedule();
+ }
+ }
+
+ public XPathQuery getQuery(IServer server, IPath path) {
+ XPathCategory cat = getCategory(server, path.segment(0));
+ if( cat != null )
+ return cat.getQuery(path.segment(1));
+ return null;
+ }
+
+ protected ArrayList<XPathCategory> getCategoryCollection(IServer server) {
+ if( serverToCategories.get(server.getId()) == null ) {
+ ArrayList<XPathCategory> val = new
ArrayList<XPathCategory>(Arrays.asList(load(server)));
+ serverToCategories.put(server.getId(), val);
+ }
+ return (ArrayList<XPathCategory>)serverToCategories.get(server.getId());
+ }
+
+ public XPathCategory[] getCategories(IServer jbs) {
+ ArrayList<XPathCategory> val = getCategoryCollection(jbs);
+ return (XPathCategory[]) val.toArray(new XPathCategory[val.size()]);
+ }
+
+ public boolean containsCategory(IServer jbs, String name) {
+ return getCategory(jbs, name) == null ? false : true;
+ }
+
+ public XPathCategory getCategory(IServer jbs, String name) {
+ ArrayList<XPathCategory> list = getCategoryCollection(jbs);
+ Iterator<XPathCategory> i = list.iterator();
+ XPathCategory c;
+ while(i.hasNext()) {
+ c = (XPathCategory)i.next();
+ if( c.getName().equals(name))
+ return c;
+ }
+ return null;
+ }
+
+ public XPathCategory addCategory(IServer jbs, String name) {
+ if( !containsCategory(jbs, name)) {
+ XPathCategory c = new XPathCategory(name, jbs);
+ getCategoryCollection(jbs).add(c);
+ return c;
+ }
+ return getCategory(jbs, name);
+ }
+
+ public void addCategory(IServer server, XPathCategory category) {
+ if( !containsCategory(server, category.getName())) {
+ getCategoryCollection(server).add(category);
+ }
+ }
+
+ public void removeCategory(IServer server, String name) {
+ ArrayList<XPathCategory> list = getCategoryCollection(server);
+ Iterator<XPathCategory> i = list.iterator();
+ while(i.hasNext()) {
+ XPathCategory cat = (XPathCategory)i.next();
+ if( cat.getName().equals(name)) {
+ i.remove();
+ return;
+ }
+ }
+ }
+
+ /*
+ * Loading and saving is below
+ */
+ private XPathCategory[] load(IServer server) {
+ ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
+ String list = helper.getAttribute(CATEGORY_LIST, (String)null);
+ if( list == null )
+ return new XPathCategory[] {};
+ String[] byName = list.split(DELIMITER);
+ XPathCategory[] cats = new XPathCategory[byName.length];
+ for( int i = 0; i < byName.length; i++ ) {
+ cats[i] = new XPathCategory(byName[i], server);
+ }
+ return cats;
+ }
+
+ public void save(IServer server) {
+ if( !serverToCategories.containsKey(server.getId()))
+ return;
+
+ ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
+ XPathCategory[] categories = getCategories(server);
+ String list = "";
+ for( int i = 0; i < categories.length; i++ ) {
+ if( i != 0 )
+ list += DELIMITER;
+ list += categories[i].getName();
+ saveCategory(categories[i], server, helper);
+ }
+ helper.setAttribute(CATEGORY_LIST, list);
+ helper.save();
+ }
+
+ public void saveCategory(XPathCategory category, IServer server, ServerAttributeHelper
helper) {
+ if( category.queriesLoaded()) {
+ XPathQuery[] queries = category.getQueries();
+ String val = "";
+ for( int i = 0; i < queries.length; i++ ) {
+ if( i != 0 )
+ val += DELIMITER;
+ val += category.getName() + Path.SEPARATOR + queries[i].getName();
+ saveQuery(queries[i], category, server, helper);
+ }
+ helper.setAttribute(QUERY_LIST + "." + category.getName().replace('
', '_'), val);
+ }
+ }
+
+ private void saveQuery(XPathQuery query, XPathCategory category, IServer server,
ServerAttributeHelper helper) {
+ ArrayList<String> list = new ArrayList<String>();
+ list.add(query.getBaseDir());
+ list.add(query.getFilePattern() == null ? EMPTY_STRING : query.getFilePattern());
+ list.add(query.getXpathPattern() == null ? EMPTY_STRING : query.getXpathPattern());
+ list.add(query.getAttribute() == null ? EMPTY_STRING : query.getAttribute());
+ helper.setAttribute(QUERY + "." + category.getName().replace(' ',
'_') + Path.SEPARATOR + query.getName().replace(' ', '_'), list);
+ }
+
+ public XPathQuery[] loadQueries(XPathCategory category, IServer server) {
+ ServerAttributeHelper helper = ServerAttributeHelper.createHelper(server);
+ String list = helper.getAttribute(QUERY_LIST + "." +
category.getName().replace(' ', '_'), (String)null);
+ if( list == null )
+ return new XPathQuery[] {};
+ String[] queriesByName = list.split(DELIMITER);
+ List<String> queryAsStringValues;
+ ArrayList<XPathQuery> returnList = new ArrayList<XPathQuery>();
+ for( int i = 0; i < queriesByName.length; i++ ) {
+ queryAsStringValues = helper.getAttribute(QUERY + "." +
queriesByName[i].replace(' ', '_'), (List)null);
+ if( queryAsStringValues != null ) {
+ XPathQuery q =new
XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1),
queryAsStringValues);
+ q.setCategory(category);
+ returnList.add(q);
+ }
+ }
+ return (XPathQuery[]) returnList.toArray(new XPathQuery[returnList.size()]);
+ }
+
+
+
+ /*
+ * Loading the defaults for the server
+ * returns the category created
+ */
+ private static HashMap<String, IPath> rtToPortsFile;
+ private static final String ATTRIBUTE_SUFFIX = "_ATTRIBUTE";
+ private static final String FILE_SUFFIX = "_FILE";
+ static {
+ rtToPortsFile = new HashMap<String, IPath>();
+ rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.32", new
Path("properties").append("jboss.32.default.ports.properties"));
+ rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.40", new
Path("properties").append("jboss.40.default.ports.properties"));
+ rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.42", new
Path("properties").append("jboss.42.default.ports.properties"));
+ rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.50", new
Path("properties").append("jboss.50.default.ports.properties"));
+ rtToPortsFile.put("org.jboss.ide.eclipse.as.runtime.eap.43", new
Path("properties").append("jboss.eap.43.default.ports.properties"));
+ }
+
+ public void loadDefaults(IServer server, String configFolder) {
+ ArrayList<XPathCategory> retVal = new ArrayList<XPathCategory>();
+ Path p = (Path)rtToPortsFile.get(server.getRuntime().getRuntimeType().getId());
+ if( p == null ) return;
+ URL url = FileLocator.find(JBossServerCorePlugin.getDefault().getBundle(), p, null);
+ if( url == null ) return;
+
+ Properties pr = new Properties();
+ try {
+ pr.load(url.openStream());
+ XPathCategory ports = new XPathCategory(PORTS_CATEGORY_NAME, server);
+ Iterator i = pr.keySet().iterator();
+ String name, xpath, attributeName, file;
+ XPathQuery query;
+ while(i.hasNext()) {
+ name = (String)i.next();
+ if( !name.endsWith(ATTRIBUTE_SUFFIX) && !name.endsWith(FILE_SUFFIX)) {
+ xpath = pr.getProperty(name);
+ attributeName = pr.getProperty(name+ATTRIBUTE_SUFFIX);
+ file = pr.getProperty(name + FILE_SUFFIX);
+ query = new XPathQuery(name.replace('_', ' '), configFolder, file,
xpath, attributeName);
+ ports.addQuery(query);
+ }
+ }
+ retVal.add(ports);
+ } catch (IOException e) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Error loading default xpaths", e));
+ }
+
+ serverToCategories.put(server.getId(), retVal);
+ }
+
+
+ /*
+ * Namespace map
+ */
+ public Properties namespaceMap = null;
+ public Properties getNamespaceMap() {
+ if( namespaceMap == null )
+ loadNamespaceMap();
+ return (Properties)namespaceMap.clone();
+ }
+ protected void loadNamespaceMap() {
+ // TODO load from preferenes.
+ //If nothing's there, load from default
+ IPath p = new
Path("properties").append("namespaceMap.properties");
+ if( p != null ) {
+ URL url = FileLocator.find(JBossServerCorePlugin.getDefault().getBundle(), p, null);
+ if( url != null ) {
+ Properties pr = new Properties();
+ try {
+ pr.load(url.openStream());
+ namespaceMap = pr;
+ return;
+ } catch(IOException ioe) {
+ }
+ }
+ }
+ namespaceMap = new Properties();
+ }
+ public void setNamespaceMap(Properties map) {
+ namespaceMap = map;
+ // TODO save to preferences
+ }
+
+ /*
+ * Static utility methods
+ */
+
+
+ public static XPathResultNode getResultNode(Object data) {
+ // if we are the node to change, change me
+ if( data instanceof XPathResultNode ) {
+ return (XPathResultNode)data;
+ }
+
+ // if we're a node which represents a file, but only have one matched node, thats
the node.
+ if( data instanceof XPathFileResult &&
((XPathFileResult)data).getChildren().length == 1 ) {
+ return (XPathResultNode) (((XPathFileResult)data).getChildren()[0]);
+ }
+
+ // if we're a top level tree item (JNDI), with one file child and one mbean
grandchild, the grandchild is the node
+ if( data instanceof XPathQuery && ((XPathQuery)data).getResults().length == 1 )
{
+ XPathFileResult item = ((XPathFileResult) ((XPathQuery)data).getResults()[0]);
+ if( item.getChildren().length == 1 )
+ return (XPathResultNode)item.getChildren()[0];
+ }
+ return null;
+ }
+
+ public static XPathResultNode[] getResultNodes(XPathQuery query) {
+ ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
+ XPathFileResult[] files = query.getResults();
+ for( int i = 0; i < files.length; i++ ) {
+ l.addAll(Arrays.asList(files[i].getChildren()));
+ }
+ return l.toArray(new XPathResultNode[l.size()]);
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2009-01-30
11:46:18 UTC (rev 13395)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2009-01-30
11:53:32 UTC (rev 13396)
@@ -78,7 +78,7 @@
public static File getServerLogFile(IServer server) {
File f = server == null ? PLUGIN_LOCATION.toFile() :
- PLUGIN_LOCATION.append(server.getId()).append(LOG).toFile();
+ PLUGIN_LOCATION.append(server.getId().replace(' ',
'_')).append(LOG).toFile();
if( !f.getParentFile().exists() )
f.getParentFile().mkdirs();
return f;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-01-30
11:46:18 UTC (rev 13395)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-01-30
11:53:32 UTC (rev 13396)
@@ -37,18 +37,26 @@
// create metadata area
File location =
IJBossServerConstants.PLUGIN_LOCATION.append(server.getId().replace(' ',
'_')).toFile();
location.mkdirs();
- new File(location, IJBossServerConstants.DEPLOY).mkdir();
- new File(location, IJBossServerConstants.TEMP_DEPLOY).mkdir();
// create temp deploy folder
- IRuntime rt = server.getRuntime();
- IJBossServerRuntime jbsrt =
(IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
- String config = jbsrt.getJBossConfiguration();
- String newTemp = new Path(IJBossServerConstants.SERVER).append(config)
- .append(IJBossServerConstants.TMP)
- .append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative().toString();
- new File(newTemp).mkdirs();
-
+ IDeployableServer ds = (IDeployableServer)server.loadAdapter(IDeployableServer.class,
null);
+ if( ds != null ) {
+ File d1 = new File(location, IJBossServerConstants.DEPLOY);
+ File d2 = new File(location, IJBossServerConstants.TEMP_DEPLOY);
+ d1.mkdirs();
+ d2.mkdirs();
+ if( !new File(ds.getDeployFolder()).equals(d1))
+ new File(ds.getDeployFolder()).mkdirs();
+ if( !new File(ds.getTempDeployFolder()).equals(d2))
+ new File(ds.getTempDeployFolder()).mkdirs();
+ IRuntime rt = server.getRuntime();
+ IJBossServerRuntime jbsrt =
(IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
+ String config = jbsrt.getJBossConfiguration();
+ String newTemp = new Path(IJBossServerConstants.SERVER).append(config)
+ .append(IJBossServerConstants.TMP)
+ .append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative().toString();
+ new File(newTemp).mkdirs();
+ }
}
public void serverRemoved(IServer server) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2009-01-30 11:46:18
UTC (rev 13395)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2009-01-30 11:53:32
UTC (rev 13396)
@@ -1,23 +1,32 @@
pluginName=JBoss WTP Server Tools Core Plugin
-providerName=JBoss, a division of Red Hat
+providerName=JBoss.org
+enterpriseProviderName=JBoss, a division of Red Hat
# Version Delegates
jboss.version.32.name=JBoss AS 3.2
-jboss.version.32.version=JBoss 3.2
jboss.version.32.description=JBoss Application Server 3.2
+jboss.version.32.runtime.name=JBoss 3.2 Runtime
jboss.version.40.name=JBoss AS 4.0
-jboss.version.40.version=JBoss 4.0
jboss.version.40.description=JBoss Application Server 4.0
+jboss.version.40.runtime.name=JBoss 4.0 Runtime
jboss.version.42.name=JBoss AS 4.2
-jboss.version.42.version=JBoss 4.2
jboss.version.42.description=JBoss Application Server 4.2
+jboss.version.42.runtime.name=JBoss 4.2 Runtime
jboss.version.50.name=JBoss AS 5.0
-jboss.version.50.version=JBoss 5.0
jboss.version.50.description=JBoss Application Server 5.0
+jboss.version.50.runtime.name=JBoss 5.0 Runtime
+jboss.eap.version.43.name=JBoss EAP 4.3
+jboss.eap.version.43.description=JBoss EAP Server 4.3
+jboss.eap.version.43.runtime.name=JBoss EAP 4.3 Runtime
+
+deploy.runtime.name=JBoss Deploy-Only Runtime
+deploy.runtime.description=A runtime provided to allow a deploy-only server the ability
to deploy certain project types.
+
+
# service names
jboss.ejb.deployer=JBoss Enterprise JavaBeans (EJB-JAR) Deployer
jboss.war.deployer=JBoss Web Application (WAR) Deployer
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-01-30 11:46:18 UTC (rev
13395)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-01-30 11:53:32 UTC (rev
13396)
@@ -76,7 +76,24 @@
stopTimeout="450000"
supportsRemoteHosts="false"/>
+ <serverType
+
behaviourClass="org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior"
+ class="org.jboss.ide.eclipse.as.core.server.internal.JBossServer"
+ description="%jboss.eap.version.43.description"
+ hasConfiguration="false"
+ id="org.jboss.ide.eclipse.as.eap.43"
+ initialState="stopped"
+
launchConfigId="org.jboss.ide.eclipse.as.core.server.startupConfiguration"
+ launchModes="run,debug,profile"
+ name="%jboss.eap.version.43.name"
+ runtime="true"
+ runtimeTypeId="org.jboss.ide.eclipse.as.runtime.eap.43"
+ startBeforePublish="false"
+ startTimeout="450000"
+ stopTimeout="450000"
+ supportsRemoteHosts="false"/>
+
<serverType
behaviourClass="org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior"
class="org.jboss.ide.eclipse.as.core.server.internal.DeployableServer"
@@ -102,7 +119,7 @@
vendor="%providerName"
class="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime"
description="%jboss.version.32.description"
- name="JBoss 3.2 Runtime"
+ name="%jboss.version.32.runtime.name"
id="org.jboss.ide.eclipse.as.runtime.32"
version="3.2">
<moduleType
@@ -125,7 +142,7 @@
vendor="%providerName"
class="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime"
description="%jboss.version.40.description"
- name="JBoss 4.0 Runtime"
+ name="%jboss.version.40.runtime.name"
id="org.jboss.ide.eclipse.as.runtime.40"
version="4.0">
<moduleType
@@ -158,7 +175,7 @@
vendor="%providerName"
class="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime"
description="%jboss.version.42.description"
- name="JBoss 4.2 Runtime"
+ name="%jboss.version.42.runtime.name"
id="org.jboss.ide.eclipse.as.runtime.42"
version="4.2">
<moduleType
@@ -191,7 +208,7 @@
vendor="%providerName"
class="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime"
description="%jboss.version.50.description"
- name="JBoss 5.0 Runtime"
+ name="%jboss.version.50.runtime.name"
id="org.jboss.ide.eclipse.as.runtime.50"
version="5.0">
<moduleType
@@ -221,13 +238,47 @@
</moduleType>
</runtimeType>
+ <runtimeType
+ vendor="%enterpriseProviderName"
+
class="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime"
+ description="%jboss.eap.version.43.description"
+ name="%jboss.eap.version.43.runtime.name"
+ id="org.jboss.ide.eclipse.as.runtime.eap.43"
+ version="4.3">
+ <moduleType
+ types="jst.web"
+ versions="2.2, 2.3, 2.4, 2.5"/>
+ <moduleType
+ types="jst.ejb"
+ versions="1.0, 1.1, 2.0, 2.1, 3.0"/>
+ <moduleType
+ types="jst.ear"
+ versions="1.2, 1.3, 1.4, 5.0"/>
+ <moduleType
+ types="jst.connector"
+ versions="1.0, 1.5"/>
+ <moduleType
+ types="jst.utility"
+ versions="1.0"/>
+ <moduleType
+ types="jboss.package"
+ versions="1.0"/>
+ <moduleType
+ types="jboss.singlefile"
+ versions="1.0"/>
+ <moduleType
+ types="jst.jboss.esb"
+ versions="4.2,4.3,4.4,5.0">
+ </moduleType>
+ </runtimeType>
+
<runtimeType
class="org.jboss.ide.eclipse.as.core.server.internal.DeployableServerRuntime"
- description="A runtime provided to allow a deploy-only server the
ability to deploy certain project types."
+ description="%deploy.runtime.description"
id="org.jboss.ide.eclipse.as.runtime.stripped"
- name="JBoss Deploy-Only Runtime"
+ name="%deploy.runtime.name"
vendor="%providerName"
version="1.0">
<moduleType
@@ -389,6 +440,12 @@
runtimeTypeId="org.jboss.ide.eclipse.as.runtime.stripped"
runtime-component="org.jboss.ide.eclipse.as.runtime.stripped.component"
version="1.0"/>
+
+
+ <runtimeFacetMapping
+ runtimeTypeId="org.jboss.ide.eclipse.as.runtime.eap.43"
+ runtime-component="org.jboss.ide.eclipse.eap.runtime.component"
+ version="4.3"/>
</extension>
@@ -412,9 +469,29 @@
</supported>
</extension>
-
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <runtime-component-type
id="org.jboss.ide.eclipse.eap.runtime.component"/>
+ <runtime-component-version
+ type="org.jboss.ide.eclipse.eap.runtime.component"
+ version="4.3"/>
+
+ <supported>
+ <runtime-component
+ id="org.jboss.ide.eclipse.eap.runtime.component"
+ version="4.3"/>
+ <facet id="jst.web" version="2.2,2.3,2.4,2.5"/>
+ <facet id="jst.java" version="1.3,1.4,5.0,6.0"/>
+ <facet id="jst.utility" version="1.0"/>
+ <facet id="jst.connector" version="1.0,1.5"/>
+ <facet id="jst.ejb" version="2.0,2.1,3.0"/>
+ <facet id="jst.ear" version="1.2,1.3,1.4,5.0"/>
+ <facet id="jst.appclient"
version="1.2,1.3,1.4,5.0"/>
+ </supported>
+ </extension>
+
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
<runtime-component-type
id="org.jboss.ide.eclipse.as.runtime.component"/>
<runtime-component-version
type="org.jboss.ide.eclipse.as.runtime.component"
@@ -430,8 +507,6 @@
version="5.0"/>
-
-
<supported>
<runtime-component
id="org.jboss.ide.eclipse.as.runtime.component"
@@ -483,6 +558,7 @@
<facet id="jst.ear" version="1.2,1.3,1.4,5.0"/>
<facet id="jst.appclient" version="1.2,1.3,1.4,5.0"/>
</supported>
+
</extension>
@@ -517,6 +593,16 @@
version="5.0">
</facet>
</default-facets>
+ <default-facets>
+ <runtime-component
+ id="org.jboss.ide.eclipse.eap.runtime.component"
+ version="4.3">
+ </runtime-component>
+ <facet
+ id="jst.java"
+ version="5.0">
+ </facet>
+ </default-facets>
</extension>
<extension
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.eap.43.default.ports.properties
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.eap.43.default.ports.properties
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.eap.43.default.ports.properties 2009-01-30
11:53:32 UTC (rev 13396)
@@ -0,0 +1,20 @@
+# As much as possible, try to create file patterns that match
+# as few files as possible. Each matching file *WILL* be scanned
+# and cached, regardless of if there's a match.
+
+JNDI=//server/mbean[@name='jboss:service=Naming']/attribute[@name='Port']
+JNDI_FILE=**/jboss-service.xml
+JBoss_Web=//Server/Service[@name='jboss.web']/Connector[count((a)sslProtocol) = 0
and (count(@protocol) = 0 or @protocol = 'HTTP/1.1')]
+JBoss_Web_ATTRIBUTE=port
+JBoss_Web_FILE=**/*server.xml
+JNDI_RMI=//server/mbean[@name='jboss:service=Naming']/attribute[@name='RmiPort']
+JNDI_RMI_FILE=**/jboss-service.xml
+Web_Services=//server/mbean[@name='jboss:service=WebService']/attribute[@name='Port']
+JRMP_Invoker=//server/mbean[@name='jboss:service=invoker,type=jrmp']/attribute[@name='RMIObjectPort']
+Pooled_Invoker=//server/mbean[@name='jboss:service=invoker,type=pooled']/attribute[@name='ServerBindPort']
+#HA_JNDI_STUB=//server/mbean[@name='jboss:service=HAJNDI']/attribute[@name='Port']
+#HA_JNDI_RMI=//server/mbean[@name='jboss:service=HAJNDI']/attribute[@name='RmiPort']
+#JRMPA_RMI_OBJECT=//server/mbean[@name='jboss:service=invoker,type=jrmpha']/attribute[@name='RMIObjectPort']
+#CLUSTER_UDP_MCAST=//server/mbean[@name='jboss:service=${jboss.partition.name:DefaultPartition}']/attribute[@name='PartitionConfig']/Config/UDP
+#CLUSTER_UDP_MCAST_ATTRIBUTE=mcast_port
+#Hypersonic=//server/mbean[@name='jboss:service=Hypersonic']/attribute[@name='Port']
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-01-30
11:46:18 UTC (rev 13395)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-01-30
11:53:32 UTC (rev 13396)
@@ -121,7 +121,7 @@
IRuntime rt = (IRuntime) getTaskModel().getObject(
TaskModel.TASK_RUNTIME);
String id = rt.getRuntimeType().getId();
- String imageKey = "";
+ String imageKey = JBossServerUISharedImages.WIZBAN_JBOSS42_LOGO;
if (id.equals("org.jboss.ide.eclipse.as.runtime.32"))
imageKey = JBossServerUISharedImages.WIZBAN_JBOSS32_LOGO;
else if (id.equals("org.jboss.ide.eclipse.as.runtime.40"))
@@ -446,9 +446,6 @@
protected boolean isHomeValid() {
if( homeDir == null || !(new File(homeDir).exists())) return false;
String version = new ServerBeanLoader().getFullServerVersion(new File(homeDir,
JBossServerType.AS.getSystemJarPath()));
- if (version.startsWith("4.3.0")) {
- version="4.2";
- }
IRuntime rt = (IRuntime) getTaskModel().getObject(
TaskModel.TASK_RUNTIME);
String v = rt.getRuntimeType().getVersion();
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-01-30
11:46:18 UTC (rev 13395)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-01-30
11:53:32 UTC (rev 13396)
@@ -21,12 +21,9 @@
package org.jboss.ide.eclipse.as.ui.wizards;
-import java.io.File;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
@@ -49,7 +46,6 @@
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
@@ -98,6 +94,7 @@
else if( id.equals("org.jboss.ide.eclipse.as.runtime.40")) imageKey =
JBossServerUISharedImages.WIZBAN_JBOSS40_LOGO;
else if( id.equals("org.jboss.ide.eclipse.as.runtime.42")) imageKey =
JBossServerUISharedImages.WIZBAN_JBOSS42_LOGO;
else if( id.equals("org.jboss.ide.eclipse.as.runtime.50")) imageKey =
JBossServerUISharedImages.WIZBAN_JBOSS50_LOGO;
+ else if( id.equals("org.jboss.ide.eclipse.as.runtime.eap.43")) imageKey =
JBossServerUISharedImages.WIZBAN_JBOSS42_LOGO; // TODO until we have a proper image
return JBossServerUISharedImages.getImageDescriptor(imageKey);
}
@@ -250,32 +247,16 @@
public void performFinish(IProgressMonitor monitor) throws CoreException {
IServerWorkingCopy serverWC = (IServerWorkingCopy)
getTaskModel().getObject(TaskModel.TASK_SERVER);
- handleDefaults(serverWC);
+ name = name == null ? getDefaultNameText() : name;
+ JBossServer jbs = (JBossServer)serverWC.loadAdapter(JBossServer.class, new
NullProgressMonitor());
+ jbs.setUsername("admin");
+ jbs.setPassword("admin");
+ jbs.setDeployLocationType(isAS5() ? IDeployableServer.DEPLOY_SERVER :
IDeployableServer.DEPLOY_METADATA);
serverWC.setRuntime((IRuntime)getTaskModel().getObject(TaskModel.TASK_RUNTIME));
serverWC.setName(name);
serverWC.setServerConfiguration(null); // no inside jboss folder
}
- protected void handleDefaults(IServerWorkingCopy wc) {
- name = name == null ? getDefaultNameText() : name;
- String deployVal = IJBossServerConstants.PLUGIN_LOCATION.append(name).
- append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
- String deployTmpFolderVal = IJBossServerConstants.PLUGIN_LOCATION.append(name).
- append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
-
- JBossServer jbs = (JBossServer)wc.loadAdapter(JBossServer.class, new
NullProgressMonitor());
- jbs.setUsername("admin");
- jbs.setPassword("admin");
-
- boolean as5 = isAS5();
- String as5TmpDeployFolderVal = new
Path(IJBossServerConstants.SERVER).append(getRuntime().getJBossConfiguration()).append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative().toString();
- jbs.setDeployLocationType(as5 ? IDeployableServer.DEPLOY_SERVER :
IDeployableServer.DEPLOY_METADATA);
- jbs.setDeployFolder(deployVal);
- jbs.setTempDeployFolder(as5 ? as5TmpDeployFolderVal : deployTmpFolderVal);
- new File(deployVal).mkdirs();
- new File(deployTmpFolderVal).mkdirs();
- }
-
private IJBossServerRuntime getRuntime() {
IRuntime r = (IRuntime) getTaskModel()
.getObject(TaskModel.TASK_RUNTIME);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2009-01-30 11:46:18 UTC (rev
13395)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2009-01-30 11:53:32 UTC (rev
13396)
@@ -9,10 +9,16 @@
point="org.eclipse.wst.server.ui.serverImages">
<image
icon="icons/jboss.gif"
- typeIds="org.jboss.ide.eclipse.as.32"
+
typeIds="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.eap.43"
id="org.jboss.ide.eclipse.as.ui.jbossIcon"/>
<image
icon="icons/jboss.gif"
+
typeIds="org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.eap.43"
+ id="org.jboss.ide.eclipse.as.ui.jbossIcon"/>
+
+<!--
+ <image
+ icon="icons/jboss.gif"
typeIds="org.jboss.ide.eclipse.as.40"
id="org.jboss.ide.eclipse.as.ui.jbossIcon"/>
<image
@@ -41,6 +47,12 @@
id="org.jboss.ide.eclipse.as.ui.jbossIcon"/>
<image
icon="icons/jboss.gif"
+ typeIds="org.jboss.ide.eclipse.as.runtime.eap.43"
+ id="org.jboss.ide.eclipse.as.ui.jbossIcon"/>
+-->
+
+ <image
+ icon="icons/jboss.gif"
typeIds="org.jboss.ide.eclipse.as.systemCopyServer"
id="org.jboss.ide.eclipse.as.ui.jbossIcon"/>
<image
@@ -53,12 +65,12 @@
point="org.eclipse.wst.server.ui.wizardFragments">
<fragment
class="org.jboss.ide.eclipse.as.ui.wizards.JBossRuntimeWizardFragment"
-
typeIds="org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50"
+
typeIds="org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.eap.43"
id="org.jboss.ide.eclipse.as.ui.jboss32RuntimeWizardFragmentragment"/>
<fragment
class="org.jboss.ide.eclipse.as.ui.wizards.JBossServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.jbossServerWizardFragment"
-
typeIds="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50"/>
+
typeIds="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.eap.43"/>
<fragment
class="org.jboss.ide.eclipse.as.ui.wizards.StrippedServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.strippedServerWizardFragment"
@@ -100,7 +112,15 @@
<factory
class="org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Factory"/>
<type
class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider"/>
</adapter>
- </extension>
+ </extension>
+
+ <extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <adapter>
+ <runtime-component
id="org.jboss.ide.eclipse.eap.runtime.component"/>
+ <factory
class="org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Factory"/>
+ <type
class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider"/>
+ </adapter>
+ </extension>
<extension
@@ -152,25 +172,25 @@
id="org.jboss.ide.eclipse.as.ui.editor.deployServer.deployDir"
insertionId="org.eclipse.wst.server.editor.overview.left"
order="10"
- typeIds="org.jboss.ide.eclipse.as.systemCopyServer,
org.jboss.ide.eclipse.as.32, org.jboss.ide.eclipse.as.40, org.jboss.ide.eclipse.as.42,
org.jboss.ide.eclipse.as.50"/>
+ typeIds="org.jboss.ide.eclipse.as.systemCopyServer,
org.jboss.ide.eclipse.as.32, org.jboss.ide.eclipse.as.40, org.jboss.ide.eclipse.as.42,
org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.eap.43"/>
<section
class="org.jboss.ide.eclipse.as.ui.editor.PollerSection"
id="org.jboss.ide.eclipse.as.ui.editor.pollerSection"
insertionId="org.eclipse.wst.server.editor.overview.right"
order="10"
- typeIds="org.jboss.ide.eclipse.as.32, org.jboss.ide.eclipse.as.40,
org.jboss.ide.eclipse.as.42, org.jboss.ide.eclipse.as.50"/>
+ typeIds="org.jboss.ide.eclipse.as.32, org.jboss.ide.eclipse.as.40,
org.jboss.ide.eclipse.as.42,
org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.eap.43"/>
<section
class="org.jboss.ide.eclipse.as.ui.editor.PortSection"
id="org.jboss.ide.eclipse.as.ui.editor.portSection"
insertionId="org.eclipse.wst.server.editor.overview.right"
order="11"
- typeIds="org.jboss.ide.eclipse.as.32, org.jboss.ide.eclipse.as.40,
org.jboss.ide.eclipse.as.42, org.jboss.ide.eclipse.as.50"/>
+ typeIds="org.jboss.ide.eclipse.as.32, org.jboss.ide.eclipse.as.40,
org.jboss.ide.eclipse.as.42,
org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.eap.43"/>
<section
class="org.jboss.ide.eclipse.as.ui.editor.ServerPasswordSection"
id="org.jboss.ide.eclipse.as.ui.editor.passwordSection"
insertionId="org.eclipse.wst.server.editor.overview.left"
order="10"
-
typeIds="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50"/>
+
typeIds="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.eap.43"/>
</extension>