Basic Specification
Specifying a dynamic view type basically consists in defining propagation paths for notification in the server object model and a set of representations associated with the server object classes concerned with the path.
For example, if you want to get a tree representation of a company to list all the company departments and all the employees in each department, write the dynamic view type specification CompanyTree as follows:
Example
view CompanyTree:
subscribe origin Company:
represent TreeR root:
string label=identifier;
propagate departments;
subscribe Department:
represent TreeItemR item:
Ref<TreeR> ownerTree=company->root;
string label=name;
propagate employees;
subscribe Employee:
represent TreeItemR subItem:
Ref<TreeItemR> ownerItem=department->item;
string label=name;
This dynamic view type declares the class Company as its (main) origin type. In other words, when a view is opened as an instance of the class CompanyTree, a server object of type Company should normally be passed as a parameter to the class CompanyTree. This server object is the starting point for propagation.
As will be discussed later in this chapter, specific properties are automatically attached to the main origin type.
Also refer to the class IlsMvView in the Rogue Wave Server Reference Manual to learn how to handle dynamic view origins, such as opening a dynamic view without origins, adding an origin to a view or removing an origin from a view.
The propagation path from the origin type Company includes the relation departments of the class Company and the relation employees of the class Department
The mechanism can be illustrated as follows:
Specifying Dynamic View Types
Note that from one server object type, you can propagate to 0, 1 or n relations.
Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.