com.adobe.repository.bindings.dsc.client
Class ResourceRepositoryClient

java.lang.Object
  extended by com.adobe.repository.bindings.dsc.client.ResourceRepositoryClient
All Implemented Interfaces:
ResourceRepository, ResourceRepositoryDelegate

public class ResourceRepositoryClient
extends java.lang.Object
implements ResourceRepositoryDelegate

The ResourceRepositoryClient is the client implementation of the ResourceRepositoryDelegate interface, which extends the ResourceRepository interface. This is the class that should be used by client applications that use the Repository service.

See Also:
ResourceRepositoryDelegate, ResourceRepository

Constructor Summary
ResourceRepositoryClient(ServiceClientFactory factory)
          Repository Service Client constructor.
 
Method Summary
 void addLockTokens(java.util.Collection lockTokens)
          Adds the supplied lock tokens to the delegate's lock token cache.
 void clearAttributes(java.lang.String key)
          Clears all attribute map.
 void clearLockTokens()
          Clears the lock tokens stored in the delegate's lock token cache.
 void copyResource(java.lang.String sourceResourceUri, java.lang.String targetResourcePath, short depth)
          Copies the resource at sourceResourcePath into the ResourceCollection at targetResourceCollectionPath.
 void createPendingRelationship(java.lang.String sourceResourceUri, java.lang.String targetResourcePath, int relationshipType)
          Creates a PendingRelation of type relationshipType between the source and target resources.
 void createRelationship(java.lang.String sourceResourceUri, java.lang.String targetResourceUri, int relationshipType, boolean trackHead)
          Creates a Relation of type relationshipType between the source and target resources.
 void deleteResource(java.lang.String resourceUri)
          Permanently removes the Resource identified by resourceUri from the repository.
 void deleteResources(java.lang.String[] resourceUris)
          Permanently removes the Resource objects identified by resourceUris from the repository.
 java.lang.Object getAttribute(java.lang.String key)
          Retrieves the value for the key that is mapped in this attribute map.
 java.util.Map getAttributes()
          Retrieves the attribute map.
 java.util.List getHistory(java.lang.String resourceUri)
          Retrieves all versions of the logical resource identified by the resourceUri.
 RepositoryImplementationType getImplementationType()
          Describes the backing Repository implementation.
 java.util.List getLocks(java.lang.String resourceUri)
          Retrieves a java.util.List containing all Lock objects on a specific resource identified by the given resourceUri.
 java.util.List getLockTokens()
          Retrieves the lock tokens that are currently stored in the delegate's lock token cache.
 java.util.List getRelated(java.lang.String resourceUri, boolean isSource, int relationshipType)
          Retrieves a java.util.List containing all resources related to a specific resource by relation instances of type relationshipType.
 java.util.List getRelated(java.lang.String resourceUri, boolean isSource, int[] relationshipTypes)
          Retrieves a java.util.List containing all resources related to a specific resource by relation instances of types contained in relationshipTypes.
 java.util.List getRelated(java.lang.String resourceUri, boolean isSource, int[] relationshipTypes, boolean returnDeprecatedResources, boolean isHead)
          Retrieves a java.util.List containing all resources related to a specific resource by relation instances of types contained in relationshipTypes.
 java.util.List getRelated(java.lang.String resourceUri, boolean isSource, int relationshipType, boolean returnDeprecatedResources, boolean isHead)
          Retrieves a java.util.List containing all resources related to a specific resource by relation instances of type relationshipType.
 java.util.List listMembers(java.lang.String resourceUri)
          Retrieves the contents of the ResourceCollection.
 java.util.List listMembersWithoutContent(java.lang.String resourceUri)
          this method is for performance improvement for those methods who dont want to retrive TLO contents
 java.lang.String lockResource(java.lang.String resourceUri, short lockScope, short lockDepth)
          Locks the logical Resource identified by resourceUri.
 java.lang.String lockResource(java.lang.String resourceUri, short lockScope, short lockDepth, int expireSecondsFromNow)
          Locks the logical Resource identified by the resourceUri, and sets an expiration date on the lock.
 void moveResource(java.lang.String sourceResourceUri, java.lang.String targetResourcePath)
          Moves all versions of the logical resource at sourceResourcePath to targetResourceCollectionPath.
 AccessControlList readAccessControlList(java.lang.String resourceUri)
          Reads an access control list for the resource identified by resourceUri.
 ResourceProperty[][] readProperties(java.lang.String[] resourceUris, ResourceProperty[] propertyNames)
          Retrieves an array of property instances for the requested properties.
 Resource readResource(java.lang.String resourceUri)
          Retrieves the Resource identified by resourceUri from the Repository.
 Document readResourceContent(java.lang.String resourceUri)
          Retrieves the content of the Resource object identified by resourceUri from the Repository.
 java.util.List readResources(java.lang.String[] resourceUris)
          Retrieves the Resource objects identified by resourceUris from the Repository.
 java.util.List readResourcesWithoutContent(java.lang.String[] resourceUris)
          Retrieves the Resource objects identified by resourceUris from the Repository without resource contents
 Resource readResourceWithoutContent(java.lang.String resourceUri)
          Retrieves the Resource identified by resourceUri from the Repository.
 void removeAttribute(java.lang.String key)
          Removes the specified attribute.
 void removeProperties(java.lang.String resourceUri, ResourceProperty[] resourceProperties, boolean revMajorVersion)
          Removes properties from a resource and creates a new version from the result.
 void removeRelationship(java.lang.String sourceResourceUri, java.lang.String targetResourceUri, int relationshipType)
          Removes a Relation of type relationshipType between the source and target resources.
 boolean resourceExists(java.lang.String resourceUri)
          Determines whether a Resource is identified by resourceUri in the Repository.
 boolean[] resourcesExist(java.lang.String[] resourceUris)
          Determines whether Resource objects identified by resourceUris exist in the Repository.
 java.util.List searchProperties(java.lang.String basePath, Query queryString, int depth, int offset, int maxResults, SortOrder sortOrder)
          Executes a properties search against the resources contained within the Repository.
 java.util.List searchRelated(java.lang.String resourceUri, int relationshipType, int depth, Query query, int offset, int maxResults, SortOrder sortOrder)
          Retrieves a list of resources related to the resource identified by resourceUri by a relation of type relationshipType and which also match the supplied criteria found in the Query object.
 void selectVersion(java.lang.String sourceResourceUri, java.lang.String targetResourceUri, int relationshipType, java.lang.String newVersionUri, boolean applyToSource, boolean trackHead)
          Changes the version of a resource involved in a relationship to the version identified by newVersionUri.
 void setAttribute(java.lang.String key, java.lang.Object value)
          Sets the attribute using the specified key and value.
 void setLoadProfile(RepositoryLoadProfile loadProfile)
          The load profile to apply to objects returned from the repository.
 void setReturnByValue(boolean returnByValue)
           Changes the type of results returned by read calls to the repository.
 java.lang.String unlockResource(java.lang.String resourceUri)
          Unlocks the locked resources identified by the resourceUri.
 void updateCustomStatus(java.lang.String resourceUri, java.lang.String customStatus)
          Updates the custom status of a resource.
 void updateDeploymentStatus(java.lang.String resourceUri, int deploymentStatus)
          Updates the deployment status of a resource.
 void updateObjectStatus(java.lang.String resourceUri, int objectStatus)
          Updates the object status of a resource.
 void updateProperties(java.lang.String[] resourceUris, ResourceProperty[] properties)
          Adds and updates the properties of the resources.
 void updateProperties(java.lang.String resourceUri, ResourceProperty[] properties)
          Adds and updates the properties of a resource.
 Resource updateResource(java.lang.String resourceUri, Resource resource, boolean revMajorVersion)
          Updates the resource identified by resourceUri with the data in resource.
 Resource updateResourceWithId(java.lang.String resourceUri, java.lang.String resourceVersionId, boolean revMajorVersion)
          The purpose of this method is to allow a resource to be updated using content from a previous revision of the same logical resource.
 void writeAccessControlList(java.lang.String resourceUri, AccessControlList accessControlList, boolean propagate)
          Sets or updates the access control list (ACL) contained in accessControlList on the resources identified by the resourceUri.
 void writeAccessControlList(java.lang.String resourceUri, AccessControlList accessControlList, short propagationMode)
          Sets or updates the access control list (ACL) contained in accessControlList on the resources identified by the resourceUri.
 Resource writeResource(java.lang.String parentResourcePath, Resource resource)
          Writes a new resource into the Repository.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceRepositoryClient

public ResourceRepositoryClient(ServiceClientFactory factory)
Repository Service Client constructor.

Parameters:
factory - A ServiceClientFactory instance that sets up the properties for the Repository service.
Method Detail

getAttributes

public java.util.Map getAttributes()
Retrieves the attribute map.

Returns:
A java.util.Map containing the attributes for this client.

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Sets the attribute using the specified key and value.

Parameters:
key - The attribute key.
value - The attribute value.

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Retrieves the value for the key that is mapped in this attribute map. A return value of null does not mean that the key was not found, since the key could be explicitly storing null.

Parameters:
key - The attribute key.
Returns:
Object The attribute value.

removeAttribute

public void removeAttribute(java.lang.String key)
Removes the specified attribute.

Parameters:
key - The attribute key.

clearAttributes

public void clearAttributes(java.lang.String key)
Clears all attribute map.

Parameters:
key - Specify null for this parameter.

copyResource

public void copyResource(java.lang.String sourceResourceUri,
                         java.lang.String targetResourcePath,
                         short depth)
                  throws RepositoryException
Copies the resource at sourceResourcePath into the ResourceCollection at targetResourceCollectionPath. If sourceResourcePath is a ResourceCollection, the depth parameter indicates whether the operation is recursive, and if so, to what degree. Only the head versions of Resource objects are copied. Overwriting does not occur.

Pre-conditions:

Post-conditions:

Specified by:
copyResource in interface ResourceRepository
Parameters:
sourceResourceUri - A path-based identifier that identifies a Resource.
targetResourcePath - A path-based identifier that identifies the ResourceCollection where the resource identified by sourceResourcePath will be copied.
depth - One of Resource.DEPTH_ZERO, ResourceCollection.DEPTH_ONE, or ResourceCollection.DEPTH_INFINITE.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000depth is not one of the allowed values
ALC-REP-015-000A resource exists at targetResourceCollectionPath + "/" + source.getName()
ALC-REP-016-000The resource collection identified by targetResourceCollectionPath is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource collection identified by targetResourceCollectionPath is locked
ALC-REP-018-000The resource identified by sourceResourcePath or targetResourceCollectionPath does not exist or is not accessible
ALC-REP-050-000sourceResourcePath is not a path-based identifier
ALC-REP-054-000depth is not one of the allowed values
ALC-REP-055-000targetResourceCollectionPath does not identify a ResourceCollection

createRelationship

public void createRelationship(java.lang.String sourceResourceUri,
                               java.lang.String targetResourceUri,
                               int relationshipType,
                               boolean trackHead)
                        throws RepositoryException
Creates a Relation of type relationshipType between the source and target resources. Relationships of type Relation.TYPE_MEMBER_OF must be created with writeResource().

When the logical resource identified by targetResourceUri is updated:

Pre-conditions:

Post-conditions:

Specified by:
createRelationship in interface ResourceRepository
Parameters:
sourceResourceUri - The source of the relationship.
targetResourceUri - The target of the relationship.
relationshipType - The type of relationship, chosen among the Relation.TYPE_* constants, or a user-defined value greater or equal to 1024.
trackHead - Determines whether the new relationship should always refer to the latest version of the resource identified by targetResourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by sourceResourceUri or targetResourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by sourceResourceUri or targetResourceUri is locked
ALC-REP-018-000The resource identified by sourceResourceUri or targetResourceUri does not exist or is not accessible
ALC-REP-013-000relationshipType is less than one
ALC-REP-024-000relationshipType is equal to Relation.TYPE_MEMBER_OF
ALC-REP-030-000relationshipType is a reserved value. For example, it is positive, not a constant, and is less than 1024.

createPendingRelationship

public void createPendingRelationship(java.lang.String sourceResourceUri,
                                      java.lang.String targetResourcePath,
                                      int relationshipType)
                               throws RepositoryException
Creates a PendingRelation of type relationshipType between the source and target resources.

Pre-conditions:

Post-conditions:

Specified by:
createPendingRelationship in interface ResourceRepository
Parameters:
sourceResourceUri - The source of the relationship.
targetResourcePath - The target of the relationship.
relationshipType - The type of relationship, chosen among the Relation.TYPE_* constants, or a user-defined value greater or equal to 1024.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by sourceResourceUri is locked by another user
ALC-REP-018-000The resource identified by sourceResourceUri does not exist or is not accessible
ALC-REP-013-000relationshipType is less than one
ALC-REP-024-000relationshipType is equal to Relation.TYPE_MEMBER_OF
ALC-REP-030-000relationshipType is a reserved value. For example, it is positive, not a constant, and is less than 1024.

deleteResources

public void deleteResources(java.lang.String[] resourceUris)
                     throws RepositoryException
Permanently removes the Resource objects identified by resourceUris from the repository. Deleting a ResourceCollection also deletes its members. If the head version is deleted, the previous version becomes the head version.

Duplicate URIs are silently ignored. To improve performance, clients should avoid submitting URIs that are known duplicates.

URIs that specify a subset of other URIs provided in the same request will be silently ignored. For example, a request to delete URIs {/a, /a/b} will succeed without warnings about /a/b being a subfolder of /a. To improve performance, clients should avoid submitting URIs that are known to be subsets of other URIs.

Post-conditions:

Specified by:
deleteResources in interface ResourceRepository
Parameters:
resourceUris - An array of Resource objects to be deleted.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000A resource identified by one of the elements of resourceUris is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. A resource identified by one of the elements of resourceUris is locked
ALC-REP-018-000A resource identified by one of the elements of resourceUris does not exist or is not accessible
ALC-REP-051-000A resource identified by one of the elements of resourceUris is a system path of /

deleteResource

public void deleteResource(java.lang.String resourceUri)
                    throws RepositoryException
Permanently removes the Resource identified by resourceUri from the repository. Deleting a ResourceCollection also deletes its members. If a head version is deleted, the previous version becomes the head version. If a deleted version was the active version, the head version becomes the active version.

Post-conditions:

Specified by:
deleteResource in interface ResourceRepository
Parameters:
resourceUri - The Resource to be deleted.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-051-000resourceUri is a system path of /

getImplementationType

public RepositoryImplementationType getImplementationType()
                                                   throws RepositoryException
Describes the backing Repository implementation.

Specified by:
getImplementationType in interface ResourceRepository
Returns:
An object detailing the implementation type.
Throws:
RepositoryException

getHistory

public java.util.List getHistory(java.lang.String resourceUri)
                          throws RepositoryException
Retrieves all versions of the logical resource identified by the resourceUri. Clients should use Lid-based or path-based identifiers for best performance. If a version of the resource identified by resourceUri is not accessible, the version is silently excluded from the results.

Specified by:
getHistory in interface ResourceRepository
Parameters:
resourceUri - A Resource for which to retrieve its version history.
Returns:
A java.util.List of Resource instances, each representing a version of the logical resource.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The version of the resource identified by resourceUri does not exist or is not accessible

listMembers

public java.util.List listMembers(java.lang.String resourceUri)
                           throws RepositoryException
Retrieves the contents of the ResourceCollection. Internal members are immediate children of a resource collection. If you call this method for anything other than a resource collection, no results are returned.

Specified by:
listMembers in interface ResourceRepository
Parameters:
resourceUri - The resource collection identifier.
Returns:
A java.util.List of Resource objects that are the source of a Relation of type Relation.TYPE_MEMBER_OF and have resourceCollectionUri as the target.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The version of the resource identified by resourceCollectionUri does not exist or is not accessible

listMembersWithoutContent

public java.util.List listMembersWithoutContent(java.lang.String resourceUri)
                                         throws RepositoryException
this method is for performance improvement for those methods who dont want to retrive TLO contents

Specified by:
listMembersWithoutContent in interface ResourceRepository
Parameters:
resourceUri - The resource collection identifier.
Returns:
A java.util.List of Resource objects that are the source of a Relation of type Relation.TYPE_MEMBER_OF and have resourceCollectionUri as the target.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The version of the resource identified by resourceCollectionUri does not exist or is not accessible

lockResource

public java.lang.String lockResource(java.lang.String resourceUri,
                                     short lockScope,
                                     short lockDepth)
                              throws RepositoryException
Locks the logical Resource identified by resourceUri. Id-based identifiers resolve to logical resources.

The lockDepth parameter only applies when resourceUri is a ResourceCollection. In this case, Lock.DEPTH_ZERO locks only the collection, Lock.DEPTH_ONE locks the collection and its internal members, and Lock.DEPTH_INFINITE locks the collection and all members.

Pre-conditions:

Post-conditions:

The resource identified by resourceUri is write-locked with a lock scope equal to lockScope.

Specified by:
lockResource in interface ResourceRepository
Parameters:
resourceUri - The Resource identifier.
lockScope - Either Lock.SCOPE_EXCLUSIVE or Lock.SCOPE_SHARED.
lockDepth - One of Lock.DEPTH_ZERO, Lock.DEPTH_ONE, or Lock.DEPTH_INFINITE.
Returns:
It returns a lock token, but the token can be discarded as its use is deprecated.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The version of the resource identified by resourceUri does not exist or is not accessible
ALC-REP-031-000lockScope is not an accepted value
ALC-REP-032-000lockDepth is not an accepted value

lockResource

public java.lang.String lockResource(java.lang.String resourceUri,
                                     short lockScope,
                                     short lockDepth,
                                     int expireSecondsFromNow)
                              throws RepositoryException
Locks the logical Resource identified by the resourceUri, and sets an expiration date on the lock. Id-based identifiers resolve to logical resources. The returned lock token is automatically added to the set of lock tokens inside the delegate.

The lockDepth parameter only applies when resourceUri is a ResourceCollection. In this case, Lock.DEPTH_ZERO locks only the collection, Lock.DEPTH_ONE locks the collection and its internal members, and Lock.DEPTH_INFINITE locks the collection and all members.

Pre-conditions:

Post-conditions:

The resource identified by resourceUri is write-locked with a lock scope equal to lockScope and will expire in expireSecondsFromNow.

Specified by:
lockResource in interface ResourceRepository
Parameters:
resourceUri - The Resource identifier.
lockScope - Either Lock.SCOPE_EXCLUSIVE or Lock.SCOPE_SHARED.
lockDepth - One of Lock.DEPTH_ZERO, Lock.DEPTH_ONE, or Lock.DEPTH_INFINITE.
expireSecondsFromNow - A positive value indicating the number of seconds in which this lock will expire.
Returns:
The lock token.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000expireSecondsFromNow is not a positive value
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The version of the resource identified by resourceUri does not exist or is not accessible
ALC-REP-031-000lockScope is not an accepted value
ALC-REP-032-000lockDepth is not an accepted value
ALC-REP-042-000resourceUri is already share-locked, and cannot add an exclusive lock
ALC-REP-043-000resourceUri is already exclusively locked, and cannot add a shared lock

moveResource

public void moveResource(java.lang.String sourceResourceUri,
                         java.lang.String targetResourcePath)
                  throws RepositoryException
Moves all versions of the logical resource at sourceResourcePath to targetResourceCollectionPath. A move operation should be approached with as much caution as a delete operation, because references embedded in user content will break once the resource is moved.

The operation is atomic; if a member of the targetResourcePath cannot be moved, the operation fails. This is in contrast with WEBDAV, in which the recommended approach is that a server should try to move as much of the sourceResourcePath as possible, and return a multi-status response indicating the failures that occurred.

Pre-conditions:

Post-conditions:

Specified by:
moveResource in interface ResourceRepository
Parameters:
sourceResourceUri - The resource to move.
targetResourcePath - The destination ResourceCollection in which the source resource will be contained at the end of the operation.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-015-000A resource exists at path targetResourceCollectionPath + "/" + source.getName()
ALC-REP-016-000The resource identified by sourceResourcePath or targetResourceCollectionPath is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by sourceResourcePath or targetResourceCollectionPath is locked
ALC-REP-018-000The resource identified by sourceResourcePath or targetResourceCollectionPath does not exist or is not accessible
ALC-REP-050-000sourceResourcePath or targetResourceCollectionPath is not a path-based identifier

readAccessControlList

public AccessControlList readAccessControlList(java.lang.String resourceUri)
                                        throws RepositoryException
Reads an access control list for the resource identified by resourceUri.

Specified by:
readAccessControlList in interface ResourceRepository
Parameters:
resourceUri - The Resource for which to retrieve its access control list.
Returns:
An access control list representing the permissions on this resource.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible

readProperties

public ResourceProperty[][] readProperties(java.lang.String[] resourceUris,
                                           ResourceProperty[] propertyNames)
                                    throws RepositoryException
Retrieves an array of property instances for the requested properties. Properties are returned in the same order in which they were defined in propertyNames. The absence of a property on a resource is signaled in the results by a null object at the non-existent property's index.

Pre-conditions:

Post-conditions:

Property arrays are returned in the order in which their resourceUri counterparts were submitted.

Specified by:
readProperties in interface ResourceRepository
Parameters:
resourceUris - An array of resource identifiers for which to return properties.
propertyNames - ResourceProperty instances having names and namespaces that identify which properties to return.
Returns:
A two-dimensional array of ResourceProperty instances. The first dimension contains a ResourceProperty[] for each element of resourceUris.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000A ResourceProperty in propertyNames has a null or empty name or namespace.
ALC-REP-018-000A resource identified by an element of resourceUris does not exist or is not accessible


readResource

public Resource readResource(java.lang.String resourceUri)
                      throws RepositoryException
Retrieves the Resource identified by resourceUri from the Repository.

Specified by:
readResource in interface ResourceRepository
Parameters:
resourceUri - The resource to be retrieved.
Returns:
The Resource instance identified by resourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible

readResourceWithoutContent

public Resource readResourceWithoutContent(java.lang.String resourceUri)
                                    throws RepositoryException
Retrieves the Resource identified by resourceUri from the Repository. without resource content

Specified by:
readResourceWithoutContent in interface ResourceRepository
Parameters:
resourceUri - The resource to be retrieved.
Returns:
The Resource instance identified by resourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible

readResources

public java.util.List readResources(java.lang.String[] resourceUris)
                             throws RepositoryException
Retrieves the Resource objects identified by resourceUris from the Repository.

Specified by:
readResources in interface ResourceRepository
Parameters:
resourceUris - The resources to be retrieved.
Returns:
A java.util.List of Resource instances identified by resourceUris.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000A resource identified by an element of resourceUris does not exist or is not accessible

readResourcesWithoutContent

public java.util.List readResourcesWithoutContent(java.lang.String[] resourceUris)
                                           throws RepositoryException
Retrieves the Resource objects identified by resourceUris from the Repository without resource contents

Specified by:
readResourcesWithoutContent in interface ResourceRepository
Parameters:
resourceUris - The resources to be retrieved.
Returns:
A java.util.List of Resource instances identified by resourceUris.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000A resource identified by an element of resourceUris does not exist or is not accessible

resourceExists

public boolean resourceExists(java.lang.String resourceUri)
                       throws RepositoryException
Determines whether a Resource is identified by resourceUri in the Repository.

Specified by:
resourceExists in interface ResourceRepository
Parameters:
resourceUri - The resource to be checked.
Returns:
true if a Resource is identified by resourceUri.
Throws:
RepositoryException

resourcesExist

public boolean[] resourcesExist(java.lang.String[] resourceUris)
                         throws RepositoryException
Determines whether Resource objects identified by resourceUris exist in the Repository.

Specified by:
resourcesExist in interface ResourceRepository
Parameters:
resourceUris - The resources to check.
Returns:
An array of boolean values representing whether a Resource is identified by each item URI in resourceUris.
Throws:
RepositoryException

removeProperties

public void removeProperties(java.lang.String resourceUri,
                             ResourceProperty[] resourceProperties,
                             boolean revMajorVersion)
                      throws RepositoryException
Removes properties from a resource and creates a new version from the result. This is effectively a resource update and, as such, this method follows the rules laid out in updateResource(). Reserved namespace properties that can be assigned null values, such as a resource description, may be supplied as arguments to this method, but will only be set to null and will not actually be removed as dynamic properties would.

Post-conditions:

A new version of the resource is created without the properties specified in propertyNames.

Specified by:
removeProperties in interface ResourceRepository
Parameters:
resourceUri - The resource from which to remove properties.
resourceProperties - The properties to remove. Only the namespace and name are required; the value is ignored.
revMajorVersion - true to increment the major version number and reset the minor version number to zero; false to increment the minor version number and to leave the major version number unchanged.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-019-000A property cannot be removed. For example, the identifier attribute is immutable.
ALC-REP-021-000Pre-condition 1 of updateResource() fails
ALC-REP-020-000Pre-condition 2 of updateResource() fails
ALC-REP-022-000The post-condition of updateResource() fails

removeRelationship

public void removeRelationship(java.lang.String sourceResourceUri,
                               java.lang.String targetResourceUri,
                               int relationshipType)
                        throws RepositoryException
Removes a Relation of type relationshipType between the source and target resources. It is not an error to remove a non-existent relationship, since the post-condition is satisfied.

Pre-conditions:

relationshipType is one of the Relation.TYPE_* constants, or a user-defined type with a value greater than or equal to 1024.

Post-conditions:

A Relation of type relationshipType no longer exists between sourceResourceUri and targetResourceUri.

Specified by:
removeRelationship in interface ResourceRepository
Parameters:
sourceResourceUri - The source of the relationship.
targetResourceUri - The target of the relationship.
relationshipType - The type of relationship, chosen from the Relation.TYPE_* constants, or a user-defined type with a value greater than or equal to 1024.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by sourceResourceUri or targetResourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by sourceResourceUri or targetResourceUri is locked
ALC-REP-018-000The resource identified by sourceResourceUri or targetResourceUri does not exist or is not accessible
ALC-REP-030-000relationshipType is reserved. For example, it is positive, not a constant and less than 1024.
ALC-REP-013-000relationshipType is less than one

searchProperties

public java.util.List searchProperties(java.lang.String basePath,
                                       Query queryString,
                                       int depth,
                                       int offset,
                                       int maxResults,
                                       SortOrder sortOrder)
                                throws RepositoryException
Executes a properties search against the resources contained within the Repository. A list of resources whose properties match the Query object filter are returned. Infinite-depth searches recursively traverse relations from target to source, effectively searching an entire resource collection's members.

This method supports results paging; the start parameter is zero-based.

Specified by:
searchProperties in interface ResourceRepository
Parameters:
basePath - The base path from which to execute the properties search.
queryString - An instance of Query consisting of logically related conditions on which to base the search.
depth - The depth of the search. Its possible values are ResourceCollection.DEPTH_ONE (to search the base path only) or ResourceCollection.DEPTH_INFINITE (to search the base path and all folders).
offset - Indicates the first row from which to select the unpaged result set.
maxResults - The maximum number of resources returned per page, starting at index start of the entire result set.
sortOrder - An instance of SortOrder that defines the sort order of the unpaged result set.
Returns:
A list of resources matching the search filter.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000start is less than zero, maxResults is less than one, or depth is not equal to ResourceCollection.DEPTH_ONE or ResourceCollection.DEPTH_INFINITE
ALC-REP-018-000The resource identified resourceUri does not exist or is not accessible
See Also:
Query, SortOrder

getRelated

public java.util.List getRelated(java.lang.String resourceUri,
                                 boolean isSource,
                                 int relationshipType)
                          throws RepositoryException
Retrieves a java.util.List containing all resources related to a specific resource by relation instances of type relationshipType. If isSource is true, this method returns all the Resource objects that are targets of relations of type relationshipType and for which resourceUri is the source. If isSource is false, this method returns all the Resource objects that are sources of relations of type relationshipType and for which resourceUri is the target.

Pre-conditions:

relationshipType must be positive and not within the reserved values list.

Specified by:
getRelated in interface ResourceRepository
Parameters:
resourceUri - The Resource for which to get related resources.
isSource - true if the resourceUri is the source of the relationship and therefore the target resources should be returned. Otherwise, the resourceUri is the target of the relation and source resources should be returned.
relationshipType - The type of relationship, chosen among the Relation.TYPE_* constants, or a user-defined value greater or equal to 1024.
Returns:
A java.util.List of Resource objects related to resourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000relationshipType is less than one
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-030-000relationshipType is a reserved value. For example, it is positive, not a constant, and is less than 1024.

getRelated

public java.util.List getRelated(java.lang.String resourceUri,
                                 boolean isSource,
                                 int[] relationshipTypes)
                          throws RepositoryException
Retrieves a java.util.List containing all resources related to a specific resource by relation instances of types contained in relationshipTypes. If isSource is true, this method returns all the Resource objects that are targets of relations of type relationshipTypes and for which resourceUri is the source. If isSource is false, this method returns all the Resource objects that are sources of relations of type relationshipTypes and for which resourceUri is the target.

Pre-conditions:

Each element of relationshipTypes must be positive.

Specified by:
getRelated in interface ResourceRepository
Parameters:
resourceUri - The Resource for which to get related resources.
isSource - true if the resourceUri is the source of the relationship and therefore the target resources should be returned. Otherwise, the resourceUri is the target of the relation and source resources should be returned.
relationshipTypes - The types of relationships to return, chosen among the Relation.TYPE_* constants, or a user-defined value greater or equal to 1024.
Returns:
A java.util.List of Resource objects related to resourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000An element of relationshipTypes is less than one
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-030-000An element of relationshipTypes is a reserved value. For example, it is positive, not a constant, and is less than 1024.

getRelated

public java.util.List getRelated(java.lang.String resourceUri,
                                 boolean isSource,
                                 int relationshipType,
                                 boolean returnDeprecatedResources,
                                 boolean isHead)
                          throws RepositoryException
Retrieves a java.util.List containing all resources related to a specific resource by relation instances of type relationshipType. If isSource is true, this method returns all the Resource objects that are targets of relations of type relationshipType and for which resourceUri is the source. If isSource is false, this method returns all the Resource objects that are sources of relations of type relationshipType and for which resourceUri is the target.

Pre-conditions:

relationshipType must be positive and not within the reserved values list.

Specified by:
getRelated in interface ResourceRepository
Parameters:
resourceUri - The Resource for which to get related resources.
isSource - true if the resourceUri is the source of the relationship and therefore the target resources should be returned. Otherwise, the resourceUri is the target of the relation and source resources should be returned.
relationshipType - The type of relationship, chosen among the Relation.TYPE_* constants, or a user-defined value greater or equal to 1024.
returnDeprecatedResources - If returnDeprecatedResources is false then only resources that are not deprecated will be returned. If returnDeprecatedResources is true all Resources will be returned.
isHead - If isHead is false then all related resources will be returned. If isHead is true only related Resources which are the head version will be returned.
Returns:
A java.util.List of Resource objects related to resourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000relationshipType is less than one
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-030-000relationshipType is a reserved value. For example, it is positive, not a constant, and is less than 1024.

getRelated

public java.util.List getRelated(java.lang.String resourceUri,
                                 boolean isSource,
                                 int[] relationshipTypes,
                                 boolean returnDeprecatedResources,
                                 boolean isHead)
                          throws RepositoryException
Retrieves a java.util.List containing all resources related to a specific resource by relation instances of types contained in relationshipTypes. If isSource is true, this method returns all the Resource objects that are targets of relations of type relationshipTypes and for which resourceUri is the source. If isSource is false, this method returns all the Resource objects that are sources of relations of type relationshipTypes and for which resourceUri is the target.

Pre-conditions:

Each element of relationshipTypes must be positive.

Specified by:
getRelated in interface ResourceRepository
Parameters:
resourceUri - The Resource for which to get related resources.
isSource - true if the resourceUri is the source of the relationship and therefore the target resources should be returned. Otherwise, the resourceUri is the target of the relation and source resources should be returned.
relationshipTypes - The types of relationships to return, chosen among the Relation.TYPE_* constants, or a user-defined value greater or equal to 1024.
returnDeprecatedResources - If returnDeprecatedResources is false then only resources that are not deprecated will be returned. If returnDeprecatedResources is true all Resources will be returned.
isHead - If isHead is false then all related resources will be returned. If isHead is true only related Resources which are the head version will be returned.
Returns:
A java.util.List of Resource objects related to resourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000An element of relationshipTypes is less than one
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-030-000An element of relationshipTypes is a reserved value. For example, it is positive, not a constant, and is less than 1024.

searchRelated

public java.util.List searchRelated(java.lang.String resourceUri,
                                    int relationshipType,
                                    int depth,
                                    Query query,
                                    int offset,
                                    int maxResults,
                                    SortOrder sortOrder)
                             throws RepositoryException
Retrieves a list of resources related to the resource identified by resourceUri by a relation of type relationshipType and which also match the supplied criteria found in the Query object. The resource identified by resourceUri is taken to be the target of the relationships, and infinite-depth searches recursively traverse relations from target to source.

The implementation supports results paging; both the start and maxResults parameters are zero-based.

Specified by:
searchRelated in interface ResourceRepository
Parameters:
resourceUri - The Resource for which to retrieve related resources.
relationshipType - The type of relationship, chosen among the Relation.TYPE_* constants, or a user-defined value greater than or equal to 1024.
depth - The depth of the search. Its possible values are ResourceCollection.DEPTH_ONE (search the base path only) or ResourceCollection.DEPTH_INFINITE (search the base path and all subfolders).
query - An instance of Query describing a Repository query.
offset - Indicates the first row to select from the unpaged result set.
maxResults - The maximum number of resources returned per page, starting at index start of the entire result set.
sortOrder - Format and type TBD
Returns:
A java.util.List of Resource objects related to resourceUri.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000start is less than zero, maxResults is less than one, or relationshipType is less than one
ALC-REP-018-000The resource identified resourceUri does not exist or is not accessible
ALC-REP-030-000relationshipType is reserved. For example, it is positive, not a constant and less than 1024.

See Also:
Query, SortOrder

selectVersion

public void selectVersion(java.lang.String sourceResourceUri,
                          java.lang.String targetResourceUri,
                          int relationshipType,
                          java.lang.String newVersionUri,
                          boolean applyToSource,
                          boolean trackHead)
                   throws RepositoryException
Changes the version of a resource involved in a relationship to the version identified by newVersionUri. It is not an error to reselect the same target, as the post-condition is still satisfied.

Pre-conditions:

Post-conditions:

The target object attribute of the existing relation object between source and target resources is modified to point to the new target resource.

Specified by:
selectVersion in interface ResourceRepository
Parameters:
sourceResourceUri - Identifies the Resource that is the source of the relationship.
targetResourceUri - Identifies the Resource that is the target of the relationship.
relationshipType - The type of relationship, chosen among the Relation.TYPE_* constants, or a user-defined value greater than or equal to 1024.
newVersionUri - Identifies the version of the Resource that is to become the new source or target of the relationship. The applyToSource parameter determines the attribute (source or target) to which the new URI is applied.
applyToSource - If true, the newVersionUri is applied to the source of the relationship. Otherwise the resourceUri is applied to the target of the relation.
trackHead - If true, the relationship will automatically track new versions of the target Resource. If false, the relationship will not automatically change when the target Resource is updated.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000relationshipType is less than one
ALC-REP-016-000The resource identified by sourceResourceUri or targetResourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by sourceResourceUri or targetResourceUri is locked
ALC-REP-018-000The resource identified by sourceResourceUri or targetResourceUri does not exist or is not accessible
ALC-REP-030-000relationshipType is reserved. For example, it is positive, not a constant and less than 1024.
ALC-REP-040-000The relationship does not exist
ALC-REP-044-000 newResourceUri is not a version of sourceResourceUri (if applyToSource is true), or newResourceUri is not a version of targetResourceUri (if applyToSource is false)

setReturnByValue

public void setReturnByValue(boolean returnByValue)

Changes the type of results returned by read calls to the repository. If returnByValue is true the repository will return resources and data with all data loaded (based on the current RepositoryLoadProfile), otherwise the repository will return implementations which may still make calls against the database to load data as requested.

Specified by:
setReturnByValue in interface ResourceRepositoryDelegate
Parameters:
returnByValue - true if the Repository should return results by value, false if the Repository should return results by reference.

updateCustomStatus

public void updateCustomStatus(java.lang.String resourceUri,
                               java.lang.String customStatus)
                        throws RepositoryException
Updates the custom status of a resource.

Pre-conditions:

customStatus may be null.

Post-conditions:

Specified by:
updateCustomStatus in interface ResourceRepository
Parameters:
resourceUri - The resource to update.
customStatus - The new custom status to set.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible

updateDeploymentStatus

public void updateDeploymentStatus(java.lang.String resourceUri,
                                   int deploymentStatus)
                            throws RepositoryException
Updates the deployment status of a resource.

Post-conditions:

Specified by:
updateDeploymentStatus in interface ResourceRepository
Parameters:
resourceUri - The resource to update.
deploymentStatus - The new deployment status to set.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000deploymentStatus is less than one
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-030-000deploymentStatus is reserved. For example, it is positive, not a constant and less than 1024.

getLockTokens

public java.util.List getLockTokens()
Retrieves the lock tokens that are currently stored in the delegate's lock token cache.

Clients should invoke this method prior to destroying a delegate instance and initialize the next delegate session with the saved lock tokens. This method exists for efficiency; while it is possible to rediscover lock tokens by calling delegate.getLocks(...) for each resource for which a lock token was saved, it is faster to save the lock tokens for the next session.

Specified by:
getLockTokens in interface ResourceRepositoryDelegate
Returns:
A List of lock tokens currently stored in the delegate.

updateObjectStatus

public void updateObjectStatus(java.lang.String resourceUri,
                               int objectStatus)
                        throws RepositoryException
Updates the object status of a resource.

Pre-conditions:

The objectStatus parameter's lifecycle must be respected.

Post-conditions:

Specified by:
updateObjectStatus in interface ResourceRepository
Parameters:
resourceUri - The resource to update.
objectStatus - The object status to set.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000objectStatus is less than one
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-030-000objectStatus is reserved. For example, it is positive, not a constant and less than 1024.
ALC-REP-036-000The object status was changed from latest to updated
ALC-REP-037-000The object status was changed from other than latest to updated
ALC-REP-038-000The object status was changed from updated to latest
ALC-REP-039-000The object status was changed from other than updated to latest

addLockTokens

public void addLockTokens(java.util.Collection lockTokens)
Adds the supplied lock tokens to the delegate's lock token cache. The lock tokens are obtained as a result of a previous delegate session.

Specified by:
addLockTokens in interface ResourceRepositoryDelegate
Parameters:
lockTokens - A Collection of previously saved lock tokens.

setLoadProfile

public void setLoadProfile(RepositoryLoadProfile loadProfile)
The load profile to apply to objects returned from the repository. Clients should specify the narrowest possible load profile to improve performance. If loadProfile is unspecified or set to null, a default load profile that returns all resource attributes is used.

Specified by:
setLoadProfile in interface ResourceRepositoryDelegate
Parameters:
loadProfile - The load profile.

updateProperties

public void updateProperties(java.lang.String resourceUri,
                             ResourceProperty[] properties)
                      throws RepositoryException
Adds and updates the properties of a resource. This is effectively a resource update, and, as such, this method is subject to the rules laid out in updateResource().

Pre-conditions:

properties and its elements must not be null.

Post-conditions:

Specified by:
updateProperties in interface ResourceRepository
Parameters:
resourceUri - The resource to update.
properties - New or updated properties to set on the resource.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-019-000A property specified in properties is immutable

updateProperties

public void updateProperties(java.lang.String[] resourceUris,
                             ResourceProperty[] properties)
                      throws RepositoryException
Adds and updates the properties of the resources.

Pre-conditions:

properties and its elements must not be null.

Post-conditions:

Specified by:
updateProperties in interface ResourceRepository
Parameters:
resourceUris - An array of resources to update with the given properties.
properties - New or updated properties to set on the resource.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by an element of resourceUris is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by an element of resourceUris is locked
ALC-REP-018-000The resource identified by an element of resourceUris does not exist or is not accessible
ALC-REP-019-000A property specified in properties is immutable

unlockResource

public java.lang.String unlockResource(java.lang.String resourceUri)
                                throws RepositoryException
Unlocks the locked resources identified by the resourceUri.

Post-conditions:

If the user has system write permission, all locks on the resource are removed.

Specified by:
unlockResource in interface ResourceRepository
Parameters:
resourceUri - The resource to unlock.
Returns:
The lock token used to unlock this resource. The token can be discarded as its use is deprecated.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible

updateResource

public Resource updateResource(java.lang.String resourceUri,
                               Resource resource,
                               boolean revMajorVersion)
                        throws RepositoryException
Updates the resource identified by resourceUri with the data in resource. The Lid, major version, and minor version attributes on the supplied resource are ignored, and are read from the resource identified by resourceUri. It is important to be aware that changing the name of a resource will break all prior path-based references. For example, the resource will not be accessible by the old path.

Pre-conditions:

Post-conditions:

If the ownerVersion attribute is set on resource, ownerVersion must be unique across all versions of this logical resource.

Specified by:
updateResource in interface ResourceRepository
Parameters:
resourceUri - The version of the resource being updated.
resource - The new resource version.
revMajorVersion - If true, the major version number is incrememted and the minor version number is reset to zero. If false, the minor version number is incremented and the major version number is unchanged.
Returns:
An instance of the newly created version. The returned instance is not the same instance as resource.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-020-000Pre-condition 2 failed
ALC-REP-021-000Pre-condition 1 failed
ALC-REP-022-000Pre-condition 1 failed

writeAccessControlList

public void writeAccessControlList(java.lang.String resourceUri,
                                   AccessControlList accessControlList,
                                   boolean propagate)
                            throws RepositoryException
Sets or updates the access control list (ACL) contained in accessControlList on the resources identified by the resourceUri. If propagate is true and resourceUri identifies a ResourceCollection, the ACL will be applied to all members of the collection. Locking rules do not apply to the resource identified by resourceUri.

Post-conditions:

Specified by:
writeAccessControlList in interface ResourceRepository
Parameters:
resourceUri - The URI of the resource to which the ACL must be applied.
accessControlList - The ACL to apply to the resource identified by resourceId.
propagate - When the resource is a ResourceCollection, this parameter determines whether the permissions should be propagated to all path-contained resources.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
See Also:
AccessControlList

writeAccessControlList

public void writeAccessControlList(java.lang.String resourceUri,
                                   AccessControlList accessControlList,
                                   short propagationMode)
                            throws RepositoryException
Sets or updates the access control list (ACL) contained in accessControlList on the resources identified by the resourceUri. If propagate is true and resourceUri identifies a ResourceCollection, the ACL will be applied to all members of the collection. Locking rules do not apply to the resource identified by resourceUri.

Post-conditions:

Specified by:
writeAccessControlList in interface ResourceRepository
Parameters:
resourceUri - The URI of the resource to which the ACL must be applied.
accessControlList - The ACL to apply to the resource identified by resourceId.
propagationMode - When the resource is a ResourceCollection, this flag indicates whether to recursively write the ACL to all child Resources, or to all non ResourceCollection immediate children in the specified ResourceCollection or to not recursively write the ACL.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
See Also:
AccessControlList

writeResource

public Resource writeResource(java.lang.String parentResourcePath,
                              Resource resource)
                       throws RepositoryException
Writes a new resource into the Repository.

Pre-conditions:

If specified by the client:

Post-conditions:

Specified by:
writeResource in interface ResourceRepository
Parameters:
parentResourcePath - The path to the ResourceCollection that will contain the new Resource.
resource - The new Resource to create.
Returns:
An instance of the newly created Resource. The returned instance is not the same instance as resource.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-013-000parentResourcePath is not a path-based identifier
ALC-REP-016-000The resource identified by parentResourcePath is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by parentResourcePath is locked
ALC-REP-018-000The resource identified by parentResourcePath does not exist or is not accessible
ALC-REP-028-000The major/minor combination is invalid
ALC-REP-100-000The Id or Lid is already in use by other resources

getLocks

public java.util.List getLocks(java.lang.String resourceUri)
                        throws RepositoryException
Retrieves a java.util.List containing all Lock objects on a specific resource identified by the given resourceUri.

Specified by:
getLocks in interface ResourceRepository
Parameters:
resourceUri - A Resource for which to retrieve locks.
Returns:
A java.util.List of Lock instances on the Resource.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible

readResourceContent

public Document readResourceContent(java.lang.String resourceUri)
                             throws RepositoryException
Retrieves the content of the Resource object identified by resourceUri from the Repository. This method may return null, in which case the Resource may still have content associated with it, but is stored externally. See Resource.getContent() and ResourceContent.getContentUri().

Specified by:
readResourceContent in interface ResourceRepository
Parameters:
resourceUri - The resource for which the content will be returned.
Returns:
A Document object representing the resource's content.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible

clearLockTokens

public void clearLockTokens()
Clears the lock tokens stored in the delegate's lock token cache.

Specified by:
clearLockTokens in interface ResourceRepositoryDelegate

updateResourceWithId

public Resource updateResourceWithId(java.lang.String resourceUri,
                                     java.lang.String resourceVersionId,
                                     boolean revMajorVersion)
                              throws RepositoryException
The purpose of this method is to allow a resource to be updated using content from a previous revision of the same logical resource. The previous revision must be identified using the resourceVersionId parameter. For more information, see updateResource().

Specified by:
updateResourceWithId in interface ResourceRepository
Parameters:
resourceUri - The version of the resource being updated.
resourceVersionId - The new resource version identifier.
revMajorVersion - If true, the major version number is incremented and the minor version number is reset to zero. If false, the minor version number is incremented and the major version number is unchanged.
Returns:
An instance of the newly created version.
Throws:
RepositoryException - The following error codes indicate the error cause:

Error codeDescription
ALC-REP-016-000The resource identified by resourceUri is locked by another user
ALC-REP-017-000This error code is deprecated because it will never occur. The resource identified by resourceUri is locked
ALC-REP-018-000The resource identified by resourceUri does not exist or is not accessible
ALC-REP-020-000Pre-condition 2 of updateResource() failed
ALC-REP-021-000Pre-condition 1 of updateResource() failed
ALC-REP-022-000Pre-condition 1 of updateResource() failed


[an error occurred while processing this directive] [an error occurred while processing this directive]