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 2003/10/25 20:00:04 UTC

[WIKI-UPDATE] FlowAndWebServices XspSessionFw BuiltInLogicsheets Sat Oct 25 20:00:04 2003

Page: http://wiki.cocoondev.org/Wiki.jsp?page=FlowAndWebServices , version: 29 on Sat Oct 25 17:05:31 2003 by JoergHeinicke

+ ! Discussion on Cocoon Dev Mailinglist
+ * [http://marc.theaimsgroup.com/?t=106432248900006&r=1&w=2]
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=XspSessionFw , version: 1 on Sat Oct 25 17:49:57 2003 by AntonioGallardo

New page created:
+ An [XSP] [Logicsheet] that's bundled with the Cocoon distribution (see also [Built-In Logicsheets])
+ 
+ It provides an XML syntax which is essentially a simple wrapper around session context provided by the session framework (session-fw block). See the [official Session context documentation|http://cocoon.apache.org/2.1/developing/webapps/contexts.html].
+ 
+ ---- 
+ The namespace of the logicsheet is: __xsp-session-fw__
+ Currently there is just one tag in the logicsheet: __<xsp-session-fw:getxml>__
+ 
+ !!!<xsp-session-fw:getxml>
+ 
+ This tag allows read contexts data.
+ 
+ !! Attributes
+ 
+ *__context__ : The name of the context where the data resides.
+ *__path__: describes the source of the data inside the context and consists of an XPath expression. All path values must be absolute and only nodes and attributes can be accessed.
+ *__as__: It can have 3 values: string, object and xml. Default value: string.
+ 
+ **__as="string"__ ''(default)'' - returns the value of the given path as a String.
+ 
+ **__as="object"__ returns the value of the given path as an Object of type {{org.w3c.dom.DocumentFragment}}.
+ 
+ **__as="xml"__ returns the value of the given path as an __{{org.w3c.dom.DocumentFragment}}__. The root of the returned DocumentFragment is __<xsp-session-fw:xml>__
+ 
+ The idea of the default __as="string"__ is to let you add easily inside your
+ XSP some strings. i.e: to show the user name in a welcome page:
+ 
+ {{{
+ <p>Hi <xsp-session-fw:getxml
+          context="authentication"
+          path="/authentication/data/full_name"/>, welcome back to the System
+ </p>
+ }}}
+ 
+ In this example the __path__ attribute always exists, so we don't need to
+ test if the __path__ really exists in the given session context.
+ 
+ If you need to test if the path exists, then use __as="object"__, get the object and if the object is
+ null, then there is nothing. Else the path exists so you can get it using __as="string"__.
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=BuiltInLogicsheets , version: 7 on Sat Oct 25 17:07:02 2003 by AntonioGallardo

+ |[xsp-session-fw]|Equivalent of the [Session Context Transformer | http://cocoon.apache.org/2.1/developing/webapps/contexts.html]|