org.apache.jackrabbit.webdav.jcr
Class VersionControlledItemCollection

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.jcr.AbstractResource
      extended byorg.apache.jackrabbit.webdav.jcr.AbstractItemResource
          extended byorg.apache.jackrabbit.webdav.jcr.DefaultItemCollection
              extended byorg.apache.jackrabbit.webdav.jcr.VersionControlledItemCollection
All Implemented Interfaces:
DavResource, DeltaVResource, ItemResourceConstants, ObservationResource, OrderingResource, SearchResource, TransactionResource, VersionableResource, VersionControlledResource

public class VersionControlledItemCollection
extends DefaultItemCollection
implements VersionControlledResource

VersionControlledItemCollection represents a JCR node item and covers all functionality related to versioning of Nodes.

See Also:
Node

Field Summary
 
Fields inherited from class org.apache.jackrabbit.webdav.jcr.DefaultItemCollection
initedProps, item, properties, supportedLock, supportedReports
 
Fields inherited from interface org.apache.jackrabbit.webdav.version.VersionControlledResource
ACTIVITY_SET, AUTO_MERGE_SET, AUTO_VERSION, BASELINE_CONTROLLED_COLLECTION, CHECKED_IN, CHECKED_OUT, CHECKIN_FORK, CHECKOUT_FORK, ECLIPSED_SET, MERGE_SET, methods_checkedIn, methods_checkedOut, PREDECESSOR_SET, SUBBASELINE_SET, UNRESERVED, VERSION_HISTORY
 
Fields inherited from interface org.apache.jackrabbit.webdav.version.VersionableResource
COMPLIANCE_CLASS, METHODS
 
Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
METHODS_INCL_MKWORKSPACE
 
Fields inherited from interface org.apache.jackrabbit.webdav.ordering.OrderingResource
COMPLIANCE_CLASS, METHODS
 
Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationResource
COMPLIANCE_CLASS, METHODS
 
Fields inherited from interface org.apache.jackrabbit.webdav.jcr.ItemResourceConstants
ATTR_VALUE_TYPE, EXCLUSIVE_SESSION, JCR_DEFINITION, JCR_DEPTH, JCR_INDEX, JCR_ISMODIFIED, JCR_ISNEW, JCR_LENGTH, JCR_LENGTHS, JCR_MIXINNODETYPES, JCR_NAME, JCR_NAMESPACES, JCR_PARENT, JCR_PATH, JCR_PRIMARYITEM, JCR_PRIMARYNODETYPE, JCR_REFERENCES, JCR_TYPE, JCR_UUID, JCR_VALUE, JCR_VALUES, JCR_VERSIONABLEUUID, METHODS, NAMESPACE, PRIVILEGE_JCR_ADD_NODE, PRIVILEGE_JCR_READ, PRIVILEGE_JCR_REMOVE, PRIVILEGE_JCR_SET_PROPERTY, ROOT_ITEM_PATH, ROOT_ITEM_RESOURCEPATH, VERSIONSTORAGE_PATH, XML_DESCRIPTOR, XML_DESCRIPTORKEY, XML_DESCRIPTORVALUE, XML_EXCLUSIVE_SESSION_SCOPED, XML_LENGTH, XML_NAMESPACE, XML_PREFIX, XML_PRIMARYNODETYPE, XML_RELPATH, XML_REMOVEEXISTING, XML_URI, XML_VALUE
 
Fields inherited from interface org.apache.jackrabbit.webdav.transaction.TransactionResource
COMPLIANCE_CLASS, METHODS
 
Fields inherited from interface org.apache.jackrabbit.webdav.search.SearchResource
COMPLIANCE_CLASS, METHODS
 
Constructor Summary
VersionControlledItemCollection(DavResourceLocator locator, JcrDavSession session, DavResourceFactory factory, Item item)
          Create a new VersionControlledItemCollection.
 
Method Summary
 void addVersionControl()
          Adds version control to this resource.
 MultiStatusResponse alterProperties(List changeList)
          Set/add and remove the specified properties from this resource.
 String checkin()
          Calls Node.checkin() on the underlying repository node.
 void checkout()
          Calls Node.checkout() on the underlying repository node.
 String getSupportedMethods()
          Return a comma separated string listing the supported method names.
 VersionHistoryResource getVersionHistory()
          Returns the VersionHistory associated with the repository node.
protected  void initProperties()
          Fill the property set for this resource.
protected  void initSupportedReports()
          Define the set of reports supported by this resource.
 void label(LabelInfo labelInfo)
          Modify the labels present with the versions of this resource.
 MultiStatus merge(MergeInfo mergeInfo)
          Merge the repository node represented by this resource according to the information present in the given MergeInfo object.
 void uncheckout()
          Not implemented.
 MultiStatus update(UpdateInfo updateInfo)
          Perform an update on this resource.
 
Methods inherited from class org.apache.jackrabbit.webdav.jcr.DefaultItemCollection
addHrefProperty, addHrefProperty, addLockManager, addMember, addWorkspace, alterProperties, copy, createResourceFromLocator, exists, getCollection, getComplianceClass, getDisplayName, getFactory, getHref, getItemName, getLocator, getLocatorFromItem, getLocatorFromItemPath, getLock, getLocks, getMembers, getModificationTime, getOptionResponse, getProperties, getProperty, getPropertyNames, getQueryGrammerSet, getReferenceResources, getReport, getRepositorySession, getResourcePath, getSession, getTransactionId, getWorkspaceHref, hasLock, init, init, initLockSupport, isCollection, isLockable, isOrderable, lock, move, orderMembers, poll, refreshLock, removeMember, removeProperty, search, setProperty, spool, subscribe, unlock, unlock, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
addWorkspace, getOptionResponse, getReferenceResources, getReport
 
Methods inherited from interface org.apache.jackrabbit.webdav.DavResource
addLockManager, addMember, alterProperties, copy, exists, getCollection, getComplianceClass, getDisplayName, getFactory, getHref, getLocator, getLock, getLocks, getMembers, getModificationTime, getProperties, getProperty, getPropertyNames, getResourcePath, getSession, hasLock, isCollection, isLockable, lock, move, refreshLock, removeMember, removeProperty, setProperty, spool, unlock
 

Constructor Detail

VersionControlledItemCollection

public VersionControlledItemCollection(DavResourceLocator locator,
                                       JcrDavSession session,
                                       DavResourceFactory factory,
                                       Item item)
Create a new VersionControlledItemCollection.

Parameters:
locator -
session -
Method Detail

getSupportedMethods

public String getSupportedMethods()
Return a comma separated string listing the supported method names.

Specified by:
getSupportedMethods in interface DavResource
Overrides:
getSupportedMethods in class DefaultItemCollection
Returns:
the supported method names.
See Also:
DavResource.getSupportedMethods()

alterProperties

public MultiStatusResponse alterProperties(List changeList)
                                    throws DavException
Description copied from interface: DavResource
Set/add and remove the specified properties from this resource.

Specified by:
alterProperties in interface DavResource
Overrides:
alterProperties in class DefaultItemCollection
Parameters:
changeList -
Returns:
Throws:
DavException
See Also:
for additional description of non-compliant behaviour.

addVersionControl

public void addVersionControl()
                       throws DavException
Adds version control to this resource. If the resource is already under version control, this method has no effect.

Specified by:
addVersionControl in interface VersionableResource
Throws:
DavException - if this resource does not exist yet or if an error occurs while making the underlying node versionable.
See Also:
VersionableResource.addVersionControl()

checkin

public String checkin()
               throws DavException
Calls Node.checkin() on the underlying repository node.

Specified by:
checkin in interface VersionControlledResource
Returns:
String representing the location of the version created by the checkin.
Throws:
DavException
See Also:
VersionControlledResource.checkin()

checkout

public void checkout()
              throws DavException
Calls Node.checkout() on the underlying repository node.

Specified by:
checkout in interface VersionControlledResource
Throws:
DavException
See Also:
VersionControlledResource.checkout()

uncheckout

public void uncheckout()
                throws DavException
Not implemented. Always throws a DavException with error code HttpServletResponse.SC_NOT_IMPLEMENTED.

Specified by:
uncheckout in interface VersionControlledResource
Throws:
DavException
See Also:
VersionControlledResource.uncheckout()

update

public MultiStatus update(UpdateInfo updateInfo)
                   throws DavException
Perform an update on this resource. Depending on the format of the updateInfo this is translated to one of the following methods defined by the JCR API:

Limitation: note that the MultiStatus returned by this method will not list any nodes that have been removed due to an Uuid conflict.

Specified by:
update in interface VersionControlledResource
Parameters:
updateInfo -
Returns:
Throws:
DavException
See Also:
VersionControlledResource.update(org.apache.jackrabbit.webdav.version.UpdateInfo)

merge

public MultiStatus merge(MergeInfo mergeInfo)
                  throws DavException
Merge the repository node represented by this resource according to the information present in the given MergeInfo object.

Specified by:
merge in interface VersionControlledResource
Parameters:
mergeInfo -
Returns:
MultiStatus recording all repository items modified by this merge call as well as the resources that a client must modify to complete the merge (see RFC 3253)
Throws:
DavException
See Also:
VersionControlledResource.merge(org.apache.jackrabbit.webdav.version.MergeInfo), Node.merge(String, boolean)

label

public void label(LabelInfo labelInfo)
           throws DavException
Modify the labels present with the versions of this resource.

Specified by:
label in interface VersionControlledResource
Parameters:
labelInfo -
Throws:
DavException
See Also:
VersionHistory.addVersionLabel(String, String, boolean), VersionHistory.removeVersionLabel(String)

getVersionHistory

public VersionHistoryResource getVersionHistory()
                                         throws DavException
Returns the VersionHistory associated with the repository node. If the node is not versionable an exception is thrown.

Specified by:
getVersionHistory in interface VersionControlledResource
Returns:
the VersionHistoryResource associated with this resource.
Throws:
DavException
See Also:
VersionControlledResource.getVersionHistory(), Node.getVersionHistory()

initSupportedReports

protected void initSupportedReports()
Define the set of reports supported by this resource.

Overrides:
initSupportedReports in class DefaultItemCollection
See Also:
SupportedReportSetProperty

initProperties

protected void initProperties()
Fill the property set for this resource.

Overrides:
initProperties in class DefaultItemCollection


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