Using model views
In this topic ...
Related Topics ...
The Designer uses several views to portray the WebApp object and XML for the model of a portlet or Web application. We can use these views to understand the effect of a builder call on the model, to examine the XML stored as the model on disk, or to examine the relationships among elements within the model. Views include:
- WebApp Tree View - Displays content of the generated WebApp
- Builder Call Editor View - Displays user interface for editing a builder call
- Model XML View - Displays XML content that represents the model
- WebApp Diagram View - Displays relationships among WebApp objects
- Resource Log View - Displays significant events in current project session
The WebApp Tree View
The WebApp Tree view displays the objects created by builders within the WebApp. When you select an object in either the Builder Call List or the WebApp Tree view, the corresponding object is highlighted in the Builder Call List of the WebApp tree.
The WebApp Tree view is composed of two panes:
- Left Pane - Tree portion of view - Displays a tree of WebApp object categories, within which individual WebApp objects are contained
- Right Pane - Object portion of View - Displays the contents of objects in the WebApp tree (variables, pages, action lists, etc.)
WebApp Tree
The WebApp tree displays a objects in the WebApp by category. For example, all variables in the WebApp are contained in the Variable folder. The same is true for Pages, Linked Java Objects, Schemas, Properties, Comments and Action Lists. This organization of WebApp objects allows you to visualize what the WebApp contains and how the WebApp changes during regeneration. For example, we can use the WebApp Tree view to determine what a builder adds to the WebApp.
If you expand a container in the tree and click on a WebApp object, the builder responsible for creating the object is highlighted in the Builder Call List. In addition, the content of the object is displayed in the WebApp Object Viewer in the left pane.
WebApp Object Viewers
For each type of object in the WebApp there is a corresponding Viewer that displays the object contents. We can use these viewers to examine the JSP code generated by a builder call or, in the case of a Method, the Java code in the generated Java file for all the methods in the model.
A panel at the top of each Viewer displays information about the selected entity. The content (in read-only format) of the selected entity is displayed in the lower panel.
Items in a Viewer are displayed in tree form. Nodes representing item groups can be expanded and collapsed. For example, a Variable Viewer might display XML content as a tree with nodes that contain sub-elements of the XML.
WebApp entities available for inspection include...
- Action List - Displays a list of actions (and related method calls) included in an Action List. The viewer displays the entire generated methods class, and highlights the selected action list
- Comment - Displays Comment Builder Calls. These Calls are used to document model construction or segments of Builders in the Builder Call list. They provide a handy means for in situ documentation in a model.
- Data Service - Displays information about WebApp objects used to access the Factory's Data Service Layer. This common layer is used to access to back end or external data, and makes it possible to separate the UI from the Data. For example, this allows you to have one model that is used to access data and a linked model that provides the business logic or UI on top of the data. Objects that might be displayed as Data Services include: Service Calls, an SQL Calls, and data access requests made by various View and Form Builders such as Domino, SAP, PeopleSoft, Siebel, etc.
- Event - Displays event handler information. (The Event Declaration itself is not displayed.) When an Error Handler builder call is added to a model, its information will be displayed in this viewer. Each event in the WebApp is listed in the Event tree. User defined events (created with an Event Declaration builder.) are prefixed with "User" and displayed only when there is an Event Handler present that handles the event. Event Declarations add two methods to the WebApp. These methods show up under the methods node. A typical event viewer display might be:
Event: OnError.main
Action: showErrorPage
- Linked Java Object - Displays information about each LJO in the model, including status (persisted for failover) and the public methods within the LJO
- Method - Displays highlighted Java code of selected method. The viewer displays the entire generated methods class, and highlights the selected method.
- Page - Displays information about each page in the WebApp. The upper panel describes page name status (public) and properties. The lower panel displays page HTML and JSP code and tags. Click on a node (page control) listed under an individual page to jump to the code that implements that node.
- Property - Displays information about properties that apply to the overall WebApp. Various builders (such as the Schema builder and File Chooser builder) create and use WebApp properties. This viewer displays information about those properties
- Schema - Displays the XSD/XML markup defining a schema and the generic structure of elements and attributes (not actual schema data). The upper panel displays schema source and caching information. The lower panel displays schema XSD elements and references.
- Variable - Displays Information about each variable in the WebApp, whether the Variable was created manually or automatically by a builder. Upper panel presents information about variable name, status, type, and persistence and properties. In the case of "object" types, the class name and instantiate method is also listed.
The bottom panel displays variable content according to type. For example, content can be string, XML code, a list of public methods, etc.
The Model XML View
The Model XML view displays the XML for the model as it is saved on disk. We can use the Model XML view to examine how indirect references have been resolved.
Another use of the Model XML view is to examine the schemas generated by various builders, such as the Data Page builders and Database builders.
The Resource Log View
This view shows the results of the last Add/Remove Feature Set (or WebApp) operation performed in this Eclipse session The Resource Log view displays all the files that have been removed, modified, and added to a project, and any errors that occurred as a result of those changes as a result of the most recent copy/remove operation. Use this view to track the activities that have taken place within the current development session. When Eclipse is restarted, the view is cleared.
You access this view from the Eclipse Window menu as follows: Window |Show View | Other | IBM | Resource Log. The view opens in the Task View area of the Designer. The view menu provides filtering and copy options (see below)
The set of events displayed in this view is categorized into three filtering types available from the Copy choice within the view's menu:
- All Events - Shows everything. The majority of events displayed will be successful copies and/or deletion
- Exceptional Events (default) - Shows events that you'd probably be interested in, including errors, but also files that are found to be user-modified or are overwrite candidates
- Errors - Shows only events like a failure to remove or copy some file
Types of Events Logged
Here are all the types of events that are logged in the view, along with how they're rendered in the view.
A {0} is replaced by the file being copied/removed. A {1} is the "from" directory and a {2} is the "to" directory):
- File was copied to the destination - "copied {0} from {1} to {2}"
- File was not modified by user, and was removed from the destination - "removed {0} from {2}"
- File was modified by user, but was removed from the destination anyway - "removed modified {0} from {2}" *
- File was modified by user, and was not removed - "kept modified {0} in {2}" *
- Existing file was overwritten - "overwrote existing {0} in {2} from {1}" *
- Existing file was not overwritten - "kept existing {0} in {1} - new file in {1}" *
- Tried to remove, but couldn't - "could not remove {0} from {2}" **
- Unable to overwrite existing file - "error copying {0} to {1} - new file in {1}" **
* Events marked by * are "Exceptional"
** Events marked by ** are Error events (and also Exceptional events).
Using Copy
In addition to the Event filtering above, the Resource Log view menu provides a Copy operation. Copy places the view contents on the clipboard as text (lines separated by CR/LF). Note that the copy operation ignores any item selected in the view.
Copy is handy for providing a comprehensive record of project activities. For example, if you have a situation that requires several files to be overwritten and for some reason they are not,Copy will allow you to get a list of those files for future reference. In addition, you can manually copy/past file names into other commands to complete the overwrite process.
The WebApp Diagram View
This and feature-rich view displays the relationships that exist among all the entities within a WebApp. Entities are depicted as icons of various types and interconnecting links (lines) indicate the flow of data and control among entities. Features in this handy view allow you to see all the places in a WebApp where a variable is referenced or to see all the controls that exist on a given page.
This view has many additional uses and features. Click here for more information about using this view.