Creating and applying JCR patches - BloomReach Experience - Open Source CMS

Creating and applying JCR patches

Sometimes it can be convenient to inspect the changes made to the configuration in a certain environment. For instance to determine environment specific settings or to analyse why something isn't working on that environment. Sometimes it is required to port certain configuration changes made to one environment to another environment. For instance when webmasters have made changes to the HST configuration and these changes need to be merged into the bootstrap content so that those changes aren't lost on a subsequent deploy that reloads the HST configuration. In these cases you can make use of the JCR diff capabilities in the CMS console application.

 

Creating JCR diff patches 

To create a diff for a certain node in the repository, first browse to that node in the tree of the console. In the top-most menu click 'Create patch'. An empty dialog appears. Now click the button 'Show Diff'. The first time you do this on a new deployment may take a few moments: a reference workspace must be created and bootstrapped using the bootstrap content the project was deployed with. You will then see the generated diff appear in the dialog.

Some effort has gone into making the format easy to read and it should be self explanatory. However, like in the case of textual diffs, the operations in the diff don't always reflect the way in which the changes were made. For instance, you may have removed a node and added another one under the same parent node, whereas the diff will simply contain a move operation.

For some nodes creating diffs has been disabled. For instance below /content and /hippo:log it is not possible to do so: diffs of nodes below these paths are expected not to be very useful and we chose to prevent excessive strain on the system by mistake.

Applying JCR diff patches

To apply a patch to a certain node in the repository, first browse to that node in the tree of the console. In the top-most menu click 'Apply patch'. An empty dialog appears. Click 'Upload file' to choose a patch file to apply. Click 'Upload patch' to upload it to the server. The patch will appear in the text-area of the dialog. You can optionally make some changes to the patch now. When done, click 'Apply patch' button to apply the patch. You will be notified of any operations that failed. Press 'Write changes to repository' to actually save the pending changes.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?