When specified in the
<METADATA> element, the search criteria string looks like one
of the following:
<Metadata>
<MetadataType>
<AssociationName search="Object"/>
</MetadataType>
</Metadata>
<Metadata>
<MetadataType>
<AssociationName search="Object[AttributeCriteria]"/>
</MetadataType>
</Metadata>
To understand the filtering
that occurs, consider the following requests. In the first request,
the <METADATA> element specifies to get the Document metadata
object that has Id="A52WE4LI.AT0000RZ" and all objects that are associated
with it through the Objects association name (all metadata types):
<GetMetadata>
<Metadata>
<Document Id="A52WE4LI.AT0000RZ">
<Objects search="*"/>
</Document>
</Metadata>
<NS>SAS</NS>
<Flags>0</Flags>
<Options/>
</GetMetadata>
The request is the same
as specifying the association name without search criteria:
<GetMetadata>
<Metadata>
<Document Id="A52WE4LI.AT0000RZ">
<Objects/>
</Document>
</Metadata>
<NS>SAS</NS>
<Flags>0</Flags>
<Options/>
</GetMetadata>
In both requests, the
GetMetadata method specifies to get requested attributes for the specified
Document object (Id only in this case) and all objects that are associated
with it through the Objects association name. Here is an example of
the output from the requests:
<!-- Using the GETMETADATA method. -->
<Document Id="A52WE4LI.AT0000RZ">
<Objects>
<PhysicalTable Id="A52WE4LI.B60000RT" Name="Table1" Desc="Sales table"/>
<PhysicalTable Id="A52WE4LI.B60000RU" Name="Table2" Desc="Human Resources table"/>
<ExternalTable Id="A52WE4LI.BA000001" Name="Oracle Sales" Desc="Sales information
from Oracle database"/>
<ExternalTable Id="A52WE4LI.BA000002" Name="Oracle HR" Desc="Human Resources
information from Oracle database"/>
</Objects>
</Document>
The specified Document
object has four objects associated with it through the Objects association
name: two PhysicalTable objects and two ExternalTable objects. By
default, the GetMetadata method returns the Id, Name and Desc values
of the associated objects.
In this second request,
a search string is used in the Objects association name of the <METADATA>
element to filter the request to get only PhysicalTable objects that
are associated with the specified Document object through the Objects
association:
<GetMetadata>
<Metadata>
<Document Id="A52WE4LI.AT0000RZ">
<Objects search="PhysicalTable"/>
</Document>
</Metadata>
<NS>SAS</NS>
<Flags>0</Flags>
<Options/>
</GetMetadata>
Here is an example of
the output from the request:
<!-- Using the GETMETADATA method. -->
<Document Id="A52WE4LI.AT0000RZ">
<Objects>
<PhysicalTable Id="A52WE4LI.B60000RT" Name="Table1" Desc="Sales table"/>
<PhysicalTable Id="A52WE4LI.B60000RU" Name="Table2" Desc="Human Resources table"/>
</Objects>
</Document>
The ExternalTable objects
that were returned in the first example are excluded from the output
of this example.
In this third request,
attribute criteria are added to the search criteria string in the
<METADATA> element to further filter the request. The request
specifies to get PhysicalTable objects that are associated with the
specified Document object through the Objects association whose Desc
attribute value has the word Sales in it:
<GetMetadata>
<Metadata>
<Document Id="A52WE4LI.AT0000RZ">
<Objects search="PhysicalTable[@Desc ? 'Sales']"/>
</Document>
</Metadata>
<NS>SAS</NS>
<Flags>0</Flags>
<Options/>
</GetMetadata>
Here is an example of
the output from the request:
<!-- Using the GETMETADATA method. -->
<Document Id="A52WE4LI.AT0000RZ">
<Objects>
<PhysicalTable Id="A52WE4LI.B60000RT" Name="Table1" Desc="Sales table"/>
</Objects>
</Document>