cziegeler    2003/12/11 06:41:33

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/transformation
                        CopletTransformer.java
               src/blocks/portal/samples/skins/common/styles tab.xsl
                        window.xsl portal-page.xsl login-html.xsl
               src/blocks/portal/samples/skins/basic/styles window.xsl
                        portal-page.xsl login-html.xsl
               src/blocks/portal/samples sitemap.xmap
               src/blocks/portal/samples/profiles/layout portal.xml
  Added:       src/blocks/portal/samples/resources bookmarks.xml
  Log:
  Adding bookmark sample
  Enhancing link creation
  Separating uri space for samples (images, css)
  
  Revision  Changes    Path
  1.10      +49 -7     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/CopletTransformer.java
  
  Index: CopletTransformer.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/CopletTransformer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CopletTransformer.java    11 Dec 2003 13:31:55 -0000      1.9
  +++ CopletTransformer.java    11 Dec 2003 14:41:32 -0000      1.10
  @@ -141,13 +141,16 @@
               }
                   
           } else if (name.equals(LINK_ELEM)) {
  -            AttributesImpl newAttrs = new AttributesImpl();
  -            
               PortalService portalService = null;
               try {
                   portalService = 
(PortalService)this.manager.lookup(PortalService.ROLE);
   
                   final LinkService linkService = 
portalService.getComponentManager().getLinkService();
  +                final String format = attr.getValue("format");
  +                AttributesImpl newAttrs = new AttributesImpl();
  +                newAttrs.setAttributes(attr);
  +                newAttrs.removeAttribute("format");
  +
                   if ( attr.getValue("href") != null ) {
                       final CopletInstanceData cid = 
this.getCopletInstanceData();
                       ChangeCopletInstanceAspectDataEvent event = new 
ChangeCopletInstanceAspectDataEvent(cid, null, null);
  @@ -158,13 +161,18 @@
                       } else {
                           value = value + '&' + attr.getValue("href");
                       }
  -                    newAttrs.addCDATAAttribute("href", value);
  +                    newAttrs.removeAttribute("href");
  +                    this.output(value, format, newAttrs );
                   } else {
                       final String path = attr.getValue("path");
                       final String value = attr.getValue("value");
                       
  +                    newAttrs.removeAttribute("path");
  +                    newAttrs.removeAttribute("value");
  +                    
                       JXPathEvent event;
                       if ( attr.getValue("layout") != null ) {
  +                        newAttrs.removeAttribute("layout");
                           final String layoutId = attr.getValue("layout");
                           Object layout = 
portalService.getComponentManager().getProfileManager().getPortalLayout(null, 
layoutId);
                           event = new JXPathEvent(layout, path, value);
  @@ -172,7 +180,8 @@
                           final CopletInstanceData cid = 
this.getCopletInstanceData();
                           event = new CopletJXPathEvent(cid, path, value);
                       }
  -                    newAttrs.addCDATAAttribute("href", 
linkService.getLinkURI(event));
  +                    final String href = linkService.getLinkURI(event);
  +                    this.output(href, format, newAttrs );
                   }
               } catch (ServiceException e) {
                   throw new SAXException("Error getting portal service.", e);
  @@ -180,7 +189,6 @@
                   this.manager.release( portalService );
               }
               
  -            super.startElement("", "a", "a", newAttrs);
           } else {
               super.startTransformingElement(uri, name, raw, attr);
           }
  @@ -192,10 +200,44 @@
       public void endTransformingElement(String uri, String name, String raw) 
       throws ProcessingException, IOException, SAXException {
           if ( name.equals(LINK_ELEM) ) {
  -            super.endElement("", "a", "a");
  +            String elem = (String)this.stack.pop();
  +            if ( elem.length() > 0 ) {
  +                this.sendEndElementEvent(elem);
  +            }
           } else if (!name.equals(COPLET_ELEM)) {
               super.endTransformingElement(uri, name, raw);
           }  
       }
       
  +    /**
  +     * Output the link
  +     */
  +    protected void output(String uri, String format, AttributesImpl 
newAttrs) 
  +    throws SAXException {
  +        if ( format == null ) {
  +            // default
  +            format = "html-link";
  +        }
  +        
  +        if ( "html-link".equals(format) ) {
  +            newAttrs.addCDATAAttribute("href", uri);
  +            this.sendStartElementEvent("a", newAttrs);
  +            this.stack.push("a");
  +        
  +        } else if ( "html-form".equals(format) ) {
  +            newAttrs.addCDATAAttribute("action", uri);
  +            this.sendStartElementEvent("form", newAttrs);
  +            this.stack.push("form");
  +        } else if ( "text".equals(format) ) {
  +            this.sendTextEvent(uri);
  +        } else if ( "parameters".equals(format) ) {
  +            final String value = uri.substring(uri.indexOf('?')+1);
  +            this.sendTextEvent(value);
  +        } else {
  +            // own format
  +            newAttrs.addCDATAAttribute("href", uri);
  +            this.sendStartElementEvent("link", newAttrs);
  +            this.stack.push("link");
  +        }
  +    }
   }
  
  
  
  1.5       +10 -10    
cocoon-2.1/src/blocks/portal/samples/skins/common/styles/tab.xsl
  
  Index: tab.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/skins/common/styles/tab.xsl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- tab.xsl   25 Jun 2003 08:23:16 -0000      1.4
  +++ tab.xsl   11 Dec 2003 14:41:32 -0000      1.5
  @@ -20,10 +20,10 @@
                        <td width="5" Valign="bottom" bgcolor="#294563">
                                <table summary="spacer" style="height: 1.8em" 
border="0" cellpadding="0" cellspacing="0">
                                        <tr>
  -                                             <td height="99%"><img 
height="5" src="space.gif" width="5"/></td>
  +                                             <td height="99%"><img 
height="5" src="images/space.gif" width="5"/></td>
                                        </tr>
                                        <tr>
  -                                             <td height="10" 
bgcolor="#4C6C8F"><img height="10" src="space.gif" width="5"/></td>
  +                                             <td height="10" 
bgcolor="#4C6C8F"><img height="10" src="images/space.gif" width="5"/></td>
                                        </tr>
                                </table>
                        </td>
  @@ -32,7 +32,7 @@
                                <table summary="selected tab" style="height: 
1.8em" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td valign="top" width="5" 
bgcolor="#FFFFFF">
  -                                                     <img height="5" 
width="5" alt="" src="tabSel-left.gif"/>
  +                                                     <img height="5" 
width="5" alt="" src="images/tabSel-left.gif"/>
                                                </td>
                                                <td valign="middle" 
bgcolor="#FFFFFF">
                                                        <font color="#ffffff" 
size="2" face="Arial, Helvetica, Sans-serif"><b>
  @@ -40,7 +40,7 @@
                                                        </font>
                                                </td>
                                                <td valign="top" width="5" 
bgcolor="#FFFFFF">
  -                                                     <img height="5" 
width="5" alt="" src="tabSel-right.gif"/>
  +                                                     <img height="5" 
width="5" alt="" src="images/tabSel-right.gif"/>
                                                </td>
                                        </tr>
                                        <tr>
  @@ -57,10 +57,10 @@
                        <td width="5" Valign="bottom" bgcolor="#294563">
                                <table summary="non selected tab" 
style="height: 1.8em" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
  -                                             <td height="99%"><img 
height="5" src="space.gif" width="5"/></td>
  +                                             <td height="99%"><img 
height="5" src="images/space.gif" width="5"/></td>
                                        </tr>
                                        <tr>
  -                                             <td height="10" 
bgcolor="#4C6C8F"><img height="10" src="space.gif" width="5"/></td>
  +                                             <td height="10" 
bgcolor="#4C6C8F"><img height="10" src="images/space.gif" width="5"/></td>
                                        </tr>
                                </table>
                        </td>
  @@ -69,7 +69,7 @@
                                <table summary="non selected tab" 
style="height: 1.8em" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td valign="top" width="5" 
bgcolor="#B2C4E0">
  -                                                     <img height="5" 
width="5" alt="" src="tab-left.gif"/>
  +                                                     <img height="5" 
width="5" alt="" src="images/tab-left.gif"/>
                                                </td>
                                                <td valign="middle" 
bgcolor="#B2C4E0" >
                                                        <div class="tab">
  @@ -79,7 +79,7 @@
                                                        </div>
                                                </td>
                                                <td valign="top" width="5" 
bgcolor="#B2C4E0">
  -                                                     <img height="5" 
width="5" alt="" src="tab-right.gif"/>
  +                                                     <img height="5" 
width="5" alt="" src="images/tab-right.gif"/>
                                                </td>
                                        </tr>
                                        <tr>
  @@ -96,12 +96,12 @@
                <table style="height: 2.0em" border="0" cellpadding="0" 
cellspacing="0" width="100%">
                        <tr>
                                <td height="99%" bgcolor="#294563" width="99%" 
align="right" valign="center">
  -                                     <img height="10" src="space.gif" 
width="1"/>
  +                                     <img height="10" src="images/space.gif" 
width="1"/>
                                </td>
                        </tr>
                        <tr>
                                <td height="1" bgcolor="#4C6C8F" width="99%">
  -                                     <img height="10" src="space.gif" 
width="1"/>
  +                                     <img height="10" src="images/space.gif" 
width="1"/>
                                </td>
                        </tr>
                </table>
  
  
  
  1.7       +13 -13    
cocoon-2.1/src/blocks/portal/samples/skins/common/styles/window.xsl
  
  Index: window.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/skins/common/styles/window.xsl,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- window.xsl        2 Sep 2003 09:53:00 -0000       1.6
  +++ window.xsl        11 Dec 2003 14:41:32 -0000      1.7
  @@ -17,7 +17,7 @@
   
   <table cellSpacing="0" cellpadding="0" width="100%">
        <tr vAlign="top">
  -             <td width="5" style="background-color:#294563;" 
valign="top"><img src="window-top-left.gif" border="0" width="5" height="5" 
alt="top-left"/></td>
  +             <td width="5" style="background-color:#294563;" 
valign="top"><img src="images/window-top-left.gif" border="0" width="5" 
height="5" alt="top-left"/></td>
                <td bgColor="{$bgColor}" valign="middle">
                        <font>
                                <xsl:attribute 
name="color">#ffffff</xsl:attribute>
  @@ -36,48 +36,48 @@
                <td align="right" bgColor="{$bgColor}">
                        <xsl:if test="fullscreen-uri and not(maximize-uri)">
                                <a href="{fullscreen-uri}">
  -                                 <img src="customize.gif" border="0" 
alt="Full Screen"/>
  +                                 <img src="images/customize.gif" border="0" 
alt="Full Screen"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="maxpage-uri">
                                <a href="{maxpage-uri}">
  -                                 <img src="show.gif" border="0" alt="Max 
Page"/>
  +                                 <img src="images/show.gif" border="0" 
alt="Max Page"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="minpage-uri">
                                <a href="{minpage-uri}">
  -                                 <img src="show.gif" border="0" alt="Min 
Page"/>
  +                                 <img src="images/show.gif" border="0" 
alt="Min Page"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="maximize-uri">
                                <a href="{maximize-uri}">
  -                                 <img src="maximize.gif" border="0" 
alt="Maximize"/>
  +                                 <img src="images/maximize.gif" border="0" 
alt="Maximize"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="minimize-uri">
                                <a href="{minimize-uri}">
  -                                 <img src="minimize.gif" border="0" 
alt="Minimize"/>
  +                                 <img src="images/minimize.gif" border="0" 
alt="Minimize"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="remove-uri">
                                <a href="{remove-uri}">
  -                                 <img src="delete.gif" border="0" 
alt="Delete"/>
  +                                 <img src="images/delete.gif" border="0" 
alt="Delete"/>
                                </a>
                        </xsl:if>
                </td>
  -             <td width="5" style="background-color:#294563;" 
valign="top"><img src="window-top-right.gif" border="0" width="5" height="5" 
alt="top-right"/></td>
  +             <td width="5" style="background-color:#294563;" 
valign="top"><img src="images/window-top-right.gif" border="0" width="5" 
height="5" alt="top-right"/></td>
        </tr>
        <tr>
  -             <td width="5" 
style="background-image:url(window-border-left.gif);"><img src="space.gif" 
border="0" width="5" height="5" alt="space"/></td>
  +             <td width="5" 
style="background-image:url(window-border-left.gif);"><img 
src="images/space.gif" border="0" width="5" height="5" alt="space"/></td>
                <td colSpan="2">
                  <xsl:apply-templates select="content"/>
                </td>
  -             <td width="5" 
style="background-image:url(window-border-right.gif);"><img src="space.gif" 
border="0" width="5" height="5" alt="space"/></td>
  +             <td width="5" 
style="background-image:url(window-border-right.gif);"><img 
src="images/space.gif" border="0" width="5" height="5" alt="space"/></td>
        </tr>
        <tr>
  -             <td width="5"><img src="window-bottom-left.gif" border="0" 
width="5" height="5" alt="top-left"/></td>
  -             <td colspan="2" 
style="background-image:url(window-border-bottom.gif);"></td>
  -             <td width="5"><img src="window-bottom-right.gif" border="0" 
width="5" height="5" alt="top-left"/></td>
  +             <td width="5"><img src="images/window-bottom-left.gif" 
border="0" width="5" height="5" alt="top-left"/></td>
  +             <td colspan="2" 
style="background-image:url(images/window-border-bottom.gif);"></td>
  +             <td width="5"><img src="images/window-bottom-right.gif" 
border="0" width="5" height="5" alt="top-left"/></td>
        </tr>
   </table>
   </xsl:template>
  
  
  
  1.2       +8 -8      
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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- portal-page.xsl   25 Jun 2003 08:23:16 -0000      1.1
  +++ portal-page.xsl   11 Dec 2003 14:41:32 -0000      1.2
  @@ -5,7 +5,7 @@
   <xsl:template match="/">
   <html>
        <head>
  -             <link type="text/css" rel="stylesheet" href="page.css"/>
  +             <link type="text/css" rel="stylesheet" href="css/page.css"/>
        </head>
        <body>
        <table bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" 
width="100%"><tbody> 
  @@ -16,22 +16,22 @@
                <tbody> 
                        <tr> 
                                <td colspan="2" noWrap="" height="1%" 
bgcolor="#294563">
  -                                     <img height="5" src="space.gif" 
width="100%"/>
  +                                     <img height="5" src="images/space.gif" 
width="100%"/>
                                </td>
                        </tr>
                        <tr> 
                                <td colspan="2" bgcolor="#294563" height="98%" 
align="center" valign="middle" width="100%">
  -                                     <img src="portal-logo.gif" width="250" 
height="90" />
  +                                     <img src="images/portal-logo.gif" 
width="250" height="90" />
                                </td>
                        </tr>
                        <tr valign="bottom"> 
                                <td height="99%" bgcolor="#294563" width="99%" 
align="right">
  -                                     <a href="logout"><img 
src="logout-door.gif" width="18" height="22" border="0"/></a>
  -                                     <img height="5" src="space.gif" 
width="5"/>
  +                                     <a href="logout"><img 
src="images/logout-door.gif" width="18" height="22" border="0"/></a>
  +                                     <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;
  -                                     <img height="5" src="space.gif" 
width="5"/>
  +                                     <img height="5" src="images/space.gif" 
width="5"/>
                                </td>
                        </tr>
                </tbody>
  @@ -53,12 +53,12 @@
                        <tbody> 
                        <tr> 
                        <td colspan="2" noWrap="" height="10" bgcolor="#CFDCED">
  -                             <img height="1" src="space.gif" width="1"/>
  +                             <img height="1" src="images/space.gif" 
width="1"/>
                        </td>
                        </tr>
                        <tr> 
                        <td colspan="2" noWrap="" height="30" bgcolor="#294563">
  -                             <img height="1" src="space.gif" width="1"/>
  +                             <img height="1" src="images/space.gif" 
width="1"/>
                        </td>
                        </tr>
                        </tbody>
  
  
  
  1.4       +2 -2      
cocoon-2.1/src/blocks/portal/samples/skins/common/styles/login-html.xsl
  
  Index: login-html.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/skins/common/styles/login-html.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- login-html.xsl    11 Dec 2003 13:31:55 -0000      1.3
  +++ login-html.xsl    11 Dec 2003 14:41:32 -0000      1.4
  @@ -21,7 +21,7 @@
     </tr>
     <tr>
       <td bgColor="#ffffff" width="15">
  -       <img height="1" src="space.gif" width="15"/>
  +       <img height="1" src="images/space.gif" width="15"/>
       </td>
     </tr>
     <tr>
  
  
  
  1.4       +6 -6      
cocoon-2.1/src/blocks/portal/samples/skins/basic/styles/window.xsl
  
  Index: window.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/skins/basic/styles/window.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- window.xsl        2 Sep 2003 09:53:00 -0000       1.3
  +++ window.xsl        11 Dec 2003 14:41:32 -0000      1.4
  @@ -35,32 +35,32 @@
                <td align="right" bgColor="{$bgColor}">
                        <xsl:if test="fullscreen-uri and not(maximize-uri)">
                                <a href="{fullscreen-uri}">
  -                                 <img src="customize.gif" border="0" 
alt="Full Screen"/>
  +                                 <img src="images/customize.gif" border="0" 
alt="Full Screen"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="maxpage-uri">
                                <a href="{maxpage-uri}">
  -                                 <img src="show.gif" border="0" alt="Max 
Page"/>
  +                                 <img src="images/show.gif" border="0" 
alt="Max Page"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="minpage-uri">
                                <a href="{minpage-uri}">
  -                                 <img src="show.gif" border="0" alt="Min 
Page"/>
  +                                 <img src="images/show.gif" border="0" 
alt="Min Page"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="maximize-uri">
                                <a href="{maximize-uri}">
  -                                 <img src="maximize.gif" border="0" 
alt="Maximize"/>
  +                                 <img src="images/maximize.gif" border="0" 
alt="Maximize"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="minimize-uri">
                                <a href="{minimize-uri}">
  -                                 <img src="minimize.gif" border="0" 
alt="Minimize"/>
  +                                 <img src="images/minimize.gif" border="0" 
alt="Minimize"/>
                                </a>
                        </xsl:if>
                        <xsl:if test="remove-uri">
                                <a href="{remove-uri}">
  -                                 <img src="delete.gif" border="0" 
alt="Delete"/>
  +                                 <img src="images/delete.gif" border="0" 
alt="Delete"/>
                                </a>
                        </xsl:if>
                </td>
  
  
  
  1.2       +3 -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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- portal-page.xsl   25 Jun 2003 08:23:16 -0000      1.1
  +++ portal-page.xsl   11 Dec 2003 14:41:32 -0000      1.2
  @@ -5,7 +5,7 @@
   <xsl:template match="/">
   <html>
        <head>
  -             <link type="text/css" rel="stylesheet" href="page.css"/>
  +             <link type="text/css" rel="stylesheet" href="css/page.css"/>
        </head>
        <body>
        <table bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" 
width="100%">
  @@ -51,12 +51,12 @@
                <tbody> 
                <tr> 
                        <td colspan="2" noWrap="" height="10" bgcolor="#DDDDDD">
  -                             <img height="1" src="sunspotdemoimg-space.gif" 
width="1"/>
  +                             <img height="1" src="images/space.gif" 
width="1"/>
                        </td>
                </tr>
                <tr> 
                        <td colspan="2" noWrap="" height="30" bgcolor="#CCCCCC">
  -                             <img height="1" src="sunspotdemoimg-space.gif" 
width="1"/>
  +                             <img height="1" src="images/space.gif" 
width="1"/>
                        </td>
                </tr>
                </tbody>
  
  
  
  1.3       +2 -2      
cocoon-2.1/src/blocks/portal/samples/skins/basic/styles/login-html.xsl
  
  Index: login-html.xsl
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/samples/skins/basic/styles/login-html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- login-html.xsl    11 Dec 2003 13:31:55 -0000      1.2
  +++ login-html.xsl    11 Dec 2003 14:41:32 -0000      1.3
  @@ -21,7 +21,7 @@
     </tr>
     <tr>
       <td bgColor="#ffffff" width="15">
  -       <img height="1" src="sunspotdemoimg-space.gif" width="15"/>
  +       <img height="1" src="images/space.gif" width="15"/>
       </td>
     </tr>
     <tr>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/samples/resources/bookmarks.xml
  
  Index: bookmarks.xml
  ===================================================================
  <events>
    <event type="jxpath" id="showtab">
      <targettype>layout</targettype>
      <targetid>maintab</targetid>
      <path>aspectDatas/tab</path>
    </event>
  </events>
  
  
  
  1.15      +64 -33    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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- sitemap.xmap      11 Dec 2003 13:31:55 -0000      1.14
  +++ sitemap.xmap      11 Dec 2003 14:41:33 -0000      1.15
  @@ -15,6 +15,11 @@
     <map:serializers default="html"/>
     <map:matchers default="wildcard"/>
     <map:selectors default="browser"/>
  +  <map:actions>  
  +    <map:action src="org.apache.cocoon.portal.acting.BookmarkAction" 
name="portal-bookmark">
  +        <parameter name="src" value="resources/bookmarks.xml"/>
  +    </map:action>
  +  </map:actions>
    </map:components>
    
   <!-- =========================== Views =================================== 
-->
  @@ -67,6 +72,40 @@
   
     </map:component-configurations>
     
  +  <!-- The internal pipelines for loading and saving -->
  +  <map:pipeline internal-only="true">
  +    <map:match pattern="sunrise-authuser">
  +      <map:generate src="resources/sunrise-user.xml"/>
  +      <map:transform src="styles/authenticate.xsl">
  +        <map:parameter name="use-request-parameters" value="true"/>
  +      </map:transform>
  +      <map:serialize type="xml"/>
  +    </map:match>
  +
  +    <map:match pattern="load-global-profile">
  +     <map:generate 
src="profiles/{request-param:profile}/{request-param:portal}.xml"/>
  +     <map:serialize type="xml"/>
  +    </map:match>
  +
  +    <map:match pattern="load-role-profile">
  +     <map:generate 
src="profiles/{request-param:profile}/{request-param:portal}-role-{request-param:role}.xml"/>
  +     <map:serialize type="xml"/>
  +    </map:match>
  +
  +    <map:match pattern="load-user-profile">
  +     <map:generate 
src="profiles/{request-param:profile}/{request-param:portal}-user-{request-param:user}.xml"/>
  +     <map:serialize type="xml"/>
  +    </map:match>
  +
  +    <map:match pattern="save-user-profile">
  +     <map:generate src="resources/save-user-profile.xml"/>
  +        <map:transform type="session"/>
  +        <map:transform type="write-source"/>
  +     <map:serialize type="xml"/>
  +    </map:match>
  +  </map:pipeline>
  +
  +  <!-- Now the accessible pipelines -->
     <map:pipeline>
   
       <!-- images -->
  @@ -109,6 +148,20 @@
           </map:act>
       </map:match>
           
  +    <!-- Test pipeline for bookmark -->
  +    <map:match pattern="bookmark">
  +        <map:act type="auth-protect">
  +            <map:parameter name="handler" value="portalhandler"/> 
  +            <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>
  +    </map:match>
  +
       <map:match pattern="portalxml">
           <map:act type="auth-protect">
               <map:parameter name="handler" value="portalhandler"/> 
  @@ -152,7 +205,9 @@
             <map:parameter name="handler" value="portalhandler"/>
             <map:parameter name="parameter_name" value="{request-param:name}"/>
             <map:parameter name="parameter_password" 
value="{request-param:password}"/>
  -          <map:redirect-to uri="portal"/>
  +
  +          <map:redirect-to uri="{request-param:resource}"/>
  +
           </map:act>
           <map:generate src="resources/login-error.xml"/>
           <map:transform src="{global:skin}styles/portal-page.xsl"/>
  @@ -177,7 +232,11 @@
                <map:act type="auth-protect">
                    <map:parameter name="handler" value="portalhandler"/> 
               <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-logout">
                    <map:parameter name="portal-name" value="portal"/>
               </map:act>
  @@ -187,37 +246,9 @@
           <map:redirect-to uri="login"/>
       </map:match>
   
  -  </map:pipeline>
  -
  -  <map:pipeline internal-only="true">
  -    <map:match pattern="sunrise-authuser">
  -      <map:generate src="resources/sunrise-user.xml"/>
  -      <map:transform src="styles/authenticate.xsl">
  -        <map:parameter name="use-request-parameters" value="true"/>
  -      </map:transform>
  -      <map:serialize type="xml"/>
  -    </map:match>
  -
  -    <map:match pattern="load-global-profile">
  -     <map:generate 
src="profiles/{request-param:profile}/{request-param:portal}.xml"/>
  -     <map:serialize type="xml"/>
  -    </map:match>
  -
  -    <map:match pattern="load-role-profile">
  -     <map:generate 
src="profiles/{request-param:profile}/{request-param:portal}-role-{request-param:role}.xml"/>
  -     <map:serialize type="xml"/>
  -    </map:match>
  -
  -    <map:match pattern="load-user-profile">
  -     <map:generate 
src="profiles/{request-param:profile}/{request-param:portal}-user-{request-param:user}.xml"/>
  -     <map:serialize type="xml"/>
  -    </map:match>
  -
  -    <map:match pattern="save-user-profile">
  -     <map:generate src="resources/save-user-profile.xml"/>
  -        <map:transform type="session"/>
  -        <map:transform type="write-source"/>
  -     <map:serialize type="xml"/>
  +    <!-- Everything else redirect to the portal -->
  +    <map:match pattern="**">
  +        <map:redirect-to uri="portal"/>
       </map:match>
     </map:pipeline>
   
  
  
  
  1.13      +1 -1      
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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- portal.xml        11 Dec 2003 13:33:24 -0000      1.12
  +++ portal.xml        11 Dec 2003 14:41:33 -0000      1.13
  @@ -1,5 +1,5 @@
   <?xml version="1.0" encoding="UTF-8"?>
  -<composite-layout name="tab">
  +<composite-layout name="tab" id="maintab">
     <named-item name="Main">
       <composite-layout name="row">
         <item>
  
  
  

Reply via email to