Sunday, 3 July 2016

Quick IBM Notes - XPages Tip: Comparing, Replacing and Restoring Design Elements with Local History using the Text Compare Editor in Domino Designer

Last week something went completely wrong with some resources (design elements) in a modified design of an XPages application. Luckily Domino Designer has a very powerful feature, Local History. A standard Eclipse functionality of extremely great value. By using the Compare, Replace and Restore Resources functions with Local History using the Text Compare Editor the problems were quickly resolved. Below is a brief description of this very powerful feature in the Domino Designer.

A local edit history of a resource (design element), for example a Notes form, Custom Control or an XPage, is maintained when a resource is created or has been modified and saved. Each time a design element is modified and saved, a copy is saved so that the current design element can be replaced or restored with a previous edit or delete. It is also possible to compare the contents of all the local edits. Each edit in Local History is uniquely represented by the date and time the design element was saved. Only resources (design elements) have a local history; projects and folders do not.

Local History Settings
The Local History default settings can be modified by selecting Preferences - General - Workspace - Local History in the Domino Designer (DDE).


Comparing resources with Local History
To compare a design element (unmanaged Workbench resource) with a state in the Local History the following steps can be executed:
In one of the Navigation Views, select the design element (resource) that you want to compare with a local history state, for example a Custom Control or an XPage.
From the resource's pop-up menu, select Compare With > Local History. The Compare with Local History page opens.


Select a state in the Local History List


The Text Compare Editor opens.


Options Text Compare Editor
Click the Select Next Change and Select Previous Change buttons to browse the changes made between the state in the local history and the Workbench resource.
Copy all Non-Conflicting Changes from Right (Local History) to Left.
Copy Current Change form Right to Left
Next Difference
Previous Difference
Click OK when you are finished.

Replacing a resource with Local History
To replace a design element  with a state in the Local History the following steps can be executed: 
In one of the Navigation Views, select the design element (resource) that you want to replace with a local history state. From the resources pop-up menu, select Replace with > Local History. The Replace from Local History page opens.


Select a state from the Local History List. The Text Compare Editor opens.


Select the state you want to replace, and click Replace.

It is also possible to restore deleted design elements from local history. From the resource's pop-up menu, select Restore from Local History. The Restore From Local History dialog opens showing all files that were previously contained in the selected folder or project and all of their sub-folders.


So there is an easy way in the Domino Designer to compare, replace and restore one or more design elements with Local History in case something went completely wrong in the application design.

No comments:

Post a Comment