org.apache.jackrabbit.webdav.version
Class UpdateInfo

java.lang.Object
  extended by org.apache.jackrabbit.webdav.version.UpdateInfo
All Implemented Interfaces:
DeltaVConstants, XmlSerializable

public class UpdateInfo
extends Object
implements DeltaVConstants, XmlSerializable

UpdateInfo encapsulates the request body of an UPDATE request. RFC 3253 defines the request body as follows:

 <!ELEMENT update ANY>
 ANY value: A sequence of elements with at most one DAV:label-name or
 DAV:version element (but not both).
 In addition at one DAV:prop element can be present.

 <!ELEMENT version (href)>
 <!ELEMENT label-name (#PCDATA)> PCDATA value: string
 prop: see RFC 2518, Section 12.11
 
In order to reflect the complete range of version restoring and updating of nodes defined by JSR170 the definition has been extended:
 <!ELEMENT update ( (version | label-name | workspace ) , (prop)?, (removeExisting)? ) >
 <!ELEMENT version (href+) >
 <!ELEMENT label-name (#PCDATA) >
 <!ELEMENT workspace (href) >
 <!ELEMENT prop ANY >
 <!ELEMENT removeExisting EMPTY >
 


Field Summary
static int UPDATE_BY_LABEL
           
static int UPDATE_BY_VERSION
           
static int UPDATE_BY_WORKSPACE
           
 
Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVConstants
ATTR_NAME, ATTR_NAMESPACE, COMMENT, CREATOR_DISPLAYNAME, HEADER_LABEL, HEADER_LOCATION, NAMESPACE, SUPPORTED_LIVE_PROPERTY_SET, SUPPORTED_METHOD_SET, SUPPORTED_REPORT_SET, VERSION_CONTROLLED_CONFIGURATION, WORKSPACE, XML_ACTIVITY, XML_ACTIVITY_COLLECTION_SET, XML_BASELINE, XML_CHECKOUT, XML_CHECKOUT_CHECKIN, XML_CHECKOUT_UNLOCK_CHECKIN, XML_EXPAND_PROPERTY, XML_LABEL, XML_LABEL_ADD, XML_LABEL_NAME, XML_LABEL_REMOVE, XML_LABEL_SET, XML_LOCATE_BY_HISTORY, XML_LOCKED_CHECKIN, XML_MERGE, XML_N0_AUTO_MERGE, XML_N0_CHECKOUT, XML_OPTIONS, XML_OPTIONS_RESPONSE, XML_PROPERTY, XML_REPORT, XML_SUPPORTED_METHOD, XML_SUPPORTED_REPORT, XML_UPDATE, XML_VERSION, XML_VERSION_HISTORY, XML_VERSION_HISTORY_SET, XML_VERSION_TREE, XML_VH_COLLECTION_SET, XML_WORKSPACE, XML_WSP_COLLECTION_SET
 
Constructor Summary
UpdateInfo(Element updateElement)
          Create a new UpdateInfo object.
UpdateInfo(String[] updateSource, int updateType, DavPropertyNameSet propertyNameSet)
           
 
Method Summary
static Element createUpdateElement(String[] updateSource, int updateType, Document factory)
          Factory method to create the basic structure of an UpdateInfo object.
 String[] getLabelName()
           
 DavPropertyNameSet getPropertyNameSet()
          Returns a DavPropertyNameSet.
 Element getUpdateElement()
           
 String[] getVersionHref()
           
 String getWorkspaceHref()
           
 Element toXml(Document document)
          Returns the xml representation of the implementing object as Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_BY_VERSION

public static final int UPDATE_BY_VERSION
See Also:
Constant Field Values

UPDATE_BY_LABEL

public static final int UPDATE_BY_LABEL
See Also:
Constant Field Values

UPDATE_BY_WORKSPACE

public static final int UPDATE_BY_WORKSPACE
See Also:
Constant Field Values
Constructor Detail

UpdateInfo

public UpdateInfo(String[] updateSource,
                  int updateType,
                  DavPropertyNameSet propertyNameSet)

UpdateInfo

public UpdateInfo(Element updateElement)
           throws DavException
Create a new UpdateInfo object.

Parameters:
updateElement -
Throws:
DavException - if the updateElement is null or not a DAV:update element or if the element does not match the required structure.
Method Detail

getVersionHref

public String[] getVersionHref()
Returns:

getLabelName

public String[] getLabelName()
Returns:

getWorkspaceHref

public String getWorkspaceHref()
Returns:

getPropertyNameSet

public DavPropertyNameSet getPropertyNameSet()
Returns a DavPropertyNameSet. If the DAV:update element contains a DAV:prop child element the properties specified therein are included in the set. Otherwise an empty set is returned.

WARNING: modifying the DavPropertyNameSet returned by this method does not modify this UpdateInfo.

Returns:
set listing the properties specified in the DAV:prop element indicating those properties that must be reported in the response body.

getUpdateElement

public Element getUpdateElement()
Returns:

toXml

public Element toXml(Document document)
Description copied from interface: XmlSerializable
Returns the xml representation of the implementing object as Element. The given Document is used as factory and represents the owner document of the returned DOM element.

Specified by:
toXml in interface XmlSerializable
Parameters:
document -
Returns:
a w3c element representing this object
See Also:
XmlSerializable.toXml(Document)

createUpdateElement

public static Element createUpdateElement(String[] updateSource,
                                          int updateType,
                                          Document factory)
Factory method to create the basic structure of an UpdateInfo object.

Parameters:
updateSource -
updateType -
factory -
Returns:


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.