|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.generation.AbstractGenerator
org.apache.lenya.cms.cocoon.generation.SitetreeFragmentGenerator
public class SitetreeFragmentGenerator
Generates a fragment of the XML from the sitetree, corresponding to a given node. The node is specified by the sitemap parameters area/documentid. If the sitemap parameter initialTree is true, the top nodes of the tree will be generated and the node given by the sitemap parameters area/documentid will be unfolded. If initialTree is false, only the children of the selected node will be generated.
Field Summary | |
---|---|
protected java.lang.String |
area
Parameter which denotes the area of the clicked node |
protected java.lang.String[] |
areas
Parameter which denotes a comma-separated list of areas, for which the xml will be generated. |
protected static java.lang.String |
ATTR_AREA
|
protected static java.lang.String |
ATTR_BASE
|
protected static java.lang.String |
ATTR_FOLDER
|
protected static java.lang.String |
ATTR_HREF
|
protected static java.lang.String |
ATTR_ID
|
protected static java.lang.String |
ATTR_LABEL
|
protected static java.lang.String |
ATTR_LANG
|
protected static java.lang.String |
ATTR_LINK
|
protected static java.lang.String |
ATTR_SUFFIX
|
protected static java.lang.String |
ATTR_VISIBLEINNAV
|
protected org.xml.sax.helpers.AttributesImpl |
attributes
Convenience object, so we don't need to create an AttributesImpl for every element. |
protected java.lang.String |
documentid
Parameter which denotes the documentid of the clicked node |
protected boolean |
initialTree
Parameter which decides if the initial tree with the root nodes is generated |
protected static java.lang.String |
NODE_FRAGMENT
|
protected static java.lang.String |
NODE_LABEL
|
protected static java.lang.String |
NODE_NODE
|
protected static java.lang.String |
NODE_SITE
|
protected static java.lang.String |
PARAM_AREA
|
protected static java.lang.String |
PARAM_AREAS
|
protected static java.lang.String |
PARAM_DOCUMENTID
|
protected static java.lang.String |
PARAM_INITIAL
|
protected static java.lang.String |
PREFIX
The namespace prefix for this namespace. |
protected Publication |
publication
|
protected static java.lang.String |
URI
The URI of the namespace of this generator. |
protected static java.lang.String |
XML_PREFIX
|
protected static java.lang.String |
XML_URI
|
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator |
---|
objectModel, parameters, resolver, source |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.generation.Generator |
---|
ROLE |
Constructor Summary | |
---|---|
SitetreeFragmentGenerator()
|
Method Summary | |
---|---|
protected void |
addLabel(java.lang.String label,
java.lang.String language)
Adds a label element of a given language. |
protected void |
addLabels(SiteTreeNode node)
Finds all the label children of a node and adds them to the nav xml. |
protected void |
endNode(java.lang.String nodeName)
Ends the named node. |
void |
generate()
|
protected void |
generateFragment()
Generates a fragment of the tree which contains the children of a given node. |
protected void |
generateFragmentInitial(java.lang.String siteArea)
Generates the top node of the given area and then calls a recursive method to traverse the tree, if the node given by area/documentid is in this area. |
protected void |
generateFragmentRecursive(SiteTreeNode[] nodes,
java.lang.String docid)
Follows the documentid to find the way in the sitetree to the specified node and opens all folders on its way. |
protected java.lang.String |
isFolder(SiteTreeNode node)
Returns a value to indicate whether a node is a folder (contains subnodes). |
protected void |
setNodeAttributes(SiteTreeNode node)
Sets the attributes for a given node. |
void |
setup(org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
|
protected void |
startNode(java.lang.String nodeName)
Begins a named node and calls setNodeAttributes to set its attributes. |
protected void |
startNode(java.lang.String nodeName,
SiteTreeNode node)
Begins a named node and calls setNodeAttributes to set its attributes. |
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator |
---|
recycle |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
protected Publication publication
protected java.lang.String documentid
protected java.lang.String area
protected boolean initialTree
protected java.lang.String[] areas
protected org.xml.sax.helpers.AttributesImpl attributes
protected static final java.lang.String PARAM_AREA
protected static final java.lang.String PARAM_DOCUMENTID
protected static final java.lang.String PARAM_INITIAL
protected static final java.lang.String PARAM_AREAS
protected static final java.lang.String URI
protected static final java.lang.String XML_URI
protected static final java.lang.String PREFIX
protected static final java.lang.String XML_PREFIX
protected static final java.lang.String NODE_NODE
protected static final java.lang.String NODE_LABEL
protected static final java.lang.String NODE_SITE
protected static final java.lang.String NODE_FRAGMENT
protected static final java.lang.String ATTR_ID
protected static final java.lang.String ATTR_FOLDER
protected static final java.lang.String ATTR_AREA
protected static final java.lang.String ATTR_LABEL
protected static final java.lang.String ATTR_VISIBLEINNAV
protected static final java.lang.String ATTR_LINK
protected static final java.lang.String ATTR_BASE
protected static final java.lang.String ATTR_SUFFIX
protected static final java.lang.String ATTR_HREF
protected static final java.lang.String ATTR_LANG
Constructor Detail |
---|
public SitetreeFragmentGenerator()
Method Detail |
---|
public void setup(org.apache.cocoon.environment.SourceResolver resolver, java.util.Map objectModel, java.lang.String src, org.apache.avalon.framework.parameters.Parameters par) throws org.apache.cocoon.ProcessingException, org.xml.sax.SAXException, java.io.IOException
setup
in interface org.apache.cocoon.sitemap.SitemapModelComponent
setup
in class org.apache.cocoon.generation.AbstractGenerator
org.apache.cocoon.ProcessingException
org.xml.sax.SAXException
java.io.IOException
SitemapModelComponent.setup(org.apache.cocoon.environment.SourceResolver,
java.util.Map, java.lang.String,
org.apache.avalon.framework.parameters.Parameters)
public void generate() throws java.io.IOException, org.xml.sax.SAXException, org.apache.cocoon.ProcessingException
java.io.IOException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
Generator.generate()
protected void generateFragment() throws SiteTreeException, org.xml.sax.SAXException, org.apache.cocoon.ProcessingException
SiteTreeException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
protected void generateFragmentInitial(java.lang.String siteArea) throws SiteTreeException, org.xml.sax.SAXException, org.apache.cocoon.ProcessingException
siteArea
-
SiteTreeException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
protected void generateFragmentRecursive(SiteTreeNode[] nodes, java.lang.String docid) throws SiteTreeException, org.xml.sax.SAXException
nodes
- docid
-
SiteTreeException
org.xml.sax.SAXException
protected void startNode(java.lang.String nodeName) throws org.xml.sax.SAXException
nodeName
- the name of the new node
org.xml.sax.SAXException
- if an error occurs while creating the nodeprotected void startNode(java.lang.String nodeName, SiteTreeNode node) throws org.xml.sax.SAXException
nodeName
- the name of the new nodenode
- The attributes are taken from this node
org.xml.sax.SAXException
- if an error occurs while creating the nodeprotected void setNodeAttributes(SiteTreeNode node) throws org.xml.sax.SAXException
node
-
org.xml.sax.SAXException
- if an error occurs while setting the attributesprotected java.lang.String isFolder(SiteTreeNode node)
node
-
protected void endNode(java.lang.String nodeName) throws org.xml.sax.SAXException
nodeName
- the name of the new node
org.xml.sax.SAXException
- if an error occurs while closing the nodeprotected void addLabels(SiteTreeNode node) throws org.xml.sax.SAXException
node
-
org.xml.sax.SAXException
protected void addLabel(java.lang.String label, java.lang.String language) throws org.xml.sax.SAXException
label
- the value of the labellanguage
- the language of the label
org.xml.sax.SAXException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |