cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r406833 - in /cocoon/branches/BRANCH_2_1_X: ./ src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ src/blocks/portal/conf/ src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ src/blocks/p...
Date Tue, 16 May 2006 04:57:12 GMT
Author: rgoers
Date: Mon May 15 21:57:09 2006
New Revision: 406833

URL: http://svn.apache.org/viewcvs?rev=406833&view=rev
Log:
      Portal: PageLabels can now be configured to be part of the url.
      Made the pool-max values in the html block's generators externally configurable. Made sitemap
      reloading externally configurable. Made pipeline amd encodeURLTransformer pool-max values 
      externally configurable.

Added:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/projectpath.samplesxconf
Removed:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/projectpath.xconf
Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ConstraintType.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/LinkInfo.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelManager.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java
    cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/properties/core.properties
    cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ConstraintType.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ConstraintType.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ConstraintType.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ConstraintType.java Mon May 15 21:57:09 2006
@@ -22,7 +22,7 @@
  * Contraint codes
  *
  * @author Marc Johnson (marc_johnson27591@hotmail.com)
- * @version CVS $Id: ConstraintType.java,v 1.5 2004/03/05 13:02:03 bdelacretaz Exp $
+ * @version CVS $Id: ConstraintType.java 30932 2004-07-29 17:35:38Z vgritsenko $
  */
 public class ConstraintType
 {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf Mon May 15 21:57:09 2006
@@ -21,8 +21,109 @@
       It demonstrates several features of the portal engine,
       so it's not optimized for production. Make sure that
       if you use the portal for your own projects that you
-      remove all unused stuff from the configuration! 
+      remove all unused stuff from the configuration!
  -->
+
+  <component class="org.apache.cocoon.portal.event.impl.DefaultEventManager" logger="portal"
+             role="org.apache.cocoon.portal.event.EventManager">
+    <event-aspects>
+      <!--  The client should not cache the page. -->
+      <aspect type="no-client-caching"/>
+      <!-- Uncomment this aspect when marshalling JSR168 portlet events
+      <aspect type="convertable"/>
+      -->
+      <!-- Use the action counter with great care. We recommend turning it off. -->
+      <!-- Remove action-counter when using PageLabels -->
+      <!-- aspect type="action-counter"/ -->
+      <aspect type="frame"/>
+      <aspect type="link"/>
+      <aspect type="full-screen-coplet"/>
+      <!-- Uncomment the following when using PageLabels
+      <aspect type="page-label"/>
+      -->
+      <!-- Comment the following out if you don't need WSRP: -->
+      <aspect type="wsrp"/>
+      <aspect type="request-parameter">
+        <!-- Uncomment the following when marshalling JSR168 portlet events
+        <parameter name="parameter-name" value="cocoon-portal-event,url"/>
+        -->
+      </aspect>
+    </event-aspects>
+    <!-- add a new instance of each class as a subscriber: -->
+    <subscriber-classes>
+      <!-- Please note that Subcribers are deprecated. Please use receivers instead. -->
+      <!-- class name="CLASSNAME"/> -->
+    </subscriber-classes>
+    <!-- add each component as a subscriber (the component should be thread safe): -->
+    <subscriber-roles>
+      <!-- Please note that Subcribers are deprecated. Please use receivers instead. -->
+      <!-- <role name="AVALON-ROLE"/> -->
+    </subscriber-roles>
+    <!-- add a new instance of each class as a receiver: -->
+    <receiver-classes>
+      <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaulCopletDataEventSubscriber"/>
+      <class
+        name="org.apache.cocoon.portal.event.subscriber.impl.DefaultChangeAspectDataEventSubscriber"/>
+      <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaultJXPathEventSubscriber"/>
+    </receiver-classes>
+    <!-- add each component as a receiver (the component should be thread safe): -->
+    <receiver-roles>
+      <!-- <role name="AVALON-ROLE"/> -->
+    </receiver-roles>
+  </component>
+
+  <!-- This is the portal manager.
+       The portal manager can be extended with different aspects.
+       Currently the JSR-168 aspect is configured/activated.
+       If you don't need the JSR-168 support uncomment the aspect.
+       In a similar manner the wsrp support works.
+  -->
+  <component class="org.apache.cocoon.portal.impl.PortalManagerImpl"
+             logger="portal" role="org.apache.cocoon.portal.PortalManager">
+    <aspects>
+      <!-- JSR-168 support: -->
+      <aspect adapter="portlet"/>
+      <!-- wsrp support: -->
+      <aspect adapter="wsrp"/>
+    </aspects>
+    <fullScreenNav>true</fullScreenNav>
+  </component>
+
+
+  <!-- This is the portal service -->
+  <component class="org.apache.cocoon.portal.impl.PortalServiceImpl" logger="portal"
+             role="org.apache.cocoon.portal.PortalService">
+    <portals>
+      <!-- Configure your portals here: -->
+    </portals>
+  </component>
+
+  <!-- To enable PageLabels change DefaultLinkService to PageLabelLinkService -->
+  <component class="org.apache.cocoon.portal.impl.DefaultLinkService"
+             logger="portal"
+             role="org.apache.cocoon.portal.LinkService">
+    <parameter name="defaultPort" value="8888"/>
+    <parameter name="defaultSecurePort" value="443"/>
+  </component>
+
+  <!-- To enable PageLabels change DefaultEventConverter to PageLabelEventConverter -->
+  <component class="org.apache.cocoon.portal.event.impl.DefaultEventConverter" logger="portal"
+             role="org.apache.cocoon.portal.event.EventConverter">
+  </component>
+
+  <!-- Page Label Manager -->
+  <component class="org.apache.cocoon.portal.impl.PageLabelManager" logger="portal"
+             role="org.apache.cocoon.portal.impl.PageLabelManager">
+    <!-- Uncomment to marshall JSR-168 portlet events
+    <marshallEvents>true</marshallEvents>
+    -->
+    <!-- Uncomment to enable non sticky tabs
+    <nonStickyTabs>true</nonStickyTabs>
+    -->
+    <!-- Uncomment to have the label appear in the path instead of as a request parameter
+    <urlPath>true</urlPath>
+    -->
+  </component>
   <component role="org.osoco.cowarp.ApplicationManager"
              class="org.osoco.cowarp.impl.StandardApplicationManager"/>
 
@@ -57,7 +158,19 @@
   <component class="org.apache.cocoon.portal.profile.impl.GroupBasedProfileManager" logger="portal" role="org.apache.cocoon.portal.profile.ProfileManager/Cowarp">
     <parameter name="userinfo-provider" value="org.osoco.cowarp.portal.UserInfoProviderImpl"/>
   </component>
- 
+
+  <component class="org.apache.cocoon.components.persistence.CastorSourceConverter"
+             role="org.apache.cocoon.components.persistence.CastorSourceConverter" logger="portal">
+    <mapping-source source="layout">
+      resource://org/apache/cocoon/portal/layout/layout.xml</mapping-source>
+    <mapping-source source="copletbasedata">
+      resource://org/apache/cocoon/portal/coplet/copletbasedata.xml</mapping-source>
+    <mapping-source source="copletdata">
+      resource://org/apache/cocoon/portal/coplet/copletdata.xml</mapping-source>
+    <mapping-source source="copletinstancedata">
+      resource://org/apache/cocoon/portal/coplet/copletinstancedata.xml</mapping-source>
+  </component>
+
   <component class="org.apache.cocoon.portal.profile.impl.AuthenticationProfileManager" logger="portal" role="org.apache.cocoon.portal.profile.ProfileManager/Auth">
   </component>
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.xconf Mon May 15 21:57:09 2006
@@ -39,51 +39,7 @@
       <!--  You can add own aspects here. -->
   </component>
 
-  <component class="org.apache.cocoon.portal.event.impl.DefaultEventManager" logger="portal" role="org.apache.cocoon.portal.event.EventManager">
-    <event-aspects>
-        <!--  The client should not cache the page. -->
-        <aspect type="no-client-caching"/>
-        <!-- Uncomment this aspect when marshalling JSR168 portlet events 
-        <aspect type="convertable"/>
-        -->
-        <!-- Use the action counter with great care. We recommend turning it off. -->
-        <!-- Remove action-counter when using PageLabels -->
-        <!-- aspect type="action-counter"/ -->
-        <aspect type="frame"/>
-        <aspect type="link"/>
-        <aspect type="full-screen-coplet"/>
-        <!-- Uncomment the following when using PageLabels
-        <aspect type="page-label"/>
-        -->
-        <!-- Comment the following out if you don't need WSRP: -->
-        <aspect type="wsrp"/>
-        <aspect type="request-parameter">
-          <!-- Uncomment the following when marshalling JSR168 portlet events
-          <parameter name="parameter-name" value="cocoon-portal-event,url"/>
-          -->
-        </aspect>
-    </event-aspects>
-    <!-- add a new instance of each class as a subscriber: -->
-    <subscriber-classes>
-      <!-- Please note that Subcribers are deprecated. Please use receivers instead. -->
-      <!-- class name="CLASSNAME"/> -->
-    </subscriber-classes>
-    <!-- add each component as a subscriber (the component should be thread safe): -->
-    <subscriber-roles>
-      <!-- Please note that Subcribers are deprecated. Please use receivers instead. -->
-      <!-- <role name="AVALON-ROLE"/> -->
-    </subscriber-roles>
-    <!-- add a new instance of each class as a receiver: -->
-    <receiver-classes>
-        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaulCopletDataEventSubscriber"/>
-        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaultChangeAspectDataEventSubscriber"/>
-        <class name="org.apache.cocoon.portal.event.subscriber.impl.DefaultJXPathEventSubscriber"/>
-    </receiver-classes>
-    <!-- add each component as a receiver (the component should be thread safe): -->
-    <receiver-roles>
-        <!-- <role name="AVALON-ROLE"/> -->
-    </receiver-roles>
-  </component>
+
 
   <!-- Event Factory configuration -->
   <component class="org.apache.cocoon.components.ExtendedComponentSelector" role="org.apache.cocoon.portal.event.ConvertableEventFactorySelector">
@@ -92,51 +48,6 @@
     <factory logger="portal" name="url" class="org.apache.cocoon.portal.pluto.PortletURLProviderFactory"/>
   </component>
 
-  <!-- This is the portal manager.
-       The portal manager can be extended with different aspects.
-       Currently the JSR-168 aspect is configured/activated.
-       If you don't need the JSR-168 support uncomment the aspect.
-       In a similar manner the wsrp support works.       
-  -->
-  <component class="org.apache.cocoon.portal.impl.PortalManagerImpl" 
-             logger="portal" role="org.apache.cocoon.portal.PortalManager">
-    <aspects>
-      <!-- JSR-168 support: -->
-      <aspect adapter="portlet"/>
-      <!-- wsrp support: -->
-      <aspect adapter="wsrp"/>
-    </aspects>
-    <fullScreenNav>true</fullScreenNav>
-  </component>
-
-  <!-- This is the portal service -->
-  <component class="org.apache.cocoon.portal.impl.PortalServiceImpl" logger="portal" role="org.apache.cocoon.portal.PortalService">
-   <portals>
-     <!-- Configure your portals here: -->
-   </portals>
- </component>
-
- <!-- To enable PageLabels change DefaultLinkService to PageLabelLinkService -->
- <component class="org.apache.cocoon.portal.impl.DefaultLinkService"
-            logger="portal"
-            role="org.apache.cocoon.portal.LinkService">
-   <parameter name="defaultPort" value="8888"/>
-   <parameter name="defaultSecurePort" value="443"/>
- </component>
-
- <!-- To enable PageLabels change DefaultEventConverter to PageLabelEventConverter -->
- <component class="org.apache.cocoon.portal.event.impl.DefaultEventConverter" logger="portal" role="org.apache.cocoon.portal.event.EventConverter">
- </component>
-  
-  <!-- Page Label Manager -->
-  <component class="org.apache.cocoon.portal.impl.PageLabelManager" logger="portal" role="org.apache.cocoon.portal.impl.PageLabelManager">
-    <!-- Uncomment to marshall JSR-168 portlet events
-    <marshallEvents>true</marshallEvents>
-    -->
-    <!-- Uncomment to enable non sticky tabs
-    <nonStickyTabs>true</nonStickyTabs>
-    -->
-  </component>
 
   <!-- Coplet Adapter configuration -->
   <component class="org.apache.cocoon.components.ExtendedComponentSelector" 
@@ -214,12 +125,6 @@
     <store logger="portal" name="memory" class="org.apache.cocoon.portal.aspect.impl.MemoryAspectDataStore"/>
  </component>
 
-<component class="org.apache.cocoon.components.persistence.CastorSourceConverter" role="org.apache.cocoon.components.persistence.CastorSourceConverter" logger="portal">
- 	<mapping-source source="layout">resource://org/apache/cocoon/portal/layout/layout.xml</mapping-source>
- 	<mapping-source source="copletbasedata">resource://org/apache/cocoon/portal/coplet/copletbasedata.xml</mapping-source>
- 	<mapping-source source="copletdata">resource://org/apache/cocoon/portal/coplet/copletdata.xml</mapping-source>
- 	<mapping-source source="copletinstancedata">resource://org/apache/cocoon/portal/coplet/copletinstancedata.xml</mapping-source>
- </component>
  <component class="org.apache.cocoon.portal.profile.impl.MapProfileLS" role="org.apache.cocoon.portal.profile.ProfileLS" logger="portal"/>
 
  <component class="org.apache.cocoon.components.variables.DefaultVariableResolverFactory" role="org.apache.cocoon.components.variables.VariableResolverFactory" logger="portal"/>

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/projectpath.samplesxconf
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/projectpath.samplesxconf?rev=406833&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/projectpath.samplesxconf (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/projectpath.samplesxconf Mon May 15 21:57:09 2006
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed 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
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<samplesxconf xpath="/cocoon/input-modules"
+       unless="component-instance[@name='portalpath']">
+    <component-instance logger="core.modules.input"
+          name="portalpath"
+          class="org.apache.cocoon.components.modules.input.ProjectPathModule">
+       <uri-prefix>samples/blocks/portal/</uri-prefix>
+    </component-instance>
+</samplesxconf>
\ No newline at end of file

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/PageLabelEventAspect.java Mon May 15 21:57:09 2006
@@ -78,12 +78,14 @@
             final EventManager publisher = service.getComponentManager().getEventManager();
             final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
             final String parameterName = this.labelManager.getRequestParameterName();
+            final boolean useUrlPath = this.labelManager.isUrlPath();
+
+            String label = (useUrlPath) ? request.getSitemapURI() : request.getParameter(parameterName);
 
-            String label = request.getParameter(parameterName);
             // The pageLabel must be single valued
             if (label != null) {
                 String previous = this.labelManager.getPreviousLabel();
-                if (previous != null && previous.equals(label)) {
+                if (previous != null && previous.equals(label) ) {
                     // Already on this page. Don't publish the pageLabel events
                 } else {
                     Iterator iter = this.labelManager.getPageLabelEvents(label).iterator();

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java Mon May 15 21:57:09 2006
@@ -135,7 +135,7 @@
             return this.getRefreshLinkURI(secure);
         }
         final LinkInfo info = this.getInfo();
-        final StringBuffer buffer = new StringBuffer(info.getBase(secure));
+        final StringBuffer buffer = new StringBuffer(initBuffer(info, event, secure));
         boolean hasParams = info.hasParameters();
 
         // add comparable events
@@ -165,6 +165,11 @@
         return buffer.toString();
     }
 
+    protected String initBuffer(LinkInfo info, Event event, Boolean secure)
+    {
+        return info.getBase(secure);
+    }
+
     /**
      * Add one event to the buffer
      * @return Returns true, if the link contains a parameter
@@ -201,7 +206,7 @@
         }
         final LinkInfo info = this.getInfo();
         boolean hasParams = info.hasParameters();
-        final StringBuffer buffer = new StringBuffer(info.getBase(secure));
+        final StringBuffer buffer = new StringBuffer(initBuffer(info, events, secure));
 
         // add comparable events
         Iterator iter = info.comparableEvents.iterator();
@@ -252,6 +257,10 @@
         return buffer.toString();
     }
 
+    protected String initBuffer(LinkInfo info, List events, Boolean secure) {
+        return info.getBase(secure);
+    }
+
     /**
      * @see org.apache.cocoon.portal.LinkService#addEventToLink(org.apache.cocoon.portal.event.Event)
      */
@@ -357,7 +366,7 @@
         return this.eventsMarshalled.booleanValue();
     }
 
-    private String processEvent(Event event, StringBuffer value) {
+    protected String processEvent(Event event, StringBuffer value) {
         String parameterName = DEFAULT_REQUEST_EVENT_PARAMETER_NAME;
         if (event instanceof ConvertableEvent && getEventsMarshalled()) {
             final String eventParName = ((ConvertableEvent) event).getRequestParameterName();

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/LinkInfo.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/LinkInfo.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/LinkInfo.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/LinkInfo.java Mon May 15 21:57:09 2006
@@ -38,6 +38,7 @@
     protected boolean            hasParameters = false;
     protected final ArrayList    comparableEvents = new ArrayList(5);
     protected final StringBuffer url = new StringBuffer();
+    protected final Request      request;
 
     /** Is the page called using https? */
     protected final boolean isSecure;
@@ -45,22 +46,50 @@
     public LinkInfo(Request request, int defaultPort, int defaultSecurePort) {
         this.isSecure = request.getScheme().equals("https");
         // create relative url
+        String relativeURI = getRelativeURI(request);
+
+        this.request = request;
+        this.secureLinkBase = getSecureLinkBase(request, relativeURI, defaultSecurePort);
+        this.httpLinkBase = getHttpLinkBase(request, relativeURI, defaultPort);
+    }
+
+    protected String getRelativeURI(Request request) {
         String relativeURI = request.getSitemapURI();
         final int pos = relativeURI.lastIndexOf('/');
-        if ( pos != -1 ) {
-            relativeURI = relativeURI.substring(pos+1);
+        if (pos != -1)
+        {
+            relativeURI = relativeURI.substring(pos + 1);
         }
+        return relativeURI;
+    }
 
-        // do we need a protocol shift for link base?
-        if ( this.isSecure ) {
-            this.secureLinkBase = relativeURI;
-            this.httpLinkBase = this.getAbsoluteUrl(request, false, defaultPort);
-        } else {
-            httpLinkBase = relativeURI;
-            this.secureLinkBase = this.getAbsoluteUrl(request, true, defaultSecurePort);
-        }
+    /**
+     * Return the base url for a secure http request
+     * @param relativeURI The current relative URI
+     * @param defaultPort The default port to use
+     * @return A String containing the base url for a secure http request
+     */
+    protected String getSecureLinkBase(Request request, String relativeURI, int defaultPort) {
+        return (this.isSecure) ? relativeURI : getAbsoluteUrl(request, true, defaultPort);
+    }
+
+    /**
+     * Return the url for an http request
+     * @param relativeURI The current relative URI
+     * @param defaultPort The default port to use
+     * @return A string containing the base url for an http request
+     */
+    protected String getHttpLinkBase(Request request, String relativeURI, int defaultPort) {
+        return (this.isSecure) ? getAbsoluteUrl(request, false, defaultPort) : relativeURI;
     }
 
+    /**
+     * Return the absolute URL for a reqeust
+     * @param request The current Request
+     * @param useSecure true if the Request should be secure
+     * @param port The port to use
+     * @return A String containing the absolute url for a request
+     */
     protected String getAbsoluteUrl(Request request, boolean useSecure, int port) {
         final StringBuffer buffer = new StringBuffer();
         if ( useSecure ) {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java Mon May 15 21:57:09 2006
@@ -15,194 +15,131 @@
  */
 package org.apache.cocoon.portal.impl;
 
-import java.io.UnsupportedEncodingException;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ArrayList;
 
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.impl.ChangeAspectDataEvent;
 import org.apache.cocoon.portal.layout.CompositeLayout;
 import org.apache.cocoon.portal.layout.Item;
 import org.apache.cocoon.portal.layout.NamedItem;
-import org.apache.cocoon.util.NetUtils;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.components.ContextHelper;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 
 /**
- * The PageLabelLinkService generates links for named items defined in the layout portal.xml.
- * Links for other entities are passed to the DefaultLinkService to be resolved.
+ * The PageLabelLinkService generates links for named items defined in the layout portal.xml. Links
+ * for other entities are passed to the DefaultLinkService to be resolved.
  *
  * @author Ralph Goers
- *
  * @version CVS $Id:$
  */
-public class PageLabelLinkService extends DefaultLinkService {
+public class PageLabelLinkService extends DefaultLinkService
+{
 
     protected String apectName;
 
-    /** The label manager */
+    /**
+     * The label manager
+     */
     protected PageLabelManager labelManager;
 
+
     /* (non-Javadoc)
     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
     */
     public void service(ServiceManager manager) throws ServiceException {
         super.service(manager);
-        this.labelManager = (PageLabelManager)this.manager.lookup(PageLabelManager.ROLE);
+        this.labelManager = (PageLabelManager) this.manager.lookup(PageLabelManager.ROLE);
     }
 
-    /**
-     * Get the uri for the coplet containing event
-     *
-     * @param event The event to find
-     * @return A URI
-     */
-    public String getLinkURI(Event event) {
-        return getLinkURI(event, null);
-    }
 
     /**
-     * Get the uri for the coplet containing event
-     *
-     * @param event The event to find
-     * @param secure true if a secure protocol is required, false otherwise.
-     * @return A URI
+     * @see org.apache.cocoon.portal.LinkService#getLinkURI(java.util.List)
      */
-    public String getLinkURI(Event event, Boolean secure) {
-        if (event == null) {
-            return this.getRefreshLinkURI(secure);
+    public String getLinkURI(List events, Boolean secure) {
+        List eventList = new ArrayList();
+        Iterator iter = events.iterator();
+        Event aspectEvent = null;
+        while (iter.hasNext()) {
+            Event event = (Event)iter.next();
+            if (event instanceof ChangeAspectDataEvent &&
+                ((ChangeAspectDataEvent) event).getTarget() instanceof CompositeLayout) {
+                aspectEvent = event;
+            } else {
+                eventList.add(event);
+            }
         }
-        if (this.labelManager == null) {
-            return super.getLinkURI(event);
+        if (aspectEvent != null) {
+            eventList.add(0, aspectEvent);
         }
+        return super.getLinkURI(eventList, secure);
+    }
 
-        String requestParameterName = this.labelManager.getRequestParameterName();
+    protected String initBuffer(LinkInfo info, Event event, Boolean secure) {
+        StringBuffer base = new StringBuffer(info.getBase(secure));
+        if (this.labelManager == null || !this.labelManager.isUrlPath()) {
+            return base.toString();
+        }
 
-        if (event instanceof ChangeAspectDataEvent &&
+        String label;
+        if (event != null && event instanceof ChangeAspectDataEvent &&
             ((ChangeAspectDataEvent) event).getTarget() instanceof CompositeLayout) {
-
-            ChangeAspectDataEvent e = (ChangeAspectDataEvent)event;
-            CompositeLayout layout = (CompositeLayout)e.getTarget();
-            int i = ((Integer)e.getData()).intValue();
-
-            Item item = layout.getItem(i);
-            if (item instanceof NamedItem) {
-                StringBuffer key = new StringBuffer("");
-                getKey(item, key);
-
-                if (this.labelManager.getPageLabelEvents(key.toString()) != null) {
-                    final LinkInfo info = this.getInfo();
-                    boolean hasParams = info.hasParameters();
-                    final StringBuffer buffer = new StringBuffer(info.getBase(secure));
-                    if (hasParams) {
-                        buffer.append('&');
-                    }
-                    else {
-                        buffer.append('?');
-                    }
-                    try {
-                        String encodedKey = NetUtils.encode(key.toString(), "utf-8");
-                        buffer.append(requestParameterName).append('=').append(encodedKey);
-                    } catch (UnsupportedEncodingException uee) {
-                        // ignore this as utf-8 is always supported
-                    }
-                    return buffer.toString();
-                }
-            }
+            label = getLabel((ChangeAspectDataEvent)event);
+        } else {
+            label = this.labelManager.getCurrentLabel();
+        }
+        if (label.length() > 0) {
+            base.setLength(0);
+            base.append(label);
         }
 
-        String label = this.labelManager.getCurrentLabel();
-
-        return getLink(super.getLinkURI(event, secure), requestParameterName, label);
-    }
-
-    /**
-     * Get the uri for this coplet containing the additional events.
-     *
-     * @param events The events that will be processed by the generated uri.
-     * @return A URI
-     */
-    public String getLinkURI(List events) {
-        return getLinkURI(events, null);
+        return base.toString();
     }
 
-    /**
-     * Get the uri for this coplet containing the additional events.
-     *
-     * @param events The events that will be processed by the generated uri.
-     * @return A URI
-     */
-    public String getLinkURI(List events, Boolean secure) {
-        if (events == null || events.size() == 0) {
-            return this.getRefreshLinkURI(secure);
-        }
-        if (this.labelManager == null) {
-            return super.getLinkURI(events);
+    protected String initBuffer(LinkInfo info, List events, Boolean secure) {
+        if (this.labelManager == null || !this.labelManager.isUrlPath()) {
+            return info.getBase(secure);
         }
 
-        String requestParameterName = this.labelManager.getRequestParameterName();
-        final LinkInfo info = this.getInfo();
-        final StringBuffer buffer = new StringBuffer(info.getBase(secure));
-        boolean hasParams = info.hasParameters();
         Iterator iter = events.iterator();
-        StringBuffer value = new StringBuffer("");
-
-        while (iter.hasNext())
-        {
-            Event event = (Event)iter.next();
-
+        Event aspectEvent = null;
+        while (iter.hasNext()) {
+            Event event = (Event) iter.next();
             if (event instanceof ChangeAspectDataEvent &&
                 ((ChangeAspectDataEvent) event).getTarget() instanceof CompositeLayout) {
-
-                ChangeAspectDataEvent e = (ChangeAspectDataEvent) event;
-                CompositeLayout layout = (CompositeLayout) e.getTarget();
-                int i = ((Integer) e.getData()).intValue();
-
-                Item item = layout.getItem(i);
-                if (value.length() > 0) {
-                    value.append('.');
-                }
-                if (item instanceof NamedItem) {
-                    if(value.length()>0) {
-                    	value.append(((NamedItem)item).getName());
-                    }
-                    else {
-                        StringBuffer key = new StringBuffer("");
-                        getKey(item, key);
-                	    value.append(key.toString());
-                    }
-                }
-                else {
-                    value.append(Integer.toString(i));
-                }
-            }
-            else {
-                String label = this.labelManager.getCurrentLabel();
-
-                return getLink(super.getLinkURI(events, secure), requestParameterName, label);
+                aspectEvent = event;
             }
         }
+        return initBuffer(info, aspectEvent, secure);
+    }
 
-        if (value.length() > 0 && this.labelManager.getPageLabelEvents(value.toString()) != null) {
-            if (hasParams) {
-                buffer.append('&');
-            }
-            else {
-                buffer.append('?');
-            }
-            try {
-                buffer.append(requestParameterName).append('=')
-                      .append(NetUtils.encode(value.toString(), "utf-8"));
-            } catch (UnsupportedEncodingException uee) {
-                // ignore this as utf-8 is always supported
-            }
-
-            return buffer.toString();
+    /**
+     * Add one event to the buffer
+     *
+     * @return Returns true, if the link contains a parameter
+     */
+    protected boolean addEvent(StringBuffer buffer, Event event, boolean hasParams) {
+        if (this.labelManager != null && this.labelManager.isUrlPath() &&
+            event instanceof ChangeAspectDataEvent &&
+            ((ChangeAspectDataEvent) event).getTarget() instanceof CompositeLayout) {
+            return true;
         }
 
-        String label = this.labelManager.getCurrentLabel();
+        return super.addEvent(buffer, event, hasParams);
+    }
+
 
-        return getLink(super.getLinkURI(events), requestParameterName, label);
+    protected String processEvent(Event event, StringBuffer value) {
+        if (this.labelManager != null  &&
+            event instanceof ChangeAspectDataEvent &&
+            ((ChangeAspectDataEvent) event).getTarget() instanceof CompositeLayout) {
+            value.append(getLabel((ChangeAspectDataEvent)event));
+            return this.labelManager.getRequestParameterName();
+        }
+        return super.processEvent(event, value);
     }
 
     /* (non-Javadoc)
@@ -218,11 +155,47 @@
         super.dispose();
     }
 
-    /*
-     * Generates the page label.
-     * @param item An Item.
-     * @param key The StringBuffer in which to create the page label.
+    /**
+     * Return the current info for the request.
+     *
+     * @return A LinkInfo object.
      */
+    protected LinkInfo getInfo() {
+        if (!labelManager.isUrlPath())
+        {
+            return super.getInfo();
+        }
+        final Request request = ContextHelper.getRequest(this.context);
+        LinkInfo info = (LinkInfo) request.getAttribute(DefaultLinkService.class.getName());
+        if (info == null) {
+            synchronized (this) {
+                info = (LinkInfo) request.getAttribute(DefaultLinkService.class.getName());
+                if (info == null) {
+                    info = new PageLabelLinkInfo(labelManager, request, this.defaultPort, this.defaultSecurePort);
+                    request.setAttribute(DefaultLinkService.class.getName(), info);
+                }
+            }
+        }
+        return info;
+    }
+
+
+    private String getLabel(ChangeAspectDataEvent event) {
+        CompositeLayout layout = (CompositeLayout) event.getTarget();
+        int i = ((Integer) event.getData()).intValue();
+
+        Item item = layout.getItem(i);
+        StringBuffer key = new StringBuffer("");
+        if (item instanceof NamedItem) {
+            getKey(item, key);
+        }
+        return key.toString();
+    }
+    /*
+    * Generates the page label.
+    * @param item An Item.
+    * @param key The StringBuffer in which to create the page label.
+    */
     private void getKey(Item item, StringBuffer key) {
         CompositeLayout parentLayout = item.getParent();
         Item parentItem = parentLayout.getParent();
@@ -236,36 +209,8 @@
         }
         if (item instanceof NamedItem) {
             key.append(((NamedItem) item).getName());
-        }
-        else {
-            key.append(parentLayout.getItems().indexOf(item));
-        }
-    }
-
-    /*
-     * Append the page label to the link.
-     * @param link The link to add the label to.
-     * @param parmName The request parameter name.
-     * @param label The page label.
-     * @return The modified link.
-     */
-    private String getLink(String link, String parmName, String label)
-    {
-        if (label == null) {
-            return link;
-        }
-        StringBuffer uri = new StringBuffer(link);
-        if (link.indexOf('?') >= 0) {
-            uri.append('&');
         } else {
-            uri.append('?');
-        }
-        try {
-            String encodedLabel = NetUtils.encode(label, "utf-8");
-            uri.append(parmName).append('=').append(encodedLabel);
-        } catch (UnsupportedEncodingException uee) {
-            // ignore this as utf-8 is always supported
+            key.append(parentLayout.getItems().indexOf(item));
         }
-        return uri.toString();
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelManager.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelManager.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelManager.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelManager.java Mon May 15 21:57:09 2006
@@ -28,6 +28,7 @@
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.avalon.framework.CascadingRuntimeException;
+import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.component.Component;
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
@@ -56,16 +57,21 @@
  */
 public class PageLabelManager
     extends AbstractLogEnabled
-    implements ThreadSafe, Serviceable, Configurable, Contextualizable, Component {
+    implements ThreadSafe, Serviceable, Configurable, Contextualizable, Component, Disposable {
 
     public static final String ROLE = PageLabelManager.class.getName();
 
     /** The service manager */
     protected ServiceManager manager;
+    /** The portal Service */
+    protected PortalService service;
     /** The cocoon context */
     protected Context context;
     protected String aspectName = null;
     private String requestParameterName;
+
+   //boolean to determine if page label should use directory structure
+    private boolean useUrlPath;
     private boolean nonStickyTabs;
     private boolean marshallEvents;
 
@@ -74,19 +80,28 @@
     protected static final String EVENT_MAP = PageLabelManager.class.getName() + "E";
     private static final String DEFAULT_REQUEST_PARAMETER_NAME = "pageLabel";
 
-
     /* (non-Javadoc)
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
+        this.service = (PortalService) this.manager.lookup(PortalService.ROLE);
+    }
+
+    /**
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
+    public void dispose() {
+        if (this.manager != null) {
+            this.manager.release(this.service);
+            this.manager = null;
+        }
     }
 
     /* (non-Javadoc)
     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
     */
-    public void configure(Configuration config)
-    {
+    public void configure(Configuration config) {
         this.requestParameterName =
             config.getChild("parameterName").getValue(DEFAULT_REQUEST_PARAMETER_NAME);
         this.aspectName = config.getChild("aspectName").getValue("tab");
@@ -94,6 +109,8 @@
             Boolean.valueOf(config.getChild("nonStickyTabs").getValue("false")).booleanValue();
         this.marshallEvents =
             Boolean.valueOf(config.getChild("marshallEvents").getValue("false")).booleanValue();
+        this.useUrlPath =
+            Boolean.valueOf(config.getChild("urlPath").getValue("false")).booleanValue();
     }
 
     /* (non-Javadoc)
@@ -130,7 +147,16 @@
     public String  setCurrentLabel() {
         final Request request =
             ObjectModelHelper.getRequest(ContextHelper.getObjectModel(this.context));
-        String value = request.getParameter(this.requestParameterName);
+        String value;
+        if (this.useUrlPath) {
+            value = request.getSitemapURI();
+            if (!isLabel(value)) {
+                value = null;
+            }
+        } else {
+            value = request.getParameter(this.requestParameterName);
+        }
+
         String[] labels = getLabels();
 
         if (value != null) {
@@ -141,6 +167,14 @@
     }
 
     /**
+     * Returns whether directory structure should be used
+     * @return A boolean specifying if directory structure should be used.
+     */
+    public boolean isUrlPath() {
+        return this.useUrlPath;
+    }
+
+    /**
      * Returns the request parameter being used to identify the page label.
      * @return A String containing the request parameter name used for page labels.
      */
@@ -148,7 +182,6 @@
         return this.requestParameterName;
     }
 
-
     /**
      * Return the Map that contains events for all the page labels.
      * @return The Map to use for converting events to and from urls.
@@ -208,6 +241,30 @@
         }
     }
 
+    public boolean isLabel(String pageLabel) {
+        PortalService service = null;
+        try
+        {
+            service = (PortalService) this.manager.lookup(PortalService.ROLE);
+            Map map = (Map) service.getAttribute(LABEL_MAP);
+            if (null == map)
+            {
+                map = initializeLabels(service);
+                service.setAttribute(LABEL_MAP, map);
+            }
+
+            return map.containsKey(pageLabel);
+        }
+        catch (ServiceException ce)
+        {
+            throw new CascadingRuntimeException("Unable to lookup component.", ce);
+        }
+        finally
+        {
+            this.manager.release(service);
+        }
+    }
+
     /**
      * Returns true if events are not to be exposed as request parameters
      */
@@ -225,6 +282,7 @@
             String[] labels = (String[]) service.getAttribute(LABEL_ARRAY);
             if (null == labels) {
                 labels = new String[2];
+                labels[0] = getRoot();
                 service.setAttribute(LABEL_ARRAY, labels);
             }
             return labels;
@@ -259,6 +317,37 @@
         return map;
     }
 
+    private String getRoot() {
+        Layout portalLayout = service.getEntryLayout(null);
+        if (portalLayout == null) {
+            portalLayout =
+                service.getComponentManager().getProfileManager().getPortalLayout(null, null);
+        }
+
+        if (portalLayout instanceof CompositeLayout) {
+            return getRoot((CompositeLayout)portalLayout, new StringBuffer(""));
+        }
+        return "";
+    }
+
+    private String getRoot(CompositeLayout layout, StringBuffer root) {
+        for (int j=0; j < layout.getSize(); j++) {
+            Item tab = layout.getItem(j);
+            if (tab instanceof NamedItem) {
+                if (root.length() > 0) {
+                    root.append(".");
+                }
+                root.append(((NamedItem)tab).getName());
+                Layout child = tab.getLayout();
+                if (child != null && child instanceof CompositeLayout) {
+                    getRoot((CompositeLayout)child, root);
+                }
+                break;
+            }
+        }
+        return root.toString();
+    }
+
 
     /**
      * Populate the event map
@@ -290,14 +379,10 @@
             if (this.nonStickyTabs) {
                 // With non-sticky tabs the non-leaf nodes always display
                 // the left-most child tabs
-                if (lhList == null)
-                {
-                    if (allEvents != null)
-                    {
+                if (lhList == null) {
+                    if (allEvents != null) {
                         lhList = allEvents;
-                    }
-                    else
-                    {
+                    } else {
                         lhList = events;
                     }
                 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java Mon May 15 21:57:09 2006
@@ -265,10 +265,14 @@
 
     private String encodeParameterValues(String[] paramValues) {
         StringBuffer returnvalue = new StringBuffer(100);
-        returnvalue.append(paramValues.length);
-        for (int i = 0; i < paramValues.length; i++) {
-            returnvalue.append("_");
-            returnvalue.append(encodeValue(paramValues[i]));
+        if (paramValues == null) {
+            returnvalue.append("0");
+        } else {
+            returnvalue.append(paramValues.length);
+            for (int i = 0; i < paramValues.length; i++) {
+                returnvalue.append("_");
+                returnvalue.append(encodeValue(paramValues[i]));
+            }
         }
         return returnvalue.toString();
     }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap Mon May 15 21:57:09 2006
@@ -82,6 +82,30 @@
     </map:actions>
   </map:components>
 
+  <map:resources>
+    <map:resource name="show-portal">
+      <map:act type="cowarp-is-logged-in">
+        <map:parameter name="application" value="portal"/>
+
+        <map:generate type="portal" label="content"/>
+        <map:transform src="{portal-skin:skin.basepath}/styles/portal-page.xsl">
+          <map:parameter name="user" value="{ID}"/>
+          <map:parameter name="title" value="{global:mainTitle}"/>
+          <map:parameter name="base" value="{portalpath:relative}"/>
+        </map:transform>
+        <map:transform type="cinclude"/>
+        <map:transform type="portal-coplet"/>
+        <map:transform type="portal-new-eventlink"/>
+        <map:transform type="encodeURL"/>
+        <!--
+        <map:transform type="htmlroot" />
+        -->
+        <!-- If you don't need JSR-168 support, you can use the html serializer instead -->
+        <map:serialize type="html-include"/>
+      </map:act>
+    </map:resource>
+  </map:resources>
+
   <!-- =========================== Views =================================== -->
 
   <map:views>
@@ -200,25 +224,7 @@
 
       <!-- Test pipeline for portal engine -->
       <map:match pattern="portal">
-        <map:act type="cowarp-is-logged-in">
-          <map:parameter name="application" value="portal"/>
-
-          <map:generate type="portal" label="content"/>
-          <map:transform src="{portal-skin:skin.basepath}/styles/portal-page.xsl">
-            <map:parameter name="user" value="{ID}"/>
-            <map:parameter name="title" value="{global:mainTitle}"/>
-            <map:parameter name="base" value="{portalpath:relative}"/>
-          </map:transform>
-          <map:transform type="cinclude"/>
-          <map:transform type="portal-coplet"/>
-          <map:transform type="portal-new-eventlink"/>
-          <map:transform type="encodeURL"/>
-          <!--
-          <map:transform type="htmlroot" />
-          -->
-          <!-- If you don't need JSR-168 support, you can use the html serializer instead -->
-          <map:serialize type="html-include"/>
-        </map:act>
+        <map:call resource="show-portal"/>
       </map:match>
 
       <!-- Test pipeline for bookmark -->
@@ -301,14 +307,19 @@
             <map:act type="portal-save-profile"/>
 -->
           <map:act type="cowarp-logout">
-		    <map:parameter name="application" value="portal"/>
-        </map:act>
+		        <map:parameter name="application" value="portal"/>
+          </map:act>
         </map:act>
         <!-- TODO logout page -->
-        <map:redirect-to uri="login"/>
+        <map:redirect-to uri="portal"/>
+      </map:match>
+
+      <!-- Test pipeline for portal engine -->
+      <map:match pattern="*">
+        <map:call resource="show-portal"/>
       </map:match>
       
-      	<!-- ==== P O R T A L   T O O L S ==== -->
+        <!-- ==== P O R T A L   T O O L S ==== -->
 	
 	<!-- mount sitemap of the portal tools -->
 	<map:match pattern="tools/**"> 
@@ -326,6 +337,12 @@
 	<map:match pattern="userImages/*.jpg">
 		<map:read mime-type="image/jpg" src="tools/plugins/userManagement/userImages/{1}.jpg"/>
 	</map:match>
+
+
+      <!-- process page labels -->
+      <map:match pattern="*">
+        <map:call resource="show-portal"/>
+      </map:match>
 
       <!-- Everything else redirect to the portal -->
       <map:match pattern="**">

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java Mon May 15 21:57:09 2006
@@ -52,6 +52,7 @@
 import org.apache.cocoon.util.Deprecation;
 import org.apache.cocoon.util.SimpleSourceResolver;
 import org.apache.cocoon.util.Settings;
+import org.apache.cocoon.util.PropertySettings;
 import org.apache.cocoon.util.SettingsHelper;
 import org.apache.cocoon.util.location.Location;
 import org.apache.cocoon.util.location.LocationImpl;
@@ -74,6 +75,7 @@
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Map;
+import java.util.ConcurrentModificationException;
 
 /**
  * The Cocoon Object is the main Kernel for the entire Cocoon system.
@@ -120,12 +122,12 @@
                     return result;
                 }
             }
-            
+
             if (obj instanceof Exception) {
                 // Many exceptions in Cocoon have a message like "blah blah at file://foo/bar.xml:12:1"
                 String msg = ((Exception)obj).getMessage();
                 if (msg == null) return null;
-                
+
                 int pos = msg.lastIndexOf(" at ");
                 if (pos != -1) {
                     return LocationUtils.parse(msg.substring(pos + 4));
@@ -134,16 +136,16 @@
                     return null;
                 }
             }
-            
+
             // Try next finders.
             return null;
         }
     };
-    
+
     static {
         LocationUtils.addFinder(confLocFinder);
     }
-    
+
     static Cocoon instance;
 
     /** The root Cocoon logger */
@@ -602,6 +604,7 @@
                     msg.append(", ");
                 }
             }
+
             msg.append("'").append(lineSeparator);
         }
 
@@ -630,17 +633,27 @@
 
         // log all of the session attributes
         if (session != null) {
-            // Fix bug #12139: Session can be modified while still
-            // being enumerated here
-            synchronized (session) {
-                e = session.getAttributeNames();
-                while (e.hasMoreElements()) {
-                    String p = (String) e.nextElement();
-                    msg.append("PARAM: '").append(p).append("' ")
+            StringBuffer buffer = new StringBuffer("");
+            int count = -1;
+            while (count <= 0) {
+                // Fix bug #12139: Session can be modified while still
+                // being enumerated here
+                try {
+                    e = session.getAttributeNames();
+                    while (e.hasMoreElements()) {
+                        String p = (String) e.nextElement();
+                        buffer.append("PARAM: '").append(p).append("' ")
                        .append("VALUE: '").append(session.getAttribute(p)).append("'")
                        .append(lineSeparator);
+                    }
+                    break;
+                } catch (ConcurrentModificationException ex) {
+                    buffer = new StringBuffer("");
+                    ++count;
                 }
+
             }
+            msg.append(buffer.toString());
         }
 
         getLogger().debug(msg.toString());

Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/properties/core.properties
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/properties/core.properties?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/properties/core.properties (original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/properties/core.properties Mon May 15 21:57:09 2006
@@ -15,6 +15,8 @@
 xml-deserializer.pool-max = 32
 # sitemap variables
 
+sitemap-mount.check-reload = yes
+
 #  Generators
 file-generator.pool-max = 16
 directory-generator.pool-max = 16
@@ -29,6 +31,7 @@
 include-transformer.pool-max = 16
 xinclude-transformer.pool-max = 16
 cinclude-transformer.pool-max = 16
+encodeurl-transformer.pool-max = 0
 log-transformer.pool-max = 16
 jx-transformer.pool-max = 16
 
@@ -41,4 +44,8 @@
 resource-reader.pool-max = 32
 
 #  Pipelines
+caching-pipeline.pool-max = 0
+caching-point-pipeline.pool-max = 0
+noncaching-pipeline.pool-max = 0
+expires-pipeline.pool-max = 0
 expires-pipeline.cache-expires = 180

Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap (original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap Mon May 15 21:57:09 2006
@@ -122,7 +122,7 @@
     <map:transformer logger="sitemap.transformer.include" name="include" pool-max="${include-transformer.pool-max}" src="org.apache.cocoon.transformation.IncludeTransformer"/>
     <map:transformer logger="sitemap.transformer.xinclude" name="xinclude" pool-max="${xinclude-transformer.pool-max}" src="org.apache.cocoon.transformation.XIncludeTransformer"/>
     <map:transformer logger="sitemap.transformer.cinclude" name="cinclude" pool-max="${cinclude-transformer.pool-max}" src="org.apache.cocoon.transformation.CIncludeTransformer"/>
-    <map:transformer logger="sitemap.transformer.encodeURL" name="encodeURL" src="org.apache.cocoon.transformation.EncodeURLTransformer"/>
+    <map:transformer logger="sitemap.transformer.encodeURL" name="encodeURL" pool-max="${encodeurl-transformer.pool-max}" src="org.apache.cocoon.transformation.EncodeURLTransformer"/>
     <map:transformer logger="sitemap.transformer.write-source" name="write-source" src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
     <map:transformer logger="sitemap.transformer.jpath" name="jpath" src="org.apache.cocoon.transformation.JPathTransformer"/>
     <map:transformer logger="sitemap.transformer.filter" name="filter" src="org.apache.cocoon.transformation.FilterTransformer"/>
@@ -404,7 +404,8 @@
       | cache points.
       +-->
    <map:pipes default="caching">
-     <map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline">
+     <map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"
+               pool-max="${caching-pipeline.pool-max}">
        <!--+
            | If not specified, the value of the outputBufferSize parameter is -1.
            | This will cause Cocoon to buffer all output until processing has finished
@@ -420,18 +421,21 @@
            +-->
        <!-- parameter name="outputBufferSize" value="8192"/ -->
      </map:pipe>
-     <map:pipe name="caching-point" src="org.apache.cocoon.components.pipeline.impl.CachingPointProcessingPipeline">
+     <map:pipe name="caching-point" src="org.apache.cocoon.components.pipeline.impl.CachingPointProcessingPipeline"
+               pool-max="${caching-point-pipeline.pool-max">
        <!-- parameter name="autoCachingPoint" value="On"/ -->
        <!-- parameter name="outputBufferSize" value="8192"/ -->
      </map:pipe>
-     <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
+     <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline"
+               pool-max="${noncaching-pipeline.pool-max}">
        <!-- parameter name="outputBufferSize" value="8192"/ -->
      </map:pipe>
      <!--+
          | This pipeline implementation caches the complete content for a defined
          | period of time (expires). The cache key is the current uri.
          +-->
-     <map:pipe name="expires" src="org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline">
+     <map:pipe name="expires" src="org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline"
+               pool-max="${expires-pipeline.pool-max}">
        <parameter name="cache-expires" value="${expires-pipeline.cache-expires}"/> <!-- Expires in secondes -->
      </map:pipe>
    </map:pipes>
@@ -691,7 +695,7 @@
         | in the requested folder.
         +-->
     <map:match pattern="*/**">
-      <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
+      <map:mount check-reload="${sitemap-mount.check-reload}" src="{1}/" uri-prefix="{1}"/>
     </map:match>
 
     <!--+

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=406833&r1=406832&r2=406833&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Mon May 15 21:57:09 2006
@@ -182,6 +182,14 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.10" date="TBD">
+    <action dev="RG" type="update">
+      Portal: PageLabels can now be configured to be part of the url.
+    </action>
+    <action dev="RG" type="update">
+      Made the pool-max values in the html block's generators externally configurable. Made sitemap
+      reloading externally configurable. Made pipeline amd encodeURLTransformer pool-max values
+      externally configurable.
+    </action>
     <action dev="BRD" type="fix">
       CForms/Ajax: when the Ajax-update contained an empty textarea, IE failed to parse this correctly,
       displaying '&lt;/span>&lt;/div>' in the textarea. Fixed by adding an explicit closing tag for



Mime
View raw message