Create new JBoss Tools Documentation Jira issue

This will launch the Jboss Tools Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

Chapter 2. Functionality Overview

2.1. Guvnor Perspective
2.2. Guvnor Connection Wizard
2.3. Guvnor Repositories View
2.4. Local Copies of Guvnor Files
2.5. Actions for Local Guvnor Resources
2.5.1. Update Action
2.5.2. Add Action
2.5.3. Commit Action
2.5.4. Show History Action
2.5.5. Compare with Version Action
2.5.6. Switch to Version Action
2.5.7. Delete Action
2.5.8. Disconnect Action
2.6. Guvnor Resource History View
2.7. Importing Guvnor Repository Resources

This chapter will introduce you to the Guvnor Repository Exploring perspective and give an overview on all functionality the Guvnor Tools provides.

The Guvnor Repository Exploring perspective contains two views supplied by EGTRepository Explorer and Version History, that will be the center of most interaction with Guvnor, and Eclipse standard views such as Properties and Resource Navigator that are also useful.

While each of these views can be opened and positioned independently within an Eclipse workbench, the Guvnor perspective provides a convenient method of getting a suggested layout. In the Eclipse workbench menu, choose Window > Open Perspective > Other to get the perspective list:


And then choose Guvnor Repository Exploring. This opens the Guvnor perspective.

After opening the Guvnor perspective, the first task is to make a connection to a Guvnor repository. This is handled by the Guvnor Connection wizard. This wizard appears in a number of places within the EGT (as detailed below), but in this section we will cover only the two most basic entry points.

The Guvnor Connection wizard can be started in the following ways:

Choosing either of these will start the Guvnor Connection wizard.


Default values appear in the Location, Port, and Repository fields (See the “Guvnor Preferences” section below for details about how to change these default values.) Of course, any of these fields can be edited by typing in the corresponding text box. Drag-and-drop or paste into the Location field of a typical Guvnor repository URL such as:

http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav

Results in the URL being parsed into the respective fields as well. The authentication information (user name and password) can optionally be stored in the Eclipse workbench's key-ring file based on the selection of Save user name and password.

Note:

If the authentication information is not stored in the key-ring, then the EGT uses a session authentication, what means that the credentials supplied are used only for the lifetime of the Eclipse workbench instance.

If authentication information is not stored in the key-ring or the authentication information (key-ring or session) is not valid, the EGT will prompt for authentication information when it has to access the Guvnor repository.

If authentication fails, the EGT will retry once and then issue an authentication failure error.

Tip:

If an authentication failure error occurs, you can retry the same operation and supply different authentication information.

Note that the EGT calls the Guvnor repository at various times, such as when determining if resource updates are available. Thus if you use session authentication, the authentication dialog will appear at different times during the Eclipse workbench session, depending on what actions you take. For ease of use, we recommend saving the authentication information in the Eclipse key-ring.

Note:

The Eclipse key-ring file is distinct from key-ring files found in some platforms such as Mac OS X and many forms of Linux. Thus, sometimes if you access a Guvnor repository outside the EGT, the key-ring files might become unsynchronized and you will be unexpectedly prompted for authentication in Eclipse. This is nuisance, but your usual credentials should apply in this case.

The Guvnor Repositories view contains tree structures for Guvnor repository contents.


You can perform the following actions under the resources in the Guvnor Repositories view:

Drill-down is useful when working with deeply nested tree structures and when you wish to concentrate on only branch of the tree. For example, drilling into the "defaultPackage" node changes the tree view to:


Clicking on the Go Home button ( ) or selecting Go Home in the context menu returns the tree to the top-level structure shown in the previous picture above.

There are a number of operations that can be performed on Guvnor repository files. Selecting a file in the Guvnor repository causes the Eclipse Properties view to update with details about that file:


As mentioned in the "Introduction", the main purpose of the EGT is to allow development using resources held in a Guvnor repository. There are two method of getting local copies of Guvnor repository resources:

  1. Drag-and-drop from the Guvnor Repositories view

  2. Using the Import from Guvnor wizard, as described further in this document

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. On 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 presence/location of these can be changed the Guvnor Preferences.)

Here we see that, Dummy role.drl 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. The file Sample.drl, however, 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 contributes 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 Guvnor Resource History view should details about revision history for selected files, both local and those in Guvnor repositories. The initial state of this view is shown on the figure below.


The Guvnor Resource History view is populated by Show History actions in either the local Guvnor context menu or in the context menu for a Guvnor repository file in the Guvnor Repositories view. Once this action is performed, the Guvnor Resource History view updates to show the revision history:


Here we see that the file test.txt has three revisions. Double clicking on a revision row (or the context menu Open (Read only)) opens an Eclipse read-only editor with the revision contents.


Note:

You can also use the Save As... option when a file is open in a read-only editor to save a local writable copy of the contents. Doing so, however, will not associate the file created with its Guvnor source.

In addition to the single file drag-and-drop from the Guvnor Repositories view, the EGT also includes a wizard for copying one or more files from a Guvnor repository to the local workspace (and setting the association with the Guvnor repository). This wizard is available from the File > Import > Guvnor > Resource from Guvnor and the File > New > Other > Guvnor > Resource from Guvnor menu items.

The first page of the wizard asks for the selection of the source Guvnor repository and gives the choice to create a new Guvnor repository connection (in which case the second page is the same as the Guvnor Connection wizard).


Once the source Guvnor repository is chosen, the wizard prompts for resource selection:


Finally, the target location in the local workspace should be chosen:


On completion the wizard copies the selected files from the Guvnor repository to the local workspace. If a file with the same name already exists in the destination, the wizard uses the Eclipse standard "prompt for rename" dialog: