Each of these root objects has different APIs. For more details on this, you can refer to the Alfresco wiki's JavaScript API page at http://wiki.alfresco.com/wiki/3.2_JavaScript_API and see some examples at http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook. In the next section, we will talk about FreeMarker APIs that are available for the AVM repository.
avm
is the root object for JavaScript APIs, and with this root object you can access the AVM repository. The available APIs for the avm
root node are as follows:
stores:
This returns all store objects in the AVM repositorylookupStore(storeid):
This returns the store object for the specified store IDlookupStoreRoot(storeid):
This returns the root node for the specified store IDlookupNode(path):
This returns a single AVM node based on the given full path, including store to the nodewebappsFolderPath(storeid):
This returns the root path to the AVM webapps
folder for the specified store IDWhen you use any of the previous mentioned AVM API, you will get the object of the AVM store. This store object can have the APIs described next:
id:
This returns the internal ID of the storename:
This returns the name of the storecreator:
This returns the user who has created this storecreatedDate:
This returns the date on which the store was createdlookupRoot:
This returns the root node for the storelookupNode(path):
This returns the node for the specified path relative to the AVM webapps
root folder for the storeluceneSearch(query):
This executes a search against the store and returns an array of AVM nodes as the resultversion:
Returns node's version. Generally it will be 1 (Head revision).path:
Returns fully qualified AVM path to the node.parentPath:
Returns fully qualified AVM path to the parent of the node.isDirectory:
Returns true
if this node is a directory.isFile:
Returns true
if this node is a file.isLocked:
Returns true
if this node is currently locked.isLockOwner:
Returns true
if this node is locked by the current user.hasLockAccess:
Returns true
if this user has the permission to perform operations on the node when locked. This is true if the item is either unlocked, locked by the current user, or locked and the current user has the Content Manager role in the associated web project.rename(name):
This renames the node. In AVM you cannot change the cm:name
property directly to change the name.