Developing exteNd Director Applications

CHAPTER 10

Working with Views

This chapter explains how to use views to look at exteNd Director project items. It contains the following sections:

 
Top of page

About views

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.

 
Top of page

Displaying a view

Procedure To display a view:

  1. In the exteNd Director Navigation Pane, click the Resources tab.

  2. 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:

    View1

  3. If you have more than one resource set:

    1. Click the Select Resource Set button:

      View2

    2. Select the target resource set and click OK:

      View3

  4. Select the view you want to see in the view dropdown box:

    View4

    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).

    View5

Procedure To open a view in a separate tab:

Procedure To open an item displayed in a view:

Procedure To see the definition of a view:

 
Top of page

Using predefined views

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.

View

What it shows

config.services.by.subsystem.ear.xml

config.services.by.subsystem.war.xml

Settings for all exteNd Director subsystems.

Searches for:

  • Configuration files:

      config.xml
      services.xml
    

config.services.by.subsystem.ear

content.management.subsystem.ear.xml

content.management.subsystem.war.xml

Artifacts related to the Content Management subsystem.

Searches for:

  • Configuration files:

      config.xml
      services.xml
      web.xml
    
  • Files whose names contain:

      Content
      CM 
    
    • In these directories:

        com
        portal-component
        portal-style
        rule
      

content.management.subsystem.ear

portal.resources.xml

All directories containing portal resources

Searches for:

  • Directories whose names begin with:

      portal-
    

portal.resources

rule.subsystem.ear.xml

rule.subsystem.war.xml

All artifacts related to the Rules subsystem

Searches for:

  • Configuration files:

      config.xml
      services.xml
    
  • Files whose names contain the strings:

      rule
      Rule
    
    • In these directories

        portal-component
        portal-styles
        rule
      
  • Files whose names contain:

      .class
      .java
    
    • And whose contents contain the string:

        portal.condition
        portal.action
        re.condition
        re.action
      

rule.subsystem.ear

rules.ca.xml

All rules and conditions and actions

Searches for:

  • Java source files whose content contains the regular expression:

      implements.*EbiCondition
      extends.*Condition
      implements.*EbiAction
      extends.*Action
    
  • Directories whose names begin with:

      rule
    

rules.ca

sample.element.xml

How to use a element in a view

Elements are used to reference objects outside the scope of a resource set

Searches for:

  • Files whose names contain:

      ResourceSet
    
    • In the disk path:

        $WARLOCATION$/web-inf/conf/resourceset.xml
      

sample.element

sample.folder.xml

How to use a folder in a view

Searches for:

  • Nothing

sample.folder

sample.search.xml

How to use a search in a view

Searches for:

  • Files whose names contain:

      my
    
  • Files whose contents contain:

      Weather
    
  • Files whose names contain:

      Phone
    
    • And whose contents contain:

        com/sssw/portal/component
      
  • Files whose names contain:

      Stock
      Weather
    
    • And whose contents contain:

        com/sssw/portal/component
      
  • Directories whose names contain:

      security
    
  • Files within the disk path:

      c:\projects\director
    

sample.search

sample.view-link.xml

How to use a view-link in a view

Searches for:

  • The folder:

      samples
    
    • In the view definition:

        element.xml
      
  • The folder:

      samples
    
    • In the view definition:

        folder.xml
      

sample.view-link

settings.ear.xml

settings.war.xml

Common settings for a director EAR or WAR

Searches for:

  • Files whose names contain:

      resourceset.xml
      web.xml
      config.xml
      services.xml
    
    • In the disk path:

        $WARLOCATION$/web-inf/...
        $EARLOCATION$/PAC/web-inf/...
        $EARLOCATION$/PMC/web-inf/...
      

settings.ear

workflow.subsystem.ear.xml

workflow.subsystem.war.xml

All artifacts related to the Workflow subsystem.

Searches for:

  • Configuration files:

      config.xml
      services.xml
    
  • Directories whose names begin with:

      workflow
    
  • Files whose names contain:

      Workflow
    
    • In directories whose names contain:

        portal-component
        portal-style
        security-role
      
  • Files whose names contain:

      Workflow
    
    • And whose contents contain:

        com/sssw/portal/component
      

workflow.subsystem.ear

 
Top of page

Importing resources into a view

You can import the contents of a JAR into a view. When you do this, exteNd Director:

Procedure To import resources into a view:

  1. In the Navigation Pane, click the Resources tab.

  2. Select the view you want to be the target for the import.

  3. Click the Import view jar button in the view display window:

    View8

  4. Select the JAR you want to import and click Open:

    View9

 
Top of page

Exporting resources from a view

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 structure—plus the XML file that defines the view from which the resources were exported. This JAR can then be imported into another resource set.

Procedure To export resources from a view:

  1. In the Navigation Pane, click the Resources tab.

  2. Select the view from which you want to export resources.

  3. Click the Export view to jar button in the view display window:

    View10

  4. Specify the target directory and click Save:

    View11

 
Top of page

Defining custom views

You can create custom views in one of two ways:

This section describes how to manually edit a view definition file.

For more information    For details on saving a search as a view, see Saving a search as a view.

 
Top of section

About the view definition file

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 more information    For syntax and reference information on regular expressions, see the section on regular expressions for text searches in Utility Tools.

 
Top of section

Searching for items within a resource set

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.

 
Top of section

Defining folders in a view

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>

 
Top of section

Including elements that are outside a view's resource set

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>

 
Top of section

Referencing other views within a view definition

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 ...