Class RepositoryNodeGenerator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.generation.AbstractGenerator
-
- org.apache.cocoon.generation.ServiceableGenerator
-
- org.ametys.workspaces.repository.jcr.AbstractRepositoryGenerator
-
- org.ametys.workspaces.repository.jcr.RepositoryNodeGenerator
-
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
public class RepositoryNodeGenerator extends AbstractRepositoryGenerator
Generate the content of a node:- properties
- children
- referers
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
RepositoryNodeGenerator.NodeNameComparator
Compares two nodes on its names.
-
Field Summary
Fields Modifier and Type Field Description private static Comparator<Node>
__ALPHA_NODE_COMPARATOR
private static Comparator<Node>
__REVERSE_ALPHA_NODE_COMPARATOR
-
Fields inherited from class org.ametys.workspaces.repository.jcr.AbstractRepositoryGenerator
_repositoryProvider, _session
-
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
-
-
Constructor Summary
Constructors Constructor Description RepositoryNodeGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Collection<Node>
_extractNodes(NodeIterator itNodes, long start, long end, boolean ascending)
private void
_saxChildren(Node node, long start, long end, String order)
private void
_saxGroups(Node node, long startIndex, long childCount)
Generate node groups.private void
_saxNode(Session session, String order)
private void
_saxProperties(Node node)
private void
_saxProperty(Property property, Node parentNode)
private void
_saxReferers(Node node)
private void
_saxSubnode(Node node)
Sax a sub node.private void
_saxValue(Value value)
void
generate()
-
Methods inherited from class org.ametys.workspaces.repository.jcr.AbstractRepositoryGenerator
_getRepository, service
-
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
-
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
-
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
-
__ALPHA_NODE_COMPARATOR
private static final Comparator<Node> __ALPHA_NODE_COMPARATOR
-
__REVERSE_ALPHA_NODE_COMPARATOR
private static final Comparator<Node> __REVERSE_ALPHA_NODE_COMPARATOR
-
-
Constructor Detail
-
RepositoryNodeGenerator
public RepositoryNodeGenerator()
-
-
Method Detail
-
generate
public void generate() throws IOException, SAXException, ProcessingException
-
_saxNode
private void _saxNode(Session session, String order) throws SAXException, RepositoryException
- Throws:
SAXException
RepositoryException
-
_saxProperties
private void _saxProperties(Node node) throws SAXException, RepositoryException
- Throws:
SAXException
RepositoryException
-
_saxProperty
private void _saxProperty(Property property, Node parentNode) throws SAXException, RepositoryException
- Throws:
SAXException
RepositoryException
-
_saxChildren
private void _saxChildren(Node node, long start, long end, String order) throws SAXException, RepositoryException
- Throws:
SAXException
RepositoryException
-
_extractNodes
private Collection<Node> _extractNodes(NodeIterator itNodes, long start, long end, boolean ascending)
-
_saxGroups
private void _saxGroups(Node node, long startIndex, long childCount) throws RepositoryException, SAXException
Generate node groups.- Parameters:
node
- The node to considerstartIndex
- The index to start the groupchildCount
- The group size- Throws:
RepositoryException
- if an error occurredSAXException
- if an error occurred
-
_saxSubnode
private void _saxSubnode(Node node) throws RepositoryException, SAXException
Sax a sub node.- Parameters:
node
- the sub node to SAX.- Throws:
RepositoryException
- if an error occurredSAXException
- if an error occurred
-
_saxReferers
private void _saxReferers(Node node) throws SAXException, RepositoryException
- Throws:
SAXException
RepositoryException
-
_saxValue
private void _saxValue(Value value) throws RepositoryException, SAXException
- Throws:
RepositoryException
SAXException
-
-