|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AVMService
Service interface for the Alfresco Versioning Model (AVM).
For the remote API, see: AVMRemote
.
Because the AVM is a versioning repository, fully explicit references to the nodes within it consist of an absolute AVM path, and a version ID. Absolute AVM paths are of the form: <store-name>:<store-relative-path>.
For example: mystore:/www/avm_webapps/ROOT/x/y/z.html
Within AVMService, whenever an API takes a path and a name, the path is the parent directory in which the name appears. Whenever just a path is needed by an API, it is an absolute path to a file or directory.
The special version ID -1
(negative one)
refers to the latest read/write version at the given absolute AVM path.
Non-negative version ID values refer to read-only snapshots of a store.
For this reason, the version ID -1
is implicit for all write operations. Sometimes,
-1
is referred to as the
HEAD
version (a term that should be
already be familiar to users of other versioning systems like
CVS
and SVN).
Snapshots can be created explicitly via a call to
createSnapshot
,
or implicitly by various APIs in this interface and in
AVMSyncService
.
Although a new snapshot of a store will have version a ID one higher
than the previous snapshot in that store, the history of an AMV store
does not necessarily contain a continuous range of version ID values,
because purgeVersion
may have been called. Regardless of whether
purgeVersion
has been called, the AVM never recycles version ID values
within a store.
Method Summary | |
---|---|
void |
addAspect(java.lang.String path,
org.alfresco.service.namespace.QName aspectName)
Add an aspect to an AVM node. |
void |
copy(int srcVersion,
java.lang.String srcPath,
java.lang.String dstPath,
java.lang.String name)
Perform a non-virtual (heavy-weight), and potentially recursive copy of the source into the destination directory. |
void |
createBranch(int version,
java.lang.String srcPath,
java.lang.String dstPath,
java.lang.String name)
Create a branch from a given version and path. |
void |
createDirectory(java.lang.String path,
java.lang.String name)
Create a new directory. |
void |
createDirectory(java.lang.String path,
java.lang.String name,
java.util.List aspects,
java.util.Map properties)
Create a new directory with aspects and properties. |
java.io.OutputStream |
createFile(java.lang.String path,
java.lang.String name)
Create a new "plain" (non-layered) file within a path. |
void |
createFile(java.lang.String path,
java.lang.String name,
java.io.InputStream in)
Create a new "plain" (non-layered) file. |
void |
createFile(java.lang.String path,
java.lang.String name,
java.io.InputStream in,
java.util.List aspects,
java.util.Map properties)
Create a new "plain" (non-layered) file with aspects and properties. |
void |
createLayeredDirectory(java.lang.String targetPath,
java.lang.String parent,
java.lang.String name)
Create a new layered directory. |
void |
createLayeredFile(java.lang.String targetPath,
java.lang.String parent,
java.lang.String name)
Deprecated. |
java.util.Map |
createSnapshot(java.lang.String store,
java.lang.String tag,
java.lang.String description)
Snapshot the given AVMStore. |
void |
createStore(java.lang.String name)
Create a new AVMStore. |
void |
createStore(java.lang.String name,
java.util.Map props)
Create a new AVMStore with store properties (equivalent to createStore + setProperties) |
void |
deleteNodeProperties(java.lang.String path)
Delete all the properties attached to an AVM node. |
void |
deleteNodeProperty(java.lang.String path,
org.alfresco.service.namespace.QName name)
Delete a property. |
void |
deleteStoreProperty(java.lang.String store,
org.alfresco.service.namespace.QName name)
Delete a property on a store by name. |
AVMNodeDescriptor |
forceCopy(java.lang.String path)
Low-level internal function: Force a copy on write write event on the given node. |
org.alfresco.util.Pair |
getAPath(AVMNodeDescriptor desc)
Get a single valid path to a given node. |
java.util.Set |
getAspects(AVMNodeDescriptor desc)
Get all the aspects from a node descriptor. |
java.util.Set |
getAspects(int version,
java.lang.String path)
Get all the aspects on an AVM node. |
AVMNodeDescriptor |
getCommonAncestor(AVMNodeDescriptor left,
AVMNodeDescriptor right)
Get the common ancestor of two nodes if a common ancestor exists. |
org.alfresco.service.cmr.repository.ContentData |
getContentDataForRead(AVMNodeDescriptor desc)
Get ContentData using only a node descriptor. |
org.alfresco.service.cmr.repository.ContentData |
getContentDataForRead(int version,
java.lang.String path)
Low-level internal function: Get the ContentData for a node in a read context. |
org.alfresco.service.cmr.repository.ContentData |
getContentDataForWrite(java.lang.String path)
Low-level internal function: Get the ContentData for a node in a write context. |
org.alfresco.service.cmr.repository.ContentReader |
getContentReader(int version,
java.lang.String path)
Low-level internal function: Fetch a content reader for a file node. |
org.alfresco.service.cmr.repository.ContentWriter |
getContentWriter(java.lang.String path,
boolean update)
Low-level internal function: Fetch a ContentWriter to a file node. |
java.util.List |
getDeleted(int version,
java.lang.String path)
Non-recursively get the names of nodes that have been deleted in a directory identified by a version ID and a path |
java.util.SortedMap |
getDirectoryListing(AVMNodeDescriptor dir)
Get a non-recursive directory listing of a directory node identified by a node descriptor. |
java.util.SortedMap |
getDirectoryListing(AVMNodeDescriptor dir,
boolean includeDeleted)
Get a non-recursive directory listing of a directory identified by a node descriptor; optionally, deleted nodes can be included in this listing. |
java.util.SortedMap |
getDirectoryListing(AVMNodeDescriptor dir,
java.lang.String childNamePattern)
Get a non-recursive directory listing of a directory node identified by a node descriptor. |
java.util.SortedMap |
getDirectoryListing(int version,
java.lang.String path)
Get a non-recursive listing of a directory identified by its version ID and path. |
java.util.SortedMap |
getDirectoryListing(int version,
java.lang.String path,
boolean includeDeleted)
Get a non-recursive listing of a directory node identified by its version ID and path; optionally, deleted notes can be included in this listing. |
AVMNodeDescriptor[] |
getDirectoryListingArray(AVMNodeDescriptor dir,
boolean includeDeleted)
A convenience method to get a non-recursive directory listing as an Array from a directory identified by a node descriptor; optionally, deleted nodes can be included in this listing. |
AVMNodeDescriptor[] |
getDirectoryListingArray(int version,
java.lang.String path,
boolean includeDeleted)
A convenience method to get a directory listing as an Array of AVMNodeDescriptors; this function is otherwise equivalent to getDirectoryListing |
java.util.SortedMap |
getDirectoryListingDirect(AVMNodeDescriptor dir,
boolean includeDeleted)
Get a non-recursive listing of all the nodes contained by a directory identified by an AVMNodeDescriptor, excluding those that are only present "indirectly" via layering; optionally, deleted nodes that are directly contained can be included this listing. |
java.util.SortedMap |
getDirectoryListingDirect(int version,
java.lang.String path)
Get a non-recursive listing of nodes contained by a directory identified by its version ID and path, but exclude all nodes that are only contained "indirectly" via layering. |
java.util.SortedMap |
getDirectoryListingDirect(int version,
java.lang.String path,
boolean includeDeleted)
Get a non-recursive listing of nodes contained directly, but exclude all nodes that are only contained "indirectly" (i.e.: via layering). |
java.io.InputStream |
getFileInputStream(AVMNodeDescriptor desc)
Get an InputStream for reading the contents of a file node identified by its descriptor. |
java.io.InputStream |
getFileInputStream(int version,
java.lang.String path)
Get an InputStream for reading the contents of a file identified by its version ID and AVM path. |
java.io.OutputStream |
getFileOutputStream(java.lang.String path)
Get an output stream to write to a file identified by an AVM path. |
java.util.List |
getHeadPaths(AVMNodeDescriptor desc)
Get all paths that a given node has that are in the HEAD version ( -1 ). |
java.util.List |
getHistory(AVMNodeDescriptor desc,
int count)
Get a list of up to count nodes in the history chain of a node. |
java.lang.String |
getIndirectionPath(int version,
java.lang.String path)
Get the indirection path for a node in a layered context whether that indirection path is primary or non-primary (or seen via transparency). |
int |
getLatestSnapshotID(java.lang.String storeName)
Get the latest snapshot ID of a store. |
LayeringDescriptor |
getLayeringInfo(int version,
java.lang.String path)
Get layering information about a path. |
int |
getNextVersionID(java.lang.String storeName)
Gets the ID that the next snapshotted version of a store will have. |
java.util.Map |
getNodeProperties(AVMNodeDescriptor desc)
Get all the properties associated with a node identified by a descriptor. |
java.util.Map |
getNodeProperties(int version,
java.lang.String path)
Get all the properties associated with a node that is identified by a version ID and a path. |
PropertyValue |
getNodeProperty(int version,
java.lang.String path,
org.alfresco.service.namespace.QName name)
Get a property of a node by QName. |
java.util.List |
getPaths(AVMNodeDescriptor desc)
Get a list of all paths that a given node has. |
java.util.List |
getPathsInStoreHead(AVMNodeDescriptor desc,
java.lang.String store)
Get all paths to a node starting at the HEAD version ( -1 )
of a store. |
java.util.List |
getPathsInStoreVersion(AVMNodeDescriptor desc,
java.lang.String store,
int version)
Get all paths to a given node in a single store in a single non-head version. |
AVMStoreDescriptor |
getStore(java.lang.String name)
Get a descriptor for an AVMStore. |
java.util.Map |
getStoreProperties(java.lang.String store)
Get all the properties associated with a store. |
PropertyValue |
getStoreProperty(java.lang.String store,
org.alfresco.service.namespace.QName name)
Get a property from a store. |
AVMNodeDescriptor |
getStoreRoot(int version,
java.lang.String name)
A convenience method for getting the specified root directory of an AVMStore (e.g.: "mysite:/" ). |
java.util.List |
getStores()
Get the descriptors of all AVMStores in the repository. |
java.util.List |
getStoreVersions(java.lang.String name)
Get the set of versions in an AVMStore. |
java.util.List |
getStoreVersions(java.lang.String name,
java.util.Date from,
java.util.Date to)
Get AVMStore version descriptors by creation date. |
java.util.List |
getStoreVersionsBetween(java.lang.String name,
int startVersion,
int endVersion)
Get all versions from an including startVersion up to but NOT including endVersion |
java.util.List |
getStoreVersionsFrom(java.lang.String name,
int version)
Get all versions from the last down to and including the one specified Returned in descending version id. |
java.util.List |
getStoreVersionsTo(java.lang.String name,
int version)
Get all versions from the first up to and including the one specified Returned in ascending version id order. |
AVMStoreDescriptor |
getSystemStore()
Low-level internal function: Retrieve the reserved "system" store. |
boolean |
hasAspect(int version,
java.lang.String path,
org.alfresco.service.namespace.QName aspectName)
Determines whether a node has a particular aspect. |
void |
link(java.lang.String parentPath,
java.lang.String name,
AVMNodeDescriptor toLink)
Low-level internal function: Insert a node into a parent directly. |
AVMNodeDescriptor |
lookup(AVMNodeDescriptor dir,
java.lang.String name)
Lookup a node identified by the directory node that contains it, and its name. |
AVMNodeDescriptor |
lookup(AVMNodeDescriptor dir,
java.lang.String name,
boolean includeDeleted)
Lookup a node identified by the directory that contains it, and its name; optionally, the lookup can retrive the descriptor of a node even if it has been deleted from its containing directory. |
AVMNodeDescriptor |
lookup(int version,
java.lang.String path)
Lookup a node identified by version ID and path. |
AVMNodeDescriptor |
lookup(int version,
java.lang.String path,
boolean includeDeleted)
Lookup a node identified by version ID and path; optionally, if the node is deleted, its descriptor can still be retrieved. |
void |
makePrimary(java.lang.String path)
Make a directory into a primary indirection node. |
void |
makeTransparent(java.lang.String dirPath,
java.lang.String name)
Atomically delete name within dirPath
and uncover
it so whatever is underneath can be seen via transparency. |
void |
purgeStore(java.lang.String name)
Purge an AVMStore. |
void |
purgeVersion(int version,
java.lang.String name)
Purge a version from an AVMStore. |
java.util.Map |
queryStorePropertyKey(java.lang.String store,
org.alfresco.service.namespace.QName keyPattern)
Deprecated. |
java.util.Map |
queryStoresPropertyKeys(org.alfresco.service.namespace.QName keyPattern)
Deprecated. |
void |
removeAspect(java.lang.String path,
org.alfresco.service.namespace.QName aspectName)
Remove an aspect and its properties from a node. |
void |
removeNode(java.lang.String path)
A convenience method that removes a node specified by an AVM path. |
void |
removeNode(java.lang.String parent,
java.lang.String name)
Remove a file or directory from its parent directory. |
void |
rename(java.lang.String srcParent,
java.lang.String srcName,
java.lang.String dstParent,
java.lang.String dstName)
Rename a file or directory. |
void |
renameStore(java.lang.String sourceName,
java.lang.String destName)
Rename a store. |
void |
retargetLayeredDirectory(java.lang.String path,
java.lang.String target)
Retarget a layered directory. |
void |
revert(java.lang.String path,
AVMNodeDescriptor toRevertTo)
Revert a HEAD path to a given version. |
void |
setContentData(java.lang.String path,
org.alfresco.service.cmr.repository.ContentData data)
Low-level internal function: Set the content data on a file. |
void |
setEncoding(java.lang.String path,
java.lang.String encoding)
Set the encoding. |
void |
setGuid(java.lang.String path,
java.lang.String guid)
Set the GUID on a node. |
void |
setMetaDataFrom(java.lang.String path,
AVMNodeDescriptor from)
Set all metadata on a node from another node. |
void |
setMimeType(java.lang.String path,
java.lang.String mimeType)
Set the mime type. |
void |
setNodeProperties(java.lang.String path,
java.util.Map properties)
Set a collection of properties on a node. |
void |
setNodeProperty(java.lang.String path,
org.alfresco.service.namespace.QName name,
PropertyValue value)
Set a property on a node. |
void |
setOpacity(java.lang.String path,
boolean opacity)
Set the opacity of a layered directory. |
void |
setStoreProperties(java.lang.String store,
java.util.Map props)
Set a group of properties on a store. |
void |
setStoreProperty(java.lang.String store,
org.alfresco.service.namespace.QName name,
PropertyValue value)
Set a property on a store. |
void |
uncover(java.lang.String dirPath,
java.lang.String name)
If a layered directory dirPath
has a deleted entry of the given name ,
remove that name from the deleted list,
so that if a layer below it contains an entry
of this name, it can be seen via transparency
from dirPath . |
void |
updateLink(java.lang.String parentPath,
java.lang.String name,
AVMNodeDescriptor toLink)
Low-level internal function: replace a node in a parent directly. |
Method Detail |
---|
java.io.InputStream getFileInputStream(int version, java.lang.String path)
version
- The version ID to look in.path
- The absolute path to the file.
AVMNotFoundException
AVMWrongTypeException
java.io.InputStream getFileInputStream(AVMNodeDescriptor desc)
desc
- The descriptor.
AVMNotFoundException
java.io.OutputStream getFileOutputStream(java.lang.String path)
createFile
.
To create a layered file, see:
createLayeredFile
.
path
- The absolute path to the file.
AVMNotFoundException
AVMWrongTypeException
java.util.SortedMap getDirectoryListing(int version, java.lang.String path)
path
does not refer to a directory
node, AVMWrongTypeException
is thrown.
version
- The version ID to look in.path
- The absolute AVM path to the file.
AVMNotFoundException
AVMWrongTypeException
java.util.SortedMap getDirectoryListingDirect(int version, java.lang.String path)
If this function is called on a "plain" (non-layered) directory,
it is equivalent to
getDirectoryListing
.
version
- The version to look up.path
- The full path to get listing for.
AVMNotFoundException
AVMWrongTypeException
java.util.SortedMap getDirectoryListing(AVMNodeDescriptor dir)
dir
- The directory node descriptor.
AVMNotFoundException
AVMWrongTypeException
java.util.SortedMap getDirectoryListing(AVMNodeDescriptor dir, java.lang.String childNamePattern)
dir
- The directory node descriptor.childPattern
-
AVMNotFoundException
AVMWrongTypeException
java.util.List getDeleted(int version, java.lang.String path)
version
- The version to look under.path
- The path of the directory.
AVMNotFoundException
AVMWrongTypeException
java.io.OutputStream createFile(java.lang.String path, java.lang.String name)
path
does not exist.
path
- The path of the directory containing the created file.name
- The name of the new file
AVMNotFound
AVMExists
AVMWrongType
void createDirectory(java.lang.String path, java.lang.String name)
path
is within a layer, the new directory will be a layered directory;
otherwise, the new directory will be a plain directory.
path
- The simple absolute path to the parent.name
- The name to give the directory.
AVMNotFound
AVMExists
AVMWrongType
void createLayeredFile(java.lang.String targetPath, java.lang.String parent, java.lang.String name)
Note: the target of the indirection does not need to exist at the time the layered file node is created.
targetPath
- The absolute path of the underlying file being pointed atparent
- The absolute path of the directory containing layered file to be createdname
- The name of the layered file to be created
AVMNotFound
AVMExists
AVMWrongType
void createLayeredDirectory(java.lang.String targetPath, java.lang.String parent, java.lang.String name)
Note: a "primary" indirection is one in which the target is explicitly set; "non-primary" indirect nodes compute their effective target dynamically on the basis of their relative position to the closest "primary" indirect node that contains them. Therefore, changing the target of a "primary" layered directory node immediately alters the indirection targets computed by the "non-primary" layered nodes it contains.
Note: the target of the indirection does not need to exist at the time the layered directory node is created.
targetPath
- The absolute path to the underlying directory that
the layered directory being created will point at.parent
- The absolute path to directory containing the layered directory being created.name
- The name of the layered directory being created
AVMNotFound
AVMExists
AVMWrongType
void retargetLayeredDirectory(java.lang.String path, java.lang.String target)
path
- Path to the layered directory.target
- The new indirection target of the layered directory
AVMNotFoundException
AVMWrongTypeException
void createStore(java.lang.String name)
purgeStore
, the name of
the deleted store can be reused in a later call to
createStore
.
The store name must be non-null, cannot be the empty string, and must not contain characters that are illegal in normal file names.
name
- The name of the new AVMStore.
AVMExistsException
void createStore(java.lang.String name, java.util.Map props)
name
- The name of the new AVMStore.props
- A Map of the properties to set.
AVMExistsException
void createBranch(int version, java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
version
- The version number from which to make the branch.srcPath
- The path to the node to branch from.dstPath
- The path to the directory to contain the new branch.name
- The name to give the new branch.
AVMNotFoundException
AVMExistsException
AVMWrongTypeException
void removeNode(java.lang.String parent, java.lang.String name)
If instead you want to make the file in the lower layer visible
via transparency, see:
uncover
.
If you want to perform a removal and an uncover
operation atomically, see:
makeTransparent
.
Caution: this removes directories even if they are not empty.
Note: developers of records management systems must also
be aware that the AVMNode corresponding to the
parent
directory and name
provided might still be accessible via different
path lookups after this function has completed;
this because branching and versioning operations create
manifestations of nodes in a manner that is similar
to a UNIX hard link. If you need to discover every
possible path that could retrieve the associated AVMNode, see:
getPaths
,
getHeadPaths
, and
getPathsInStoreHead
.
parent
- The absolute path to the parent directory.name
- The name of the child to remove.
AVMNotFoundException
AVMWrongTypeException
void rename(java.lang.String srcParent, java.lang.String srcName, java.lang.String dstParent, java.lang.String dstName)
uncover
operation is performed afterwards).
Note: if instead you want to rename an AVM store, see
renameStore
.
srcParent
- The absolute path to the parent directory.srcName
- The name of the node in the src directory.dstParent
- The absolute path to the destination directory.dstName
- The name that the node will have in the destination directory.
AVMNotFoundException
AVMExistsException
void uncover(java.lang.String dirPath, java.lang.String name)
dirPath
has a deleted entry of the given name
,
remove that name from the deleted list,
so that if a layer below it contains an entry
of this name, it can be seen via transparency
from dirPath
.
Note: if you are looking for an atomic operation
that first deletes an object, then performs
an "uncover" operation to make it transparent, see
makeTransparent
.
dirPath
- The path to the layered directory.name
- The name to uncover.
AVMNotFoundException
AVMWrongTypeException
int getNextVersionID(java.lang.String storeName)
Note: unless the operations that require this value to be valid are performed within a transaction, this value can become "stale".
storeName
- The name of the AVMStore.
AVMNotFoundException
int getLatestSnapshotID(java.lang.String storeName)
storeName
- The store name.
AVMNotFoundException
java.util.Map createSnapshot(java.lang.String store, java.lang.String tag, java.lang.String description)
When no snapshot is actually taken, but either 'tag' or 'store' are non-null, they will override the value for the last snapshot (i.e.: the old values will be discarded); however, if both 'tag' and 'description' are null then invoking createSnapshot when no files have been modified becomes a true no-op.
store
- The name of the AVMStore to snapshot.tag
- The short description.description
- The thick description.
AVMNotFoundException
java.util.List getStoreVersions(java.lang.String name)
purgeStore
operations have
been performed).
Because the number of versions that a store can contain
may become large, this call can be a resource-intensive,
and may even causing Out of Memory exceptions.
name
- The name of the AVMStore.
AVMNotFoundException
java.util.List getStoreVersions(java.lang.String name, java.util.Date from, java.util.Date to)
from
or to
can be null but not both.
from
is null, all versions earlier than
to
will be returned.
to
is null, all versions later than
from
will be returned.
The order of the values returned is not guaranteed, nor are the version
IDs necessarily free of "missing" values (due to the possibility that
purgeStore
operations have
been performed).
Note: for portability, all dates are stored as 64-bit longs, with a time resolution of one millisecond. Therefore, aliasing/wrapping are not a concern unless you need to plan 292.4 million years ahead. If so, please contact your system administrator.
name
- The name of the AVMStore.from
- Earliest date of version to include.to
- Latest date of version to include.
AVMNotFoundException
java.util.List getStores()
AVMStoreDescriptor getStore(java.lang.String name)
name
- The AVMStore's name.
AVMNodeDescriptor getStoreRoot(int version, java.lang.String name)
"mysite:/"
).
version
- The version to look up.name
- The name of the AVMStore.
AVMNotFoundException
AVMNodeDescriptor lookup(int version, java.lang.String path)
version
- The version ID to look under.path
- The simple absolute path to the parent directory.
AVMNodeDescriptor lookup(int version, java.lang.String path, boolean includeDeleted)
version
- The version ID to look under.path
- The simple absolute path to the parent directory.includeDeleted
- Whether to allow a deleted node to be retrieved
AVMNodeDescriptor lookup(AVMNodeDescriptor dir, java.lang.String name)
dir
- The descriptor for the directory node.name
- The name to lookup.
AVMWrongTypeException
- If dir
does not refer to a directory.AVMNodeDescriptor lookup(AVMNodeDescriptor dir, java.lang.String name, boolean includeDeleted)
dir
- The descriptor for the directory node.name
- The name to lookup.includeDeleted
- Whether to allow a deleted node to be retrieved via the lookup
AVMNotFoundException
AVMWrongTypeException
org.alfresco.util.Pair getAPath(AVMNodeDescriptor desc)
desc
- The descriptor of the node to which a version and path will be fetched.
AVMNotFoundException
java.lang.String getIndirectionPath(int version, java.lang.String path)
For example, if "mysite--alice:/www" is a layered
directory that targets "mysite:/www", and "mysite--alice"
contains no content directly, then if the path
path "mysite:/www/avm_webapps/ROOT/x/y/z" is valid,
calling getIndirectionPath
on
"mysite--alice:/www/avm_webapps/ROOT/x/y/z" will yield
"mysite:/www/avm_webapps/ROOT/x/y/z".
version
- The version number to get.path
- The path to the node of interest.
AVMNotFoundException
AVMWrongTypeException
void purgeStore(java.lang.String name)
Note: while the store being purged disappears from view immediately, any nodes that become unreachable as a result are deleted asynchronously.
name
- The name of the AVMStore.
AVMNotFoundException
void purgeVersion(int version, java.lang.String name)
version
- The version to purge.name
- The name of the AVMStore from which to purge it.
AVMNotFoundException
- If name
or version
do not exist.void makePrimary(java.lang.String path)
path
- The full path.
AVMNotFoundException
AVMWrongTypeException
java.util.List getHistory(AVMNodeDescriptor desc, int count)
desc
(as long as the count is non-zero).
desc
- The descriptor for a node to find ancestors for.count
- maximum number of ancestors to return in the list
(the value -1
means
"no limit -- return them all")
AVMNotFoundException
void setOpacity(java.lang.String path, boolean opacity)
path
- The path to the layered directory.
AVMNotFoundException
AVMWrongTypeException
AVMNodeDescriptor getCommonAncestor(AVMNodeDescriptor left, AVMNodeDescriptor right)
left
- The first node.right
- The second node.
AVMNotFoundException
LayeringDescriptor getLayeringInfo(int version, java.lang.String path)
path
.
version
- The version to look under.path
- The absolute AVM path.
AVMNotFoundException
AVMWrongTypeException
void setNodeProperty(java.lang.String path, org.alfresco.service.namespace.QName name, PropertyValue value)
path
- The path to the node to set the property on.name
- The QName of the property.value
- The property to set.
AVMNotFoundException
AVMWrongTypeException
void setNodeProperties(java.lang.String path, java.util.Map properties)
path
- The path to the node.properties
- The Map of properties to set.
AVMNotFoundException
AVMWrongTypeException
PropertyValue getNodeProperty(int version, java.lang.String path, org.alfresco.service.namespace.QName name)
version
- The version to look under.path
- The path to the node.name
- The QName.
AVMNotFoundException
AVMWrongTypeException
java.util.Map getNodeProperties(int version, java.lang.String path)
version
- The version to look under.path
- The path to the node.
AVMNotFoundException
void deleteNodeProperty(java.lang.String path, org.alfresco.service.namespace.QName name)
Note: to remove an apsect, see: removeAspect
path
- The path to the node.name
- The QName of the property to delete.
AVMNotFoundException
void deleteNodeProperties(java.lang.String path)
Note: to remove an apsect, see: removeAspect
path
- The path to the node.
AVMNotFoundException
void setStoreProperty(java.lang.String store, org.alfresco.service.namespace.QName name, PropertyValue value)
store
- The store to set the property on.name
- The name of the property.value
- The value of the property.
AVMNotFoundException
- (if store does not exist)void setStoreProperties(java.lang.String store, java.util.Map props)
store
- The name of the store.props
- A Map of the properties to set.
AVMNotFoundException
- (if store does not exist)PropertyValue getStoreProperty(java.lang.String store, org.alfresco.service.namespace.QName name)
store
- The name of the store.name
- The name of the property.
AVMNotFoundException
- (if store does not exist)java.util.Map getStoreProperties(java.lang.String store)
store
- The name of the store.
AVMNotFoundException
- (if store does not exist)java.util.Map queryStorePropertyKey(java.lang.String store, org.alfresco.service.namespace.QName keyPattern)
store
- The name of the store.keyPattern
- The sql 'like' pattern, inserted into a QName.
void deleteStoreProperty(java.lang.String store, org.alfresco.service.namespace.QName name)
Note: to remove an apsect, see: removeAspect
store
- The name of the store.name
- The name of the property to delete.
AVMNotFoundException
void addAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
path
- The path to the node.aspectName
- The QName of the aspect.
AVMNotFoundException
AVMExistsException
java.util.Set getAspects(int version, java.lang.String path)
version
- The version to look under.path
- The path to the node.
AVMNotFoundException
void removeAspect(java.lang.String path, org.alfresco.service.namespace.QName aspectName)
path
- The path to the node.aspectName
- The name of the aspect.
AVMNotFoundException
boolean hasAspect(int version, java.lang.String path, org.alfresco.service.namespace.QName aspectName)
version
- The version to look under.path
- The path to the node.aspectName
- The aspect name to check.
AVMNotFoundException
void renameStore(java.lang.String sourceName, java.lang.String destName)
sourceName
- The original name.destName
- The new name.
AVMNotFoundException
AVMExistsException
void revert(java.lang.String path, AVMNodeDescriptor toRevertTo)
HEAD
path to a given version.
This works by cloning the version to revert to, and then linking
that new version into HEAD
.
The reverted version will have the previous
HEAD
version as ancestor.
path
- The path to the node to revert.toRevertTo
- The descriptor of the version to revert to.
AVMNotFoundException
void setGuid(java.lang.String path, java.lang.String guid)
path
- The path to the node.guid
- The GUID to set.void setMimeType(java.lang.String path, java.lang.String mimeType)
path
- The path of the file.mimeType
- The mime type.void setEncoding(java.lang.String path, java.lang.String encoding)
path
- The path of the file.encoding
- The encoding.java.util.Map queryStoresPropertyKeys(org.alfresco.service.namespace.QName keyPattern)
keyPattern
- The sql 'like' pattern, inserted into a QName.
void createDirectory(java.lang.String path, java.lang.String name, java.util.List aspects, java.util.Map properties)
path
is within a layer, the new directory will be a layered directory;
otherwise, the new directory will be a plain directory.
path
- The simple absolute path to the parent.name
- The name to give the directory.aspects
- A list of aspects to add.properties
- A Map of properties to add.
AVMNotFound
AVMExists
AVMWrongType
void createFile(java.lang.String path, java.lang.String name, java.io.InputStream in)
path
must already exist.
path
- The path of the directory containing the created file.name
- The name of the new filein
- An input stream with data for the file.
AVMNotFound
AVMExists
AVMWrongType
void createFile(java.lang.String path, java.lang.String name, java.io.InputStream in, java.util.List aspects, java.util.Map properties)
path
must already exist.
path
- The path of the directory containing the created file.name
- The name of the new filein
- An input stream with data for the file.aspect
- A list of aspects to give the file.properties
- A map of properties to give the file.
AVMNotFound
AVMExists
AVMWrongType
java.util.SortedMap getDirectoryListing(AVMNodeDescriptor dir, boolean includeDeleted)
dir
- The directory node descriptor.includeDeleted
- Whether to include deleted nodes.
AVMNotFoundException
- If the descriptor is stale.
AVMWrongTypeException
- If the descriptor does not point at a directory.AVMNodeDescriptor[] getDirectoryListingArray(AVMNodeDescriptor dir, boolean includeDeleted)
getDirectoryListing
except that it returns an array.
dir
- The descriptor pointing at the directory to list.includeDeleted
- Whether include deleted nodes
AVMNotFoundException
AVMWrongTypeException
java.util.SortedMap getDirectoryListingDirect(int version, java.lang.String path, boolean includeDeleted)
getDirectoryListingDirect
but it has the option of including deleted nodes in the listing.
version
- The version to look up.path
- The absolute AVM directory path to get a listing for.includeDeleted
- Whether to include deleted nodes.
AVMNotFoundException
AVMWrongTypeException
AVMNodeDescriptor[] getDirectoryListingArray(int version, java.lang.String path, boolean includeDeleted)
getDirectoryListing
version
- The version to look under.path
- The path to the directory to be listed.includeDeleted
- Whether to include deleted nodes
AVMNotFoundException
AVMWrongTypeException
java.util.SortedMap getDirectoryListingDirect(AVMNodeDescriptor dir, boolean includeDeleted)
dir
- The directory descriptor.includeDeleted
- Whether to include directly contained deleted nodes
AVMNotFoundException
AVMWrongTypeException
java.util.SortedMap getDirectoryListing(int version, java.lang.String path, boolean includeDeleted)
If instead, you wish to obtain a list of only
the deleted nodes within a directory, see:
getDeleted
.
version
- The version ID to look in.path
- The absolute AVM path to the file.includeDeleted
- Whether to include deleted nodes
AVMNotFoundException
AVMWrongTypeException
void removeNode(java.lang.String path)
removeNode
.
path
- The full path to the node to remove.
AVMNotFoundException
AVMWrongTypeException
void makeTransparent(java.lang.String dirPath, java.lang.String name)
name
within dirPath
and uncover
it so whatever is underneath can be seen via transparency.
If name
corresponds to a deletion already,
then the deletion step is skipped, and the "uncover"
operation is performed.
dirPath
- The path to the layered directory.name
- The name of the item this method will
flatten
AVMNotFoundException
AVMWrongTypeException
AVMStoreDescriptor getSystemStore()
void setMetaDataFrom(java.lang.String path, AVMNodeDescriptor from)
path
- The path to the node to set.from
- The descriptor for the node to get metadata from.
AVMNotFoundException
void link(java.lang.String parentPath, java.lang.String name, AVMNodeDescriptor toLink)
parentPath
- The path to the parent directory.name
- The name to give the node.toLink
- A descriptor for the node to insert.
AVMNotFoundException
void updateLink(java.lang.String parentPath, java.lang.String name, AVMNodeDescriptor toLink)
parentPath
- The path to the parent directory.name
- The name to give the node.toLink
- A descriptor for the node to insert.
AVMNotFoundException
AVMNodeDescriptor forceCopy(java.lang.String path)
path
- The path to force.
AVMNotFoundException
void copy(int srcVersion, java.lang.String srcPath, java.lang.String dstPath, java.lang.String name)
srcVersion
- The version of the source.srcPath
- The path of the source directory.dstPath
- The directory containing the destination directory.name
- The name of the destination within dstPath
.
AVMNotFoundException
java.util.List getPaths(AVMNodeDescriptor desc)
Note: paths that only access desc
via transparency are not returned by this function;
only "direct" containment relationships are considered.
For those concerned with records management applications, it's worth noting that once every path to an asset has been deleted, the system will purge it entirely in an asynchronous manner.
desc
- The node descriptor to get paths for.
AVMNotFoundException
java.util.List getHeadPaths(AVMNodeDescriptor desc)
HEAD
version ( -1
).
This can be an expensive operation but less so than getPaths().
desc
- The node descriptor to get paths for.
AVMNotFoundException
java.util.List getPathsInStoreHead(AVMNodeDescriptor desc, java.lang.String store)
HEAD
version ( -1
)
of a store. This can be an expensive operation but less so than getHeadPaths().
desc
- The node descriptor.store
- The store.
AVMNotFoundException
java.util.List getPathsInStoreVersion(AVMNodeDescriptor desc, java.lang.String store, int version)
desc
- The node descriptor.store
- The name of the store.version
- The version.
java.util.Map getNodeProperties(AVMNodeDescriptor desc)
desc
- The node descriptor
AVMNotFoundException
java.util.Set getAspects(AVMNodeDescriptor desc)
desc
- The node descriptor.
org.alfresco.service.cmr.repository.ContentReader getContentReader(int version, java.lang.String path)
getFileInputStream
;
however, it can be used to fetch either InputStream or a
random-access nio channel.
version
- The version ID of the file.path
- The absolute AVM path to the file.
AVMNotFoundException
AVMWrongTypeException
org.alfresco.service.cmr.repository.ContentWriter getContentWriter(java.lang.String path, boolean update)
path
- The path to the file.update
- true if the property must be updated atomically when the content write
stream is closed (attaches a listener to the stream); false if the client code
will perform the updates itself.
AVMNotFoundException
AVMWrongTypeException
org.alfresco.service.cmr.repository.ContentData getContentDataForRead(int version, java.lang.String path)
version
- The version to look under.path
- The path to the node.
AVMNotFoundException
AVMWrongTypeException
org.alfresco.service.cmr.repository.ContentData getContentDataForRead(AVMNodeDescriptor desc)
desc
- The node descriptor.
AVMNotFoundException
org.alfresco.service.cmr.repository.ContentData getContentDataForWrite(java.lang.String path)
path
- The path to the node.
AVMNotFoundException
AVMWrongTypeException
void setContentData(java.lang.String path, org.alfresco.service.cmr.repository.ContentData data)
path
- The path to the file.data
- The ContentData to set.
AVMNotFoundException
AVMWrongTypeException
java.util.List getStoreVersionsFrom(java.lang.String name, int version)
name
- version
-
java.util.List getStoreVersionsTo(java.lang.String name, int version)
name
- version
-
java.util.List getStoreVersionsBetween(java.lang.String name, int startVersion, int endVersion)
name
- startVersion
- endVersion
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |