Package org.alfresco.repo.webdav
Class PropPatchMethod
- java.lang.Object
-
- org.alfresco.repo.webdav.WebDAVMethod
-
- org.alfresco.repo.webdav.PropFindMethod
-
- org.alfresco.repo.webdav.PropPatchMethod
-
public class PropPatchMethod extends PropFindMethod
Implements the WebDAV PROPPATCH method- Author:
- Ivan Rybnikov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PropPatchMethod.PropertyAction
Stores information about PROPPATCH action(set or remove) an according property.-
Nested classes/interfaces inherited from class org.alfresco.repo.webdav.WebDAVMethod
WebDAVMethod.Condition
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<PropPatchMethod.PropertyAction>
m_propertyActions
-
Fields inherited from class org.alfresco.repo.webdav.PropFindMethod
FIND_PROPS, GET_ALL_PROPS, GET_NAMED_PROPS, m_mode, m_namespaces, m_properties
-
Fields inherited from class org.alfresco.repo.webdav.WebDAVMethod
logger, m_childToParent, m_conditions, m_davHelper, m_depth, m_parentLockInfo, m_request, m_resourceTag, m_response, m_rootNodeRef, m_strPath, m_userAgent
-
-
Constructor Summary
Constructors Constructor Description PropPatchMethod()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WebDAVProperty
createProperty(org.w3c.dom.Node node)
Creates a WebDAVProperty from the given XML nodeprotected void
executeImpl()
Execute the main WebDAV request processingprotected void
generateError(org.dom4j.io.XMLWriter xml)
Generates the error tagprotected void
generatePropertyResponse(org.dom4j.io.XMLWriter xml, WebDAVProperty property, int status, java.lang.String description)
Generates the XML response for a PROPFIND request that asks for a list of all known propertiesprotected void
generateResponseImpl()
Does nothing unless overridden - for reasons of backwards compatibility.protected boolean
isReadOnly()
Override and return true if the method is a query method only.protected void
parseRequestBody()
Parse the request bodyprotected void
parseRequestHeaders()
Parse the request headersprotected void
patchProperties(org.alfresco.service.cmr.model.FileInfo nodeInfo, java.lang.String path)
-
Methods inherited from class org.alfresco.repo.webdav.PropFindMethod
generateAllPropertiesResponse, generateFindPropertiesResponse, generateLockDiscoveryResponse, generateResponseForNode, getMode, getXMLOutputFormat, loadDeadProperties, persistDeadProperties, writeLockTypes
-
Methods inherited from class org.alfresco.repo.webdav.WebDAVMethod
checkNode, checkNode, createXMLWriter, execute, flushXML, generateLockDiscoveryXML, generateLockDiscoveryXML, generateNamespaceDeclarations, getActionService, getAuthenticationService, getContentService, getContextPath, getDAVHelper, getDAVLockService, getDepth, getFileFolderService, getMimetypeService, getNamespaceService, getNodeForPath, getNodeLockInfo, getNodeService, getPath, getPermissionService, getRequestBodyAsDocument, getRootNodeRef, getSearchService, getServiceRegistry, getServletPath, getSiteId, getStatusForAccessDeniedException, getTenantDomain, getTransactionService, getURLForPath, getWorkingCopy, parseDepthHeader, parseIfHeader, setDetails, shouldFlushXMLWriter, toString
-
-
-
-
Field Detail
-
m_propertyActions
protected java.util.ArrayList<PropPatchMethod.PropertyAction> m_propertyActions
-
-
Method Detail
-
isReadOnly
protected boolean isReadOnly()
Description copied from class:WebDAVMethod
Override and return true if the method is a query method only. The default implementation returns false.- Overrides:
isReadOnly
in classPropFindMethod
- Returns:
- Returns false always
-
executeImpl
protected void executeImpl() throws WebDAVServerException, java.lang.Exception
Description copied from class:PropFindMethod
Execute the main WebDAV request processing- Overrides:
executeImpl
in classPropFindMethod
- Throws:
WebDAVServerException
- a general server exceptionjava.lang.Exception
- any unhandled exception
-
generateResponseImpl
protected void generateResponseImpl() throws java.lang.Exception
Description copied from class:WebDAVMethod
Does nothing unless overridden - for reasons of backwards compatibility. Subclasses implementing this method should separate the WebDAV method execution logic from response generation logic. Execution logic should be contained in theWebDAVMethod.executeImpl()
method and should NOT contain any code that writes to the response. Conversely response generation logic should NOT contain any code relating to the desired effect of the WebDAV method (e.g. setting properties on a node) and should be contained purely within this method.Older methods, until refactored will not override this method, relying only on
WebDAVMethod.executeImpl()
.- Overrides:
generateResponseImpl
in classWebDAVMethod
- Throws:
java.lang.Exception
-
parseRequestBody
protected void parseRequestBody() throws WebDAVServerException
Parse the request body- Overrides:
parseRequestBody
in classPropFindMethod
- Throws:
WebDAVServerException
-
parseRequestHeaders
protected void parseRequestHeaders() throws WebDAVServerException
Parse the request headers- Overrides:
parseRequestHeaders
in classPropFindMethod
- Throws:
WebDAVServerException
-
createProperty
protected WebDAVProperty createProperty(org.w3c.dom.Node node)
Creates a WebDAVProperty from the given XML node- Overrides:
createProperty
in classPropFindMethod
-
patchProperties
protected void patchProperties(org.alfresco.service.cmr.model.FileInfo nodeInfo, java.lang.String path) throws WebDAVServerException
- Throws:
WebDAVServerException
-
generatePropertyResponse
protected void generatePropertyResponse(org.dom4j.io.XMLWriter xml, WebDAVProperty property, int status, java.lang.String description)
Generates the XML response for a PROPFIND request that asks for a list of all known properties- Parameters:
xml
- XMLWriterproperty
- WebDAVPropertystatus
- intdescription
- String
-
generateError
protected void generateError(org.dom4j.io.XMLWriter xml)
Generates the error tag- Parameters:
xml
- XMLWriter
-
-