This library can be used in any environment where JCR and Hippo Repository API are available. However, just for simiplicty, the following examples are assumed to run in Hippo Updater Editor (a.k.a Groovy Updater).
WARNING: If you run the following demo scripts in production or in system having too many content, then it might cause a critical system overhead or problems. So, run the following demo scripts in a local test environment or change the XPath query to narrow the search result to a resonably small amount.
The following example groovy script reads JSON data from parametersMap,
creates a document through FolderWorkflow, binds ContentNode object
to document variant nodes and finally commits the changes through a DocumentWorkflow.
| Name: | Import a document from JSON |
|---|---|
| Description: |
For demonstration purpose, this example groovy script (a) unmarshal ContentNode from JSON,
(b) creates a document handle and variant node,
and (c) binds the ContentNode to the document variant node.
|
| XPath query: |
/jcr:root
|
| Parameters: |
|
| Script >>> |
|
The following example groovy script reads JSON data from parametersMap,
creates an imageset node through JCR API, binds ContentNode object
to the imageset nodes.
| Name: | Import an Image Set from JSON |
|---|---|
| Description: |
For demonstration purpose, this example groovy script (a) unmarshal ContentNode from JSON,
(b) creates an Image Set node, and (c) binds the ContentNode to the Image Set node.
|
| XPath query: |
/jcr:root
|
| Parameters: |
|
| Script >>> |
|