You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by st...@outerthought.org on 2004/02/19 16:00:05 UTC

[WIKI-UPDATE] FAQs PortalEngine Thu Feb 19 16:00:05 2004

Page: http://wiki.cocoondev.org/Wiki.jsp?page=FAQs , version: 93 on Thu Feb 19 15:05:23 2004 by 154.32.46.2

+ 
+ Q: I was having an XML parsing error when trying to install Cocoon 2.1.4 into Tomcat 4.1.24.
+ 
+ A: Copying the contents of the Cocoon lib/endorsed directory to Tomcat's common/endorsed directory fixed the problem which seemed to be to do with the interface offered by the Xerces parser.


Page: http://wiki.cocoondev.org/Wiki.jsp?page=PortalEngine , version: 8 on Thu Feb 19 14:53:14 2004 by JonEvans

+ }}}
+ 
+ ----
+ 
+ __Q:__ One of my coplets does a database lookup, then chunks the resultset through the filter transformer to display it in pages of 5 items.  When I'm in full screen mode, I'd like it to display 50 at a time instead of 5.  How do I do that?
+ 
+ __A:__ Use the parameter selector to test the value of {{aspectDatas/fullscreen}} in the sitemap for your coplet.  For example:
+ 
+ {{{
+   <map:select type="parameter">
+     <map:parameter name="parameter-selector-test"
+      value="{coplet:aspectDatas/fullScreen}"/>
+     <map:when test="false">
+       <map:transform type="filter">
+         <map:parameter name="element-name" value="row"/>
+         <map:parameter name="count" value="5"/>
+         <map:parameter name="blocknr" value="{coplet:attributes/page}"/>
+       </map:transform>
+     </map:when>
+     <map:otherwise>
+       <map:transform type="filter">
+         <map:parameter name="element-name" value="row"/>
+         <map:parameter name="count" value="50"/>
+         <map:parameter name="blocknr" value="{coplet:attributes/page}"/>
+       </map:transform>
+     </map:otherwise>
+   </map:select>
+ }}}
+ 
+ Note also from the above example that the coplet parameter {{page}} is being used to indicate the current page.  By using a coplet parameter, different coplets can cut and paste the same code, but they all remember their own value of {{page}}.  When your coplet generates the links for each page, it should use the cl:links tags, something like this:
+ 
+ {{{
+ <xsl:for-each select="sql:block">
+   <cl:link class="activepage"
+            path="attributes/page"
+            value="{@sql:id}">
+     <xsl:value-of select="@sql:id" />
+   </cl:link>
+ </xsl:for-each>