You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/10/03 10:23:13 UTC
svn commit: r293277 -
/lenya/docu/src/documentation/content/xdocs/1_4/reference/resource-types.xml
Author: andreas
Date: Mon Oct 3 01:23:10 2005
New Revision: 293277
URL: http://svn.apache.org/viewcvs?rev=293277&view=rev
Log:
Added docs about resource type formats.
Modified:
lenya/docu/src/documentation/content/xdocs/1_4/reference/resource-types.xml
Modified: lenya/docu/src/documentation/content/xdocs/1_4/reference/resource-types.xml
URL: http://svn.apache.org/viewcvs/lenya/docu/src/documentation/content/xdocs/1_4/reference/resource-types.xml?rev=293277&r1=293276&r2=293277&view=diff
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/1_4/reference/resource-types.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/1_4/reference/resource-types.xml Mon Oct 3 01:23:10 2005
@@ -66,6 +66,7 @@
<sample-name>fallback://lenya/publets/xhtml/samples/xhtml.xml</sample-name>
</creator>
<link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
+ <format name="xhtml" uri="cocoon://modules/xhtml/xhtml.xml"/>
</component-instance>
</xconf>]]></source>
@@ -173,6 +174,7 @@
<sample-name>fallback://lenya/resources/samples/profile.xml</sample-name>
</creator>
<link-attribute xpath="//*[namespace-uri() = 'http://foo.bar.org/profile']/@href"/>
+ <format name="xhtml" uri="cocoon://modules/profile/profile.xml"/>
</component-instance>
</xconf>]]></source>
@@ -190,8 +192,55 @@
To let the user create new resources using the <code>DefaultBranchCreator</code>,
you have to add the following menu item:
</p>
-<source><![CDATA[<item uc:usecase="site.create" href="?doctype=profile"><i18n:text>New Profile Document</i18n:text></item>]]>
+<source>
+ <![CDATA[<item uc:usecase="site.create" href="?doctype=profile"><i18n:text>New Profile Document</i18n:text></item>]]>
</source>
+ </section>
+
+ <section>
+ <title>Formats</title>
+
+ <p>
+ A resource type provides a set of <em>formats</em> to provide different ways of presenting content documents.
+ The formats are defined in the resource type declaration:
+ </p>
+<source xml:space="preserve">
+ <![CDATA[<format name="xhtml" uri="cocoon://modules/profile/profile.xml"/>]]>
+</source>
+ <p>
+ The <code>uri</code> attribute of the <code>format</code> element may refer to an arbitrary URL,
+ which is typically a request into the module itself. This URI is matched inside the module
+ sitemap (in our case, <code>modules/profile/sitemap.xmap</code>). Typically, an XSLT is applied
+ to the content document to transform it into another format (XHTML, XSL-FO, ...):
+ </p>
+ <source xml:space="preserve"><![CDATA[
+ <!-- apply a format -->
+ <map:match pattern="*.xml">
+ <map:generate src="lenya://lenya/pubs/{pe:publication-id}/content/{pe:area}/{pe:document-path}"/>
+ <map:transform src="fallback://lenya/modules/profile/xslt/profile2xhtml.xsl">
+ <map:parameter name="rendertype" value="{request-param:rendertype}"/>
+ <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
+ <map:parameter name="language" value="{page-envelope:document-language}"/>
+ </map:transform>
+ <map:serialize type="xml"/>
+ </map:match>
+]]></source>
+ <p>
+ To request a formatted document, use the <code>format-...</code> attribute of the
+ <code>resource-type</code> input module:
+ </p>
+<source xml:space="preserve">
+ <![CDATA[<!-- aggregate navigation components and XHTML-formatted content -->
+ <map:aggregate element="cmsbody">
+ <map:part src="cocoon://modules/sitetree/{2}/{3}/breadcrumb/{5}.xml"/>
+ <map:part src="cocoon://modules/sitetree/{2}/{3}/tabs/{5}.xml"/>
+ <map:part src="cocoon://modules/sitetree/{2}/{3}/menu/{5}.xml"/>
+ <map:part src="cocoon://modules/sitetree/{2}/{3}/search/{5}.xml"/>
+ <map:part src="{resource-type:format-xhtml}"/>
+ </map:aggregate>
+]]>
+</source>
+
</section>
<section><title>Presentation</title>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org