Author: rob.stryker(a)jboss.com
Date: 2012-02-03 02:53:55 -0500 (Fri, 03 Feb 2012)
New Revision: 38408
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
Log:
https://issues.jboss.org/browse/JBIDE-10514 wooooot! simple easy
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2012-02-03
07:03:34 UTC (rev 38407)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2012-02-03
07:53:55 UTC (rev 38408)
@@ -218,7 +218,10 @@
}
public static URL getModuleRootURL(IModule module, String host, int port) {
-
+ return getModuleRootURL(module, host, port, false);
+ }
+
+ public static URL getModuleRootURL(IModule module, String host, int port, boolean
ignoreContextRoot) {
if (module == null || module.loadAdapter(IWebModule.class,null)==null )
return null;
@@ -230,10 +233,11 @@
if (port != 80)
url += ":" + port; //$NON-NLS-1$
- String cxRoot = webModule.getContextRoot();
- if( !cxRoot.equals("/") && !cxRoot.equals("./"))
//$NON-NLS-1$ //$NON-NLS-2$
- url += "/"+webModule.getContextRoot(); //$NON-NLS-1$
-
+ if( !ignoreContextRoot ) {
+ String cxRoot = webModule.getContextRoot();
+ if( !cxRoot.equals("/") && !cxRoot.equals("./"))
//$NON-NLS-1$ //$NON-NLS-2$
+ url += "/"+webModule.getContextRoot(); //$NON-NLS-1$
+ }
if (!url.endsWith("/")) //$NON-NLS-1$
url += "/"; //$NON-NLS-1$
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-02-03
07:03:34 UTC (rev 38407)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-02-03
07:53:55 UTC (rev 38408)
@@ -77,6 +77,7 @@
@Override
public URL getModuleRootURL(IModule module) {
- return JBossServer.getModuleRootURL(module, getServer().getHost(), 80);
+ boolean shouldIgnore = ExpressServerUtils.getIgnoresContextRoot(getServer());
+ return JBossServer.getModuleRootURL(module, getServer().getHost(), 80, shouldIgnore);
}
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-03
07:03:34 UTC (rev 38407)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-03
07:53:55 UTC (rev 38408)
@@ -53,6 +53,8 @@
public static final String ATTRIBUTE_REMOTE_NAME =
"org.jboss.tools.openshift.express.internal.core.behaviour.RemoteName";
public static final String ATTRIBUTE_REMOTE_NAME_DEFAULT = "origin";
+ public static final String PREFERENCE_IGNORE_CONTEXT_ROOT =
"org.jboss.tools.openshift.express.internal.core.behaviour.IgnoreContextRoot";
+
/** the OpensHift Server Type as defined in the plugin.xml.*/
public static final String OPENSHIFT_SERVER_TYPE =
"org.jboss.tools.openshift.express.openshift.server.type";
@@ -144,6 +146,17 @@
}
+ public static boolean getIgnoresContextRoot(IServerAttributes server) {
+ return server.getAttribute(PREFERENCE_IGNORE_CONTEXT_ROOT, true);
+ }
+
+ public static IServer setIgnoresContextRoot(IServerAttributes server, boolean val)
throws CoreException {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.setAttribute(ATTRIBUTE_REMOTE_NAME, val);
+ return wc.save(false, new NullProgressMonitor());
+ }
+
+
/**
* To be used if you must create a local runtime adapter
* as the user does not have one in their workspace yet