org.apache.cocoon.generation
Class SessionAttributeGenerator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.generation.AbstractGenerator
org.apache.cocoon.generation.SessionAttributeGenerator
- All Implemented Interfaces:
- Generator, LogEnabled, Poolable, Recyclable, SitemapModelComponent, XMLProducer
- public class SessionAttributeGenerator
- extends AbstractGenerator
- Version:
- $Id: SessionAttributeGenerator.java 171341 2005-05-22 16:35:41Z cziegeler $
- Author:
- Cédric Damioli, Sylvain Wallez
- See Also:
ReadDOMSessionTransformer
,
WriteDOMSessionTransformer
- Cocoon.sitemap.component.documentation:
- Generates a document from a session attribute.
- Cocoon.sitemap.component.label:
- content
- Cocoon.sitemap.component.logger:
- sitemap.generator.sessionattribute
Generates a document from a session attribute. The attribute may be a DOM
node, an
XMLizable
, or any other object, and is streamed using
the same rules as for <xsp:expr> in XSPs (see XSPObjectHelper
).
Name of the session attribute is specified using src attribute of the generate
tag, or, if no src tag present, using attr-name parameter.
This generator has 2 parameters:
attr-name
: the session attribute name (mandatory if no src
attribute specified).
root-element
(optional) : the name of the root element of the
produced document. This parameter is optional if the session attribute is
a DOM or an XMLizable
.
Example usage :
<map:generator name="session-attr" logger="sitemap.generator.session-attr"
src="org.apache.cocoon.generation.SessionAttributeGenerator"/>
...
<map:generate type="session-attr">
<map:parameter name="attr-name" value="myAttribute"/>
<map:parameter name="root-element" value="root"/>
</map:generate>
- Cocoon.sitemap.component.name:
- sessionattribute
Fields inherited from interface org.apache.cocoon.generation.Generator |
ROLE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ATTR_NAME
public static final String ATTR_NAME
- See Also:
- Constant Field Values
ELEMENT_NAME
public static final String ELEMENT_NAME
- See Also:
- Constant Field Values
SessionAttributeGenerator
public SessionAttributeGenerator()
setup
public void setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
throws ProcessingException,
SAXException,
IOException
- Setup the file generator :try to retrieve the session attribute given as sitemap parameter
- Specified by:
setup
in interface SitemapModelComponent
- Overrides:
setup
in class AbstractGenerator
- Throws:
ProcessingException
SAXException
IOException
generate
public void generate()
throws IOException,
SAXException,
ProcessingException
- Generate XML data
- Throws:
IOException
SAXException
ProcessingException
Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.