JBoss.orgCommunity Documentation
This chapter provides an overview of the functionality provided by the Guvnor Tools.
As mentioned in Chapter 1, Introduction, the main purpose of the EGT™ is to allow development using resources held in a Guvnor repository. The first task is to make a connection to a Guvnor repository. This is handled by the Connection Wizard (see Section 3.2, “Guvnor Connection Wizard”).
There are two methods of getting local copies of Guvnor repository resources:
Drag-and-drop from the Guvnor Repositories View, as described in Section 3.4, “Guvnor Repositories View”
Using the Resource from Guvnor Wizard, as described in Section 3.3, “Resource from Guvnor Wizard”
When local copies of Guvnor repository files are created, the EGT sets an association between the local copy and the master file in the repository. This information is kept in the (normally) hidden .guvnorinfo
folder in the local project and, like all metadata, should not be changed by end users.
The association allows for operations such as update and commit in synchronization with the master copy held in the Guvnor repository.
The EGT decorates local resources associated with Guvnor repository master copies. This decoration appears in Eclipse views conforming to the Eclipse Common Navigator framework, such as the Eclipse Resource Navigator and the Java Package Explorer. In the image above you can see the Dummy rule.drl
file with the decoration in the Resource Navigator. The Guvnor icon decorator is on the top right of the file image, and the Guvnor revision details are appended to the file name. The location of these can be changed in the Local Guvnor Repository Resource Decoration Preferences (see the Section 3.6.2, “Local Guvnor Repository Resource Decoration Preferences” section).
Here we see that the Dummy rule.drl
file is associated with a Guvnor repository resource, and the local copy is based on revision 0, with a 02-10-2008, 4:21:53
date/time stamp. However, the file Sample.drl
is not associated with a Guvnor repository file. Further details about the association can be found in the standard Eclipse properties page, accessed via the Properties option in the context menu:
The EGT adds a property page to the standard Eclipse properties dialog, the contents of which are shown above. It displays the specific Guvnor repository, the location within the repository, the version (date/time stamp) and the revision number.
The EGT provides a number of actions (available through the Guvnor context menu on files) for working with files, both those associated with Guvnor repository master copies and those not associated. The actions are:
Each of these actions is described below.
The Update action is available for one or more Guvnor resources that are not synchronized with the Guvnor repository master copies. These resources would not synchronized due to one or or both of the following conditions:
There are local changes to these resources
The master copies have been changed in the Guvnor repository
Performing the Update action replaces the local file contents with the current contents from the Guvnor repository master copies (equivalent to Section 2.3.6, “Switch to Version Action” for the latest version).
The Add action is available for one or more local files that are not associated with a Guvnor repository master copy. Choosing the Add action launches the Add to Guvnor wizard:
The first page of the wizard asks for the selection of the target Guvnor repository, and provides the option of creating a new Guvnor repository connection (in which case the second page is the same as Figure 3.4, “Guvnor Connection Wizard”). Once the target Guvnor repository is chosen, the wizard then asks for the folder location to add the selection files:
Here the defaultPackage
folder is selected as the destination location.
Note that the snapshot
folder in the Guvnor repository is read-only for EGT, and hence not visible as a candidate location in this wizard. The Guvnor repository web administration tools must be used to add snapshot content.
Clicking on the
button adds the selected files to the Guvnor repository and creates an association between the local and Guvnor repository files.Note that the wizard will not allow existing Guvnor repository files to be overwritten. Another target location must be chosen.
The Commit action is enabled for one or more Guvnor repository associated files that have local changes. The Commit action will write the local changes back to the associated Guvnor repository files, and update the association for the new revision created.
If a local change is based on an older revision of a file than is currently in the Guvnor repository (for example, someone else changed the same file), then the Commit action will ask whether you wish to overwrite the current version in the Guvnor repository with the local content. When such conflicts occur, however, you should use the Eclipse Guvnor version tools, along with Eclipse standard tools, to determine the differences and merge content based on the current version in the Guvnor repository.
The Show History action is enabled for one Guvnor repository associated file, and populates the Section 3.5, “Guvnor Resource History View” with revision history for the selected file.
The Compare with Version action is enabled for one Guvnor repository associated file. This action first opens a wizard asking for the version for comparison (with the local file contents):
Once the revision is selected, the action opens the Eclipse Compare editor (in a read-only mode):
This editor uses the standard Eclipse comparison techniques to show the differences in the two versions. In cases where there are no differences, the editor will not open, and instead a dialog saying that there are no differences will be displayed.
The Switch to Version action is enabled for one Guvnor repository associated file.
First the Switch to Version action prompts for the selection of a version:
Once the version is selected, the Switch to Version action replaces the local file contents with those from the revision selected.
The Delete action is enabled for one or more Guvnor repository associated files. After the action has been confirmed using the dialog shown below, the Delete action removes the files in the Guvnor repository and deletes local metadata for the Guvnor repository association.