org.apache.jackrabbit.webdav.version
Class LabelInfo

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.version.LabelInfo
All Implemented Interfaces:
DeltaVConstants

public class LabelInfo
extends Object
implements DeltaVConstants

LabelInfo encapsulates the request body of a LABEL request used to add, set or remove a label from the requested version resource or from that version specified with the Label header in case the requested resource is a version-controlled resource.

The request body (thus the 'labelElement' passed to the constructore must be a DAV:label element:

 <!ELEMENT label ANY>
 ANY value: A sequence of elements with at most one DAV:add,
 DAV:set, or DAV:remove element.
 <!ELEMENT add (label-name)>
 <!ELEMENT set (label-name)>
 <!ELEMENT remove (label-name)>
 <!ELEMENT label-name (#PCDATA)>
 PCDATA value: string
 


Field Summary
static int TYPE_ADD
           
static int TYPE_REMOVE
           
static int TYPE_SET
           
 
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, 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
LabelInfo(org.jdom.Element labelElement)
          Create a new LabelInfo from the given element.
LabelInfo(org.jdom.Element labelElement, int depth)
          Create a new LabelInfo from the given element and depth integer.
 
Method Summary
 int getDepth()
          Return the depth
 org.jdom.Element getLabelElement()
          Return the DAV:label element
 String getLabelName()
          Return the 'label-name' or null
 int getType()
          Return the type of the LABEL request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_SET

public static final int TYPE_SET
See Also:
Constant Field Values

TYPE_REMOVE

public static final int TYPE_REMOVE
See Also:
Constant Field Values

TYPE_ADD

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

LabelInfo

public LabelInfo(org.jdom.Element labelElement,
                 int depth)
Create a new LabelInfo from the given element and depth integer. If the specified Xml element does have a DeltaVConstants.XML_LABEL root element or no label name is specified with the action to perform the creation will fail.

Parameters:
labelElement -
depth -
Throws:
IllegalArgumentException - if the specified element does not start with a DeltaVConstants.XML_LABEL element or if the DAV:label element contains illegal instructions e.g. contains multiple DAV:add, DAV:set or DAV:remove elements.

LabelInfo

public LabelInfo(org.jdom.Element labelElement)
Create a new LabelInfo from the given element. As depth the default value 0 is assumed.

Parameters:
labelElement -
Throws:
IllegalArgumentException
See Also:
LabelInfo(org.jdom.Element, int)
Method Detail

getLabelName

public String getLabelName()
Return the 'label-name' or null

Returns:
'label-name' or null

getType

public int getType()
Return the type of the LABEL request. This might either be TYPE_SET, TYPE_ADD or TYPE_REMOVE.

Returns:
type

getDepth

public int getDepth()
Return the depth

Returns:
depth

getLabelElement

public org.jdom.Element getLabelElement()
Return the DAV:label element

Returns:
the DAV:label element


Copyright © 2005 . All Rights Reserved.