Previous Page | Next Page

Filtering a GetMetadataObjects Request

Filtering the Associated Objects That Are Retrieved By a GetMetadataObjects Request

Search criteria that are specified in the <XMLSELECT> element of a GetMetadataObjects method call filters the initial set of metadata objects that are retrieved. You can filter the associated objects that are retrieved by GetMetadataObjects by setting the OMI_GETMETADATA (256) and OMI_TEMPLATE (4) flags and specifying a search criteria string in the association name subelement of a template that requests associated objects.

The search criteria specified in an association name subelement supports a reduced form of the XMLSELECT syntax. The search criteria string supports object and attribute criteria in the following forms:

<AssociationName search="Object"/>

<AssociationName search="Object[AttributeCriteria]"/>

This syntax is a change from SAS 9.1, which supported search criteria in the following form:

<AssociationName search="AttributeCriteria"/>

The SAS 9.2 syntax improves performance by enabling users to limit the number of metadata types on which the attribute criteria are evaluated. The older syntax is still supported in SAS 9.2, and is the same as specifying "*[AttributeCriteria]".

The following is an example of a GetMetadataObjects request that specifies search criteria on an association name. The request specifies to get Document objects and ExternalTable objects that are associated with the Document objects through the Objects association and have the words Human Resources in their Desc= attribute.

<GetMetadataObjects>
   <Reposid>A0000001.A5DQTZY5</Reposid>
   <Type>Document</Type>
   <Objects/>
   <NS>SAS</NS>
   <!-- OMI_GET_METADATA(256) + OMI_TEMPLATE (4) + OMI_ALL_SIMPLE (8) -->
   <Flags>268</Flags>  
   <Options>
      <Templates>
         <Document>
           <Objects search="ExternalTable[@Desc ? 'Human Resources']"/>
         </Document>
      </Templates>
   </Options>
</GetMetadataObjects>

In the request, note the following:

Here is an example of the output from the request:

<!-- Using the GETMETADATAOBJECTS method. -->

<Objects>
   <Document Id="A5DQTZY5.B9000001" Name="MyDocument" ChangeState="" 
Desc="Document object created to do search string tests" LockedBy="" MetadataCreated=
"07Aug2008:14:04:35" MetadataUpdated="07Aug2008: 18:40:11" PublicType="Document" 
TextRole="" TextType="" URI="text file" URIType="" UsageVersion="1000000">
   <Objects SEARCH="ExternalTable[@Desc ? 'Human Resources']">
          <ExternalTable  Id="A5DQTZY5.BA000002" ChangeState="" Desc="Human Resources 
information from Oracle database" LockedBy="" MetadataCreated="07Aug2008:14:04:35" 
MetadataUpdated="07Aug2008: 18:40:36" Name="Oracle HR" NumRows="-1" PublicType=
"ExternalFile"  TableName="" UsageVersion="1000000"/>
         <ExternalTable  Id="A5DQTZY5.BA000004" ChangeState="" Desc="Human Resources
information from Sybase database" LockedBy="" MetadataCreated="07Aug2008:14:04:35" 
MetadataUpdated="07Aug2008: 18:40:36" Name="Sybase HR" NumRows="-1" PublicType=
"ExternalFile"  TableName="" UsageVersion="1000000"/>
   </Objects>
</Document>
</Objects>

Two ExternalTable objects were found that met the selection criteria.

Previous Page | Next Page | Top of Page