As we saw above, being able to specify one or more Workspace Roots is essential to creating representations of files and file system locations that are comparable across platforms and users. To define your Workspace Roots, you must log in to your Hackystat account, click on the "Preferences" page, and scroll down to the "Workspace" section. This section contains two commands. The "Workspace Root Config" command allows you to select one or more of your current Workspaces as Workspace Roots. The "Display or Hide Workspaces" command both shows you the effect of your current Workspace Root settings, as well as enabling you to control which set of Workspaces show up in the Workspace selector associated with other Hackystat analyses.
Figure 3.5, “ The initial (empty) Workspace section ” illustrates what "Workspace" section of the Preferences page will look like for a new user.
As you can see, this Workspace section is quite empty with no Workspaces displayed anywhere. It looks this way because this user's account does not yet contain any sensor data containing file paths, so there is no data for the system to use to generate Workspaces. This screen illustrates a very important point about Workspaces: they cannot be manually typed in by the user, they can only be created through analysis of sensor data containing raw file paths. Because of this fact, you must always install sensors and actually have data sent to the server involving files that you are working on before you will see any Workspaces in your account and be able to define Workspace Roots.
Figure 3.6, “ The Workspace section with Workspaces but no Workspace Roots ” illustrates the "Workspace" section of the Preferences page for an account that has received sensor data containing file paths.
This section is much more interesting. First, the left side of the "Display or Hide Workspaces" command shows the Workspaces that appear in pull-down menus, and the right side shows Workspaces that are present in your raw data but "hidden" from these menus. To change the set of displayed Workspaces, simply select one or more Workspaces in one of the columns and click the bi-directional arrow button, which will move the selected Workspaces to the other column.
The Display or Hide Workspaces command also illustrates that a single file path can generate multiple Workspaces. For example, consider the file path "a\b\c\foo.txt". This file path can generate three possible Workspaces: "a\", "a\b\", and "a\b\c", corresponding to all possible subdirectories of the original file path. By default, Hackystat only places the "top level" Workspace generated from any given directory hierarchy into the "Displayed" list. You can always alter this default behavior by manually adding or removing workspaces using this Preference command.
When properly configured, Workspaces represent platform-independent directory trees containing project data, and the Displayed Workspaces contain the platform-independent directory trees of interest for analyses. The example above does not satisfy those criteria on either count: the displayed workspaces are Windows drive letters, which are certainly not directory trees of interest, and Windows drive letters are certainly not platform-independent. To produce usable Workspaces, we must define some Workspace Roots.
Figure 3.7, “ Workspaces with Workspace Roots ” illustrates the Workspace section after setting two Workspace Roots.
The first thing to notice is that in the "Workspace Root Config" command, two Workspaces have now been specified as Workspace Roots: "C:\CruiseControls\install-All\hacky\" and "c:\cvs\". This significantly changes the way Workspaces appear in the Display or Hide Workspaces command. Now, the default displayed Workspaces correspond to the top-level directories for the source code of various projects, such as "691ActiveFile", "hackyAnt", "hackyCourse", and so forth.
The figure also shows that the hidden Workspaces correspond to the interior subdirectories of projects. For example, while the Workspace "691ActiveFile\" will be displayed in other analyses requiring Workspaces, its subdirectories (or subworkspaces) such as "691ActiveFile\src\", "691ActiveFile\src\activefile\", and so forth will not be displayed. In most cases, you will only need access to the top-level Workspace, but if you need access to a subWorkspace you can enable that access using the "Display Or Hide Workspaces" command.
At this point, you should log in to your own Hackystat account and successfully configure one or more Workspace Roots so that the set of displayed Workspaces corresponds to the set of top-level project directories that you are working on. Having done so, you might wonder exactly how to utilize these Workspaces. The most important use of Workspaces is to support definition of Hackystat Projects, which we turn to next.