cancel
Showing results for 
Search instead for 
Did you mean: 

How can I execute loop action with nuxeo-shell ?

ftorchet_
Champ in-the-making
Champ in-the-making

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 ?
2 REPLIES 2

Sun_Seng_David_
Champ on-the-rise
Champ on-the-rise

Using groovy, you'll need to use nuxeo-core java api: May be this can help you: http://doc.nuxeo.com/x/VIdH

You can try:

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

perfect ! it works !