How can I execute loop action with nuxeo-shell ?

I would like to create about 100 workspaces with nuxeo-shell.

  • I tryed from the command line using -f my_batch_file

with my_batch_file :

connect -u Administrator -p Administrator http://localhost:8080/nuxeo/site/automation

cd /default-domain/workspaces

mkdir -title W1 Workspace path_W1

OK to create W1 but how loop to create W2, W3… (and their paths) ?

  • I tryed with groovy (easyer for the loop)… But How create a Workspace with groovy ?
0 votes

1 answers



Using groovy, you'll need to use nuxeo-core java api: May be this can help you:

You can try:

doc = Session.createDocumentModel("/default-domain/workspaces","myWS,"Workspace");
doc.setPropertyValue("dc:title", "my WS");
1 votes

perfect ! it works !