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 classWebdavPropfindGenerator.PropfindType
-
Field Summary
Fields Modifier and Type Field Description private static List<Pair<String,String>>__DEFAULT_PROPS_COLLECTIONprivate static List<Pair<String,String>>__DEFAULT_PROPS_RESOURCEstatic intDEFAULT_DEPTH_ALLPROPDefault recursion depth for foldersstatic intDEFAULT_DEPTH_NO_RECURSIONDefault recursion depth for no recursionstatic StringWEBDAV_NAMESPACEThe 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 boolean_processProperty(String namespace, String name, Resource resource, String href)private void_processResource(Resource resource, WebdavPropfindGenerator.PropfindType type, List<Pair<String,String>> props)private void_startPropstatNode()private void_startResponseNode(String href)voidgenerate()-
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_ALLPROP
public static final int DEFAULT_DEPTH_ALLPROP
Default recursion depth for folders- See Also:
- Constant Field Values
-
DEFAULT_DEPTH_NO_RECURSION
public static final int DEFAULT_DEPTH_NO_RECURSION
Default recursion depth for no recursion- 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
-
_processProperty
private boolean _processProperty(String namespace, String name, Resource resource, String href) 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
-
-