Automation Script utilities
Miscellaneous utilities to be used with JS Automation.
Look at the script you need and copy/paste it in your Studio project. The comments in the "header" explain how to use it.
- Make sure to set the
outputof your script as expected in the comments.
- Don't forget to explicitly declare the parameter(s). They also are described in the comments.
|utils_FollowTransitionIfPossible||FollowLifecycleTransition throws an error if the Document is in a state that does not allow following the transition. When bulk updating a list of documents, we may want to avoid that|
|utils_getUserFullName||Receives as input a user ID, returns a string, the full name (firstname + " " + lastname)|
|utils_LockDocument||Lock the input doc if it was not already locked (avoid a NuxeoException)|
|utils_PictureGetView||Set ctx.pictureView Context Variable to the PictureView object, whose title is passed in the viewName parameter (null if not found)|
|utils_SetLifleCycleState||Used mainly when setting up some data (typically demo data)|
|utils_UnlockDocument||Unlock the input doc if it was not already unlocked (avoid a NuxeoException)|
Create the automation script(s) and copy the content from the original(s). You can of course change the names to fit your naming convention.