The methods listed below are available for use in all scripts.
- getPage(String path) - Get the Page for the given path, or null if it does not exist.
- getNode(String path) - Get the Node for the given path. Throws javax.jcr.RepositoryException if it does not exist.
- getResource(String path) - Get the Resource for the given path, or null if it does not exist.
- getModel(String path, Class type) - Get an instance of a Sling Model class for the Resource at the given path.
- getService(Class<ServiceType> serviceType) - Get the OSGi service instance for the given type, e.g. com.day.cq.workflow.WorkflowService.
- getService(String className) - Get the OSGi service instance for the given class name.
- getServices(Class<ServiceType> serviceType, String filter) - Get OSGi services for the given type and filter expression.
- getServices(String className, String filter) - Get OSGi services for the given class name and filter expression.
- copy "sourceAbsolutePath" to "destinationAbsolutePath" - Groovy DSL syntax for copying a node, equivalent to calling session.workspace.copy(sourceAbsolutePath, destinationAbsolutePath).
- move "sourceAbsolutePath" to "destinationAbsolutePath" - Groovy DSL syntax for moving a node, equivalent to calling session.move(sourceAbsolutePath, destinationAbsolutePath), except that the Session is saved automatically when the move is completed.
- rename [node] to "newName" - Groovy DSL syntax for renaming a node, similar to calling session.move(sourceAbsolutePath, destinationAbsolutePath) with the new node name, except that the renamed node will retain its order and the Session is saved automatically when the rename is completed.
- save() - Save the current JCR session.
- activate(String path) - Activate the node at the given path.
- activate(String path, ReplicationOptions options) - Activate the node at the given path with supplied options.
- deactivate(String path) - Deactivate the node at the given path.
- deactivate(String path, ReplicationOptions options) - Deactivate the node at the given path with supplied options.
- createQuery(Map predicates) - Create a Query instance from the QueryBuilder for the current JCR session.