OpenWGA 7.9 - TMLScript reference
Object:
CollectionResult
Description |
Represents an object carrying all resulting data of a document collection. This is the parent class for objects QueryResult and NavigatorResult which represent collection results of a query or navigator respectively, defining shared functionality of both. A CollectionResult is also created by methods that modify an existing collection result by filtering it or skipping its first results. Methods that create new CollectionResult objects with modified versions of the original CollectionResult, like filter() and skip(), may be freely cascaded. So you can apply multiple filters and do multiple skips on a collection result. |
||||||||||||||||||||||||||||
Retrieval | |||||||||||||||||||||||||||||
Allowed in script types |
|
||||||||||||||||||||||||||||
Properties and methods |
|
||||||||||||||||||||||||||||
Examples |
Iterating over a CollectionResult, actually a NavigatorResult here, using a JavaScript iterator. The variable cx is filled with TMLContext objects pointing to the result documents: for (let cx in Iterator(WGA.nav().children())) { Same as WGA.nav().children().each(function(cx){ An example of creating CollectionResults with special modifications in a cascaded way. FIrst we implement a filter to exclude documents being older than 1 month, then we skip the first 10 documents. Finally we retrieve a collection page of 5 documents, being the first 5 documents of the collection which a) are behind the first 10 documents and b) are modified in the recent month: var theFilter = function (cx) cx.LASTMODIFIED > WGA.modifyDate(WGA.createDate(), "M", -1); |