cziegeler    2003/12/17 07:03:28

  Modified:    src/blocks/portal/samples/profiles/copletinstancedata
                        portal.xml
               src/blocks/portal/samples/resources sunrise-user.xml
               src/blocks/portal/samples sitemap.xmap
               src/blocks/portal/java/org/apache/cocoon/portal/coplet
                        copletdata.xml
               src/blocks/portal/samples/profiles/copletdata portal.xml
               src/blocks/portal/samples/coplets sitemap.xmap
               src/blocks/portal/samples/news/content/xdocs
                        portal-intro.xml
               src/blocks/portal/java/org/apache/cocoon/portal/profile/impl
                        AbstractProfileManager.java
                        AbstractUserProfileManager.java
               src/blocks/portal/samples/skins/basic/styles portal-page.xsl
               src/blocks/portal/samples/profiles/layout portal.xml
               src/blocks/portal/samples/styles authenticate.xsl
               src/blocks/portal/samples/skins/common/styles
                        portal-page.xsl
  Added:       src/blocks/portal/samples/coplets/login sitemap.xmap
                        login.xml
               src/blocks/portal/samples/coplets/gallery sitemap.xmap
               src/blocks/portal/samples/news/content/xdocs portal-demo.xml
               src/blocks/portal/samples/profiles/layout
                        portal-user-anonymous.xml
  Log:
  Enhancing portal demo
  
  Revision  Changes    Path
  1.1                  
cocoon-2.1/src/blocks/portal/samples/coplets/login/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
  
  <map:pipelines>
      
    <map:pipeline>      
  
       <!-- 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:match>
      
    </map:pipeline>
  
  </map:pipelines>
  </map:sitemap>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/samples/coplets/login/login.xml
  
  Index: login.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!-- $Id: login.xml,v 1.1 2003/12/17 15:03:27 cziegeler Exp $ 
   Description: The login form for the portal
  
  -->
  
  <content>
        <form>
                <url>auth</url>
                <field name="name" type="text" length="24" description="User"/>
                <field name="password" type="password" length="10" 
description="Password"/>
        </form>
  </content>
  
  
  
  1.6       +7 -0      
cocoon-2.1/src/blocks/portal/samples/profiles/copletinstancedata/portal.xml
  
  Index: portal.xml
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/profiles/copletinstancedata/portal.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- portal.xml        11 Dec 2003 16:05:01 -0000      1.5
  +++ portal.xml        17 Dec 2003 15:03:27 -0000      1.6
  @@ -60,11 +60,18 @@
      <coplet-instance-data id="Portal-Bottom-1" name="standard">
         <coplet-data>Portal-Bottom</coplet-data>
      </coplet-instance-data>
  +   <coplet-instance-data id="Portal-Demo-1" name="standard">
  +      <coplet-data>Portal-Demo</coplet-data>
  +   </coplet-instance-data>
   
      <coplet-instance-data id="Gallery-Petstore" name="standard">
         <coplet-data>Gallery</coplet-data>
      </coplet-instance-data>
      <coplet-instance-data id="GalleryViewer-1" name="standard">
         <coplet-data>GalleryViewer</coplet-data>
  +   </coplet-instance-data>
  +
  +   <coplet-instance-data id="Login-1" name="standard">
  +      <coplet-data>Login</coplet-data>
      </coplet-instance-data>
   </coplets>
  
  
  
  1.2       +6 -29     
cocoon-2.1/src/blocks/portal/samples/resources/sunrise-user.xml
  
  Index: sunrise-user.xml
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/resources/sunrise-user.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sunrise-user.xml  19 May 2003 09:14:07 -0000      1.1
  +++ sunrise-user.xml  17 Dec 2003 15:03:27 -0000      1.2
  @@ -11,39 +11,16 @@
                        <name>cocoon</name>
                        <password>cocoon</password>
                        <role>admin</role>
  -            <title>Mr.</title>
  -                     <firstname>Walter</firstname>
  -            <lastname>Cocoon</lastname>
  -                     <company/>
  -            <street/>
  -                     <zipcode/>
  -            <city/>
  -                     <country/>
  -            <phone/>
  -            <fax/>
  -                     <email/>
  -            <bankid/>
  -                     <bankname/>
  -            <accountid/>
                </user>
                <user>
                        <name>guest</name>
               <password>guest</password>
                        <role>guest</role>
  -            <title>Mrs.</title>
  -                     <firstname>G.</firstname>
  -            <lastname>Guest</lastname>
  -                     <company>Cocoon</company>
  -            <street>Cocoon Street</street>
  -                     <zipcode>33100</zipcode>
  -            <city>Cocooncity</city>
  -                     <country>Somewhere</country>
  -            <phone/>
  -            <fax/>
  -                     <email>guest</email>
  -            <bankid/>
  -                     <bankname/>
  -            <accountid/>
  +             </user>
  +             <user>
  +                     <name>anonymous</name>
  +            <password>anonymous</password>
  +                     <role>guest</role>
                </user>
        </users>
   </authentication>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/samples/coplets/gallery/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
  
  <map:pipelines>
      
    <map:pipeline>      
  
        <map:match pattern="images/*.jpg">
        <map:read mime-type="image/jpg" src="samplepics/{1}.jpg"/>
        </map:match>
  
      <!-- this is a gallery coplet -->
      <map:match pattern="browser">
          <map:generate type="directory" 
src="{coplet:copletData/attributes/image-dir}">
              <map:parameter name="include" 
value="{coplet:copletData/attributes/image-include}"/>
          </map:generate>
          <map:transform src="dir2pic.xsl">
              <map:parameter name="dirprefix" 
value="{coplet:copletData/attributes/image-uri-prefix}"/>
          </map:transform>
          <map:transform type="xslt" src="gallery.xsl">
              <map:parameter name="pic" value="{coplet:attributes/picture}"/>
              <map:parameter name="fullscreen" 
value="{coplet:aspectDatas/fullScreen}"/>
          </map:transform>
          <map:transform type="portal-coplet"/>
          <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="viewer">
          <map:generate src="picture.xml"/>
          <map:transform type="xslt" src="picture.xsl">
              <map:parameter name="pic" value="{coplet:attributes/picture}"/>
          </map:transform>
          <map:serialize type="xml"/>
      </map:match>
  
    </map:pipeline>
  
  </map:pipelines>
  </map:sitemap>
  
  
  
  1.19      +39 -30    cocoon-2.1/src/blocks/portal/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/samples/sitemap.xmap,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- sitemap.xmap      12 Dec 2003 14:42:35 -0000      1.18
  +++ sitemap.xmap      17 Dec 2003 15:03:27 -0000      1.19
  @@ -132,8 +132,7 @@
         <map:mount check-reload="yes" src="coplets/" uri-prefix="coplets"/>
       </map:match>
   
  -    <!-- Do an auto login as guest -->
  -    <!--
  +    <!-- Do an auto login as anonymous -->
       <map:act type="auth-loggedIn">
           <map:parameter name="handler" value="portalhandler"/> 
           <map:parameter name="application" value="portal"/> 
  @@ -143,12 +142,11 @@
               <map:parameter name="handler" value="portalhandler"/>
               <map:parameter name="application" value="portal"/> 
       
  -            <map:parameter name="parameter_name" value="guest"/>
  -            <map:parameter name="parameter_password" value="guest"/>
  +            <map:parameter name="parameter_name" value="anonymous"/>
  +            <map:parameter name="parameter_password" value="anonymous"/>
            
           </map:act>
       </map:act>
  -    -->
   
       <!-- Test pipeline for layout engine -->
       <map:match pattern="portal">
  @@ -159,7 +157,9 @@
               <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:transform src="{global:skin}styles/portal-page.xsl">
  +                <map:parameter name="user" value="{ID}"/>
  +            </map:transform>
               <map:transform type="cinclude"/> 
               <map:transform type="encodeURL"/>
   <!--
  @@ -195,44 +195,53 @@
           </map:act>
       </map:match>
   
  -    <!-- authentication stuff -->
  -
  -    <map:match pattern="login">
  -        <map:act type="auth-loggedIn">
  -            <map:parameter name="handler" value="portalhandler"/> 
  -            <map:parameter name="application" value="portal"/> 
  -
  -            <map:act type="portal-login">
  -                 <map:parameter name="portal-name" value="portal"/>
  -            </map:act>
  -                        
  -            <map:redirect-to uri="portal"/>
  -        </map:act>
  -        <map:generate src="resources/login.xml"/>
  -        <map:transform src="{global:skin}styles/login-html.xsl">
  -            <map:parameter name="resource" value="{request-param:resource}"/>
  -        </map:transform>
  -        <map:transform src="{global:skin}styles/portal-page.xsl"/>
  -        <map:transform type="encodeURL"/>
  -        <map:serialize/>
  -    </map:match>
  -
  +    <!-- Authenticate a user -->
       <map:match pattern="auth">
  +        <!-- Check if we are logged in:
  +             - if we are anonymous, then logout
  +             - if we are any other use, redirect to loggedin
  +        -->
           <map:act type="auth-loggedIn">
               <map:parameter name="handler" value="portalhandler"/> 
  -            <map:redirect-to uri="loggedin"/>
  +            
  +             <map:act type="auth-protect">
  +                 <map:parameter name="handler" value="portalhandler"/> 
  +                 <map:parameter name="application" value="portal"/> 
  +
  +                     <map:select type="parameter" >
  +                             <map:parameter name="parameter-selector-test" 
value="{ID}"/>
  +                             <map:when test="anonymous">
  +                                 <map:act type="auth-logout">
  +                             <map:parameter name="handler" 
value="portalhandler"/> 
  +                                 </map:act>
  +                             </map:when>
  +                             <map:otherwise>
  +                         <map:redirect-to uri="loggedin"/>
  +                             </map:otherwise>
  +                     </map:select>
  +             </map:act>
           </map:act>
  +        
  +        <!-- Start the authentication process -->
           <map:act type="auth-login">
               <map:parameter name="handler" value="portalhandler"/>
               <map:parameter name="application" value="portal"/> 
               <map:parameter name="parameter_name" 
value="{request-param:name}"/>
               <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: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="{global:skin}styles/portal-page.xsl">
  +            <map:parameter name="user" value="anonymous"/>
  +        </map:transform>
           <map:transform type="encodeURL"/>
           <map:serialize/>
       </map:match>
  
  
  
  1.3       +13 -0     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/copletdata.xml
  
  Index: copletdata.xml
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/copletdata.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- copletdata.xml    2 Sep 2003 08:34:18 -0000       1.2
  +++ copletdata.xml    17 Dec 2003 15:03:27 -0000      1.3
  @@ -3,6 +3,9 @@
        <description>Coplet data mapping file</description>
   
        <class 
name="org.apache.cocoon.portal.aspect.impl.AbstractAspectalizable">
  +        <field name="persistentAspectDatas" 
type="org.apache.cocoon.portal.util.MapItem" collection="map" 
handler="org.apache.cocoon.portal.util.AspectDataFieldHandler">
  +            <bind-xml name="aspect"/>
  +        </field>
       </class>
   
        <class name="org.apache.cocoon.portal.factory.impl.AbstractProducible"
  @@ -47,5 +50,15 @@
                        <bind-xml name="value"/>
                </field>
        </class>
  +     <class name="org.apache.cocoon.portal.util.MapItem">
  +             <field name="key" type="java.lang.String">
  +                     <bind-xml name="name"/>
  +             </field>
  +
  +             <field name="value">
  +                     <bind-xml name="value"/>
  +             </field>
  +     </class>
  +     
   </mapping>
   
  
  
  
  1.12      +32 -6     
cocoon-2.1/src/blocks/portal/samples/profiles/copletdata/portal.xml
  
  Index: portal.xml
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/profiles/copletdata/portal.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- portal.xml        12 Dec 2003 13:46:13 -0000      1.11
  +++ portal.xml        17 Dec 2003 15:03:27 -0000      1.12
  @@ -116,7 +116,9 @@
         </attribute>
      </coplet-data>
   
  -   <!-- The portal introduction coplet -->
  +   <!-- 
  +     + The portal introduction coplet 
  +   -->
      <coplet-data id="Portal-Intro" name="standard">
         <title>Introduction</title>
         <coplet-base-data>URICoplet</coplet-base-data>
  @@ -125,6 +127,14 @@
                <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/news/portal-intro.html</value>
         </attribute>
      </coplet-data>
  +   <coplet-data id="Portal-Demo" name="standard">
  +      <title>Introduction</title>
  +      <coplet-base-data>URICoplet</coplet-base-data>
  +      <attribute>
  +             <name>uri</name>
  +             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/news/portal-demo.html</value>
  +      </attribute>
  +   </coplet-data>
      <coplet-data id="Portal-Right" name="standard">
         <title>Right</title>
         <coplet-base-data>URICoplet</coplet-base-data>
  @@ -133,7 +143,6 @@
                <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/news/portal-right.html</value>
         </attribute>
      </coplet-data>
  -
      <coplet-data id="Portal-Left" name="standard">
         <title>Left</title>
         <coplet-base-data>URICoplet</coplet-base-data>
  @@ -142,7 +151,6 @@
                <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/news/portal-left.html</value>
         </attribute>
      </coplet-data>
  -
      <coplet-data id="Portal-Bottom" name="standard">
         <title>Bottom</title>
         <coplet-base-data>URICoplet</coplet-base-data>
  @@ -152,16 +160,19 @@
         </attribute>
      </coplet-data>
   
  +   <!--
  +     +  The Gallery coplets
  +   -->
      <coplet-data id="Gallery" name="standard">
         <title>Picture Gallery</title>
         <coplet-base-data>URICoplet</coplet-base-data>
         <attribute>
                <name>uri</name>
  -             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/coplets/gallery</value>
  +             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/coplets/gallery/browser</value>
         </attribute>
         <attribute>
                <name>image-dir</name>
  -             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>gallery/samplepics</value>
  +             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>samplepics</value>
         </attribute>
         <attribute>
                <name>image-include</name>
  @@ -177,8 +188,23 @@
         <coplet-base-data>URICoplet</coplet-base-data>
         <attribute>
                <name>uri</name>
  -             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/coplets/galleryviewer</value>
  +             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/coplets/gallery/viewer</value>
         </attribute>
      </coplet-data>
   
  +   <!--
  +     +  The login coplet
  +   -->
  +   <coplet-data id="Login" name="standard">
  +      <title>Login</title>
  +      <coplet-base-data>URICoplet</coplet-base-data>
  +      <attribute>
  +             <name>uri</name>
  +             <value xsi:type="java:java.lang.String" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>cocoon:/coplets/login/coplet</value>
  +      </attribute>
  +      <aspect>
  +        <name>mandatory</name>
  +        <value xsi:type="java:java.lang.Boolean" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>true</value>
  +      </aspect>
  +   </coplet-data>
   </coplets>
  
  
  
  1.5       +6 -26     cocoon-2.1/src/blocks/portal/samples/coplets/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/coplets/sitemap.xmap,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- sitemap.xmap      12 Dec 2003 13:46:13 -0000      1.4
  +++ sitemap.xmap      17 Dec 2003 15:03:27 -0000      1.5
  @@ -2,38 +2,18 @@
   
   <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
   
  +<!-- This sitemap just forwards the request to the corresponding coplet
  +     sub sitemap -->
   <map:pipelines>
       
     <map:pipeline>     
   
  -     <map:match pattern="gallery/images/*.jpg">
  -     <map:read mime-type="image/jpg" src="gallery/samplepics/{1}.jpg"/>
  -     </map:match>
  -
  -    <!-- this is a gallery coplet -->
  -    <map:match pattern="gallery">
  -        <map:generate type="directory" 
src="{coplet:copletData/attributes/image-dir}">
  -            <map:parameter name="include" 
value="{coplet:copletData/attributes/image-include}"/>
  -        </map:generate>
  -        <map:transform src="gallery/dir2pic.xsl">
  -            <map:parameter name="dirprefix" 
value="{coplet:copletData/attributes/image-uri-prefix}"/>
  -        </map:transform>
  -        <map:transform type="xslt" src="gallery/gallery.xsl">
  -            <map:parameter name="pic" value="{coplet:attributes/picture}"/>
  -            <map:parameter name="fullscreen" 
value="{coplet:aspectDatas/fullScreen}"/>
  -        </map:transform>
  -        <map:transform type="portal-coplet"/>
  -        <map:serialize type="xml"/>
  -    </map:match>
  -    <map:match pattern="galleryviewer">
  -        <map:generate src="gallery/picture.xml"/>
  -        <map:transform type="xslt" src="gallery/picture.xsl">
  -            <map:parameter name="pic" value="{coplet:attributes/picture}"/>
  -        </map:transform>
  -        <map:serialize type="xml"/>
  -    </map:match>
  +   <map:match pattern="*/**">
  +     <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
  +   </map:match>
   
     </map:pipeline>
   
   </map:pipelines>
  +
   </map:sitemap>
  
  
  
  1.6       +3 -8      
cocoon-2.1/src/blocks/portal/samples/news/content/xdocs/portal-intro.xml
  
  Index: portal-intro.xml
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/news/content/xdocs/portal-intro.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- portal-intro.xml  12 Dec 2003 13:46:13 -0000      1.5
  +++ portal-intro.xml  17 Dec 2003 15:03:27 -0000      1.6
  @@ -11,18 +11,13 @@
           <p>The Cocoon portal page you currently view displays some so called
             <em>Coplets</em> (= Cocoon Portlets). Each coplet displays
             a select content.</p> 
  -        <p>The different tabs display/demonstrate different aspects of the 
portal.</p>
  -        <ul>
  -          <li>The TabDemo1 shows a tab inside a tab, which is useful for 
structuring content.</li>
  -          <li>The TabDemo2 shows the same content as TabDemo2 but with just 
a different stylesheet for the tab.</li>
  -          <li>The Coplets tab show some more coplets.</li>
  -        </ul>
  -        <note>THIS IS A SAMPLE PORTAL. It demonstrates several features of 
  +        <p><strong>THIS IS A SAMPLE PORTAL!</strong></p>
  +        <p>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! Every configured
             feature might have an impact on the performance.
  -        </note>
  +        </p>
           <p>For more information <fork href="http://cocoon.apache.org";>visit 
the Cocoon Homepage</fork>.</p>
        </s1> 
   
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/samples/news/content/xdocs/portal-demo.xml
  
  Index: portal-demo.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <document> 
    <header> 
         <title>The Cocoon Portal</title>
         <version>0.1</version> 
         <type>Overview document</type> 
    </header> 
    <body> 
         <s1 title="The Apache Cocoon Portal"> 
                <p>This is a demo of the Cocoon Portal Engine.</p>
          <p>The Cocoon portal page you currently view displays some so called
            <em>Coplets</em> (= Cocoon Portlets). Each coplet displays
            a select content.</p> 
          <p>The different tabs display/demonstrate different aspects of the 
portal.</p>
          <ul>
            <li>The TabDemo1 shows a tab inside a tab, which is useful for 
structuring content.</li>
            <li>The TabDemo2 shows the same content as TabDemo2 but with just a 
different stylesheet for the tab.</li>
            <li>The Coplets tab show some more coplets.</li>
          </ul>
          <p><strong>THIS IS A SAMPLE PORTAL!</strong></p>
          <p>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! Every configured
            feature might have an impact on the performance.
          </p>
          <p>For more information <fork href="http://cocoon.apache.org";>visit 
the Cocoon Homepage</fork>.</p>
       </s1> 
  
    </body>
  </document>
  
  
  
  1.5       +13 -1     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
  
  Index: AbstractProfileManager.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractProfileManager.java       20 Oct 2003 13:37:10 -0000      1.4
  +++ AbstractProfileManager.java       17 Dec 2003 15:03:27 -0000      1.5
  @@ -194,12 +194,21 @@
           
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.profile.ProfileManager#login()
  +     */
       public void login() {
       }
       
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.profile.ProfileManager#logout()
  +     */
       public void logout() {
       }
   
  +    /* (non-Javadoc)
  +     * @see 
org.apache.cocoon.portal.profile.ProfileManager#setEntryLayout(org.apache.cocoon.portal.layout.Layout)
  +     */
       public void setEntryLayout(Layout object) {
           String layoutKey = this.getDefaultLayoutKey();
           PortalService service = null;
  @@ -213,6 +222,9 @@
           }
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.profile.ProfileManager#getEntryLayout()
  +     */
       public Layout getEntryLayout() {
           String layoutKey = this.getDefaultLayoutKey();
           PortalService service = null;
  
  
  
  1.5       +25 -11    
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractUserProfileManager.java
  
  Index: AbstractUserProfileManager.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractUserProfileManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractUserProfileManager.java   20 Oct 2003 13:37:10 -0000      1.4
  +++ AbstractUserProfileManager.java   17 Dec 2003 15:03:27 -0000      1.5
  @@ -81,6 +81,9 @@
   public abstract class AbstractUserProfileManager 
       extends AbstractProfileManager { 
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.profile.ProfileManager#login()
  +     */
       public void login() {
           super.login();
           // TODO - we should move most of the stuff from getPortalLayout to 
here
  @@ -88,6 +91,9 @@
           this.getPortalLayout(null, null);
       }
       
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.profile.ProfileManager#logout()
  +     */
       public void logout() {
           final String layoutKey = this.getDefaultLayoutKey();
           PortalService service = null;
  @@ -97,18 +103,20 @@
               service = (PortalService)this.manager.lookup(PortalService.ROLE);
   
               CopletInstanceDataManager copletInstanceDataManager = 
(CopletInstanceDataManager)service.getAttribute("CopletInstanceData:"+layoutKey);
  -            Iterator iter = 
copletInstanceDataManager.getCopletInstanceData().values().iterator();
  -            while ( iter.hasNext() ) {
  -                CopletInstanceData cid = (CopletInstanceData) iter.next();
  -                CopletAdapter adapter = null;
  -                try {
  -                    adapter = 
(CopletAdapter)adapterSelector.select(cid.getCopletData().getCopletBaseData().getCopletAdapterName());
  -                    adapter.logout( cid );
  -                } finally {
  -                    adapterSelector.release( adapter );
  +            if ( copletInstanceDataManager != null ) {
  +                Iterator iter = 
copletInstanceDataManager.getCopletInstanceData().values().iterator();
  +                while ( iter.hasNext() ) {
  +                    CopletInstanceData cid = (CopletInstanceData) 
iter.next();
  +                    CopletAdapter adapter = null;
  +                    try {
  +                        adapter = 
(CopletAdapter)adapterSelector.select(cid.getCopletData().getCopletBaseData().getCopletAdapterName());
  +                        adapter.logout( cid );
  +                    } finally {
  +                        adapterSelector.release( adapter );
  +                    }
                   }
               }
  -
  +            
               service.removeAttribute("CopletData:"+layoutKey);
               service.removeAttribute("CopletInstanceData:"+layoutKey);
               service.removeAttribute("Layout:"+layoutKey);
  @@ -168,6 +176,9 @@
                }
        }
        
  +    /* (non-Javadoc)
  +     * @see 
org.apache.cocoon.portal.profile.ProfileManager#getCopletInstanceData(java.lang.String)
  +     */
       public CopletInstanceData getCopletInstanceData(String copletID) {
           String layoutKey = this.getDefaultLayoutKey();
           PortalService service = null;
  @@ -186,6 +197,9 @@
           }
       }
   
  +    /* (non-Javadoc)
  +     * @see 
org.apache.cocoon.portal.profile.ProfileManager#getCopletInstanceData(org.apache.cocoon.portal.coplet.CopletData)
  +     */
       public List getCopletInstanceData(CopletData data) {
           String layoutKey = this.getDefaultLayoutKey();
           List coplets = new ArrayList();
  
  
  
  1.3       +5 -3      
cocoon-2.1/src/blocks/portal/samples/skins/basic/styles/portal-page.xsl
  
  Index: portal-page.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/skins/basic/styles/portal-page.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- portal-page.xsl   11 Dec 2003 14:41:32 -0000      1.2
  +++ portal-page.xsl   17 Dec 2003 15:03:27 -0000      1.3
  @@ -27,9 +27,11 @@
                        </tr>
                        <tr> 
                                <td colspan="2" noWrap="" height="10" 
bgcolor="#DDDDDD" align="right">
  -                                     <a href="logout" 
style="color:#4C6C8F;font-size:75%;">
  -                                             Logout
  -                                     </a>
  +                                 <xsl:if test="$user!='anonymous'">
  +                                             <a href="logout" 
style="color:#4C6C8F;font-size:75%;">
  +                                                     Logout
  +                                             </a>
  +                                 </xsl:if>
                                </td>
                        </tr>
                </tbody>
  
  
  
  1.16      +5 -26     
cocoon-2.1/src/blocks/portal/samples/profiles/layout/portal.xml
  
  Index: portal.xml
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/profiles/layout/portal.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- portal.xml        14 Dec 2003 12:27:24 -0000      1.15
  +++ portal.xml        17 Dec 2003 15:03:27 -0000      1.16
  @@ -1,32 +1,9 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <composite-layout name="tab" id="maintab">
       <named-item name="Main">
  -             <composite-layout name="row">
  -             <item>
  -                <coplet-layout name="coplet">
  -                    
<coplet-instance-data>Portal-Intro-1</coplet-instance-data>
  -                </coplet-layout>
  -            </item>
  -            <item>
  -                <composite-layout name="column">
  -                    <item>
  -                        <coplet-layout name="coplet">
  -                            
<coplet-instance-data>Portal-Left-1</coplet-instance-data>
  -                        </coplet-layout>
  -                    </item>
  -                    <item>
  -                        <coplet-layout name="coplet">
  -                                 
<coplet-instance-data>Portal-Right-1</coplet-instance-data>
  -                        </coplet-layout>
  -                     </item>
  -                </composite-layout>
  -            </item>
  -            <item>
  -                     <coplet-layout name="coplet">
  -                         
<coplet-instance-data>Portal-Bottom-1</coplet-instance-data>
  -                </coplet-layout>
  -            </item>
  -        </composite-layout>
  +        <coplet-layout name="coplet">
  +            <coplet-instance-data>Portal-Intro-1</coplet-instance-data>
  +        </coplet-layout>
       </named-item>
       <named-item name="News">
           <composite-layout name="column">
  @@ -89,11 +66,13 @@
               <item>
                   <composite-layout name="row">
                       <item>
  +                        <parameter name="width" value="50%" />
                                <coplet-layout name="coplet">
                                    <coplet-instance-data>CZ 
Weblog-1</coplet-instance-data>
                                </coplet-layout>
                       </item>
                       <item>
  +                        <parameter name="width" value="50%" />
                                <coplet-layout name="coplet">
                                    <coplet-instance-data>ML 
Weblog-1</coplet-instance-data>
                                </coplet-layout>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml
  
  Index: portal-user-anonymous.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <composite-layout name="row">
      <item>
          <composite-layout name="column">
              <item>
                        <coplet-layout name="coplet">
                            
<coplet-instance-data>Portal-Intro-1</coplet-instance-data>
                        </coplet-layout>
              </item>
              <item>
                        <coplet-layout name="coplet">
                            <coplet-instance-data>Login-1</coplet-instance-data>
                        </coplet-layout>
                </item>
          </composite-layout>
      </item>
      <item>
          <composite-layout name="column">
              <item>
                  <coplet-layout name="coplet">
                      <coplet-instance-data>Portal-Left-1</coplet-instance-data>
                  </coplet-layout>
              </item>
              <item>
                  <coplet-layout name="coplet">
                        
<coplet-instance-data>Portal-Right-1</coplet-instance-data>
                  </coplet-layout>
                </item>
          </composite-layout>
      </item>
      <item>
          <coplet-layout name="coplet">
                    <coplet-instance-data>Portal-Bottom-1</coplet-instance-data>
          </coplet-layout>
      </item>
  </composite-layout>
  
  
  
  1.2       +1 -18     
cocoon-2.1/src/blocks/portal/samples/styles/authenticate.xsl
  
  Index: authenticate.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/styles/authenticate.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- authenticate.xsl  27 May 2003 11:10:20 -0000      1.1
  +++ authenticate.xsl  17 Dec 2003 15:03:28 -0000      1.2
  @@ -22,24 +22,7 @@
                <ID><xsl:value-of select="name"/></ID>
                <role><xsl:value-of select="role"/></role>
                <data>
  -                     <name><xsl:value-of select="name"/></name>
  -                     <role><xsl:value-of select="role"/></role>
  -                     <ID><xsl:value-of select="name"/></ID>
                        <user><xsl:value-of select="name"/></user>
  -                     <title><xsl:value-of select="title"/></title>
  -                     <firstname><xsl:value-of 
select="firstname"/></firstname>
  -                     <lastname><xsl:value-of select="lastname"/></lastname>
  -                     <company><xsl:value-of select="company"/></company>
  -                     <street><xsl:value-of select="street"/></street>
  -                     <zipcode><xsl:value-of select="zipcode"/></zipcode>
  -                     <city><xsl:value-of select="city"/></city>
  -                     <country><xsl:value-of select="country"/></country>
  -                     <phone><xsl:value-of select="phone"/></phone>
  -                     <fax><xsl:value-of select="fax"/></fax>
  -                     <email><xsl:value-of select="email"/></email>
  -                     <bankid><xsl:value-of select="bankid"/></bankid>
  -                     <bankname><xsl:value-of select="bankname"/></bankname>
  -                     <accountid><xsl:value-of 
select="accountid"/></accountid>
                </data>
        </xsl:if>
   </xsl:template>
  
  
  
  1.3       +7 -2      
cocoon-2.1/src/blocks/portal/samples/skins/common/styles/portal-page.xsl
  
  Index: portal-page.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/skins/common/styles/portal-page.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- portal-page.xsl   11 Dec 2003 14:41:32 -0000      1.2
  +++ portal-page.xsl   17 Dec 2003 15:03:28 -0000      1.3
  @@ -2,6 +2,7 @@
   <xsl:stylesheet version="1.0" 
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
   
  +<xsl:param name="user"/>
   <xsl:template match="/">
   <html>
        <head>
  @@ -26,11 +27,15 @@
                        </tr>
                        <tr valign="bottom"> 
                                <td height="99%" bgcolor="#294563" width="99%" 
align="right">
  -                                     <a href="logout"><img 
src="images/logout-door.gif" width="18" height="22" border="0"/></a>
  +                                 <xsl:if test="$user!='anonymous'">
  +                                     <a href="logout"><img 
src="images/logout-door.gif" width="18" height="22" border="0"/></a>
  +                                 </xsl:if>
                                        <img height="5" src="images/space.gif" 
width="5"/>
                                </td>
                                <td height="99%" bgcolor="#294563" width="1%" 
align="right">
  -                                     <a href="logout" 
style="color:#CFDCED;font-size:75%;">Logout</a>&#160;
  +                                 <xsl:if test="$user!='anonymous'">
  +                                     <a href="logout" 
style="color:#CFDCED;font-size:75%;">Logout</a>&#160;
  +                                 </xsl:if>
                                        <img height="5" src="images/space.gif" 
width="5"/>
                                </td>
                        </tr>
  
  
  

Reply via email to