You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by at...@apache.org on 2008/05/02 21:37:49 UTC

svn commit: r652878 - in /portals/pluto/branches/2.0-spi-refactoring: pluto-container-api/src/main/java/org/apache/pluto/om/portlet/ pluto-container/src/main/java/org/apache/pluto/core/ pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/po...

Author: ate
Date: Fri May  2 12:37:48 2008
New Revision: 652878

URL: http://svn.apache.org/viewvc?rev=652878&view=rev
Log:
Defining PortletApp.name property and deriving contextPath from it.
PortletApp.name can and will be used from now on as the unique identifier within the container. 

Modified:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApp.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApp.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApp.java?rev=652878&r1=652877&r2=652878&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApp.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/om/portlet/PortletApp.java Fri May  2 12:37:48 2008
@@ -21,16 +21,24 @@
 public interface PortletApp {
 
     /**
-     * The contextPath for this Portlet (web) Application
-     * @return
+     * The name of the Portlet Application (web application context name)
+     * <br/>
+     * Note: this equals to the context name of the corresponding Web Application
+     *       and is also the unique identifier of the application (within the container)
      */
-    public String getContextPath();
+    public String getName();
     
     /**
-     * Set the contextPath for this Portlet (web) Application
-     * @param contextPath
+     * Set the name for the Portlet Application
+     * @param name
      */
-    public void setContextPath(String contextPath);
+    public void setName(String name);
+    
+    /**
+     * The contextPath of the Portlet Application
+     * @return
+     */
+    public String getContextPath();
     
 	/**
 	 * Retrieve the portlets which exist within this application.

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java?rev=652878&r1=652877&r2=652878&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java Fri May  2 12:37:48 2008
@@ -159,7 +159,7 @@
 
             PortletApp portletAppDD = PortletDescriptorRegistry.getRegistry()
                 .getPortletAppDD(servletContext);
-            portletAppDD.setContextPath(applicationId);
+            portletAppDD.setName(applicationId.substring(1));
 
             PortletContextImpl portletContext = new PortletContextImpl(
                 applicationId, servletContext, portletAppDD);

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java?rev=652878&r1=652877&r2=652878&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java Fri May  2 12:37:48 2008
@@ -92,7 +92,7 @@
 })
 public class PortletAppDD implements PortletApp {
 
-    private String contextPath;
+    private String name;
     
     /** The defined portlets within the system. */
 	@XmlElement(name = "portlet", type=PortletDD.class, namespace = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd")
@@ -167,19 +167,27 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.pluto.om.portlet.PortletApp#getContextPath()
+     * @see org.apache.pluto.om.portlet.PortletApp#getName()
      */
-    public String getContextPath()
+    public String getName()
     {
-        return contextPath;
+        return name;
     }
 
     /* (non-Javadoc)
-     * @see org.apache.pluto.om.portlet.PortletApp#setContextPath(java.lang.String)
+     * @see org.apache.pluto.om.portlet.PortletApp#setName(java.lang.String)
      */
-    public void setContextPath(String contextPath)
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.pluto.om.portlet.PortletApp#getContextPath()
+     */
+    public String getContextPath()
     {
-        this.contextPath = contextPath;
+        return "/" + (name != null ? name : "");
     }
 
     /* (non-Javadoc)