OSID Logo
OSID Specifications
osid package
Version 3.0.0
Release Candidate Preview
Interfaceosid.OsidQuery
Implementsosid.Suppliable
Description

The OsidQuery is used to assemble search queries. An OsidQuery is available from an OsidQuerySession and defines methods to match objects. Once the desired parameters are set, the OsidQuery is given to the designated search method. The same OsidQuery returned from the session must be used in the search as the provider may utilize implementation-specific data wiithin the object.

If multiple data elements are set in this interface, the results matching all the given data (eg: AND) are returned.

Any match method inside an OsidQuery may be invoked multiple times. In the case of a match method, each invocation adds an element to an OR expression. Any of these terms may also be negated through the match flag.

                     
                     
                     OsidQuery { OsidQuery.matchDisplayName AND (OsidQuery.matchDescription OR OsidQuery.matchDescription)}
                     
                                 
                     
                

OsidObjects allow for the definition of an additonal records and the OsidQuery parallels this mechanism. An interface type of an OsidObject record must also define the corresponding OsidQuery record which is available through query interfaces. Multiple requests of these typed interfaces may return the same underlying object and thus it is only useful to request once.

An OsidQuery may be used to query for set or unset values using the "match any" methods. A field that has not bee explicitly assigned may default to a value. If multiple language translations exist and the query session is placed in a non-default locale, fields that have not been explicitly assigned in the non-default locale are considered unset even if the values from the default locale appear in the objects.

MethodgetStringMatchTypes
Description

Gets the string matching types supported. A string match type specifies the syntax of the string query, such as matching a word or including a wildcard or regular expression.

Returnosid.type.TypeLista list containing the supported string match types
CompliancemandatoryThis method must be implemented.
MethodsupportsStringMatchType
Description

Tests if the given string matching type is supported.

Parametersosid.type.TypestringMatchTypea Type indicating a string match type
Returnboolean true if the given Type is supported, false otherwise
ErrorsNULL_ARGUMENT stringMatchType is null
CompliancemandatoryThis method must be implemented.
MethodmatchKeyword
Description

Adds a keyword to match. Multiple keywords can be added to perform a boolean OR among them. A keyword may be applied to any of the elements defined in this object such as the display name, description or any method defined in an interface implemented by this object.

Parametersstringkeywordkeyword to match
osid.type.TypestringMatchTypethe string match type
booleanmatch true for a positive match, false for a negative match
ErrorsINVALID_ARGUMENT keyword is not of stringMatchType
NULL_ARGUMENT keyword or stringMatchType is null
UNSUPPORTED supportsStringMatchType(stringMatchType) is false
CompliancemandatoryThis method must be implemented.
MethodclearKeywordTerms
Description

Clears all keyword terms.

CompliancemandatoryThis method must be implemented.
MethodmatchAny
Description

Matches any object.

Parametersbooleanmatch true to match any object , false to match no objects
CompliancemandatoryThis method must be implemented.
MethodclearAnyTerms
Description

Clears the match any terms.

CompliancemandatoryThis method must be implemented.