portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: r356025 - in /portals/pluto/trunk: pluto-portal-driver/src/main/java/org/apache/pluto/driver/ pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/impl/resource/ pluto-portal/src/main/webapp/WEB-INF/
Date Sun, 11 Dec 2005 21:26:48 GMT
Author: ddewolf
Date: Sun Dec 11 13:26:30 2005
New Revision: 356025

URL: http://svn.apache.org/viewcvs?rev=356025&view=rev
Log:
Updating tck driver

Added:
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckDriverServlet.java
      - copied, changed from r356016, portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckServlet.java
Removed:
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckServlet.java
Modified:
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
    portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml

Copied: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckDriverServlet.java
(from r356016, portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckServlet.java)
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckDriverServlet.java?p2=portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckDriverServlet.java&p1=portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckServlet.java&r1=356016&r2=356025&rev=356025&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckServlet.java
(original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/TckDriverServlet.java
Sun Dec 11 13:26:30 2005
@@ -19,6 +19,8 @@
 import org.apache.pluto.driver.services.portal.PageConfig;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
 import org.apache.pluto.driver.config.AdminConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
@@ -36,11 +38,11 @@
  * @version 1.0
  * @since Dec 11, 2005
  */
-public class TckServlet extends PortalDriverServlet {
+public class TCKDriverServlet extends PortalDriverServlet {
 
-    private int pageCounter = 0;
+    private static final Log LOG = LogFactory.getLog( TCKDriverServlet.class );
 
-    private String portalDriver = "/portal/";
+    private int pageCounter = 0;
 
     public String getServletInfo() {
         return "Pluto TCK Driver Servlet";
@@ -59,11 +61,17 @@
         //   create a new page.  This page must be setup and then
         //   redirected to the actual page.
         String[] portletNames = request.getParameterValues("portletName");
-        if(portletNames != null && portletNames.length < 0) {
+        if(portletNames != null && portletNames.length > 0) {
+            if(LOG.isDebugEnabled()) {
+                LOG.debug("Initializing new TCK Page.");
+            }
             doSetup(request, response);
             return;
         }
 
+        if(LOG.isDebugEnabled()) {
+            LOG.debug("TCK Test: No Portlet Names specified.  Continue as normal.");
+        }
         super.doGet(request, response);
     }
 
@@ -77,14 +85,14 @@
         String[] portletNames = request.getParameterValues("portletName");
         String pageName = request.getParameter("pageName");
         if(pageName == null) {
-            pageName = new java.text.DecimalFormat("TCK00000").format(pageCounter);
+            pageName = new java.text.DecimalFormat("TCK00000").format(pageCounter++);
             PageConfig config = new PageConfig();
             config.setName(pageName);
             config.setUri("/WEB-INF/fragments/portlet.jsp");
             for(int i = 0;i < portletNames.length; i++) {
                 int idx = portletNames[i].indexOf("/");
-                String context = portletNames[i].substring(0, idx);
-                String portletName = portletNames[i].substring(idx, portletNames.length);
+                String context = "/"+portletNames[i].substring(0, idx);
+                String portletName = portletNames[i].substring(idx + 1, portletNames[i].length());
                 config.addPortlet(context, portletName);
             }
 
@@ -95,10 +103,13 @@
                 throw new ServletException("Invalid Configuration.  An AdminConfiguration
must be specified to run the TCK.");
             }
             adminConfig.getRenderConfigAdminService().addPage(config);
+            if(LOG.isDebugEnabled()) {
+                LOG.debug("Created TCK Page: "+pageName);
+            }
         }
 
         // The other possibility would be to redirect to the actual portal.
         // I'm not sure which is better at this point.
-        response.sendRedirect(request.getContextPath()+request.getRequestURL()+"/"+pageName);
+        response.sendRedirect(request.getRequestURL()+(request.getRequestURL().toString().endsWith("/")?"":"/")+pageName);
     }
 }

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java?rev=356025&r1=356024&r2=356025&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
(original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
Sun Dec 11 13:26:30 2005
@@ -17,6 +17,7 @@
 
 import org.apache.pluto.driver.config.DriverConfigurationException;
 import org.apache.pluto.driver.services.portal.*;
+import org.apache.pluto.driver.services.portal.admin.RenderConfigAdminService;
 
 import javax.servlet.ServletContext;
 import java.util.List;
@@ -31,7 +32,8 @@
  * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
  * @since Aug 10, 2005
  */
-public class RenderConfigServiceImpl implements RenderConfigService {
+public class RenderConfigServiceImpl
+    implements RenderConfigService, RenderConfigAdminService {
 
 
     private ResourceConfig config;
@@ -109,4 +111,7 @@
         return config.getRenderConfig().getPageConfig(id);
     }
 
+    public void addPage(PageConfig pageConfig) {
+        config.getRenderConfig().addPage(pageConfig);
+    }
 }

Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml?rev=356025&r1=356024&r2=356025&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
(original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
Sun Dec 11 13:26:30 2005
@@ -51,6 +51,7 @@
 
     <bean id="AdminConfiguration" class="org.apache.pluto.driver.config.impl.AdminConfigurationImpl">
       <property name="portletRegistryAdminService"><ref local="PortletRegistryConfig"/></property>
+      <property name="renderConfigAdminService"><ref local="RenderConfigService"/></property>
     </bean>
 
     <!-- ================================================ -->



Mime
View raw message