Filtering a GetMetadataObjects Request |
The GetMetadataObjects method enables you to filter both the initial set of objects and the associated objects that are selected in the GetMetadataObjects request. This topic describes how to filter the initial set of objects selected by GetMetadataObjects. For information to filter the associated objects, see Filtering the Associated Objects That Are Retrieved By a GetMetadataObjects Request.
The GetMetadataObjects method supports an OMI_XMLSELECT (128) flag to enable you to filter the initial set of objects that are retrieved by the SAS Metadata Server. The OMI_XMLSELECT flag instructs the server to check the <OPTIONS> element for search criteria specified in an <XMLSELECT> element. The <XMLSELECT> search syntax enables you to filter objects based on the following:
attribute criteria
association path criteria
a combination of the two criteria
a concatenation of each criteria
Attribute criteria enable you to select only objects that contain specified attribute values. For example:
You can specify to select only Person objects that have a Name= attribute value of John Doe.
By concatenating attribute criteria with the logical operators AND or OR, you can perform exclusive or inclusive filtering based on the attribute criteria. For example:
You can specify to select objects that have a Name= attribute value of John Doe or Jane Doe (exclusive search).
You can specify to select objects that have the attribute=value pairs Name="John Doe" and Title="Manager" (inclusive search).
Association path criteria enables you to select objects that have a specific association and whose associated objects meet association and attribute criteria. For example:
You can specify to select only Document objects that have a Reports association to a Report object.
You can specify to select only Document objects that have a ResponsibleParties association to a ResponsibleParty object that has a Persons association to a Person object that has the Name= attribute value of John Doe.
In both examples, the Document objects that are retrieved are filtered by one association path criteria. In the first example, the filtering association path starts with the association Reports. Documents that do not have a Reports association are ignored. In the second example, the filtering association path starts with the association ResponsibleParties. Documents that do not have a ResponsibleParties association are ignored. In addition, the ResponsibleParty objects found through the ResponsibleParties association are filtered to include only objects that have a Persons association to a Person object that has the attribute value Name="John Doe".
When you concatenate association path criteria, the method filters the objects that are selected based on two or more associations that are directly defined for the specified metadata type. It joins the association paths using an implicit AND operator. As a result, the method selects only objects that meet all of the criteria specified in all of the association paths.
An example of a concatenated association path is specifying to select Document objects that have a Reports association to a Report object that has a Name= attribute value of Sales, as well as a ResponsibleParties association to a ResponsibleParty object that has a Persons association to a Person object that has a Name= value of John Doe.
The ability to concatenate association path criteria is new in SAS 9.2.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.