Class WebdavPropfindGenerator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.generation.AbstractGenerator
-
- org.ametys.plugins.workspaces.dav.WebdavPropfindGenerator
-
- All Implemented Interfaces:
Poolable
,Recyclable
,Component
,LogEnabled
,Generator
,SitemapModelComponent
,XMLProducer
public class WebdavPropfindGenerator extends AbstractGenerator
Reader for WebDAV PROFIND method
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
WebdavPropfindGenerator.PropfindType
-
Field Summary
Fields Modifier and Type Field Description private static List<Pair<String,String>>
__DEFAULT_PROPS_COLLECTION
private static List<Pair<String,String>>
__DEFAULT_PROPS_RESOURCE
static int
DEFAULT_DEPTH
Default recursion depth for foldersstatic String
WEBDAV_NAMESPACE
The webdav namespace-
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 WebdavPropfindGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_endPropstatNode(String status)
private void
_endResponseNode()
private Element
_getFirstChildElement(Element element)
private List<Pair<String,String>>
_getProps(Element props)
private void
_notFoundPropstatNode(List<Pair<String,String>> notFound)
private void
_processCollection(ResourceCollection resource, int currentDepth, int maxDepth, WebdavPropfindGenerator.PropfindType type, List<Pair<String,String>> props)
Add a folder in the XML responseprivate void
_processResource(Resource resource, WebdavPropfindGenerator.PropfindType type, List<Pair<String,String>> props)
private void
_startPropstatNode()
private void
_startResponseNode(String href)
void
generate()
-
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
-
WEBDAV_NAMESPACE
public static final String WEBDAV_NAMESPACE
The webdav namespace- See Also:
- Constant Field Values
-
DEFAULT_DEPTH
public static final int DEFAULT_DEPTH
Default recursion depth for folders- See Also:
- Constant Field Values
-
__DEFAULT_PROPS_RESOURCE
private static final List<Pair<String,String>> __DEFAULT_PROPS_RESOURCE
-
__DEFAULT_PROPS_COLLECTION
private static final List<Pair<String,String>> __DEFAULT_PROPS_COLLECTION
-
-
Constructor Detail
-
WebdavPropfindGenerator
public WebdavPropfindGenerator()
-
-
Method Detail
-
generate
public void generate() throws IOException, SAXException, ProcessingException
-
_getFirstChildElement
private Element _getFirstChildElement(Element element)
-
_processResource
private void _processResource(Resource resource, WebdavPropfindGenerator.PropfindType type, List<Pair<String,String>> props) throws SAXException
- Throws:
SAXException
-
_processCollection
private void _processCollection(ResourceCollection resource, int currentDepth, int maxDepth, WebdavPropfindGenerator.PropfindType type, List<Pair<String,String>> props) throws SAXException
Add a folder in the XML response- Parameters:
resource
- the resource to saxprops
- the list of properties to returncurrentDepth
- current depthmaxDepth
- max depth (if current depth >= max depth, no children nodes will be added, only the current folder)type
- the prop find type- Throws:
SAXException
- an exception occurred
-
_startResponseNode
private void _startResponseNode(String href) throws SAXException
- Throws:
SAXException
-
_startPropstatNode
private void _startPropstatNode() throws SAXException
- Throws:
SAXException
-
_endResponseNode
private void _endResponseNode() throws SAXException
- Throws:
SAXException
-
_endPropstatNode
private void _endPropstatNode(String status) throws SAXException
- Throws:
SAXException
-
_notFoundPropstatNode
private void _notFoundPropstatNode(List<Pair<String,String>> notFound) throws SAXException
- Throws:
SAXException
-
-