Dynamic View Services > Semantics of Dynamic View Type Specifications > Collectors
 
Collectors
A collector is a representation attribute whose purpose is to allow a Server relation to be modified from a representation object. It is generally used to edit n-ary relations because unary relations can be edited through reference attributes. N-ary relations can be modified via the specific collector-related callback functions defined in the class IlsRpObject. A collector is defined by:
*An attribute name.
*An access path to a Server relation.
*The name of a representation declared in the relation target type.
For example:
view DomainView:
subscribe Domain:
represent Tree tree:
...
Collector items=nodes->item;
subscribe Node:
represent TreeItem item:...
The tree representation that corresponds to Domain has a collector, called items, that contains objects of type TreeItem. It is associated with the relation nodes.
*When a component needs to add a new item object to a tree object, the callback IlsRpObject::onAddToCollection must be invoked.
*When an item is to be removed, the callback function IlsRpObject::onRmFromCollection must be called.
Unlike the other representation attributes, the value of a collector is never updated by the server. It is only used by the component to edit the Server relation. Therefore, there is no need to associate an editing function with a collector attribute.

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