Author: snjeza
Date: 2009-01-27 19:17:44 -0500 (Tue, 27 Jan 2009)
New Revision: 13299
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java
Log:
JBIDE-3642 Portlet Tools hardcode "default" for configuration name
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF 2009-01-27
21:37:23 UTC (rev 13298)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF 2009-01-28
00:17:44 UTC (rev 13299)
@@ -22,7 +22,8 @@
org.eclipse.jem,
org.eclipse.jst.jsf.facesconfig,
org.eclipse.wst.server.core,
- org.eclipse.jem.util
+ org.eclipse.jem.util,
+ org.jboss.ide.eclipse.as.core
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.portlet.core,
org.jboss.tools.portlet.core.internal,
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java
===================================================================
---
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java 2009-01-27
21:37:23 UTC (rev 13298)
+++
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java 2009-01-28
00:17:44 UTC (rev 13299)
@@ -71,9 +71,9 @@
static final String USER_LIBRARY_NAME = "userLibraryName"; //$NON-NLS-1$
- static final String SERVER_DEFAULT_DEPLOY_JBOSS_PORTAL_SAR =
"server/default/deploy/jboss-portal.sar"; //$NON-NLS-1$
+ static final String SERVER_DEFAULT_DEPLOY_JBOSS_PORTAL_SAR =
"deploy/jboss-portal.sar"; //$NON-NLS-1$
- static final String SERVER_DEFAULT_DEPLOY_SIMPLE_PORTAL =
"server/default/deploy/simple-portal"; //$NON-NLS-1$
+ static final String SERVER_DEFAULT_DEPLOY_SIMPLE_PORTAL =
"deploy/simple-portal"; //$NON-NLS-1$
static final String TOMCAT_LIB = "lib"; //$NON-NLS-1$
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java
===================================================================
---
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java 2009-01-27
21:37:23 UTC (rev 13298)
+++
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/PortletRuntimeComponentProvider.java 2009-01-28
00:17:44 UTC (rev 13299)
@@ -5,6 +5,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentType;
@@ -12,6 +14,8 @@
import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
import org.eclipse.wst.server.core.IRuntime;
import
org.eclipse.wst.server.core.internal.facets.RuntimeFacetComponentProviderDelegate;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.portlet.core.IPortletConstants;
import org.jboss.tools.portlet.core.Messages;
import org.jboss.tools.portlet.core.PortletCoreActivator;
@@ -28,7 +32,8 @@
public List<IRuntimeComponent> getRuntimeComponents(final IRuntime runtime) {
final File location = runtime.getLocation().toFile();
final List<IRuntimeComponent> components = new
ArrayList<IRuntimeComponent>();
- if (isPortalPresent(location)) {
+
+ if (isPortalPresent(location,runtime)) {
final IRuntimeComponent portalComponent = RuntimeManager
.createRuntimeComponent(PORTAL_VERSION_1, null);
components.add(portalComponent);
@@ -37,19 +42,28 @@
}
- private static boolean isPortalPresent(final File location) {
+ private static boolean isPortalPresent(final File location, IRuntime runtime) {
boolean check =
PortletCoreActivator.getDefault().getPluginPreferences().getBoolean(PortletCoreActivator.CHECK_RUNTIMES);
if (!check) {
return true;
}
- // JBoss Portal server
- if (exists(location, IPortletConstants.SERVER_DEFAULT_DEPLOY_JBOSS_PORTAL_SAR)) {
- return true;
+
+ IJBossServerRuntime jbossRuntime =
(IJBossServerRuntime)runtime.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
+ if (jbossRuntime != null) {
+ // JBoss Portal server
+ IPath jbossLocation = runtime.getLocation();
+ IPath configPath =
jbossLocation.append(IJBossServerConstants.SERVER).append(jbossRuntime.getJBossConfiguration());
+ File configFile = configPath.toFile();
+ if (exists(configFile,
+ IPortletConstants.SERVER_DEFAULT_DEPLOY_JBOSS_PORTAL_SAR)) {
+ return true;
+ }
+ // JBoss portletcontainer
+ if (exists(configFile,
+ IPortletConstants.SERVER_DEFAULT_DEPLOY_SIMPLE_PORTAL)) {
+ return true;
+ }
}
- // JBoss portletcontainer
- if (exists(location,IPortletConstants.SERVER_DEFAULT_DEPLOY_SIMPLE_PORTAL)) {
- return true;
- }
// Tomcat portletcontainer
File tomcatLib = new File(location,IPortletConstants.TOMCAT_LIB);
if (tomcatLib.exists() && tomcatLib.isDirectory()) {
Show replies by date