org.apache.wvcm.store.webdav.request
Class AbstractRequest

java.lang.Object
  extended by org.apache.wvcm.store.webdav.request.AbstractRequest
Direct Known Subclasses:
AclRequest, BindRequest, CheckinRequest, CheckoutRequest, LabelRequest, LockRequest, OptionsRequest, PropfindRequest, ProppatchRequest, RebindRequest, ReportRequest, SearchRequest, UnbindRequest, UpdateRequest, VersionControlRequest

public abstract class AbstractRequest
extends java.lang.Object

Base class for all handlers for request bodies.

Version:
$Revision: 1.1.1.1.2.8 $

Field Summary
protected static java.lang.String[] defaultProperties
           
protected static org.jdom.Namespace dnsp
           
 
Constructor Summary
AbstractRequest()
          Constructor
 
Method Summary
protected  void createDefaultPropertyElement(org.jdom.Element contextElm, java.lang.String name)
           
protected  void createDefaultPropertyElements(org.jdom.Element contextElm, PropertyNameList pnameList)
          Add default property elements, needed for resource type determination, to the specified context element.
protected  void createHrefElement(org.jdom.Element contextElm, Resource resource)
          Create a href element for the specified resource in the specified context
protected  void createHrefElement(org.jdom.Element contextElm, java.lang.String resourcePath)
          Create a href element for the specified resource path in the specified context
protected  void createHrefElements(org.jdom.Element contextElm, java.util.List resourceList)
          Create a href elements for all the specified resources in the specified context
protected  void createPrivilegeElement(org.jdom.Element contextElm, AccessControlElement.Privilege privilege)
          Create a privilege element for the specified Privilege in the specified context
protected  void createPropElement(org.jdom.Element contextElm, PropertyNameList pnameList)
          Add a DAV:prop element containing the specified properties to the specified context element.
protected  void createPropElement(org.jdom.Element contextElm, PropertyNameList pnameList, boolean addDefaultProps)
          Add a DAV:prop element containing the specified properties to the specified context element.
protected  org.jdom.Element createPropertyElement(PropertyNameList.PropertyName pname)
          Create property element for specified PropertyName
protected  void createPropertyElements(org.jdom.Element contextElm, PropertyNameList pnameList)
          Create property elements in the specified context.
 byte[] getReqBodyAsBytes()
          Get the request body as byte array.
 void setReqBodyDoc(org.jdom.Document reqBodyDoc)
          Set the request body document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dnsp

protected static org.jdom.Namespace dnsp

defaultProperties

protected static java.lang.String[] defaultProperties
Constructor Detail

AbstractRequest

public AbstractRequest()
Constructor

Method Detail

setReqBodyDoc

public void setReqBodyDoc(org.jdom.Document reqBodyDoc)
Set the request body document

Parameters:
reqBodyDoc - the document

getReqBodyAsBytes

public byte[] getReqBodyAsBytes()
Get the request body as byte array.

Returns:
the request body

createPropElement

protected void createPropElement(org.jdom.Element contextElm,
                                 PropertyNameList pnameList)
Add a DAV:prop element containing the specified properties to the specified context element. If the specified property name list consists only of ALL_ATTRIBUTES, a DAV:allprop element is added instead.

Parameters:
contextElm - an Element
pnameList - a PropertyNameList

createPropElement

protected void createPropElement(org.jdom.Element contextElm,
                                 PropertyNameList pnameList,
                                 boolean addDefaultProps)
Add a DAV:prop element containing the specified properties to the specified context element. If the specified property name list consists only of ALL_ATTRIBUTES, a DAV:allprop element is added instead.

Parameters:
contextElm - an Element
pnameList - a PropertyNameList
addDefaultProps - a boolean

createDefaultPropertyElements

protected void createDefaultPropertyElements(org.jdom.Element contextElm,
                                             PropertyNameList pnameList)
Add default property elements, needed for resource type determination, to the specified context element.

Parameters:
contextElm - an Element

createDefaultPropertyElement

protected void createDefaultPropertyElement(org.jdom.Element contextElm,
                                            java.lang.String name)

createPropertyElements

protected void createPropertyElements(org.jdom.Element contextElm,
                                      PropertyNameList pnameList)
Create property elements in the specified context.

Parameters:
contextElm - the context
pnameList - the wanted properties

createPropertyElement

protected org.jdom.Element createPropertyElement(PropertyNameList.PropertyName pname)
Create property element for specified PropertyName

Parameters:
pname - a PropertyName
Returns:
the property element

createPrivilegeElement

protected void createPrivilegeElement(org.jdom.Element contextElm,
                                      AccessControlElement.Privilege privilege)
Create a privilege element for the specified Privilege in the specified context

Parameters:
contextElm - an Element
privilege - a Privilege

createHrefElement

protected void createHrefElement(org.jdom.Element contextElm,
                                 Resource resource)
                          throws WvcmException
Create a href element for the specified resource in the specified context

Parameters:
contextElm - an Element
resource - a Resource
Throws:
WvcmException - if the resource has an invalid URI location

createHrefElement

protected void createHrefElement(org.jdom.Element contextElm,
                                 java.lang.String resourcePath)
                          throws WvcmException
Create a href element for the specified resource path in the specified context

Parameters:
contextElm - an Element
resourcePath - a String
Throws:
WvcmException - if the resource has an invalid URI location

createHrefElements

protected void createHrefElements(org.jdom.Element contextElm,
                                  java.util.List resourceList)
                           throws WvcmException
Create a href elements for all the specified resources in the specified context

Parameters:
contextElm - an Element
resourceList - a List of Resource instances
Throws:
WvcmException - if a resource has an invalid URI location


Copyright (c) 2003 - Apache Software Foundation