Author: ate
Date: Thu Mar 26 20:11:04 2009
New Revision: 758828

URL: http://svn.apache.org/viewvc?rev=758828&view=rev
Log:
Use the current portal contextPath for for new local portlet apps

Modified:
    
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java

Modified: 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java?rev=758828&r1=758827&r2=758828&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
 (original)
+++ 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
 Thu Mar 26 20:11:04 2009
@@ -60,6 +60,8 @@
     protected PermissionManager     permissionManager;
     protected boolean               autoCreateRoles;
     protected List<String>          permissionRoles;
+    protected String                portalContextPath;
+    
     protected int  descriptorChangeMonitorInterval = 
DEFAULT_DESCRIPTOR_CHANGE_MONITOR_INTERVAL;
     /**
      * holds the max number of retries in case of unsuccessful PA start
@@ -89,8 +91,14 @@
         this.nodeManager               = nodeManager;
         this.appRoot            = appRoot;
         this.descriptorService  = descriptorService;
+        portalContextPath  = appRoot.replace('\\','/');
+        if (portalContextPath.endsWith("/"))
+        {
+            portalContextPath = portalContextPath.substring(0, 
portalContextPath.length()-1 );
+        }
+        portalContextPath = 
portalContextPath.substring(portalContextPath.lastIndexOf('/'));
        }
-    
+       
     public void start()
     {
         if ( descriptorChangeMonitorInterval > 0 )
@@ -157,7 +165,7 @@
                throws RegistryException
        {
         checkStarted();
-        startPA(contextName, "/"+contextName, warStruct, paClassLoader, 
PortletApplication.LOCAL);
+        startPA(contextName, portalContextPath, warStruct, paClassLoader, 
PortletApplication.LOCAL);
        }
 
        public void startPortletApplication(String contextName, 
FileSystemHelper warStruct,
@@ -295,11 +303,6 @@
                        {
                            pa.setRevision(revision);
                        }
-
-                       if (paType == PortletApplication.LOCAL)
-                       {
-                               pa.setContextPath("<portal>");
-                       }
                }
                catch (Exception e)
                {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to