Adding Metadata Objects |
This example contains two AddMetadata method calls:
The first method call creates a second repository.
The second method call creates a Document object in the new repository and associates the Document object with the SASLibrary object created in Example of an AddMetadata Request That Creates an Application Metadata Object. A Document object has an Objects association to a SASLibrary object.
This method call creates the second repository:
<AddMetadata> <Metadata> <RepositoryBase Name="Test repository 2" Desc="Second test repository." Path="C:\testdat\repository2" RepositoryType="Custom"> </RepositoryBase> </Metadata> <Reposid>A0000001.A0000001</Reposid> <NS>REPOS</NS> <!-- OMI_TRUSTED_CLIENT flag --> <Flags>268435456</Flags> <Options/> </AddMetadata>
In the method call, note the following:
The <METADATA> element submits a property string that defines a RepositoryBase object. Path= and RepositoryType= are required attributes.
The <REPOSID> element specifies the SAS Repository Manager identifier.
The <NS> element specifies the REPOS namespace.
The <FLAGS> parameter specifies the OMI_TRUSTED_CLIENT flag (268435456).
Here is an example of the output returned by the SAS Metadata Server:
<!-- Using the ADDMETADATA method. --> <RepositoryBase Name="Test repository 2" Desc="Second test repository." Path="C:\testdat\repository2" Id="A0000001.A5KD78HW" Access="0" RepositoryType="Custom"/>
Test repository 2 is assigned the unique repository identifier A0000001.A5KD78HW.
This AddMetadata method call creates the Document object in Test repository 2:
<AddMetadata> <Metadata> <Document Name="Sales Summary" Desc="Summary of Sales Activity in the NW Region" PublicType="Document"> <Objects> <SASLibrary ObjRef="A53TPPVI.A1000001"/> </Objects> </Document> </Metadata> <Reposid>A0000001.A5KD78HW</Reposid> <NS>SAS</NS> <Flags>268435456</Flags> <Options/> </AddMetadata>
In this method call, note the following:
The <METADATA> subelement that defines the Objects association to the SASLibrary object specifies the Objref= attribute. The value in the Objref= attribute is in the form Reposid.ObjectId, where Reposid is the repository identifier of Test repository 1 and ObjectId is the SASLibrary object's 8-character identifier.
The <REPOSID> element specifies the unique repository identifier assigned to Test repository 2.
Here is an example of the output returned by the SAS Metadata Server:
<!-- Using the ADDMETADATA method. --> <Document Name="Sales Summary" Desc="Summary of Sales Activity in the NW Region" PublicType="Document" Id="A5KD78HW.A1000001"> <Objects> <SASLibrary ObjRef="A53TPPVI.A1000001"/> </Objects> </Document>
Document object A5KD78HW.A1000001 was successfully created in repository A0000001.A5KD78HW.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.