You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by da...@cocoon.zones.apache.org on 2005/12/02 12:13:41 UTC

[DAISY] Updated: Input Modules Reference

A document has been updated:

http://cocoon.zones.apache.org/daisy/legacydocs/727.html

Document ID: 727
Branch: main
Language: default
Name: Input Modules Reference (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 12/2/05 11:13:27 AM
Updated by: Upayavira

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 28383 bytes (previous version: 27542 bytes)
Content diff:
(336 equal lines skipped)
    </tbody>
    </table>
    
+++ <p>For an example, let us assume we have a Java object called "user" in the
+++ session. We can get the username from this object via its getUsername() method.
+++ We want to be able to get at this username from the sitemap. So, in
+++ cocoon.xconf:</p>
+++ 
+++ <pre>&lt;input-modules&gt;
+++   ...
+++   &lt;component-instance 
+++      class="org.apache.cocoon.components.modules.input.JXPathMetaModule" 
+++      logger="core.modules.input" 
+++      name="user-attr"&gt;
+++     &lt;input-module name="session-attr"/&gt;
+++     &lt;parameter&gt;user&lt;/parameter&gt;
+++   &lt;/component-instance&gt;
+++   ...
+++ &lt;/input-modules&gt;
+++ </pre>
+++ 
+++ <p>Then, in our sitemap, we can say:</p>
+++ 
+++ <pre>&lt;map:read src="home/{user-attr:username}/somefile.xml"/&gt;
+++ </pre>
+++ 
+++ <p>Thus the <tt>{user-attr:username}</tt> code will effectively return
+++ <tt>{session.getAttribute("user").getUsername().</tt></p>
+++ 
    <h2>LocateResource</h2>
    
    <p>Locate a resource in a resource tree. Any attribute name is interpreted as a
(451 equal lines skipped)


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes