After you have instantiated
the object factory and connected to the SAS Metadata Server (using
the makeOMRConnection method of the MdOMRConnection interface), you
can then use the methods in the MdFactory interface to create SAS
Metadata Model object instances on the client. MdFactory provides
the createComplexMetadataObject method for creating objects. The createComplexMetadataObject
method creates an object that stores information about a metadata
object's attributes and its potential associations. You can use this
method to create an object that represents a new or existing object.
The following are examples
of the createComplexMetadataObject method. To create an object that
represents a new metadata object, specify:
MdFactory.createComplexMetadataObject(myNewObjectName,
metadata_type,
8char_target_repository_identifier)
To create an object
that represents an existing metadata object on the SAS Metadata Server,
specify:
MdFactory.createComplexMetadataObject(ObjectName,
metadata_type,
identifier_of_existing_metadata_object)
An alternate —
and preferred — approach for creating objects for an existing
metadata object is to issue a getMetadata or getMetadataObjects request.
The getMetadata and getMetadataObject methods are available within
the MdOMIUtil interface. The createComplexMetadataObject method creates
an empty metadata object; it has no attributes or associations set.
Use of one of the GetMetadata methods will then be needed to fully
populate the object.
You can get the identifiers
of all registered repositories on the SAS Metadata Server by using
the getRepositories method of the MdOMIUtil interface. You can get
the identifier of an existing object instance by using one of the
getMetadataObjects methods of the MdOMIUtil interface.
For more information
about repository and object instance identifiers, see Identifying Metadata.