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 dd...@apache.org on 2007/02/06 03:24:21 UTC

svn commit: r503959 - in /portals/pluto/trunk: ./ pluto-container/src/main/java/org/apache/pluto/core/ pluto-container/src/main/java/org/apache/pluto/internal/impl/ pluto-container/src/main/java/org/apache/pluto/spi/optional/ pluto-portal/src/main/weba...

Author: ddewolf
Date: Mon Feb  5 18:24:21 2007
New Revision: 503959

URL: http://svn.apache.org/viewvc?view=rev&rev=503959
Log:
Removing retro configuration in driver config; Providing access to the PortletContexts for portals; Updating pom to use staging dir

Modified:
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
    portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml
    portals/pluto/trunk/pom.xml

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java?view=diff&rev=503959&r1=503958&r2=503959
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java Mon Feb  5 18:24:21 2007
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -29,6 +29,7 @@
 import org.apache.pluto.spi.optional.PortletRegistryService;
 
 import javax.servlet.ServletContext;
+import javax.portlet.PortletContext;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.net.MalformedURLException;
@@ -132,12 +133,23 @@
 
     }
 
+    /**
+     * Retrieve an iterator of all PortletContext instances
+     * which exist within this application.
+     *
+     * @return
+     */
     public Iterator getRegisteredPortletApplications() {
         return new HashSet(portletContexts.values()).iterator();
     }
 
-    public PortletAppDD getPortletApplicationDescriptor(String name) throws PortletContainerException {
-        InternalPortletContext ipc = (InternalPortletContext) portletContexts.get(name);
+    public PortletContext getPortletContext(String applicationId)
+    throws PortletContainerException {
+        return (InternalPortletContext) portletContexts.get(applicationId);
+    }
+
+    public PortletAppDD getPortletApplicationDescriptor(String applicationId) throws PortletContainerException {
+        InternalPortletContext ipc = (InternalPortletContext) portletContexts.get(applicationId);
         if (ipc != null) {
             return ipc.getPortletApplicationDefinition();
         }

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java?view=diff&rev=503959&r1=503958&r2=503959
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java Mon Feb  5 18:24:21 2007
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  * 
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -28,6 +28,9 @@
 import java.io.InputStream;
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Set;
+import java.util.Enumeration;
 
 /**
  * Pluto's Portlet Context Implementation. This class implements the
@@ -46,20 +49,15 @@
      */
     private static final Log LOG = LogFactory.getLog(PortletContextImpl.class);
 
-    /**
-     * Attribute key used to bind the servletContext to the application.
-     */
-    private static final String CONTEXT_PATH =
-        "org.apache.pluto.PORTLET_APP_CONTEXT_PATH";
-
-
 
     // Private Member Variables ------------------------------------------------
 
     private String applicationId;
     private String applicationName;
+
     private PortletAppDD portletAppDD = null;
     private ServletContext servletContext = null;
+    private ClassLoader contextClassLoader = null;
 
     // Constructor -------------------------------------------------------------
 
@@ -68,6 +66,7 @@
      *
      * @param servletContext the servlet context in which we are contained.
      * @param portletAppDD   the portlet application descriptor.
+     * @param portletApplicationId applicationId
      */
     public PortletContextImpl(String portletApplicationId,
                               ServletContext servletContext,
@@ -76,9 +75,15 @@
         this.portletAppDD = portletAppDD;
         this.applicationId = portletApplicationId;
         this.applicationName = servletContext.getServletContextName();
+
         if(applicationName == null) {
             applicationName = applicationId;
         }
+        init();
+    }
+
+    private void init() {
+        setContextClassLoader(Thread.currentThread().getContextClassLoader());
     }
 
     public String getApplicationId() {
@@ -89,6 +94,22 @@
         return applicationName;
     }
 
+    /**
+     * ClassLoader associated with this context.
+     * @return
+     */
+    public ClassLoader getContextClassLoader() {
+        return contextClassLoader;
+    }
+
+    /**
+     * ClassLoader associated with this context.
+     * @param contextClassLoader
+     */
+    public void setContextClassLoader(ClassLoader contextClassLoader) {
+        this.contextClassLoader = contextClassLoader;
+    }
+
     // PortletContext Impl -----------------------------------------------------
 
     /**
@@ -183,11 +204,11 @@
         return servletContext.getRealPath(path);
     }
 
-    public java.util.Set getResourcePaths(String path) {
+    public Set getResourcePaths(String path) {
         return servletContext.getResourcePaths(path);
     }
 
-    public java.net.URL getResource(String path)
+    public URL getResource(String path)
         throws java.net.MalformedURLException {
         if (path == null || !path.startsWith("/")) {
             throw new MalformedURLException("path must start with a '/'");
@@ -195,7 +216,7 @@
         return servletContext.getResource(path);
     }
 
-    public java.lang.Object getAttribute(java.lang.String name) {
+    public Object getAttribute(java.lang.String name) {
         if (name == null) {
             throw new IllegalArgumentException("Attribute name == null");
         }
@@ -203,11 +224,11 @@
         return servletContext.getAttribute(name);
     }
 
-    public java.util.Enumeration getAttributeNames() {
+    public Enumeration getAttributeNames() {
         return servletContext.getAttributeNames();
     }
 
-    public java.lang.String getInitParameter(java.lang.String name) {
+    public String getInitParameter(java.lang.String name) {
         if (name == null) {
             throw new IllegalArgumentException("Parameter name == null");
         }
@@ -215,7 +236,7 @@
         return servletContext.getInitParameter(name);
     }
 
-    public java.util.Enumeration getInitParameterNames() {
+    public Enumeration getInitParameterNames() {
         return servletContext.getInitParameterNames();
     }
 

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java?view=diff&rev=503959&r1=503958&r2=503959
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java Mon Feb  5 18:24:21 2007
@@ -18,7 +18,9 @@
 
 import org.apache.pluto.descriptors.portlet.PortletAppDD;
 import org.apache.pluto.PortletContainerException;
+import org.apache.pluto.internal.InternalPortletContext;
 
+import javax.portlet.PortletContext;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -70,6 +72,16 @@
         throws PortletContainerException;
 
     /**
+     * Retrieve the PortletContext for the specified applicationId
+     * 
+     * @param applicationId
+     * @return
+     * @throws PortletContainerException
+     */
+    PortletContext getPortletContext(String applicationId)
+    throws PortletContainerException;
+
+    /**
      * Add a listener which will recieve notifications of newly
      * registered applications.
      *
@@ -83,6 +95,7 @@
      * @param listener the listener to remove
      */
     void removePortletRegistryListener(PortletRegistryListener listener);
+
 
 
 }

Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml?view=diff&rev=503959&r1=503958&r2=503959
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml (original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml Mon Feb  5 18:24:21 2007
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at
 
 http://www.apache.org/licenses/LICENSE-2.0
@@ -41,29 +41,6 @@
   </supports>
 
 
-    <!--
-    NOTE: Once all of the services are re-implemented correctly, we will
-    remove this registry from the config. This is because it is no longer
-    necessary, as each portlet registers itself as it starts up!
-    -->
-
-  <portlet-app>
-    <context-path>/pluto</context-path>
-    <portlets>
-      <portlet name="AboutPortlet"/>
-      <portlet name="AdminPortlet"/>
-      <portlet name="PlutoPageAdmin"/>
-    </portlets>
-  </portlet-app>
-
-  <portlet-app>
-    <context-path>/testsuite</context-path>
-    <portlets>
-      <portlet name="TestPortlet1"/>
-      <portlet name="TestPortlet2"/>
-    </portlets>
-  </portlet-app>
-
   <!-- Render configuration which defines the portal pages. -->
   <render-config default="Test Page">
     <page name="Test Page" uri="/WEB-INF/themes/pluto-default-theme.jsp">
@@ -78,8 +55,8 @@
       <portlet context="/pluto" name="AboutPortlet"/>
     </page>
     <page name="Pluto Admin" uri="/WEB-INF/themes/pluto-default-theme.jsp">
-      <portlet context="/pluto" name="AdminPortlet"/>
       <portlet context="/pluto" name="PlutoPageAdmin"/>
+      <portlet context="/pluto" name="AboutPortlet"/>
     </page>
   </render-config>
   

Modified: portals/pluto/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pom.xml?view=diff&rev=503959&r1=503958&r2=503959
==============================================================================
--- portals/pluto/trunk/pom.xml (original)
+++ portals/pluto/trunk/pom.xml Mon Feb  5 18:24:21 2007
@@ -19,6 +19,12 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>3</version>
+    </parent>
+
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.pluto</groupId>
     <artifactId>pluto</artifactId>
@@ -294,10 +300,18 @@
         </site>
 
         <repository>
+            <id>pluto-staging</id>
+            <name>Apache Pluto Staging Repository</name>
+            <url>scp://people.apache.org/www/people.apache.org/builds/portals-pluto/m2-staging-repository</url>
+        </repository>
+
+        <!--
+        <repository>
             <id>apache.releases</id>
             <name>Apache Release Distribution Repository</name>
             <url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
         </repository>
+        -->
 
         <snapshotRepository>
             <id>apache.snapshots</id>