Installation and Administration

Nuxeo Server Commands

Updated: July 17, 2023

Namespace: <em>remote</em>

High level commands exposed by a remote Nuxeo Server

audit

NAME audit – Run a query against audit service

SYNTAX

audit [options] query

OPTIONS

  • -s - Use this to change the separator used in query variables. The default is ','
  • -ctx - Use this to set query variables. Syntax is: "k1=v1,k1=v2"
  • -max - The max number of rows to return.
  • -page - The current page to return. To be used in conjunction with -max.
  • -f - Use this to save results in a file. Otherwise results are printed on the screen.

ARGUMENTS

  • query - [required] - The query to run. Query is in JPQL format

USAGE

The -page parameter can be used in conjunction with -max parameter to paginate the query result. The specify the first page use 1 as value, for the second page use 2 and so on.

When saving results in a file - they are in JSON format - and dates are specified using a long value timestamp. Results printed on the screen are printed in tab separated columns: eventId category eventDate principal docUUID docType docLifeCycle comment

EXAMPLES

Using date literals in your query:

audit "FROM LogEntry log WHERE log.eventDate > timestamp('2010-11-10 00:00:00')"

Using pagination:

audit "FROM LogEntry log WHERE log.category='studio' ORDER BY log.eventDate DESC" -max 20 -page 1

Using query variables:

audit "FROM LogEntry log WHERE log.category='studio' AND log.eventDate > :startDate" -ctx "startDate={d 2010-11-10}"

or

audit "FROM LogEntry log WHERE log.category='studio' AND log.eventDate > :startDate" -ctx "startDate={d 2010-11-10 00:00:00}"

Note that query variable keys must be prefixed with "audit.query." to avoid name clash with other keys in the context.

cat

NAME cat – Print document details

SYNTAX

cat [options] [doc]

OPTIONS

  • -all - [flag] - Include all schemas. The -schemas attribute will be ignored if used in conjunction with this one.
  • -schemas - A filter of schemas to include in the document. Use * for all schemas.

ARGUMENTS

  • doc - [optional] -The document to print. To use UIDs as references you should prefix them with 'doc:'

cd

NAME cd – Change the context document

SYNTAX

cd doc

ARGUMENTS

  • doc - [required] - A reference to the new context document to use. To use UID references prefix them with 'doc:'.

connect

NAME connect – Connect to a remote automation server

SYNTAX

connect [options] [url]

OPTIONS

  • -p - The password
  • -u - The username

ARGUMENTS

  • url - [optional] -The URL of the automation server

cp

NAME cp – Copy a document

SYNTAX

cp [options] src dst

OPTIONS

  • -name - A new name for the copy. I not specified preserve the source name

ARGUMENTS

  • src - [required] - The document to copy. To use UID references prefix them with 'doc:'.
  • dst - [required] - The target parent. To use UID references prefix them with 'doc:'.

disconnect

NAME disconnect – Close current connection to server. If not connected nothing is done.

SYNTAX

disconnect

fire

NAME fire – Fire a core event in the context of the given document

SYNTAX

fire event [doc]

ARGUMENTS

  • event - [required] - The event to fire. This parameter is required.
  • doc - [optional] -The context document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

getfile

NAME getfile – Get a document attached file

SYNTAX

getfile [options] [doc]

OPTIONS

  • -todir - An optional target directory to save the file. The default is the current working directory.
  • -xpath - The XPath of the blob property to get. Defaults to the one used by the File document type.

ARGUMENTS

  • doc - [optional] -The target document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

getfiles

NAME getfiles – Get all the files attached to a document

SYNTAX

getfiles [options] [doc]

OPTIONS

  • -todir - An optional target directory to save the file. The default is the current working directory.
  • -xpath - The XPath of the blob property to get. Defaults to the one used by the File document type.

ARGUMENTS

  • doc - [optional] -The target document. If not specified the current document content is used. To use UID references prefix them with 'doc:'.

getp

NAME getp – Get the value of a document property

SYNTAX

getp [options] [doc]

OPTIONS

  • -xpath - The XPath of the property to get. This parameter is required.

ARGUMENTS

  • doc - [optional] -The target document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

getrel

NAME getrel – Get relations between two documents

SYNTAX

getrel [options] [doc]

OPTIONS

  • -in - [flag] - Is the document the relation object?
  • -predicate - The relation predicate - requested.
  • -out - [flag] - Is the document the relation subject? This flag is by default on true.

ARGUMENTS

  • doc - [optional] -The document involved in the relation

lcstate

NAME lcstate – Set or view the current life cycle state of a document

SYNTAX

lcstate [options] [doc]

OPTIONS

  • -set - If specified The new life cycle state. If not specified then in write mode the local ACL is used and in view mode all ACLs are printed.

ARGUMENTS

  • doc - [optional] -The target document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

lock

NAME lock – Lock a document

SYNTAX

lock [options] [doc]

OPTIONS

  • -key - An optional lock key. If not specified the default one is used.

ARGUMENTS

  • doc - [optional] -The document to lock. If not specified the current document is used. To use UID references prefix them with 'doc:'.

ls

NAME ls – List children documents

SYNTAX

ls [options] [doc]

OPTIONS

  • -uid - [flag] - If used the documents will be printed using the document UID.

ARGUMENTS

  • doc - [optional] -A document to list its content. If not specified list the current document content. To use UID references prefix them with 'doc:'.

mkdir

NAME mkdir – Create a document of the given type

SYNTAX

mkdir [options] type path

OPTIONS

  • -title - An optional document title.

ARGUMENTS

  • type - [required] - The document type
  • path - [required] - The document path

mkrel

NAME mkrel – Create a relation between two documents

SYNTAX

mkrel [options] subject object

OPTIONS

  • -predicate - The relation predicate - requested.

ARGUMENTS

  • subject - [required] - The subject of the relation
  • object - [required] - The object of the relation

mv

NAME mv – Move a document

SYNTAX

mv [options] src dst

OPTIONS

  • -name - A new name for the document. I not specified preserve the source name

ARGUMENTS

  • src - [required] - The document to move. To use UID references prefix them with 'doc:'.
  • dst - [required] - The target parent. To use UID references prefix them with 'doc:'.

perms

NAME perms – Set or view permissions on a document

SYNTAX

perms [options] [doc]

OPTIONS

  • -grant - If used the ACL will be modified by granting the specified permission on the specified user. The grant value format is "user:permission".
  • -deny - If used the ACL will be modified by denying the specified permission on the specified user. The deny value format is "user:permission".
  • -remove - [flag] - Remove the given ACL.
  • -acl - The ACL to view or modify. If not specified then in write mode the local ACL is used and in view mode all ACLs are printed.

ARGUMENTS

  • doc - [optional] -The target document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

popd

NAME popd – Change the context document and pop the document from the navigation stack.

SYNTAX

popd

publish

NAME publish – Publish a document into a section

SYNTAX

publish [options] src section

OPTIONS

  • -override - If set to false will not override an existing published document with same name. The default is "true".

ARGUMENTS

  • src - [required] - The document to copy. To use UID references prefix them with 'doc:'.
  • section - [required] - The target parent. To use UID references prefix them with 'doc:'.

pushd

NAME pushd – Change the context document and push the document on the navigation stack.

SYNTAX

pushd doc

ARGUMENTS

  • doc - [required] - A reference to the new context document to use. To use UID references prefix them with 'doc:'.

putfile

NAME putfile – Attach a file to a document

SYNTAX

putfile [options] file [doc]

OPTIONS

  • -xpath - The XPath of the blob property to set. Defaults to the one used by the File document type.

ARGUMENTS

  • file - [required] - The file to upload
  • doc - [optional] -The target document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

pwd

NAME pwd – Print the current context document

SYNTAX

pwd [options]

OPTIONS

  • -s - [flag] - Use this flag to show the context documents stack

query

NAME query – Query documents

SYNTAX

query [options] [query]

OPTIONS

  • -uid - [flag] - If used the matching documents will be printed using the document UID.

ARGUMENTS

  • query - [optional] -The document path

EXAMPLES

query "SELECT * FROM Document WHERE ecm:primaryType='Folder'"
query -uid "SELECT * FROM Document WHERE ecm:primaryType=\"Folder\""

rename

NAME rename – Rename a document

SYNTAX

rename [options] [doc]

OPTIONS

  • -name - A new name for the document. This parameter is required.

ARGUMENTS

  • doc - [optional] -The document to rename. To use UID references prefix them with 'doc:'.

rm

NAME rm – Remove a document

SYNTAX

rm [path]

ARGUMENTS

  • path - [optional] -The document path. To use UID references prefix them with 'doc:'.

rmfile

NAME rmfile – Remove an attached file from a document

SYNTAX

rmfile [options] [doc]

OPTIONS

  • -xpath - The XPath of the blob property to remove. Defaults to the one used by the File document type.

ARGUMENTS

  • doc - [optional] -The target document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

run

NAME run – Run a server automation chain that accepts a document or void input

SYNTAX

run [options] chain [doc]

OPTIONS

  • -s - Use this to change the separator used in context variables. The default is ','
  • -ctx - Use this to set execution context variables. Syntax is: k1=v1,k1=v2
  • -void - [flag] - Use this to avoid having the server sending back the result.

ARGUMENTS

  • chain - [required] - The chain to run
  • doc - [optional] -A reference to the new context document to use. To use UID references prefix them with 'doc:'.

runonfile

NAME runonfile – Run a server automation chain that accepts a file as an input

SYNTAX

runonfile [options] chain file

OPTIONS

  • -s - Use this to change the separator used in context variables. The default is ','
  • -ctx - Use this to set execution context variables. Syntax is: k1=v1,k1=v2
  • -void - [flag] - Use this to avoid having the server sending back the result.

ARGUMENTS

  • chain - [required] - The chain to run
  • file - [required] - A reference to the new context document to use. To use UID references prefix them with 'doc:'.

script

NAME script – Run a script on the server

SYNTAX

script [options] file

OPTIONS

  • -s - Use this to change the separator used in context variables. The default is ','
  • -ctx - Use this to set execution context variables. Syntax is: "k1=v1,k1=v2"

ARGUMENTS

  • file - [required] - The script file. Must have a .mvel or .groovy extension

setp

NAME setp – Set a property on a document

SYNTAX

setp [options] [doc]

OPTIONS

  • -value - The property value. If not specified the current property value is removed.
  • -xpath - The XPath of the property to set. This parameter is required.

ARGUMENTS

  • doc - [optional] -The target document. If not specified the current document is used. To use UID references prefix them with 'doc:'.

tree

NAME tree – List a subtree

SYNTAX

tree [doc]

ARGUMENTS

  • doc - [optional] -A document to list its subtree. If not specified list the current document subtree. To use UID references prefix them with 'doc:'.

unlock

NAME unlock – Unlock a document

SYNTAX

unlock [doc]

ARGUMENTS

  • doc - [optional] -The document to unlock. If not specified the current document is used. To use UID references prefix them with 'doc:'.

update

NAME update – Update document properties

SYNTAX

update [options] [properties] [path]

OPTIONS

  • -s - Use this to change the separator used in properties. The default is ','

ARGUMENTS

  • properties - [optional] -The properties to update.
  • path - [optional] -The document path