public class WorkspaceResourceImpl extends Object implements WorkspaceResource, VersionControlledResource
WorkspaceResourceImpl
...Modifier and Type | Field and Description |
---|---|
protected boolean |
initedProps |
protected DavPropertyNameSet |
names |
protected DavPropertySet |
properties |
protected SupportedLock |
supportedLock |
protected SupportedReportSetProperty |
supportedReports |
BASELINE_CONTROLLED_COLLECTION_SET, CURRENT_ACTIVITY_SET, CUURENT_ACTIVITY_SET, WORKSPACE_CHECKOUT_SET
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
METHODS
METHODS_INCL_MKWORKSPACE
METHODS
METHODS
Modifier and Type | Method and Description |
---|---|
void |
addLockManager(LockManager lockMgr)
Add an external
LockManager to this resource. |
void |
addMember(DavResource resource,
InputContext inputContext)
Throws 403 exception (Forbidden)
|
void |
addVersionControl()
Converts this versionable resource into a version-controlled resource.
|
void |
addWorkspace(DavResource workspace)
The JCR api does not provide methods to create new workspaces.
|
MultiStatusResponse |
alterProperties(List<? extends PropEntry> changeList)
Handles an attempt to set
ItemResourceConstants.JCR_NAMESPACES
and forwards any other set or remove requests to the super class. |
String |
checkin()
Perform a checkin on the version controlled resource.
|
void |
checkout()
Perform a checkout on the version controlled resource.
|
void |
copy(DavResource destination,
boolean shallow)
Throws
HttpServletResponse.SC_METHOD_NOT_ALLOWED |
protected DavResource |
createResourceFromLocator(DavResourceLocator loc)
Create a new
DavResource from the given locator. |
boolean |
exists()
Returns true if this webdav resource represents an existing repository item.
|
DavResource |
getCollection()
Retrieve the collection that has all workspace collections
as internal members.
|
String |
getComplianceClass()
Returns a string listing the compliance classes for this resource as it
is required for the DAV response header.
|
protected String |
getCreationDate()
Returns the creation date which is used for the
DavPropertyName.CREATIONDATE property. |
protected String |
getCreatorDisplayName()
Returns the display name of the creator which is used for the protected
DeltaVConstants.CREATOR_DISPLAYNAME property. |
String |
getDisplayName()
Returns the name of the workspace.
|
DavResourceFactory |
getFactory()
Return the
DavResourceFactory that created this resource. |
String |
getHref()
Returns the absolute href of this resource as returned in the
multistatus response body.
|
DavResourceLocator |
getLocator()
Returns the
locator object for this webdav resource,
which encapsulates the information for building the complete 'href'. |
protected DavResourceLocator |
getLocatorFromItem(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 |
getLock(Type type,
Scope scope)
Return the lock present on this webdav resource or
null
if the resource is either not locked or not lockable at all. |
ActiveLock[] |
getLocks()
Returns an array of all locks applied to the given resource.
|
DavResourceIterator |
getMembers()
Returns the resource representing the JCR root node.
|
long |
getModificationTime()
Always returns 'now'
|
OptionsResponse |
getOptionResponse(OptionsInfo optionsInfo)
Retrieves the information requested in the OPTIONS request body and
returns the corresponding values.
|
DavPropertySet |
getProperties()
Returns all webdav properties present on this resource that will be
return upon a
DavConstants.PROPFIND_ALL_PROP request. |
DavProperty<?> |
getProperty(DavPropertyName name)
Return the webdav property with the specified name.
|
DavPropertyName[] |
getPropertyNames()
Returns an array of all
property names available
on this resource. |
QueryGrammerSet |
getQueryGrammerSet()
Returns the protected DAV:supported-method-set property which is defined
mandatory by RTF 3253.
|
DavResource[] |
getReferenceResources(DavPropertyName hrefPropertyName)
Return an array of
DavResource objects that are referenced
by the property with the specified name. |
Report |
getReport(ReportInfo reportInfo)
Runs the report specified by the given
ReportInfo . |
protected 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()
Retrieve the
DavSession associated with this resource. |
String |
getSupportedMethods()
Returns a comma separated list of all METHODS supported by the given
resource.
|
String |
getTransactionId()
The TransactionId or
null according to the value of the
corresponding request header
field. |
VersionHistoryResource |
getVersionHistory()
Returns the
VersionHistoryResource , that is referenced in the
'version-history ' property. |
protected String |
getWorkspaceHref()
Retrieve the href of the workspace the current session belongs to.
|
boolean |
hasLock(Type type,
Scope scope)
Returns true if this resource has a lock applied with the given type and scope.
|
void |
init(TxLockManager txMgr,
String transactionId)
Initializes the
TransactionResource . |
protected void |
initLockSupport()
Define the set of locks supported by this resource.
|
protected void |
initProperties()
Fill the set of default properties
|
protected void |
initPropertyNames()
Property names common to all resources.
|
protected void |
initSupportedReports()
Define the set of reports supported by this resource.
|
boolean |
isCollection()
Returns true if this webdav resource has the resourcetype 'collection'.
|
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 of the version referenced by the DAV:checked-in property
of this checked-in version-controlled resource.
|
ActiveLock |
lock(LockInfo reqLockInfo)
Lock this webdav resource with the information retrieve from the request
and return the resulting lockdiscovery object.
|
MultiStatus |
merge(MergeInfo mergeInfo)
Perform a merge on this resource using the specified
MergeInfo . |
void |
move(DavResource destination)
Throws
HttpServletResponse.SC_METHOD_NOT_ALLOWED |
ActiveLock |
refreshLock(LockInfo info,
String lockToken)
Only transaction lock may be available on this resource.
|
void |
removeMember(DavResource member)
Throws 403 exception (Forbidden)
|
void |
removeProperty(DavPropertyName propertyName)
Throws
HttpServletResponse.SC_METHOD_NOT_ALLOWED |
MultiStatus |
search(SearchInfo sInfo)
Runs a search with the language and query defined in the
SearchInfo
object specified and returns a MultiStatus object listing the
results. |
void |
setProperty(DavProperty<?> property)
Allows to alter the registered namespaces (
ItemResourceConstants.JCR_NAMESPACES )
or register node types ItemResourceConstants.JCR_NODETYPES_CND
where the passed value is a cnd string containing the definition
and forwards any other property to the super class. |
void |
spool(OutputContext outputContext)
Spools the resource properties and ev.
|
void |
uncheckout()
Perform an uncheckout on the version controlled resource.
|
void |
unlock(String lockToken)
Throws
HttpServletResponse.SC_METHOD_NOT_ALLOWED since only transaction
locks may be present on this resource, that need to be released by calling
TransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo) . |
void |
unlock(String lockToken,
TransactionInfo tInfo)
Overloads the
unlock method of the DavResource
interface. |
MultiStatus |
update(UpdateInfo updateInfo)
While RFC 3253 does not define any version-related operations for the
workspace resource, this implementation uses
VersionControlledResource.update(UpdateInfo)
to map Workspace.restore(javax.jcr.version.Version[], boolean) to
a WebDAV call. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addWorkspace, getOptionResponse, getReferenceResources, getReport
addLockManager, copy, getComplianceClass, getFactory, getHref, getLocator, getLock, getLocks, getProperties, getPropertyNames, getResourcePath, getSession, hasLock, isLockable, lock, move, refreshLock, removeProperty, unlock
protected boolean initedProps
protected DavPropertySet properties
protected DavPropertyNameSet names
protected SupportedLock supportedLock
protected SupportedReportSetProperty supportedReports
public DavProperty<?> getProperty(DavPropertyName name)
DavResource
getProperty
in interface DavResource
name
- name of the webdav propertyDavProperty
with the given name or null
if the property does not exist.DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
public String getSupportedMethods()
DavResource
getSupportedMethods
in interface DavResource
public boolean exists()
DavResource
exists
in interface DavResource
getDisplayName()
is
present in the list of available workspace names such as exposed by
the editing JCR session.public boolean isCollection()
DavResource
isCollection
in interface DavResource
public String getDisplayName()
getDisplayName
in interface DavResource
DavResource.getDisplayName()
,
Workspace.getName()
public long getModificationTime()
getModificationTime
in interface DavResource
public void spool(OutputContext outputContext) throws IOException
DavResource
spool
in interface DavResource
outputContext
- IOException
public DavResource getCollection()
getCollection
in interface DavResource
null
is returned.DavResource.getCollection()
public void addMember(DavResource resource, InputContext inputContext) throws DavException
addMember
in interface DavResource
resource
- inputContext
- DavException
public DavResourceIterator getMembers()
getMembers
in interface DavResource
public void removeMember(DavResource member) throws DavException
removeMember
in interface DavResource
member
- DavException
public void setProperty(DavProperty<?> property) throws DavException
ItemResourceConstants.JCR_NAMESPACES
)
or register node types ItemResourceConstants.JCR_NODETYPES_CND
where the passed value is a cnd string containing the definition
and forwards any other property to the super class.
Note that again no property status is set. Any failure while setting a property results in an exception (violating RFC 2518).
setProperty
in interface DavResource
property
- DavException
DavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
public MultiStatusResponse alterProperties(List<? extends PropEntry> changeList) throws DavException
ItemResourceConstants.JCR_NAMESPACES
and forwards any other set or remove requests to the super class.alterProperties
in interface DavResource
changeList
- list containing DavPropertyName
objects (for
properties to be removed) and DavProperty
objects (for
properties to be added/set).DavException
- if an error occurred. This may be the case if the
general state of the resource prevents any properties to be set or removed
(e.g. due to a lock).setProperty(DavProperty)
,
DefaultItemCollection.alterProperties(List)
public void addVersionControl() throws DavException
VersionableResource
DavException
(error code: HttpServletResponse.SC_METHOD_NOT_ALLOWED
is thrown. The same applies, if this resource is versionable but its
current state does not allow to made it a version-controlled one or
if any other error occurs.addVersionControl
in interface VersionableResource
DavException
- (403) since workspace is not versionable. implementing
VersionControlledResource
only for 'update'.public String checkin() throws DavException
VersionControlledResource
checkin
in interface VersionControlledResource
DavException
- (403) since workspace is not versionable. implementing
VersionControlledResource
only for 'update'.public void checkout() throws DavException
VersionControlledResource
checkout
in interface VersionControlledResource
DavException
- (403) since workspace is not versionable. implementing
VersionControlledResource
only for 'update'.public void uncheckout() throws DavException
VersionControlledResource
uncheckout
in interface VersionControlledResource
DavException
- (403) since workspace is not versionable. implementing
VersionControlledResource
only for 'update'.public MultiStatus update(UpdateInfo updateInfo) throws DavException
VersionControlledResource.update(UpdateInfo)
to map Workspace.restore(javax.jcr.version.Version[], boolean)
to
a WebDAV call.
Limitation: note that the MultiStatus
returned by this method
will not list any nodes that have been removed due to an Uuid conflict.
update
in interface VersionControlledResource
updateInfo
- DavException
VersionControlledResource.update(org.apache.jackrabbit.webdav.version.UpdateInfo)
public MultiStatus merge(MergeInfo mergeInfo) throws DavException
VersionControlledResource
MergeInfo
.merge
in interface VersionControlledResource
MultiStatus
containing the list of resources that
have been modified.DavException
- (403) since workspace is not versionable. implementing
VersionControlledResource
only for 'update'.public void label(LabelInfo labelInfo) throws DavException
VersionControlledResource
label
in interface VersionControlledResource
DavException
- (403) since workspace is not versionable. implementing
VersionControlledResource
only for 'update'.LabelInfo
,
for the pre- and postcondition of
a successful LABEL request.
public VersionHistoryResource getVersionHistory() throws DavException
VersionControlledResource
VersionHistoryResource
, that is referenced in the
'version-history
' property.getVersionHistory
in interface VersionControlledResource
DavException
- (403) since workspace is not versionable. implementing
VersionControlledResource
only for 'update'.protected void initLockSupport()
SupportedLock
protected void initSupportedReports()
SupportedReportSetProperty
,
AbstractResource.initSupportedReports()
protected String getWorkspaceHref()
protected void initPropertyNames()
protected void initProperties()
public String getComplianceClass()
getComplianceClass
in interface DavResource
DavResource.getComplianceClass()
public DavResourceLocator getLocator()
DavResource
locator
object for this webdav resource,
which encapsulates the information for building the complete 'href'.getLocator
in interface DavResource
DavResource.getLocator()
public String getResourcePath()
null
is returned.getResourcePath
in interface DavResource
DavResource.getResourcePath()
,
DavResourceLocator.getResourcePath()
public String getHref()
DavResource
getHref
in interface DavResource
DavResource.getHref()
,
DavResourceLocator.getHref(boolean)
public DavPropertyName[] getPropertyNames()
DavResource
property names
available
on this resource.getPropertyNames
in interface DavResource
DavResource.getPropertyNames()
public DavPropertySet getProperties()
DavResource
DavConstants.PROPFIND_ALL_PROP
request. The
implementation may in addition expose other (protected or calculated)
properties which should be marked accordingly (see also
DavProperty.isInvisibleInAllprop()
.getProperties
in interface DavResource
DavPropertySet
containing at least all properties
of this resource that are exposed in 'allprop' PROPFIND request.DavResource.getProperties()
public void removeProperty(DavPropertyName propertyName) throws DavException
HttpServletResponse.SC_METHOD_NOT_ALLOWED
removeProperty
in interface DavResource
propertyName
- DavException
- Always throws HttpServletResponse.SC_METHOD_NOT_ALLOWED
DavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
public void move(DavResource destination) throws DavException
HttpServletResponse.SC_METHOD_NOT_ALLOWED
move
in interface DavResource
destination
- DavException
- Always throws HttpServletResponse.SC_METHOD_NOT_ALLOWED
DavResource.move(org.apache.jackrabbit.webdav.DavResource)
public void copy(DavResource destination, boolean shallow) throws DavException
HttpServletResponse.SC_METHOD_NOT_ALLOWED
copy
in interface DavResource
destination
- shallow
- DavException
- Always throws HttpServletResponse.SC_METHOD_NOT_ALLOWED
DavResource.copy(org.apache.jackrabbit.webdav.DavResource, boolean)
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 DavResource
type
- scope
- DavResource.isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
public boolean hasLock(Type type, Scope scope)
hasLock
in interface DavResource
type
- scope
- DavResource.hasLock(Type, Scope)
public ActiveLock getLock(Type type, Scope scope)
DavResource
null
if the resource is either not locked or not lockable at all. Note, that
a resource may have a lock that is inherited by a deep lock enforced on
one of its 'parent' resources.getLock
in interface DavResource
null
if this
resource has no lock applying it. If an error occurs while retrieving the
lock information null
is returned as well.DavResource.getLock(Type, Scope)
public ActiveLock[] getLocks()
DavResource
getLocks
in interface DavResource
todo improve....
public ActiveLock lock(LockInfo reqLockInfo) throws DavException
DavResource
lock
in interface DavResource
reqLockInfo
- lock info as retrieved from the request.DavException
is thrown.DavException
- if the lock could not be obtained.DavResource.lock(org.apache.jackrabbit.webdav.lock.LockInfo)
public ActiveLock refreshLock(LockInfo info, String lockToken) throws DavException
refreshLock
in interface DavResource
info
- lockToken
- DavException
is thrown.DavException
DavResource.refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String)
public void unlock(String lockToken) throws DavException
HttpServletResponse.SC_METHOD_NOT_ALLOWED
since only transaction
locks may be present on this resource, that need to be released by calling
TransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)
.unlock
in interface DavResource
lockToken
- DavException
- Always throws HttpServletResponse.SC_METHOD_NOT_ALLOWED
public void addLockManager(LockManager lockMgr)
DavResource
LockManager
to this resource. This method may
throw UnsupportedOperationException
if the resource does handle
locking itself.addLockManager
in interface DavResource
DavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)
public DavResourceFactory getFactory()
DavResource
DavResourceFactory
that created this resource.getFactory
in interface DavResource
DavResource.getFactory()
public DavSession getSession()
DavResource
DavSession
associated with this resource.getSession
in interface DavResource
DavResource.getSession()
,
DavResource.getSession()
public void init(TxLockManager txMgr, String transactionId)
TransactionResource
TransactionResource
.init
in interface TransactionResource
TransactionResource.init(TxLockManager, String)
public void unlock(String lockToken, TransactionInfo tInfo) throws DavException
TransactionResource
unlock
method of the DavResource
interface.unlock
in interface TransactionResource
lockToken
- lock token as present in the request header.tInfo
- transaction info object as present in the UNLOCK request body.DavException
- if an error occursTransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)
public String getTransactionId()
TransactionResource
null
according to the value of the
corresponding request header
field.getTransactionId
in interface TransactionResource
null
TransactionResource.getTransactionId()
public OptionsResponse getOptionResponse(OptionsInfo optionsInfo)
DeltaVResource
getOptionResponse
in interface DeltaVResource
optionsInfo
- null
DeltaVResource.getOptionResponse(org.apache.jackrabbit.webdav.version.OptionsInfo)
public Report getReport(ReportInfo reportInfo) throws DavException
DeltaVResource
ReportInfo
.getReport
in interface DeltaVResource
reportInfo
- DavException
DeltaVResource.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 DeltaVResource
workspace
- 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 DeltaVResource
hrefPropertyName
- DavResource
sDavException
DeltaVResource.getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)
public QueryGrammerSet getQueryGrammerSet()
SearchResource
DavResource.getProperty(SearchConstants.QUERY_GRAMMER_SET)
.getQueryGrammerSet
in interface SearchResource
SearchResource.getQueryGrammerSet()
public MultiStatus search(SearchInfo sInfo) throws DavException
SearchResource
SearchInfo
object specified and returns a MultiStatus
object listing the
results.search
in interface SearchResource
sInfo
- DavException
SearchResource.search(org.apache.jackrabbit.webdav.search.SearchInfo)
protected DavResource createResourceFromLocator(DavResourceLocator loc) throws DavException
DavResource
from the given locator.loc
- DavResource
DavException
protected DavResourceLocator getLocatorFromItemPath(String itemPath)
DavResourceLocator
from the given itemPath path.itemPath
- DavResourceLocator
DavLocatorFactory.createResourceLocator(String, String, String)
protected DavResourceLocator getLocatorFromItem(Item repositoryItem)
DavResourceLocator
from the given repository item.repositoryItem
- getLocatorFromItemPath(String)
protected Session getRepositorySession()
getSession().getRepositorySession()
AbstractResource.session
.protected String getCreatorDisplayName()
DeltaVConstants.CREATOR_DISPLAYNAME
property.null
; subclasses may provide a regular value.protected String getCreationDate()
DavPropertyName.CREATIONDATE
property.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.