Tutorial: Building an Rogue Wave Server Application > Implementing a Java Component > Creating the View Specification File
 
Creating the View Specification File
In the specification sample below, we define a view on one of the domains of the Network object model designed in Chapter 6. This view will be represented as a table in which each row represents a node of the viewed domain. The table columns show the name and coordinates of each node, as the name of the locker if applicable.
The view specification file for the Java data sources defines two new attributes for the view: containerIndex and ContainerClass.
*The ContainerIndex attribute designates an existing data source container. If the data source does not exist, a new data source container is created by the IlsDSComponent instance from the value of the containerClass attribute. In this case, the data source is instantiated with the default constructor.
*The ContainerClass attribute specifies the associated data source container. Generally, the container class is derived from the class ilog.server.jsds.IlsDSJFrame, which extends the Swing JFrame class and implements the ilog.server.jsds.IlsDataSourceContainer interface. When the view is opened, the method IlsDataSourceContainer.open is called. By default, this method sets the frame to visible.
view DomainView (any containerIndex=0, string containerClass="MyFrame"):
represent IlsDSRepresentation repres:
any containerIndex = view.containerIndex;
string containerClass = view.containerClass;
string title = "My domain view";
 
subscribe Node:
represent IlsRpRow row:
mandatory Ref<IlsRpTable> table = view.origin->table;
int column[0] = x;
int column[1] = y;
string column[2] = name;
string column[3] = (locker?locker.userName:"none");
 
subscribe origin Domain:
represent IlsRpTable table:
string column[0] = "X";
string column[1] = "Y";
string column[2] = "Name";
string column[3] = "Locker name";
 
propagate nodes;

Version 5.7
Copyright © 2013, Rogue Wave Software, Inc. All Rights Reserved.