0.4 Item Collection Summary
Overview
An
ItemCollection contains a rule, which specifies a set of items in the repository. An example might be "all the items that are of Note kind" (for more on rules, check out
QuerySystemReference). An
ItemCollection can also be viewed as an array of items, called the results, which is just the a recent result of the running the rule. From CPIA's point of view, a Table or List often displays the list of Items in the
ItemCollection, so the array is the main interface to the
ItemCollection. In addition to the rule, an
ItemCollection also contains two other lists: Inclusions and Exclusions -- explicit lists of items to add or remove after the rule is run -- and a list of Kinds that filter the results after inclusions and exclusions have been added so the results contain only certain kinds of items.
Perhaps the most interesting feature of
ItemCollections is that the repository can know when items are created, deleted or modified, and since it can know the rule, it can usually tell when the results change, making it possible to incrementally update the results and even notify the block that it needs to update the user interface when the results change.
ItemCollections have methods to subscribe and unsubscribe to notifications about changes, add or remove items from the inclusions and exclusions, add or remove the filter kind, get and set the rule, access the results by indexing, getting its length, etc. In the future we will be adding sorts to
ItemCollections, taking advantage of the repository's recent ability to index ref collections. See
parcels/osaf/contentmodel/ItemCollection.py and
repository/query/Query.py for more details.
--
KatieCappsParlante - 07 Jul 2004