Developing exteNd Director Applications
CHAPTER 10
This chapter explains how to use views to look at exteNd Director project items. It contains the following sections:
You can use views to display personalized lists of items within an exteNd Director project. When you display a view, you see the list of items in the view represented as a tree of folders and files, similar to the tree presentation used in Windows Explorer. You can expand or collapse the branches of the tree to locate the items you want to edit.
Views can be used to look at resources in a resource set, or at system configuration and service settings. exteNd Director ships with several predefined views and also allows you to define custom views to display project items that are of particular interest to you.
View definitions are stored as XML documents in the my-views folder within a resource set. The predefined views that ship with exteNd Director are provided in the analyzers_views.jar, which is added to the WEB-INF\lib directory within the WAR for your application.
In the exteNd Director Navigation Pane, click the Resources tab.
Select the View tab, if it is not already selected.
The View tab displays the default view for the current resource set. In a WAR project, the default view is config.services.by.subsystem.war.xml. In an EAR project, the default view is config.services.by.subsystem.ear.xml. This view displays the config.xml and services.xml files for each subsystem:
Select the view you want to see in the view dropdown box:
Items that were read from disk are editable and appear in black. Items that were read from JAR files are not editable. These items appear in blue and are marked with RO (read-only).
To open a view in a separate tab:
To open an item displayed in a view:
Double-click the item in the view display window.
The source file editor displays the contents of the file, and the Relationship Viewer refreshes to show one or more relationships that are specific to the type of file you opened.
To see these relationships, click the Relationship Viewer tab.
For more information on using the Relationship Viewer, see Using the Relationship Viewer.
To see the definition of a view:
exteNd Director provides a set of predefined views that you may find useful for locating project files. This section describes each predefined view in detail. You can use these views as provided or copy and modify them to suit your requirements.
You can import the contents of a JAR into a view. When you do this, exteNd Director:
Copies the JAR to the WEB-INF\lib directory within the resource set WAR.
Adds an entry for the JAR to the resource path and lib path settings for the resource set.
Adds an entry for the JAR to the project settings in the development environment.
Restarts the resource set so that the imported resources are immediately available for use within the development environment.
If the JAR selected for import contains a view definition XML file, creates a new view in the target resource set. This view has the same definition as the view from which the resources were originally exported.
To import resources into a view:
Click the Import view jar button in the view display window:
exteNd Director allows you to export the contents of a view to a JAR. When you export resources from a view, exteNd Director creates a JAR that contains all of the elements in the view, including the directory structureplus the XML file that defines the view from which the resources were exported. This JAR can then be imported into another resource set.
To export resources from a view:
Click the Export view to jar button in the view display window:
You can create custom views in one of two ways:
This section describes how to manually edit a view definition file.
For details on saving a search as a view, see Saving a search as a view.
The view definition file is an XML file that specifies which items should be included in the view. The XML for a view definition must conform to the rules specified in the resourceset-view_4_0.dtd file, which you can find in the DTD folder within the FrameworkService.jar.
Every view definition has a view element that provides a description for the view and indicates whether this is the default view:
<view description="myview" default="false"> ... </view>
The view description is used as the display text for the view folder.
The view element can contain one or more other elements that specify which items should be included in the view. Many of the elements support the use of regular expression searches.
For syntax and reference information on regular expressions, see the section on regular expressions for text searches in Utility Tools.
You can search for items within a resource set by including one or more search elements in your view definition file. You can use the attributes of the search element to search for:
For example, to search for all files that have the string My in their names, you would include the following search element within the view element:
<view description="mysearch" default="false"> <search fileName="My" /> </view>
This view would show a folder called mysearch that contains all subfolders within the resource set that have files that contain My in their names.
To restrict this search to include those files that are located in directories that begin with either the string portal or the string rule, you could specify this search:
<search fileName="My" directoryName="^portal|^rule" />
If you specify multiple attributes in the search element, the attributes you specify are combined together in an AND operation.
You can define custom folders within a view by using the folder element. This gives you a way to organize resources or other items of interest any way you like. For example, you might define folders in a view to categorize the results of two separate searches:
<view description="mysearch" default="false"> <folder description="MyPortalItems"> <search fileName="My" directoryName="^portal" /> </folder> <folder description="MyOtherItems"> <search fileName="My" directoryName="^rule" /> </folder> </view>
A view can display items that are outside the scope of a resource set, by using the element tag. The element lets you specify a disk path and a filter for retrieving files by name.
For example, you could use the element tag to display various system configuration files. Here's a view definition that displays the configuration and services files for each subsystem in an exteNd Director EAR project:
<view description="Config/Services by Subsystem" default="false"> <folder description="ContentMgmt Service"> <element fileName="config" diskPath="$EARLOCATION$/library/ContentMgmtService/ ContentMgmtService-conf/config.xml" /> <element fileName="services" diskPath="$EARLOCATION$/library/ContentMgmtService/ ContentMgmtService-conf/services.xml" /> </folder> <folder description="Directory Service"> <element fileName="config" diskPath="$EARLOCATION$/library/DirectoryService/ DirectoryService-conf/config.xml" /> <element fileName="services" diskPath="$EARLOCATION$/library/DirectoryService/ DirectoryService-conf/services.xml" /> </folder> <folder description="Framework Service"> <element fileName="config" diskPath="$EARLOCATION$/library/frameworkservice/ frameworkservice-conf/config.xml" /> <element fileName="services" diskPath="$EARLOCATION$/library/frameworkservice/ frameworkservice-conf/services.xml" /> </folder> ... </view>
A view definition can include output generated by another view. This simplifies the creation of complex views by allowing you to reuse view definitions already created. To reference another view, you need to use the view-link element.
The following view definition includes output from three other views:
<view description="view-link" default="false"> <comment description="How to reference other views in a view" /> <view-link folder="samples" view="comment.xml" /> <view-link folder="samples" view="element.xml" /> <view-link folder="samples" view="folder.xml" /> </view>
Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...