Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
{{AVMWarning}}
2.22.9AVM
The AVM Console is an administrator/developer tool for low-level interaction with the AVM. It is available with Alfresco 2.2 and higher.
Accessing the console
You can access the AVM console via the URL:
http://<host>:<port>/alfresco/faces/jsp/admin/avm-console.jsp
Note: You must be logged-in as admin to access this page.
You can also access the AVM console (in embedded mode) from the command line tool via the class:
org.alfresco.repo.avm.AVMInterpreter (which supports the 'main' function)
Node Browser
Remember, you can also navigate AVM stores using the Alfresco Node Browser:
http://localhost:8080/alfresco/faces/jsp/admin/node-browser.jsp
Note: You must be logged-in as admin to access this page.
This might be useful if you wish to review certain store permissions/properties or node permissions/properties/aspects.
Basic syntax
Enter commands into the Command box of the form:
command, arg1, arg2, arg3, ... argn
Note: the first comma and space are significant (before arg1) otherwise you may get a syntax error.
Enter further data into the Optional Data box for commands like write and create that require input data.
Click Execute to run the command.
Common arguments
storename
The name of the store. Alphanumeric, and may also contain dash (-).
avmpath
A valid avm path should be of the form:
storename:/name/name/name.../name.
The root of the store is simply:
storename:/
#versionnumber#
A version number is indicated by an integer constant.
-1 is used to reference the 'HEAD' version.
As of Alfresco 2.2.1, certain simple commands will default to -1 if version number is not supplied.
Console Commands
Store commands
lsrep
Lists all the avmstores.
lsrep
example
lsver
Lists the versions in a given store
lsver, storename
where
examples
- lsver, abc
- lsver, TEST--admin
lsver (since 3.1.2)
Lists the versions in a given store
lsver, storename
lsver, storename, fromDate
lsver, storename, fromDate, toDate
where
- storename as above.
- fromDate, toDate in ISO 8601 format (eg. 'YYYY-MM-DDThh:mm:ss.sss<TZD>' where <TZD> = 'Z' or '+hh:mm' or '-hh:mm')
examples
- lsver, abc
- lsver, TEST--admin
- lsver, abc, 2009-09-30T10:44:29.440+01:00
- lsver, abc, 2009-09-01T10:44:29.440+01:00, 2009-09-30T10:44:29.440+01:00
mkrep
Create a new store.
mkrep, storename
where
examples
- mkrep, abc
- mkrep, TEST--admin
snap
Creates a snapshot (a new version of an avmstore).
snap, storename, tag, description
where
- storename is the name of the store to snapshot.
- tag is the short label (added in 2.2.3, optional - see notes below)
- description is the longer description (added in 2.2.3, optional - see notes below)
examples
- snap, abc
- snap, TEST--admin
- snap, mystore, mytag
- snap, anostore, ano tag, ano description
notes
- tag or description cannot contain ',' if using this interface
- WCM does not currently display snapshots that have no tag, since these are assumed to be implicit (system-generated) snapshots
statstore
Show information about a store.
statstore, storename
where
examples
- statstore, abc
- statstore, TEST--admin
rmrep
Purges a store, i.e. makes it truly go away.
rmrep, storename
where
- storename is the name of the store to purge.
examples
rmver
Purges a particular version of a store.
rmver, storename, #versionnumber#
where
- storename is the name of the store.
- #versionnmber# is the version to purge (cannot be <TZD>' where <TZD> = 'Z' or '+hh:mm' or '-hh:mm')
examples
- rmvers, abc, 2009-09-01T10:44:29.440+01:00, 2009-09-30T10:44:29.440+01:00
setstoreproperty (added 2.2.1)
Set the value of a store property.
setstoreproperty, storename, qname, value
where
- storename is the name of the store.
- value - the new property value - the type will be auto-detected. At present only TEXT
and INT types are suppored as well as collections of these types. Collections
can be specified using a comma seperated list enclosed in square brackets.
- qname - the property name in the form {namespaceURI}localName
examples
setstorepermission (added 2.2.1)
Set a permission mask on a store.
setstorepermission, storename, authority, permission
where
- storename is the name of the store.
- authority - the user or group identifier.
- permission - the permission name to set.
examples
clearstorepermission (added 2.2.1)
Clears a permission mask on a store for a given authority.
clearstorepermission, storename, authority
where
- storename is the name of the store.
- authority - the user or group identifier.
examples
Directory commands
ls
Lists the contents of the given directory.
ls, avmpath, #versionnumber#
where
- avmpath as above.
- #versionnumber# as above (optional for 2.2.1, defaults to -1).
examples
lsr
Lists the contents of the given directory recursively.
lsr, avmpath, #versionnumber#
where
- avmpath as above.
- #versionnumber# as above (optional for 2.2.1, defaults to -1).
examples
load
Loads content recursively into an avm directory.
load, fspath, avmpath
where
- fspath is a local filesystem path. Use '/'s to be safe, even on windows.
- avmpath as above and must be a path to a directory.
examples
mkdir
Create a new directory
mkdir, avmpath, name
where
- avmpath is as above and must point to a directory.
- name must be a valid Alfresco path component name.
examples
- mkdir, abc:/, testdir
- mkdir, abc:/testdir, testsubdir
mkbr
Create a branch
mkbr, srcavmpath, dstavmpath, name, #versionnumber#
where
- srcavmpath is a valid avmpath
- dstavmpath is a valid avmpath to a directory
- name is a valid path component name.
examples
mkldir
Create a new layered directory
mkldir, targetavmpath, avmpath, name
where
- targetavmpath is a valid avmpath to a directory which will be what the new layered directory is transparent to.
- avmpath is an avmpath to the directory which will contain the new layered directory.
- name is a valid path component name.
examples
setopacity (since 3.1.2)
Set layered directory to be opaque (or not) to its indirection
setopacity, avmpath, bool
where
- avmpath is an avmpath to a layered directory
- bool is 'true' (opaque) or 'false' (not opaque)
examples
File commands
rename
Renames a node from one place to another.
rename, srcdiravmpath, srcname, dstdiravmpath, dstname
where
- srcdiravmpath is the avm directory that contains the node to be renamed.
- srcname is the name of the node to rename.
- dstdiravmpath is the avm directory that the renamed node will live in.
- dstname is the name of the renamed node.
examples
cp
Copies a file from one place to another.
cp, avmpath, #versionnumber#, diravmpath, name
where
- avmpath is the path to the file to copy.
- #versionnumber# is as above.
- diravmpath is the directory in which the copy will reside.
- name is the name of the copy.
examples
cat
Shows the textual content of a node. Sorry no binary viewing.
cat, avmpath, #versionnumber#
where
- avmpath as above.
- #versionnumber# as above (optional for 2.2.1, defaults to -1).
examples
rm
Remove a node.
rm, avmpath, name
where
- avmpath is a pointer to a directory.
- name is the name of the node in that directory to remove.
examples
write
Writes content to an existing file.
write, avmpath
where
- avmpath is a path to a file.
examples
Note: This command expects the content to be written in the Optional Data box.
create
Create a new file.
create, avmpath, name
where
- avmpath is a path to a directory.
- name is the name to give the new file.
examples
Note: This command expects the content to be written in the Optional Data box.
Node commands
stat
Get information on a node.
stat, avmpath, #versionnumber#
where
- avmpath as above.
- #versionnumber# as above (optional for 2.2.1, defaults to -1).
examples
getnodeproperties
List all properties of a node.
getnodeproperties, avmpath, #versionnumber#
where
- avmpath as above.
- #versionnumber# as above (optional for 2.2.1, defaults to -1).
examples
descnode
Describes a node (including lock information).
descnode, avmpath, #versionnumber#
where
- avmpath as above.
- #versionnumber# as above (optional for 2.2.1, defaults to -1).
examples
deletenodeproperty
Delete a property of a node.
deletenodeproperty, avmpath, #versionnumber#, qname
where
- avmpath as above.
- #versionnumber# as above.
- qname - a property name in the form {namespaceURI}localName
examples
setnodeproperty (added 2.2.1)
Set the value of node property.
setnodeproperty, avmpath, qname, value
where
- value - the new property value - the type will be auto-detected. At present only TEXT,
NODE_REF and INT types are supported as well as collections of these types. Collections
must be specified using a comma separated list containing no spaces, enclosed in square brackets. For example: [aaa,bbb,ccc].
- qname - a property name in the form {namespaceURI}localName
examples:
<br>setnodeproperty, qwerty--admin:/www/avm_webapps/ROOT/folder1/file3.txt, {ah.model}aspectmv, [aaa,bbb,ccc,ddd,eee]<br>
getnodeaspects (added 2.2.1)
List all aspects of a node.
getnodeaspects, avmpath, #versionnumber#
where
- avmpath as above.
- #versionnumber# as above.
examples
addnodeaspect (added 2.2.1)
Add an aspect to a node.
addnodeaspect, avmpath, qname
where
- avmpath as above.
- qname - an aspect name in the form {namespaceURI}localName
examples
deletenodeaspect (added 2.2.1)
Remove an aspect and its properties from a node.
deletenodeaspect, avmpath, qname
where
- avmpath as above.
- qname - an aspect name in the form {namespaceURI}localName
examples
setnodepermission (added 2.2.1)
Set a permission mask on a node.
setnodepermission, avmpath, authority, permission
where
- avmpath as above.
- authority - the user or group identifier.
- permission - the permission name to set.
examples
clearnodepermission (added 2.2.1)
Clears a permission mask on a node for a given authority.
clearnodepermission, avmpath, authority
where
- avmpath as above.
- authority - the user or group identifier.
examples
history
Get a list of the previous versions of a node.
history, avmpath, #versionnumber#, #count#
where
- avmpath as above.
- #versionnumber# as above.
- #count# The number of versions into the past to list. -1 means all.
examples
update
Promotes a node from one tree to another.
update, avmpath, #versionnumber#, avmpath2
where
- avmpath as above.
- #versionnumber# as above.
- avmpath2 as above - target tree.
examples
Layer and other commands
resetLayer
Resets a layer.
resetLayer, avmpath
where
examples
flatten
Flattens a layer against a target tree.
flatten, avmpath1, avmpath2
where
- avmpath1 as above and must point to a layered directory (source tree).
- avmpath2 as above and must point to the underlying directory (target tree).
examples
mkldir
Create a new layered directory. Refer to Directory Commands above.
compare
Compares two trees.
compare, avmpath1, #versionnumber1#, avmpath2, #versionnumber2#
where
- avmpath1 as above.
- #versionnumber1# as above.
- avmpath2 as above.
- #versionnumber2# as above.
examples
Example interaction
Starting with empty AVM
> lsrep
> mkrep, abc
> lsrep
[abc:admin:Fri Apr 04 11:58:07 BST 2008]
> statstore, abc
[abc:admin:Fri Apr 04 11:58:07 BST 2008]
{http://www.alfresco.org/model/content/1.0}creator: PropertyValue[actual-type=STRING, multi-valued=false, value-type=STRING, value=admin]
{http://www.alfresco.org/model/content/1.0}created: PropertyValue[actual-type=DATE, multi-valued=false, value-type=STRING, value=2008-04-04T11:58:07.457+01:00]
> lsver, abc
[abc:0:admin:Fri Apr 04 11:58:07 BST 2008:Initial Empty Version.]
> lsr, abc:/, -1
> mkdir, abc:/, testdir
> mkdir, abc:/testdir, testsubdir
> ls, abc:/, -1
testdir [PD:1033]
> lsr, abc:/, -1
testdir [PD:1033]
testsubdir [PD:1034]
> snap, abc
> lsver, abc
[abc:0:admin:Fri Apr 04 11:58:07 BST 2008:Initial Empty Version.]
[abc:1:admin:Fri Apr 04 12:02:37 BST 2008:null]
> mkdir, abc:/, testdir2
> snap, abc
> lsver, abc
[abc:0:admin:Fri Apr 04 11:58:07 BST 2008:Initial Empty Version.]
[abc:1:admin:Fri Apr 04 12:02:37 BST 2008:null]
[abc:2:admin:Fri Apr 04 12:04:08 BST 2008:null]
> rmver, abc, 1
> lsver, abc
[abc:0:admin:Fri Apr 04 11:58:07 BST 2008:Initial Empty Version.]
[abc:2:admin:Fri Apr 04 12:04:08 BST 2008:null]
> rmver, abc, 0
org.alfresco.service.cmr.avm.AVMBadArgumentException: Cannot purge initial version
> rmver, abc, -1
org.alfresco.service.cmr.avm.AVMNotFoundException: Version not found.
> rmrep, abc
> lsrep
Starting with one empty Web Project (called 'test') created via Alfresco Web Client
> lsrep
[test--admin:admin:Thu Mar 20 18:13:52 GMT 2008]
[test--admin--preview:admin:Thu Mar 20 18:13:52 GMT 2008]
[test:admin:Thu Mar 20 18:13:52 GMT 2008]
[test--preview:admin:Thu Mar 20 18:13:53 GMT 2008]
> statstore, test--admin
[test--admin:admin:Thu Mar 20 18:13:52 GMT 2008]
{}.dns.admin.test: PropertyValue[actual-type=STRING, multi-valued=false, value-type=STRING, value=test--admin:/www/avm_webapps]
{}.background-layer.test: PropertyValue[actual-type=LONG, multi-valued=false, value-type=LONG, value=1]
{}.sandbox.store.test--admin: PropertyValue[actual-type=NULL, multi-valued=false, value-type=NULL, value=null]
{}.sandbox.author.main: PropertyValue[actual-type=NULL, multi-valued=false, value-type=NULL, value=null]
{http://www.alfresco.org/model/content/1.0}creator: PropertyValue[actual-type=STRING, multi-valued=false, value-type=STRING, value=admin]
{}.sandbox-id.6587650a-f6a9-11dc-ba7a-19d6d4e2fc41: PropertyValue[actual-type=NULL, multi-valued=false, value-type=NULL, value=null]
{}.website.name: PropertyValue[actual-type=STRING, multi-valued=false, value-type=STRING, value=test]
{http://www.alfresco.org/model/content/1.0}created: PropertyValue[actual-type=DATE, multi-valued=false, value-type=STRING, value=2008-03-20T18:13:52.073Z]