| 
 | ||||||||
| 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.cocoon.generation.ServiceableGenerator
org.apache.lenya.cms.cocoon.generation.SitetreeFragmentGenerator
public class SitetreeFragmentGenerator
Generates a fragment of the navigation XML from the sitetree, corresponding to a given node. The node is specified by the sitemap parameters area/path. 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/path will be unfolded. If initialTree is false, only the children of the selected node will be generated.
| Field Summary | |
|---|---|
| protected  java.lang.String | areaParameter which denotes the area of the clicked node | 
| protected  java.lang.String[] | areasFIXME: should pass this as a parameter | 
| 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_PUBLICATION | 
| protected static java.lang.String | ATTR_SUFFIX | 
| protected static java.lang.String | ATTR_TYPE | 
| protected static java.lang.String | ATTR_UUID | 
| protected static java.lang.String | ATTR_VISIBLEINNAV | 
| protected  org.xml.sax.helpers.AttributesImpl | attributesConvenience object, so we don't need to create an AttributesImpl for every element. | 
| protected  boolean | initialTreeParameter 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_INITIAL | 
| protected static java.lang.String | PARAM_PATH | 
| protected static java.lang.String | PARAM_TYPE | 
| protected  java.lang.String | pathParameter which denotes the path of the clicked node | 
| protected static java.lang.String | PREFIXThe namespace prefix for this namespace. | 
| protected  org.apache.lenya.cms.publication.Publication | publication | 
| protected  boolean | showTypeParameter which decides if the node mime types should be reported | 
| protected static java.lang.String | URIThe 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.ServiceableGenerator | 
|---|
| manager | 
| 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(org.apache.lenya.cms.site.SiteNode node)Finds all the label children of a node and adds them to the nav xml. | 
| protected  void | addNodeRecursive(org.apache.lenya.cms.site.SiteNode node,
                 java.lang.String nodeid,
                 java.lang.String childid)Adds the given node, and if the node's id matched the given nodeid, it continues recursively. | 
| protected  void | addNodes(org.apache.lenya.cms.site.SiteNode[] children)Adds the given nodes (not recursive). | 
| 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/path is in this area. | 
| protected  void | generateFragmentRecursive(org.apache.lenya.cms.site.SiteNode[] nodes,
                          java.lang.String path)Follows the path to find the way in the sitetree to the specified node and opens all folders on its way. | 
| protected  boolean | isFolder(org.apache.lenya.cms.site.SiteNode node)Returns a value to indicate whether a node is a folder (contains subnodes). | 
| protected  void | setNodeAttributes(org.apache.lenya.cms.site.SiteNode 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,
          org.apache.lenya.cms.site.SiteNode node)Begins a named node and calls setNodeAttributes to set its attributes. | 
| Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator | 
|---|
| dispose, service | 
| 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 org.apache.lenya.cms.publication.Publication publication
protected java.lang.String path
protected java.lang.String area
protected boolean initialTree
protected boolean showType
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_PATH
protected static final java.lang.String PARAM_INITIAL
protected static final java.lang.String PARAM_TYPE
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_PUBLICATION
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_UUID
protected static final java.lang.String ATTR_LANG
protected static final java.lang.String ATTR_TYPE
| 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.SitemapModelComponentsetup in class org.apache.cocoon.generation.AbstractGeneratororg.apache.cocoon.ProcessingException
org.xml.sax.SAXException
java.io.IOExceptionSitemapModelComponent.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.ProcessingExceptionGenerator.generate()
protected void generateFragment()
                         throws org.apache.lenya.cms.site.SiteException,
                                org.xml.sax.SAXException,
                                org.apache.cocoon.ProcessingException
org.apache.lenya.cms.site.SiteException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
protected void addNodes(org.apache.lenya.cms.site.SiteNode[] children)
                 throws org.xml.sax.SAXException,
                        org.apache.lenya.cms.site.SiteException
children - 
org.xml.sax.SAXException
org.apache.lenya.cms.site.SiteException
protected void generateFragmentInitial(java.lang.String siteArea)
                                throws org.apache.lenya.cms.site.SiteException,
                                       org.xml.sax.SAXException,
                                       org.apache.cocoon.ProcessingException
siteArea - 
org.apache.lenya.cms.site.SiteException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
protected void generateFragmentRecursive(org.apache.lenya.cms.site.SiteNode[] nodes,
                                         java.lang.String path)
                                  throws org.apache.lenya.cms.site.SiteException,
                                         org.xml.sax.SAXException
nodes - path - 
org.apache.lenya.cms.site.SiteException
org.xml.sax.SAXException
protected void addNodeRecursive(org.apache.lenya.cms.site.SiteNode node,
                                java.lang.String nodeid,
                                java.lang.String childid)
                         throws org.xml.sax.SAXException,
                                org.apache.lenya.cms.site.SiteException
node - nodeid - childid - 
org.xml.sax.SAXException
org.apache.lenya.cms.site.SiteException
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 node
protected void startNode(java.lang.String nodeName,
                         org.apache.lenya.cms.site.SiteNode node)
                  throws org.xml.sax.SAXException,
                         org.apache.lenya.cms.site.SiteException
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 node
org.apache.lenya.cms.site.SiteException
protected void setNodeAttributes(org.apache.lenya.cms.site.SiteNode node)
                          throws org.xml.sax.SAXException,
                                 org.apache.lenya.cms.site.SiteException
node - 
org.xml.sax.SAXException - if an error occurs while setting the attributes
org.apache.lenya.cms.site.SiteExceptionprotected boolean isFolder(org.apache.lenya.cms.site.SiteNode 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 node
protected void addLabels(org.apache.lenya.cms.site.SiteNode 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 | |||||||