The following example shows how to issue a DeleteMetadata request
that submits a user-defined template using the legacy template form.
The specified Group has four objects associated through the Members
association: a PhysicalTable object named “My Table,”
a PhysicalTable object named “Their Table,” a TextStore
object named “My Notes,” and a TextStore object named
“Their Notes.” The request specifies to delete the Group
object and all objects associated to it through the Members association.
The request is formatted for the INMETADATA parameter of the DoRequest
method:
<DeleteMetadata>
<Metadata>
<Group Id="A5TJRDIT.A1000004" Name="My Group"/>
</Metadata>
<Ns>SAS</Ns>
<!-- OMI_TRUSTED_CLIENT, OMI_TEMPLATE, + OMI_RETURN_LIST -->
<Flags>268436484</Flags>
<Options>
<Templates>
<Group>
<Members/>
</Group>
</Templates>
</Options>
</DeleteMetadata>
Here is sample output
from the request, reformatted for readability:
<DeleteMetadata>
<Metadata>
<Group Id="A5TJRDIT.A1000004"/>
<PhysicalTable Id="A5TJRDIT.B20000TF"/>
<PhysicalTable Id="A5TJRDIT.B20000TG"/>
<TextStore Id="A5TJRDIT.AE0001D9"/>
<TextStore Id="A5TJRDIT.AE0001DA"/>
</Metadata>
<Ns>SAS</Ns>
<Flags>268436484</Flags>
<Options>
<Templates>
<Group>
<Members/>
</Group>
</Templates>
</Options>
</DeleteMetadata>
The following example
shows how to issue a DeleteMetadata request that submits a user-defined
template using the new template form. This request specifies to delete
the Group object described in the previous example. However, in this
request, we specify to delete the Group object, and its associated
My Table and My Notes objects, leaving the other two objects intact.
<DeleteMetadata>
<Metadata>
<Group Id="A5TJRDIT.A1000004" TemplateName="test"/>
</Metadata>
<Ns>SAS</Ns>
<!-- OMI_TRUSTED_CLIENT, OMI_TEMPLATE, + OMI_RETURN_LIST -->
<Flags>268436484</Flags>
<Options>
<Templates>
<Template TemplateName="test">
<Group>
<Members>
<PhysicalTable match="@Name='My Table'" TemplateExpand="Yes"/>
<PhysicalTable TemplateExpand="No"/>
<TextStore match="@Name='My Notes'" TemplateExpand="Yes"/>
<TextStore TemplateExpand="No"/>
</Members>
</Group>
</Template>
</Templates>
</Options>
</DeleteMetadata>
Here is sample output
from the request, reformatted for readability:
<DeleteMetadata>
<Metadata>
<Group Id="A5TJRDIT.A1000004"/>
<PhysicalTable Id="A5TJRDIT.B20000TF"/>
<TextStore Id="A5TJRDIT.AE0001D9"/>
</Metadata>
<Ns>SAS</Ns>
<Flags>268436484</Flags>
<Options>
<Templates>
<Template TemplateName="test">
<Group>
<Members>
<PhysicalTable match="@Name='My Table'" TemplateExpand="Yes"/>
<PhysicalTable TemplateExpand="No"/>
<TextStore match="@Name='My Notes'" TemplateExpand="Yes"/>
<TextStore TemplateExpand="No"/>
</Members>
</Group>
</Template>
</Templates>
</Options>
</DeleteMetadata>
The Match and TemplateExpand
attributes are used to filter the associated objects that are deleted.
TextStore and PhysicalTable objects that do not meet the match criteria
are ignored.