AVM Console

From AlfrescoWiki

Jump to: navigation, search

The AVM Console is an administrator/developer tool for low-level interaction with the AVM. It is available with Alfresco 2.2 and higher.

Contents

[edit] 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)

[edit] 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.

[edit] 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.

[edit] Common arguments

[edit] storename

The name of the store. Alphanumeric, and may also contain dash (-).

[edit] avmpath

A valid avm path should be of the form:

  storename:/name/name/name.../name. 

The root of the store is simply:

  storename:/

[edit] #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.

[edit] Console Commands

[edit] Store commands

[edit] lsrep

Lists all the avmstores.

  lsrep

example

  • lsrep

[edit] lsver

Lists the versions in a given store.

  lsver, storename

where

  • storename as above.

examples

  • lsver, abc
  • lsver, TEST--admin

[edit] mkrep

Create a new store.

  mkrep, storename

where

  • storename as above.

examples

  • mkrep, abc
  • mkrep, TEST--admin

[edit] snap

Creates a snapshot (a new version of an avmstore).

  snap, storename

where

  • storename is the name of the store to snapshot.

examples

  • snap, abc
  • snap, TEST--admin

[edit] statstore

Show information about a store.

  statstore, storename

where

  • storename as above.

examples

  • statstore, abc
  • statstore, TEST--admin

[edit] rmrep

Purges a store, i.e. makes it truly go away.

  rmrep, storename

where

  • storename is the name of the store to purge.

examples

  • rmrep, abc

[edit] 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 < 1)

examples

  • rmrep, abc, 1

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] Directory commands

[edit] 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

  • ls, abc:/, -1

[edit] 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

  • lsr, abc:/, -1

[edit] 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

  • TODO

[edit] 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

[edit] 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

  • TODO

[edit] 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 and avmpath to the directory which will contain the new layered directory.
  • name is a valid path component name.

examples

  • TODO

[edit] File commands

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] write

Writes content to an existing file.

  write, avmpath

where

  • avmpath is a path to a file.

examples

  • TODO

Note: This command expects the content to be written in the Optional Data box.

[edit] 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

  • TODO

Note: This command expects the content to be written in the Optional Data box.

[edit] Node commands

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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 suppored as well as collections of these types. Collections can be specified using a comma seperated list enclosed in square brackets.

  • qname - a property name in the form {namespaceURI}localName

examples

  • TODO

[edit] getnodeaspects (added 2.2.1)

List all aspects of a node.

  getnodeaspects, avmpath, #versionnumber#

where

  • avmpath as above.
  • #versionnumber# as above.

examples

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] 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

  • TODO

[edit] Layer and other commands

[edit] resetLayer

Resets a layer.

  resetLayer, avmpath

where

  • avmpath as above.

examples

  • TODO

[edit] 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

  • TODO

[edit] mkldir

Create a new layered directory. Refer to Directory Commands above.

[edit] compare

Compares two trees.

  compare, avmpath1, #versionnumber1#, avmpath2, #versionnumber2#

where

  • avmpath1 as above.
  • #versionnumber1# as above.
  • avmpath2 as above.
  • #versionnumber2# as above.

examples

  • TODO

[edit] Example interaction

[edit] 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


[edit] 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]