GetMetadataObjects

Short Description

Gets all metadata objects of the specified metadata type in the specified repository.

Category

Read methods

Syntax

rc=GetMetadataObjects(reposid,type,objects,ns,flags,options);

Parameters

Method Parameters
Parameter
Type
Direction
Description
rc
N
out
Return code for the method. For more information, see Return Code.
reposid
C
in
Target repository identifier.
type
C
in
Metadata type name.
objects
C
out
Returned list of metadata objects.
ns
C
in
Namespace to use as the context for the request.
flags
L
in
OMI_DEPENDENCY_USED_BY=16384
Specifies to include objects from all project repositories in the method results.
OMI_DEPENDENCY_USES=8192
Specifies to include objects from all public repositories (the foundation and custom repositories) in the method results.
OMI_GET_METADATA=256
Specifies to execute a GetMetadata call for each object that is returned by the GetMetadataObjects request.
OMI_INCLUDE_SUBTYPES=16
Specifies to get all of the metadata objects that are subtypes of the specified metadata type and metadata objects of the specified metadata type. If OMI_XMLSELECT is specified, it affects the subtypes that are retrieved.
OMI_MATCH_CASE=512
Specifies to perform a case-sensitive search that is based on criteria specified in the <XMLSELECT> element. The OMI_MATCH_CASE flag must be used with the OMI_XMLSELECT flag, or the flag is ignored.
OMI_XMLSELECT=128
Specifies to check the OPTIONS parameter for search criteria that filters the objects that are returned. The search criteria are passed as a search string in an <XMLSELECT> element.
options
C
in
Passed indicator for options.
<DOAS Credential="credHandle"/>
Enables a client to make a metadata request for another user. For more information, see <DOAS> Option.
<XMLSELECT>
Specifies a search string to filter the objects that are retrieved. For usage information, see Filtering a GetMetadataObjects Request.

Details

The GetMetadataObjects method gets a list of all metadata objects of the metadata type specified in the TYPE parameter from the repository specified in the REPOSID parameter. The default behavior is to get Identifying Metadata for each metadata object.
Flags enable you to get additional properties and to expand or filter the objects that are retrieved.
  • OMI_INCLUDE_SUBTYPES expands the request to get subtypes of the specified metadata type.
  • OMI_GET_METADATA enables you to execute a GetMetadata call for each object that is returned by the GetMetadataObjects request.
  • The OMI_DEPENDENCY_USES and OMI_DEPENDENCY_USED_BY flags specify additional repositories from which to get objects.
  • The OMI_XMLSELECT flag and <XMLSELECT> element enable you to filter the objects that are returned by specifying search criteria.
The default behavior of the GetMetadataObjects method is to get objects of the specified metadata type from the specified repository. Set OMI_DEPENDENCY_USES to get metadata objects from all public repositories (the foundation and all custom repositories) in the method results, and to get metadata objects from the specified repository. Set OMI_DEPENDENCY_USED_BY only if you want to get metadata objects of the specified metadata type from all project repositories in the method results, in addition to metadata objects from the specified repository. Setting both flags will return metadata objects from all repositories that are registered in the SAS Metadata Server (foundation, custom, and project).
When the GetMetadataObjects method is issued in the SAS namespace, the REPOSID parameter is required, unless the OMI_DEPENDENCY_USED_BY flag, the OMI_DEPENDENCY_USES flag, or both is specified. When you specify a REPOSID value in addition to one or both of the flags, GetMetadataObjects gets metadata objects first from the repository specified in the REPOSID parameter, and then it gets metadata objects from the repositories specified by the flags. A request that specifies to get objects from all registered repositories returns the specified repository first, followed by the foundation repository, followed by custom repositories in the order in which they were registered, followed by project repositories in the order in which they were registered.
When the GetMetadataObjects method is issued in the REPOS namespace, it ignores the REPOSID parameter and searches the SAS Repository Manager.
When using GetMetadataObjects to list common and shared objects, use the metadata type and TypeName value indicated in the object’s type definition in the SAS type dictionary to identify the objects to retrieve. For more information about the SAS type dictionary, see Using Interfaces that Read and Write Metadata in SAS 9.3. Specify the metadata type in the TYPE parameter, set the OMI_XMLSELECT flag, and specify the TypeName value in the <XMLSELECT> element in the OPTIONS parameter as follows:
<XMLSELECT search="@PublicType=’typename’"/>
Several common and shared objects are represented in the SAS Metadata Repository by the same metadata type. Use of the TypeName value filters the request to return only objects of the specified type.
Use the new GetMetadata OMI_FULL_OBJECT flag and GetMetadataObjects OMI_GET_METADATA flag with caution. The flags can return a lot of information.
New template features that are available in GetMetadata are also available in GetMetadataObjects when you set the OMI_GET_METADATA flag and the OMI_TEMPLATE flag in a GetMetadataObjects request. For more information, see Using Templates.

Example 1: Standard Interface

The following is an example of how to issue a GetMetadataObjects method regardless of the programming environment. The request gets all objects defined for metadata type PhysicalTable in repository A0000001.A5345678. It does not set any flags.
<!-- set repository Id and type -->
reposid="A0000001.A5345678";
type="PhysicalTable";
ns="SAS";
flags=0;
options="";

rc=GetMetadataObjects(reposid,type,objects,ns,flags,options);

<!-- XML string returned in objects parameter -->

<Objects>
  <PhysicalTable Id="A5345678.A5000001" Name="New Table"/>
  <PhysicalTable Id="A5345678.A5000002" Name="New Table2"/>
</Objects>

Example 2: DoRequest Method

The following is an example of an XML string that shows how to format the request in example 1 for the INMETADATA parameter of the DoRequest method.
<!-- XML string for inMetadata parameter of DoRequest method call -->
<GetMetadataObjects>
  <Reposid>A0000001.A5345678</Reposid>
  <Type>PhysicalTable</Type>
  <Objects/>
  <NS>SAS</NS>
  <Flags>0</Flags>
  <Options/>
</GetMetadataObjects>

Related Methods