Dynamic View Services > Specifying Dynamic View Types > Collectors > Specifying a Collector
 
Specifying a Collector
A collector is defined by a relation path and by the name of a representation. Only the last relation in the path can be —and usually is—an n-ary relation. This last relation must be declared with a modifier.
The representation must be specified on the target type of the last relation in the path. Let us get back to the DepartmentTable view and add a collector attribute to the representation table:
subscribe origin Department:
represent TableR table:
string title=this.getFullName(company.identifier,name);
string column[1]="Employee name";
string column[2]="Month cost";
Collector rows=employees->row;
propagate employees;
subscribe Employee:
represent RowR row:
Ref<TableR> owner=department->table;
string column[1]=name;
string column[2]=cost;
string color=(department->manager==this)?"green":"white";
The table representation specified on the Department server object declares a collector named rows. Its relation path is the n-ary relation employees, whose target is the object Employee and which has a modifier. The collector is also defined by the representation row, which is actually a representation specified on Employee.
Note: There is no macro to declare the collector attribute “rows” to the representation model interpreter, because this kind of attribute is never edited by the server. It acts only as an API for the component to edit a server relation.

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