Author: cziegeler
Date: Fri Jan  7 03:01:03 2005
New Revision: 124479

URL: http://svn.apache.org/viewcvs?view=rev&rev=124479
Log:
Fix some minor bugs and cleanup portal name handling
Added:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java
   (contents, props changed)
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java
   (contents, props changed)
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java
   (contents, props changed)
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/skins/basic/thumb.jpg 
  (contents, props changed)
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/skins/common/thumb.jpg   
(contents, props changed)
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/modules.xconf
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LoginAction.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LogoutAction.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceInfo.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/login/sitemap.xmap
   cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf&r2=124479
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf 
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf 
Fri Jan  7 03:01:03 2005
@@ -26,10 +26,10 @@
    <!-- These are the skins the user can choose from: -->
    <skins>
      <skin name="basic" 
base-path="context://samples/blocks/portal/skins/basic">
-       <thumbnail-path>images/thumbnail.jpg</thumbnail-path>
+       <thumbnail-path>images/thumb.jpg</thumbnail-path>
      </skin>
      <skin name="common" 
base-path="context://samples/blocks/portal/skins/common">
-       <thumbnail-path>images/thumbnail.jpg</thumbnail-path>
+       <thumbnail-path>images/thumb.jpg</thumbnail-path>
      </skin>
    </skins>
  </portal>

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/modules.xconf
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/modules.xconf?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/modules.xconf&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/modules.xconf&r2=124479
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/modules.xconf   
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/modules.xconf   Fri Jan 
 7 03:01:03 2005
@@ -19,5 +19,6 @@
 
       <component-instance logger="core.modules.input" name="coplet" 
class="org.apache.cocoon.portal.components.modules.input.CopletModule"/>
       <component-instance logger="core.modules.input" name="portal-layout" 
class="org.apache.cocoon.portal.components.modules.input.LayoutModule"/>
+      <component-instance logger="core.modules.input" name="portal-skin" 
class="org.apache.cocoon.portal.components.modules.input.SkinModule"/>
 
-</xconf>
\ No newline at end of file
+</xconf>

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?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/portal.samplesxconf&r2=124479
==============================================================================
--- 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     
Fri Jan  7 03:01:03 2005
@@ -31,7 +31,7 @@
      <renderer name="column" 
class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" 
logger="portal" >
          <aspects>
              <aspect type="xslt">
-                 <parameter name="style" 
value="{global:skin}styles/column.xsl"/>
+                 <parameter name="style" 
value="{portal-skin:skin.basepath}/styles/column.xsl"/>
              </aspect>
              <aspect type="parameter">
                  <parameter name="tag-name" value="column-layout"/>
@@ -44,7 +44,7 @@
      <renderer name="row" 
class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" 
logger="portal" >
          <aspects>
              <aspect type="xslt">
-                 <parameter name="style" value="{global:skin}styles/row.xsl"/>
+                 <parameter name="style" 
value="{portal-skin:skin.basepath}/styles/row.xsl"/>
              </aspect>
              <aspect type="parameter">
                  <parameter name="tag-name" value="row-layout"/>
@@ -57,7 +57,7 @@
      <renderer name="tab" 
class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" 
logger="portal" >
          <aspects>
              <aspect type="xslt">
-                 <parameter name="style" value="{global:skin}styles/tab.xsl"/>
+                 <parameter name="style" 
value="{portal-skin:skin.basepath}/styles/tab.xsl"/>
              </aspect>
              <aspect type="parameter">
                  <parameter name="tag-name" value="tab-layout"/>
@@ -84,7 +84,7 @@
      <renderer name="linktab" 
class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" 
logger="portal">
          <aspects>
              <aspect type="xslt">
-                 <parameter name="style" 
value="{global:skin}styles/linktab.xsl"/>
+                 <parameter name="style" 
value="{portal-skin:skin.basepath}/styles/linktab.xsl"/>
              </aspect>
              <aspect type="parameter">
                  <parameter name="tag-name" value="linktab-layout"/>
@@ -99,7 +99,7 @@
      <renderer name="window" 
class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" 
logger="portal" >
          <aspects>
              <aspect type="xslt">
-                 <parameter name="style" 
value="{global:skin}styles/window.xsl"/>
+                 <parameter name="style" 
value="{portal-skin:skin.basepath}/styles/window.xsl"/>
              </aspect>
              <aspect type="parameter">
                  <parameter name="tag-name" value="window"/>
@@ -133,7 +133,7 @@
                logger="portal">
          <aspects>
              <aspect type="xslt">
-                 <parameter name="style" 
value="{global:skin}styles/window.xsl"/>
+                 <parameter name="style" 
value="{portal-skin:skin.basepath}/styles/window.xsl"/>
              </aspect>
              <aspect type="parameter">
                  <parameter name="tag-name" value="window"/>
@@ -153,7 +153,7 @@
      <renderer name="decorated-frame" 
class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" 
logger="portal">
          <aspects>
             <aspect type="xslt">
-                <parameter name="style" value="{global:skin}styles/frame.xsl"/>
+                <parameter name="style" 
value="{portal-skin:skin.basepath}/styles/frame.xsl"/>
             </aspect>
             <aspect type="parameter">
                 <parameter name="tag-name" value="frame"/>

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java
     (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/BookmarkAction.java
     Fri Jan  7 03:01:03 2005
@@ -172,7 +172,6 @@
         PortalService service = null;
         try {
             service = (PortalService)this.manager.lookup(PortalService.ROLE);
-            service.setPortalName(par.getParameter("portal-name"));
 
             PortalManager portalManager = null;
             try {
@@ -220,8 +219,6 @@
             result = new HashMap();
             result.put("uri", uri.substring(uri.indexOf('?')+1));
 
-        } catch (ParameterException pe) {
-            throw new ProcessingException("Parameter portal-name is 
required.");
         } catch (ServiceException ce) {
             throw new ProcessingException("Unable to lookup portal service.", 
ce);
         } finally {

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
        (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
        Fri Jan  7 03:01:03 2005
@@ -57,9 +57,6 @@
                 copletId = (String)context.get(Constants.COPLET_ID_KEY);
             } else {
                 copletId = (String)objectModel.get(Constants.COPLET_ID_KEY);
-            
-                // set portal name
-                
portalService.setPortalName((String)objectModel.get(Constants.PORTAL_NAME_KEY));
             }
         
             if (copletId == null) {

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LoginAction.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LoginAction.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LoginAction.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LoginAction.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LoginAction.java
        (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LoginAction.java
        Fri Jan  7 03:01:03 2005
@@ -17,7 +17,6 @@
 
 import java.util.Map;
 
-import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.thread.ThreadSafe;
@@ -31,7 +30,7 @@
  * This action logs the user into the portal
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Id: LoginAction.java,v 1.5 2004/03/15 18:18:19 cziegeler Exp $
+ * @version CVS $Id$
 */
 public final class LoginAction
 extends ServiceableAction
@@ -56,10 +55,7 @@
         PortalService service = null;
         try {
             service = (PortalService)this.manager.lookup(PortalService.ROLE);
-            service.setPortalName(par.getParameter("portal-name"));
             service.getComponentManager().getProfileManager().login();
-        } catch (ParameterException pe) {
-            throw new ProcessingException("Parameter portal-name is 
required.");
         } catch (ServiceException ce) {
             throw new ProcessingException("Unable to lookup portal service.", 
ce);
         } finally {

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LogoutAction.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LogoutAction.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LogoutAction.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LogoutAction.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LogoutAction.java
       (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/LogoutAction.java
       Fri Jan  7 03:01:03 2005
@@ -17,7 +17,6 @@
 
 import java.util.Map;
 
-import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.thread.ThreadSafe;
@@ -31,7 +30,7 @@
  *  This action logs the current user out of the portal
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Id: LogoutAction.java,v 1.5 2004/03/15 18:18:19 cziegeler Exp 
$
+ * @version CVS $Id$
 */
 public final class LogoutAction
 extends ServiceableAction
@@ -56,10 +55,7 @@
         PortalService service = null;
         try {
             service = (PortalService)this.manager.lookup(PortalService.ROLE);
-            service.setPortalName(par.getParameter("portal-name"));
             service.getComponentManager().getProfileManager().logout();
-        } catch (ParameterException pe) {
-            throw new ProcessingException("Parameter portal-name is 
required.");
         } catch (ServiceException ce) {
             throw new ProcessingException("Unable to lookup portal service.", 
ce);
         } finally {

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java?view=auto&rev=124479
==============================================================================
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/PreparePortalAction.java
        Fri Jan  7 03:01:03 2005
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+package org.apache.cocoon.portal.acting;
+
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.acting.ServiceableAction;
+import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.portal.Constants;
+import org.apache.cocoon.portal.PortalService;
+
+/**
+ * Prepare the portal by setting the portal name
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
+ * @version CVS $Id: PreparePortalAction.java,v 1.1 2005/01/07 10:21:45 
cziegeler Exp $
+ */
+public class PreparePortalAction 
+extends ServiceableAction {
+
+       /* (non-Javadoc)
+        * @see 
org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, 
org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, 
org.apache.avalon.framework.parameters.Parameters)
+        */
+       public Map act(Redirector redirector, SourceResolver resolver, Map 
objectModel, String source, Parameters parameters) 
+    throws Exception {
+        PortalService portalService = null;
+        try {
+
+            portalService = 
(PortalService)this.manager.lookup(PortalService.ROLE);
+
+            if ( portalService.getPortalName() == null ) {
+                final String portalName = 
parameters.getParameter("portal-name",
+                                              
(String)objectModel.get(Constants.PORTAL_NAME_KEY));
+                portalService.setPortalName(portalName);
+            }
+            return EMPTY_MAP;
+        
+        } catch (ServiceException e) {
+            throw new ProcessingException("Unable to lookup portal service.", 
e);
+        } finally {
+            this.manager.release(portalService);
+        }
+       }
+}

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/acting/SaveAction.java
 Fri Jan  7 03:01:03 2005
@@ -17,7 +17,6 @@
 
 import java.util.Map;
 
-import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.thread.ThreadSafe;
@@ -56,10 +55,7 @@
         PortalService service = null;
         try {
             service = (PortalService)this.manager.lookup(PortalService.ROLE);
-            service.setPortalName(par.getParameter("portal-name"));
             
service.getComponentManager().getProfileManager().saveUserProfiles(null);
-        } catch (ParameterException pe) {
-            throw new ProcessingException("Parameter portal-name is 
required.");
         } catch (ServiceException ce) {
             throw new ProcessingException("Unable to lookup portal service.", 
ce);
         } finally {

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java?view=auto&rev=124479
==============================================================================
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java
   Fri Jan  7 03:01:03 2005
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+package org.apache.cocoon.portal.components.modules.input;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.components.modules.input.InputModule;
+
+/**
+ * @version CVS $Id: AbstractModule.java,v 1.1 2005/01/07 09:14:02 cziegeler 
Exp $
+ */
+public abstract class AbstractModule 
+implements InputModule, Serviceable, ThreadSafe {
+    
+    /**
+     * The service manager.
+     */
+    protected ServiceManager manager;
+    
+    /* (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;
+    }
+
+       /* (non-Javadoc)
+        * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttributeNames(org.apache.avalon.framework.configuration.Configuration,
 java.util.Map)
+        */
+       public Iterator getAttributeNames(Configuration modeConf, Map 
objectModel) {
+        return Collections.EMPTY_LIST.iterator();
+       }
+
+       /* (non-Javadoc)
+        * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttributeValues(java.lang.String,
 org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+        */
+       public Object[] getAttributeValues(String name, Configuration modeConf, 
Map objectModel)
+    throws ConfigurationException {
+        Object[] result = new Object[1];
+        result[0] = this.getAttribute(name, modeConf, objectModel);
+        return result;
+       }
+}

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java
     (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java
     Fri Jan  7 03:01:03 2005
@@ -15,17 +15,11 @@
  */
 package org.apache.cocoon.portal.components.modules.input;
 
-import java.util.Collections;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
-import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.cocoon.components.modules.input.InputModule;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.PortalService;
@@ -64,24 +58,12 @@
  * @version CVS $Id$
  */
 public class CopletModule 
-implements InputModule, Serviceable, ThreadSafe {
-    
-    /**
-     * The component manager.
-     */
-    private ServiceManager manager;
+extends AbstractModule {
     
     /* (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;
-    }
-
-    /**
-     * Overridden from superclass.
+     * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
 org.apache.avalon.framework.configuration.Configuration, java.util.Map)
      */
-       public Object getAttribute(String name, Configuration modeConf, Map 
objectModel) 
+    public Object getAttribute(String name, Configuration modeConf, Map 
objectModel) 
     throws ConfigurationException {
         PortalService portalService = null;
         try {
@@ -95,11 +77,6 @@
                 copletId = (String)context.get(Constants.COPLET_ID_KEY);
             } else {
                 copletId = (String)objectModel.get(Constants.COPLET_ID_KEY);
-                
-                if ( copletId != null ) {
-                    // set portal name
-                    
portalService.setPortalName((String)objectModel.get(Constants.PORTAL_NAME_KEY));
                    
-                }
             }
             
             if (copletId == null) {
@@ -124,22 +101,6 @@
         } finally {
             this.manager.release(portalService);
         }
-       }
-
-    /**
-     * Overridden from superclass.
-     */
-       public Iterator getAttributeNames(Configuration modeConf, Map 
objectModel) {
-        return Collections.EMPTY_LIST.iterator();
-       }
+    }
 
-    /**
-     * Overridden from superclass.
-     */
-       public Object[] getAttributeValues(String name, Configuration modeConf, 
Map objectModel)
-    throws ConfigurationException {
-        Object[] result = new Object[1];
-        result[0] = this.getAttribute(name, modeConf, objectModel);
-        return result;
-       }
 }

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
     (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
     Fri Jan  7 03:01:03 2005
@@ -15,19 +15,12 @@
  */
 package org.apache.cocoon.portal.components.modules.input;
 
-import java.util.Collections;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
-import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.cocoon.components.modules.input.InputModule;
 import org.apache.cocoon.environment.ObjectModelHelper;
-import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.commons.jxpath.JXPathContext;
 
@@ -40,24 +33,12 @@
  * @version CVS $Id$
  */
 public class LayoutModule 
-implements InputModule, Serviceable, ThreadSafe {
-    
-    /**
-     * The component manager.
-     */
-    private ServiceManager manager;
+extends AbstractModule {
     
     /* (non-Javadoc)
-     * @see 
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+     * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
 org.apache.avalon.framework.configuration.Configuration, java.util.Map)
      */
-    public void service(ServiceManager manager) throws ServiceException {
-        this.manager = manager;
-    }
-
-       /* (non-Javadoc)
-        * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
 org.apache.avalon.framework.configuration.Configuration, java.util.Map)
-        */
-       public Object getAttribute(String name, Configuration modeConf, Map 
objectModel) 
+    public Object getAttribute(String name, Configuration modeConf, Map 
objectModel) 
     throws ConfigurationException {
         PortalService portalService = null;
         try {
@@ -66,10 +47,6 @@
 
             // are we running inside a coplet?
             final Map context = 
(Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
-            if (context == null) {
-                // set portal name
-                
portalService.setPortalName((String)objectModel.get(Constants.PORTAL_NAME_KEY));
-            }
             
             int pos = name.indexOf('/');
             String path;
@@ -102,23 +79,6 @@
         } finally {
             this.manager.release(portalService);
         }
-       }
-
-       /* (non-Javadoc)
-        * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttributeNames(org.apache.avalon.framework.configuration.Configuration,
 java.util.Map)
-        */
-       public Iterator getAttributeNames(Configuration modeConf, Map 
objectModel) {
-        return Collections.EMPTY_LIST.iterator();
-       }
-
+    }
 
-    /* (non-Javadoc)
-     * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttributeValues(java.lang.String,
 org.apache.avalon.framework.configuration.Configuration, java.util.Map)
-     */
-    public Object[] getAttributeValues(String name, Configuration modeConf, 
Map objectModel)
-    throws ConfigurationException {
-        Object[] result = new Object[1];
-        result[0] = this.getAttribute(name, modeConf, objectModel);
-        return result;
-       }
 }

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java?view=auto&rev=124479
==============================================================================
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java
       Fri Jan  7 03:01:03 2005
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+package org.apache.cocoon.portal.components.modules.input;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceSelector;
+import org.apache.cocoon.components.modules.input.InputModule;
+import org.apache.cocoon.portal.PortalService;
+import org.apache.cocoon.portal.layout.SkinDescription;
+
+/**
+ * FIXME We can use the module chaining!
+ * 
+ * @version CVS $Id: SkinModule.java,v 1.4 2005/01/07 10:21:46 cziegeler Exp $
+ */
+public class SkinModule 
+extends AbstractModule
+implements Disposable {
+    
+    protected InputModule globalModule;
+    protected ServiceSelector moduleSelector;
+    
+    /* (non-Javadoc)
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
+    public void dispose() {
+        if ( this.manager != null ) {
+            if ( this.moduleSelector != null ) {
+                this.moduleSelector.release(this.globalModule);
+                this.manager.release(this.moduleSelector);
+                this.moduleSelector = null;
+                this.globalModule = null;
+            }
+        }
+    }
+    
+    /* (non-Javadoc)
+        * @see 
org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
 org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+        */
+       public Object getAttribute(String name, Configuration modeConf, Map 
objectModel) 
+    throws ConfigurationException {
+        if ( "skin".equals(name) ) {
+            return "common";
+        } else if ( "skin.basepath".equals(name) ) {
+            return "context://samples/blocks/portal/skins/common";
+        } else if ( "skin.thumbnailpath".equals(name) ) {
+            return "thumbnail.jpg";
+        }
+
+        // lazy init
+        if ( this.moduleSelector == null ) {
+            synchronized ( this ) {
+                try {
+                    if ( this.moduleSelector == null ) {
+                        this.moduleSelector = 
(ServiceSelector)this.manager.lookup(InputModule.ROLE+"Selector");
+                        this.globalModule = 
(InputModule)this.moduleSelector.select("global");
+                    }
+                } catch (ServiceException e) {
+                    throw new ConfigurationException("Unable to lookup input 
module.", e);
+                }
+            }
+        }
+            
+        PortalService portalService = null;
+        try {
+
+            portalService = 
(PortalService)this.manager.lookup(PortalService.ROLE);
+
+            // get the current skin
+            // TODO
+            String skinName = (String)this.globalModule.getAttribute("skin", 
modeConf, objectModel);
+            if ( skinName == null ) {
+                skinName = "basic";
+            }
+            
+            // find the correct skin
+            SkinDescription desc = null;
+            final Iterator i = portalService.getSkinDescriptions().iterator();
+            while ( i.hasNext() && desc == null ) {
+                final SkinDescription current = (SkinDescription)i.next();
+                if ( current.getName().equals(skinName) ) {
+                    desc = current;
+                }
+            }
+            if ( desc != null ) {
+                if ( "skin".equals(name) ) {
+                    return skinName;
+                } else if ( "skin.basepath".equals(name) ) {
+                    return desc.getBasePath();
+                } else if ( "skin.thumbnailpath".equals(name) ) {
+                    return desc.getThumbnailPath();
+                }
+            }
+            return null;
+        } catch (ServiceException e) {
+            throw new ConfigurationException("Unable to lookup portal 
service.", e);
+        } finally {
+            this.manager.release(portalService);
+        }
+       }
+
+}

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
        (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
        Fri Jan  7 03:01:03 2005
@@ -82,22 +82,6 @@
         if ( this._portalService == null ) {
             try {
                 this._portalService = 
(PortalService)this.manager.lookup(PortalService.ROLE);
-                
-                if ( this._portalService.getPortalName() == null ) {
-                    // set portal name
-                    String portalName = 
this.parameters.getParameter(PORTAL_NAME_PARAM, 
-                                                                    
(String)this.objectModel.get(Constants.PORTAL_NAME_KEY));
-                    if ( portalName == null ) {
-                        final Map context = 
(Map)this.objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
-                        if ( context != null ) {
-                            portalName = (String) 
context.get(Constants.PORTAL_NAME_KEY);
-                        }
-                    }
-                    if ( portalName == null ) {
-                        throw new SAXException("portalName must be passed as 
parameter or in the object model.");
-                    }
-                    this._portalService.setPortalName(portalName);
-                }
             } catch (ServiceException se) {
                 throw new SAXException("Unable to get portal service.", se);
             }

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java
        (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java
        Fri Jan  7 03:01:03 2005
@@ -18,7 +18,6 @@
 import java.io.IOException;
 import java.util.Map;
 
-import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.cocoon.ProcessingException;
@@ -39,7 +38,7 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
  * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
  * 
- * @version CVS $Id: PortalGenerator.java,v 1.8 2004/04/28 13:58:16 cziegeler 
Exp $
+ * @version CVS $Id$
  */
 public class PortalGenerator 
 extends ServiceableGenerator {
@@ -75,18 +74,14 @@
         super.setup(resolver, objectModel, src, par);
         
         // instantiate the portal service for this request
-        // and set the portal-name
         PortalService service = null;
         try {
             service = (PortalService)this.manager.lookup(PortalService.ROLE);
-            service.setPortalName(par.getParameter("portal-name"));
             
             // This is a fix: if we don't use the link service here, we get
             // in some rare cases a wrong uri!
             service.getComponentManager().getLinkService().getRefreshLinkURI();
             
-        } catch (ParameterException pe) {
-            throw new ProcessingException("Parameter portal-name is 
required.");
         } catch (ServiceException ce) {
             throw new ProcessingException("Unable to lookup portal service.", 
ce);
         } finally {

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
    (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
    Fri Jan  7 03:01:03 2005
@@ -207,7 +207,7 @@
                 // scan for skins
                 final List skinList = new ArrayList();
                 this.skins.put(name, skinList);
-                final Configuration[] skinConfs = 
current.getChild("skin").getChildren("skins");
+                final Configuration[] skinConfs = 
current.getChild("skins").getChildren("skin");
                 if ( skinConfs != null ) {
                     for(int s=0;s<skinConfs.length;s++) {
                         final Configuration currentSkin = skinConfs[s];
@@ -282,4 +282,4 @@
     public List getSkinDescriptions() {
         return (List)this.skins.get(this.getPortalName());
     }
-}
\ No newline at end of file
+}

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceInfo.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceInfo.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceInfo.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceInfo.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceInfo.java
    (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceInfo.java
    Fri Jan  7 03:01:03 2005
@@ -52,17 +52,18 @@
     public void setup(Map objectModel, Map managers) {
         this.objectModel = objectModel;
         this.portalComponentManagers = managers;
-               Map context = 
(Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
-               if (context != null) {
-                       String portalName = 
(String)context.get(Constants.PORTAL_NAME_KEY);
-                       if (portalName != null) {
-                this.setPortalName(portalName);
-                       } else if ( this.portalComponentManagers.size() == 1 ) {
-                // if we only have one portal, just use it
-                portalName = 
this.portalComponentManagers.keySet().iterator().next().toString();
-                this.setPortalName(portalName);
+        Map context = (Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
+        if (context != null) {
+            String pm = (String)context.get(Constants.PORTAL_NAME_KEY);
+            if (pm != null) {
+                this.setPortalName(pm);
             }
-               }
+        }
+        if ( this.portalName == null && this.portalComponentManagers.size() == 
1 ) {
+                // if we only have one portal, just use it
+            String pm = 
this.portalComponentManagers.keySet().iterator().next().toString();
+            this.setPortalName(pm);
+       }
     }
 
     public String getPortalName() {

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
  Fri Jan  7 03:01:03 2005
@@ -83,21 +83,6 @@
             try {
                 this._portalService = 
(PortalService)this.manager.lookup(PortalService.ROLE);
                 
-                if ( this._portalService.getPortalName() == null ) {
-                    // set portal name
-                    String portalName = 
this.parameters.getParameter(PORTAL_NAME_PARAM, 
-                                                                    
(String)this.objectModel.get(Constants.PORTAL_NAME_KEY));
-                    if ( portalName == null ) {
-                        final Map context = 
(Map)this.objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
-                        if ( context != null ) {
-                            portalName = (String) 
context.get(Constants.PORTAL_NAME_KEY);
-                        }
-                    }
-                    if ( portalName == null ) {
-                        throw new SAXException("portalName must be passed as 
parameter or in the object model.");
-                    }
-                    this._portalService.setPortalName(portalName);
-                }
             } catch (ServiceException se) {
                 throw new SAXException("Unable to get portal service.", se);
             }

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
   (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
   Fri Jan  7 03:01:03 2005
@@ -601,11 +601,9 @@
                                                      String copletID,
                                                      String portalName)
     throws ProcessingException {
-        // set portal name
         PortalService portalService = null;
         try {
             portalService = (PortalService) manager.lookup(PortalService.ROLE);
-            portalService.setPortalName(portalName);
                 
             ProfileManager profileManager = 
portalService.getComponentManager().getProfileManager();
             CopletInstanceData data = 
profileManager.getCopletInstanceData(copletID);
@@ -646,7 +644,6 @@
                 try {
                     copletId = parameters.getParameter(COPLET_ID_PARAM);
 
-                    
portalService.setPortalName(parameters.getParameter(PORTAL_NAME_PARAM));
                 } catch (ParameterException e) {
                     throw new ProcessingException("copletId and portalName 
must be passed as parameter or in the object model within the parent context.");
                 }

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/login/sitemap.xmap
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/login/sitemap.xmap?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/login/sitemap.xmap&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/login/sitemap.xmap&r2=124479
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/login/sitemap.xmap
   (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/login/sitemap.xmap
   Fri Jan  7 03:01:03 2005
@@ -24,8 +24,8 @@
      <!-- this is a login coplet -->
     <map:match pattern="coplet">
         <map:generate src="login.xml"/>
-        <map:transform src="../../{global:skin}styles/login-html.xsl"/>
-               <map:serialize type="xml"/>
+        <map:transform 
src="{portal-skin:skin.basepath}/styles/login-html.xsl"/>
+       <map:serialize type="xml"/>
     </map:match>
     
   </map:pipeline>

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?view=diff&rev=124479&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap&r1=124478&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/sitemap.xmap&r2=124479
==============================================================================
--- 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 Fri Jan 
 7 03:01:03 2005
@@ -59,6 +59,7 @@
       <map:action src="org.apache.cocoon.portal.acting.BookmarkAction" 
name="portal-bookmark">
         <parameter name="src" value="resources/bookmarks.xml"/>
       </map:action>
+    <map:action src="org.apache.cocoon.portal.acting.PreparePortalAction" 
name="portal-prepare"/>
     </map:actions>
   </map:components>
 
@@ -107,10 +108,21 @@
 
       <!-- select skin to use -->
       <map:global-variables>
-        <skin>skins/common/</skin>
+               <skin>basic</skin>
       </map:global-variables>
+
     </map:component-configurations>
 
+  <map:pipeline>
+    <!-- This action sets the portal name for the current request and
+         initializes the portal service. So this should be the first
+         taks in every request!
+    -->
+    <map:act type="portal-prepare">
+      <map:parameter name="portal-name" value="portal"/>
+    </map:act>
+  </map:pipeline>
+  
     <!-- The internal pipelines for loading and saving -->
     <map:pipeline internal-only="true">
       <map:match pattern="sunrise-authuser">
@@ -152,15 +164,15 @@
         <map:read type="portal-proxy"/>
       </map:match>
       <map:match pattern="images/*.gif">
-        <map:read mime-type="image/gif" src="{global:skin}images/{1}.gif"/>
+        <map:read mime-type="image/gif" 
src="{portal-skin:skin.basepath}/images/{1}.gif"/>
       </map:match>
       <map:match pattern="images/*.jpg">
-        <map:read mime-type="image/jpg" src="{global:skin}images/{1}.jpg"/>
+        <map:read mime-type="image/jpg" 
src="{portal-skin:skin.basepath}/images/{1}.jpg"/>
       </map:match>
 
       <!-- Cascading Stylesheets -->
       <map:match pattern="css/*.css">
-        <map:read mime-type="text/css" src="{global:skin}css/{1}.css"/>
+        <map:read mime-type="text/css" 
src="{portal-skin:skin.basepath}/css/{1}.css"/>
       </map:match>
 
       <map:match pattern="">
@@ -196,10 +208,8 @@
           <map:parameter name="handler" value="portal-handler"/>
           <map:parameter name="application" value="portal"/>
 
-          <map:generate type="portal" label="content">
-            <map:parameter name="portal-name" value="portal" />
-          </map:generate>
-          <map:transform src="{global:skin}styles/portal-page.xsl">
+          <map:generate type="portal" label="content"/>
+          <map:transform 
src="{portal-skin:skin.basepath}/styles/portal-page.xsl">
             <map:parameter name="user" value="{ID}"/>
           </map:transform>
           <map:transform type="cinclude"/>
@@ -221,8 +231,6 @@
           <map:parameter name="application" value="portal"/>
 
           <map:act type="portal-bookmark">
-            <map:parameter name="portal-name" value="portal" />
-
             <map:redirect-to uri="portal?{uri}"/>
           </map:act>
         </map:act>
@@ -233,9 +241,7 @@
           <map:parameter name="handler" value="portal-handler"/>
           <map:parameter name="application" value="portal"/>
 
-          <map:generate type="portal" label="content">
-            <map:parameter name="portal-name" value="portal" />
-          </map:generate>
+            <map:generate type="portal" label="content"/>
           <map:serialize type="xml"/>
         </map:act>
       </map:match>
@@ -275,29 +281,27 @@
           <map:parameter name="parameter_password" 
value="{request-param:password}"/>
 
           <!-- Authentication succeeded -->
-          <map:act type="portal-login">
-            <map:parameter name="portal-name" value="portal"/>
-          </map:act>
+            <map:act type="portal-login"/>
 
           <map:redirect-to uri="{request-param:resource}"/>
+
         </map:act>
         <!-- Authentication failed -->
         <map:generate src="resources/login-error.xml"/>
-        <map:transform src="{global:skin}styles/portal-page.xsl">
+        <map:transform 
src="{portal-skin:skin.basepath}/styles/portal-page.xsl">
           <map:parameter name="user" value="anonymous"/>
         </map:transform>
         <map:transform type="encodeURL"/>
         <map:serialize/>
       </map:match>
 
-
       <map:match pattern="loggedin">
         <map:act type="auth-protect">
           <map:parameter name="handler" value="portal-handler"/>
           <map:parameter name="application" value="portal"/>
 
           <map:generate src="resources/logged-in.xml"/>
-          <map:transform src="{global:skin}styles/portal-page.xsl"/>
+          <map:transform 
src="{portal-skin:skin.basepath}/styles/portal-page.xsl"/>
           <map:transform type="encodeURL"/>
           <map:serialize/>
         </map:act>
@@ -309,13 +313,9 @@
           <map:parameter name="handler" value="portal-handler"/>
           <map:parameter name="application" value="portal"/>
 <!--
-          <map:act type="portal-save-profile">
-          <map:parameter name="portal-name" value="portal"/>
-          </map:act>
+            <map:act type="portal-save-profile"/>
 -->
-          <map:act type="portal-logout">
-            <map:parameter name="portal-name" value="portal"/>
-          </map:act>
+            <map:act type="portal-logout"/>
           <map:act type="auth-logout"/>
         </map:act>
         <!-- TODO logout page -->

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/skins/basic/thumb.jpg
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/skins/basic/thumb.jpg?view=auto&rev=124479
==============================================================================
Binary file. No diff available.

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/skins/common/thumb.jpg
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/skins/common/thumb.jpg?view=auto&rev=124479
==============================================================================
Binary file. No diff available.

Reply via email to