Rogue Wave Server/Rogue Wave Views Integration > Server/Views Mapping > Server Data Sources vs. Views Data Sources > Creating a Server Data Source
 
Creating a Server Data Source
When a Server data source is created (in most cases by reading the .ilv resource file of a panel), it parses the view specification file to build the set of Rogue Wave®  Views data sources that will be used by the view when it is opened.
Let us take the following view specification as an example:
view NetworkView (any panel=0,
any sds=0):
represent IlsSwRepresentation repres:
any panel=view.panel;
any sds=view.sds;
string resource="network.ilv";
subscribe origin Network:
represent IlsSwTable domainTable:
# Main data source columns
string column[1]="name";
string column[2]="rpStatus";
# Collectors
Collector rows=domains->domainRow;
string rowType="Domain,domainRow";
string collectorName="rows";
# Properties data source columns
string label=identifier;
# Table properties
string background[2]="yellow";
propagate domains;
subscribe Domain:
represent IlsSwTable nodeTable when (rpStatus==2):
# Main data source columns
string column[1]="name";
string column[2]="x";
string column[3]="y";
# Collectors
Collector rows=nodes->nodeRow;
string rowType="Node,nodeRow";
string collectorName="rows";
# Properties data source columns
string domainLabel=name;
represent IlsSwRow domainRow
## draggedPath=domains
:
mandatory Ref<IlsSwTable> table=view.origin->domainTable;
string column[1]=name;
int column[2]=rpStatus;
propagate nodes when (rpStatus==2);
subscribe Node:
represent IlsSwRow nodeRow when (domain.rpStatus==2)
## draggedPath=nodes
:
mandatory Ref<IlsSwTable> table=domain->nodeTable;
string column[1]=name;
int column[2]=x;
int column[3]=y;
*Creating the Rogue Wave Views Data Sources
When parsing this view specification file, the Server data source creates two sets of Rogue Wave Views data sources to match the two IlsSwTable representation objects:
*the first one for the nodeTable representation;
*the second one for the domainTable representation.
A set of Rogue Wave Views data sources for a table representation object is composed of two Views data sources:
*The Properties data source
*The Main data source
Rogue Wave Views data sources are named after the corresponding view and representation. For the Network view, the four data sources created are named as follows:
*NetworkView::nodeTable(properties)
*NetworkView::nodeTable
*NetworkView::domainTable(properties)
*NetworkView::domainTable
*Creating the memory table
Along with Rogue Wave Views data sources, the Server data source also creates their associated memory table as an instance of the class IlsSwMemoryTable, as well as their schema.
Schema for a Properties Data Source
The schema of the Properties data source (or, more exactly, of its corresponding memory table) is made from the properties declared on the IlsSwTable representation object.
We distinguish between table properties and predefined table properties.
*Table properties are properties that have been dragged from the model onto the Properties notebook page of the Server data source inspector in Rogue Wave Server Studio.
*Predefined table properties are properties that have been added in the Edit Table Representation Properties dialog box.
In the view specification, the columns of the Properties data source are introduced by a special Rogue Wave Server Studio comment: “Properties data source columns” and the predefined table properties are introduced by a different comment: “Table properties”.
In the previous example, the Server data source creates only one column named label for the Properties data source domainTable , whereas the predefined property Background[2] is handled by another mechanism and is not added to the Properties data source. If you have defined your own table properties, they will be handled in the Table Properties inspector but a corresponding column will be still created in the Properties data source.
You may want to map server object attributes or view parameters to columns of this Properties data source using Rogue Wave® Server Studio. If you do so, the Properties data source will contain only one row at runtime to store the values of server object attributes or of view parameters that you have mapped to columns of this Properties data source.
Schema of the Main Data Source
The schema of the Main data source (or, more exactly, of its corresponding memory table) is made from the indexed attribute named column in the IlsSwTable representation object and from the indexed attribute named column in the IlsSwRow representation. This latter attribute is used to determine the type of Views columns.
The schema of the Main data source is fully described in the view specification. It is initialized when the Rogue Wave Views data sources are built, during initialization of the Server data source. For the nodeTable Main data source, the Server data source uses the following specification to build the schema of the Main data source memory table:
represent IlsSwTable nodeTable when (rpStatus==2):
# Main data source columns
string column[1]="name";
string column[2]="x";
string column[3]="y";
 
represent IlsSwRow nodeRow when (domain.rpStatus==2)
string column[1]=name;
int column[2]=x;
int column[3]=y;
The final Views data source model for the Network view is the following:
Views Data Sources for the Network View

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.