With the groovysh
utility program, you can interactively access the Content Server, using
Unified API commands. The Groovy Shell is a third-party tool maintained by the
Groovy community. See http://groovy-lang.org/groovysh.html for
details
Before you can start the Groovy Shell, copy the file modules/cmd-tools/cms-tools-application/target/cms-tools/bin/groovysh.profile
into your home directory as .groovy/groovysh.profile
. This file defines the login parameter (username, password, IOR URL for the
Content Server and creates connections to the Unified API
repositories. Adjust the iroUrl
property to the
corresponding URL of the Content Server. Have a look into the profiles file in order to learn how to address the
repositories.
You can either start the Groovy Shell as a command line client (default) or the Groovy Console which offers a GUI.
In order to start the Groovy Console, open
the groovysh.jpif
file and assign the groovy.ui.Console
class to the JAVA_MAIN_CLASS
property. The Groovy Console does not load the content from the profile file. So, copy the content of the profile file into
the console and execute the script to set the required variables.
The program is executed with:
modules\cmd-tools\cms-tools-application\target\cms-tools\bin cm groovysh
The shell is now active or the console opens and you can enter your UAPI commands. Find the UAPI JavaDoc at http://documentation.coremedia.com/dxp8/ following the CMS Javadoc link.
Get, for example, the user named "Rick":
ur.getUserByName('Rick')