DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

OFEvaluateFilter(TCL_ADM)


OFEvaluateFilter -- filter list of objects

Syntax

OFEvaluateFilter handleId objectList [filterString]

Description

This routine takes a list of objects and performs a filter on them, returning an indication of which of those objects passed the filter (and which did not).

If the request processor is performing a scoping operation on the object instance passed to it, or is generating the list of objects to be worked on based on the named object instance and the given filter, or can eliminate a portion of the filter in a trivial solution; then the request processor might want to send only the portions of the BMIP request's filter parameter that are still relevant.

Arguments


int handleId
the handle identifier that was forwarded to the request processor by the SCOadmin services library.

objectList
list of object identification strings. The OFEvaluateFilter routine will return a subset of this list containing only the valid objects (those that pass the filter).

filterString
optional string that represents the filter to be used on the object list given. If this string is absent, the command will use the string given in the BMIP request associated with the handleId.

Error messages


NO_SUCH_CLASS_HANDLE
The handleId named does not correspond to an existing class in the Server APIs internal lookup table.

UNRECOGNIZED_OPERATION
The class represented by the named handleId has no filter function associated with it.

INVALID_FILTER
The class represented by the named handleId has defined the no filter action for one of the attributes & filter-action pairs named in the filterString argument. Or the data portion of a binary filter-action is corrupt. Or the wrong order or number of arguments were given to a filter-action. Or the filter command itself is corrupt.

EXECUTION_PROCEDURE_FAILURE
The execution of the filter operation was halted because of an error in running the operation's execution procedure.

Example

   proc RequestProcessor {osaData handleId bmipRequest} {
   

# # get the list of objects we'll be operating on, then step through # it so we can operate on each one and send the BMIP response back # to the client that called us. #

set objectList [keylget bmipRequest objectInstance]

. . .

set objectList [OFEvaluateFilter $handleId $objectList]

. . .

set listLength [llength $objectList]

if {$listLength < 1} {

# If all the objects failed the filter, we need to send a BMIP # response to that effect back to the client. So we set the # objectInstancePtr to NULL and call ofReturnBmipResponse().

set bmipResponse $bmipRequest keylset bmipResponse errorParameter {} keylset bmipResponse attributeList {} keylset bmipResponse actionInfo {} keylset bmipResponse linkedId 0 keylset bmipResponse objectInstance {}

OFReturnBmipResponse $handleId bmipResponse FALSE

return }

# # process the objects that passed the filter #

foreach object $objectList {

. . .

See also

OFGenerateHandleId(TCL_ADM), OFReturnBmipResponse(TCL_ADM), OFEvaluateOperation(TCL_ADM).
16 September 2002
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003