|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.webdav.jcr.DefaultItemCollection
org.apache.jackrabbit.webdav.jcr.VersionControlledItemCollection
public class VersionControlledItemCollection
VersionControlledItemCollection represents a JCR node item and
covers all functionality related to versioning of Nodes.
Node| Field Summary | |
|---|---|
protected boolean |
initedProps
|
protected javax.jcr.Item |
item
|
protected DavPropertySet |
properties
|
protected SupportedLock |
supportedLock
|
protected SupportedReportSetProperty |
supportedReports
|
| Fields inherited from interface org.apache.jackrabbit.webdav.version.VersionControlledResource |
|---|
ACTIVITY_SET, AUTO_MERGE_SET, AUTO_VERSION, BASELINE_CONTROLLED_COLLECTION, ECLIPSED_SET, CHECKED_IN, CHECKED_OUT, CHECKIN_FORK, CHECKOUT_FORK, MERGE_SET, methods_checkedIn, methods_checkedOut, PREDECESSOR_SET, SUBBASELINE_SET, UNRESERVED, VERSION_HISTORY |
| Fields inherited from interface org.apache.jackrabbit.webdav.version.VersionableResource |
|---|
METHODS |
| Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource |
|---|
METHODS_INCL_MKWORKSPACE |
| Fields inherited from interface org.apache.jackrabbit.webdav.ordering.OrderingResource |
|---|
METHODS |
| Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationResource |
|---|
METHODS |
| Fields inherited from interface org.apache.jackrabbit.webdav.transaction.TransactionResource |
|---|
METHODS |
| Fields inherited from interface org.apache.jackrabbit.webdav.search.SearchResource |
|---|
METHODS |
| Constructor Summary | |
|---|---|
VersionControlledItemCollection(DavResourceLocator locator,
JcrDavSession session,
DavResourceFactory factory,
javax.jcr.Item item)
Create a new VersionControlledItemCollection. |
|
| Method Summary | |
|---|---|
void |
addLockManager(LockManager lockMgr)
|
void |
addVersionControl()
Adds version control to this resource. |
void |
addWorkspace(DavResource workspace)
The JCR api does not provide methods to create new workspaces. |
MultiStatusResponse |
alterProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames)
Builds a single List from the properties to set and the properties to remove and delegates the list to AbstractResource.alterProperties(List); |
MultiStatusResponse |
alterProperties(List changeList)
Loops over the given Lists and alters the properties accordingly. |
void |
copy(DavResource destination,
boolean shallow)
Copies the underlying repository item to the indicated destination. |
protected DavResource |
createResourceFromLocator(DavResourceLocator loc)
Create a new DavResource from the given locator. |
boolean |
exists()
Returns true if there exists a repository item with the given
resource path, false otherwise. |
DavResource |
getCollection()
Returns the resource representing the parent item of the repository item represented by this resource. |
String |
getDisplayName()
Retrieves the last segment of the item path (or the resource path if this resource does not exist). |
DavResourceFactory |
getFactory()
|
String |
getHref()
|
protected static String |
getItemName(String itemPath)
Retrieves the last segment of the given path and removes the index if present. |
DavResourceLocator |
getLocator()
|
protected DavResourceLocator |
getLocatorFromItem(javax.jcr.Item repositoryItem)
Build a new DavResourceLocator from the given repository item. |
protected DavResourceLocator |
getLocatorFromItemPath(String itemPath)
Build a DavResourceLocator from the given itemPath path. |
ActiveLock[] |
getLocks()
|
OptionsResponse |
getOptionResponse(OptionsInfo optionsInfo)
|
DavPropertySet |
getProperties()
|
DavProperty |
getProperty(DavPropertyName name)
|
DavPropertyName[] |
getPropertyNames()
|
QueryGrammerSet |
getQueryGrammerSet()
|
DavResource[] |
getReferenceResources(DavPropertyName hrefPropertyName)
Return an array of DavResource objects that are referenced
by the property with the specified name. |
Report |
getReport(ReportInfo reportInfo)
|
protected javax.jcr.Session |
getRepositorySession()
Shortcut for getSession().getRepositorySession() |
String |
getResourcePath()
Returns the path of the underlying repository item or the item to be created (PUT/MKCOL). |
DavSession |
getSession()
|
String |
getSupportedMethods()
Return a comma separated string listing the supported method names. |
String |
getTransactionId()
|
VersionHistoryResource |
getVersionHistory()
Returns the VersionHistory associated with the repository node. |
protected String |
getWorkspaceHref()
Retrieve the href of the workspace the current session belongs to. |
String |
checkin()
Calls Node.checkin() on the underlying repository node. |
void |
checkout()
Calls Node.checkout() on the underlying repository node. |
void |
init(SubscriptionManager subsMgr)
|
void |
init(TxLockManager txMgr,
String transactionId)
|
protected void |
initProperties()
Fill the property set for this resource. |
protected void |
initSupportedReports()
Define the set of reports supported by this resource. |
boolean |
isLockable(Type type,
Scope scope)
Returns true, if the SupportedLock property contains an entry
with the given type and scope. |
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 |
move(DavResource destination)
Moves the underlying repository item to the indicated destination. |
EventDiscovery |
poll(String subscriptionId,
long timeout)
|
MultiStatus |
search(SearchInfo sInfo)
|
Subscription |
subscribe(SubscriptionInfo info,
String subscriptionId)
|
void |
uncheckout()
Not implemented. |
void |
unlock(String lockToken,
TransactionInfo tInfo)
|
void |
unsubscribe(String subscriptionId)
|
MultiStatus |
update(UpdateInfo updateInfo)
Perform an update on this resource. |
| Methods inherited from class org.apache.jackrabbit.webdav.jcr.DefaultItemCollection |
|---|
addHrefProperty, addHrefProperty, addMember, getComplianceClass, getLock, getMembers, getModificationTime, hasLock, initLockSupport, isCollection, isOrderable, lock, orderMembers, refreshLock, removeMember, removeProperty, setProperty, spool, unlock |
| 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 |
| Field Detail |
|---|
protected final javax.jcr.Item item
protected boolean initedProps
protected DavPropertySet properties
protected SupportedLock supportedLock
protected SupportedReportSetProperty supportedReports
| Constructor Detail |
|---|
public VersionControlledItemCollection(DavResourceLocator locator,
JcrDavSession session,
DavResourceFactory factory,
javax.jcr.Item item)
VersionControlledItemCollection.
locator - session - | Method Detail |
|---|
public String getSupportedMethods()
getSupportedMethods in interface DavResourcegetSupportedMethods in class DefaultItemCollectionDavResource.getSupportedMethods()
public MultiStatusResponse alterProperties(List changeList)
throws DavException
DefaultItemCollectionLists and alters the properties accordingly.
Changes are persisted at the end according to the rules defined with
the AbstractItemResource.complete() method.
Please note: since there is only a single property
(ItemResourceConstants.JCR_MIXINNODETYPES
that can be set or removed with PROPPATCH, this method either succeeds
or throws an exception, even if this violates RFC 2518. Thus no property
specific multistatus will be created in case of an error.
alterProperties in interface DavResourcealterProperties in class DefaultItemCollectionchangeList -
DavExceptionfor additional description of non-compliant behaviour.
public void addVersionControl()
throws DavException
addVersionControl in interface VersionableResourceDavException - if this resource does not
exist yet or if an error occurs while making the underlying node versionable.VersionableResource.addVersionControl()
public String checkin()
throws DavException
Node.checkin() on the underlying repository node.
checkin in interface VersionControlledResourceDavExceptionVersionControlledResource.checkin()
public void checkout()
throws DavException
Node.checkout() on the underlying repository node.
checkout in interface VersionControlledResourceDavExceptionVersionControlledResource.checkout()
public void uncheckout()
throws DavException
DavException with error code
HttpServletResponse.SC_NOT_IMPLEMENTED.
uncheckout in interface VersionControlledResourceDavExceptionVersionControlledResource.uncheckout()
public MultiStatus update(UpdateInfo updateInfo)
throws DavException
updateInfo
this is translated to one of the following methods defined by the JCR API:
Node.restore(javax.jcr.version.Version, boolean)Node.restore(javax.jcr.version.Version, String, boolean)Node.restoreByLabel(String, boolean)Node.update(String)MultiStatus returned by this method
will not list any nodes that have been removed due to an Uuid conflict.
update in interface VersionControlledResourceupdateInfo -
DavExceptionVersionControlledResource.update(org.apache.jackrabbit.webdav.version.UpdateInfo)
public MultiStatus merge(MergeInfo mergeInfo)
throws DavException
MergeInfo object.
merge in interface VersionControlledResourcemergeInfo -
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)
DavExceptionVersionControlledResource.merge(org.apache.jackrabbit.webdav.version.MergeInfo),
Node.merge(String, boolean)
public void label(LabelInfo labelInfo)
throws DavException
label in interface VersionControlledResourcelabelInfo -
DavExceptionVersionHistory.addVersionLabel(String, String, boolean),
VersionHistory.removeVersionLabel(String)
public VersionHistoryResource getVersionHistory()
throws DavException
VersionHistory associated with the repository node.
If the node is not versionable an exception is thrown.
getVersionHistory in interface VersionControlledResourceVersionHistoryResource associated with this resource.
DavExceptionVersionControlledResource.getVersionHistory(),
Node.getVersionHistory()protected void initSupportedReports()
initSupportedReports in class DefaultItemCollectionSupportedReportSetPropertyprotected void initProperties()
initProperties in class DefaultItemCollectionpublic boolean exists()
repository item with the given
resource path, false otherwise.
exists in interface DavResourceDavResource.exists()public String getDisplayName()
item name
which is exposed with the {http://www.day.com/jcr/webdav/1.0}name property.
getDisplayName in interface DavResourceDavResource.getDisplayName()public DavResource getCollection()
RootCollection is returned.
getCollection in interface DavResourceDavResource.getCollection()
public void move(DavResource destination)
throws DavException
move in interface DavResourcedestination -
DavExceptionDavResource.move(DavResource),
Session.move(String, String)
public void copy(DavResource destination,
boolean shallow)
throws DavException
Workspace.copy(String, String, String) is used to perform
the copy operation, Workspace.copy(String, String) otherwise.
Note, that this implementation does not support shallow copy.
copy in interface DavResourcedestination - shallow -
DavExceptionDavResource.copy(DavResource, boolean),
Workspace.copy(String, String),
Workspace.copy(String, String, String)public void init(SubscriptionManager subsMgr)
init in interface ObservationResourceObservationResource.init(SubscriptionManager)
public Subscription subscribe(SubscriptionInfo info,
String subscriptionId)
throws DavException
subscribe in interface ObservationResourceDavExceptionObservationResource.subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo, String),
SubscriptionManager.subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo, String, org.apache.jackrabbit.webdav.observation.ObservationResource)
public void unsubscribe(String subscriptionId)
throws DavException
unsubscribe in interface ObservationResourceDavExceptionObservationResource.unsubscribe(String),
SubscriptionManager.unsubscribe(String, org.apache.jackrabbit.webdav.observation.ObservationResource)
public EventDiscovery poll(String subscriptionId,
long timeout)
throws DavException
poll in interface ObservationResourceDavExceptionObservationResource.poll(String, long),
SubscriptionManager.poll(String, long, org.apache.jackrabbit.webdav.observation.ObservationResource)protected String getWorkspaceHref()
null if this resource
does not represent a repository item.AbstractResource.getWorkspaceHref()protected static String getItemName(String itemPath)
itemPath -
public DavResourceLocator getLocator()
getLocator in interface DavResourceDavResource.getLocator()public String getResourcePath()
null is returned.
getResourcePath in interface DavResourceDavResource.getResourcePath(),
DavResourceLocator.getResourcePath()public String getHref()
getHref in interface DavResourceDavResource.getHref(),
DavResourceLocator.getHref(boolean)public DavPropertyName[] getPropertyNames()
getPropertyNames in interface DavResourceDavResource.getPropertyNames()public DavProperty getProperty(DavPropertyName name)
getProperty in interface DavResourceDavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)public DavPropertySet getProperties()
getProperties in interface DavResourceDavResource.getProperties()
public MultiStatusResponse alterProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames)
throws DavException
AbstractResource.alterProperties(List);
alterProperties in interface DavResourceDavExceptionDavResource.alterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet, org.apache.jackrabbit.webdav.property.DavPropertyNameSet)
public boolean isLockable(Type type,
Scope scope)
SupportedLock property contains an entry
with the given type and scope. By default resources allow for transaction lock only.
isLockable in interface DavResourcetype - scope -
DavResource.isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)public ActiveLock[] getLocks()
getLocks in interface DavResourcetodo improve....public void addLockManager(LockManager lockMgr)
addLockManager in interface DavResourceDavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)public DavResourceFactory getFactory()
getFactory in interface DavResourceDavResource.getFactory()public DavSession getSession()
getSession in interface DavResourceDavResource.getSession(),
DavResource.getSession()
public void init(TxLockManager txMgr,
String transactionId)
init in interface TransactionResourceTransactionResource.init(TxLockManager, String)
public void unlock(String lockToken,
TransactionInfo tInfo)
throws DavException
unlock in interface TransactionResourceDavExceptionTransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)public String getTransactionId()
getTransactionId in interface TransactionResourceTransactionResource.getTransactionId()public OptionsResponse getOptionResponse(OptionsInfo optionsInfo)
getOptionResponse in interface DeltaVResourceoptionsInfo -
nullDeltaVResource.getOptionResponse(org.apache.jackrabbit.webdav.version.OptionsInfo)
public Report getReport(ReportInfo reportInfo)
throws DavException
getReport in interface DeltaVResourcereportInfo -
DavExceptionDeltaVResource.getReport(org.apache.jackrabbit.webdav.version.report.ReportInfo)
public void addWorkspace(DavResource workspace)
throws DavException
addWorkspace on this resource will always fail.
addWorkspace in interface DeltaVResourceworkspace -
DavException - Always throws.DeltaVResource.addWorkspace(org.apache.jackrabbit.webdav.DavResource)
public DavResource[] getReferenceResources(DavPropertyName hrefPropertyName)
throws DavException
DavResource objects that are referenced
by the property with the specified name.
getReferenceResources in interface DeltaVResourcehrefPropertyName -
DavResources
DavExceptionDeltaVResource.getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)public QueryGrammerSet getQueryGrammerSet()
getQueryGrammerSet in interface SearchResourceSearchResource.getQueryGrammerSet()
public MultiStatus search(SearchInfo sInfo)
throws DavException
search in interface SearchResourcesInfo -
DavExceptionSearchResource.search(org.apache.jackrabbit.webdav.search.SearchInfo)
protected DavResource createResourceFromLocator(DavResourceLocator loc)
throws DavException
DavResource from the given locator.
loc -
DavResource
DavExceptionprotected DavResourceLocator getLocatorFromItemPath(String itemPath)
DavResourceLocator from the given itemPath path.
itemPath -
DavResourceLocatorDavLocatorFactory.createResourceLocator(String, String, String)protected DavResourceLocator getLocatorFromItem(javax.jcr.Item repositoryItem)
DavResourceLocator from the given repository item.
repositoryItem -
getLocatorFromItemPath(String)protected javax.jcr.Session getRepositorySession()
getSession().getRepositorySession()
AbstractResource.session.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||