AML API
Copy
It is possible to use standard AML to operate on File Representations.
AML to Add a File Representation to a File.
<AML>
<Item type="fr_Representation" action="add">
<source_id>{source file ID}</source_id>
<representation_type_id>
<Item type="fr_RepresentationType" action="get">
<name>XML</name>
</Item>
</representation_type_id>
<Relationships>
<Item type="fr_RepresentationFile" action="add">
<kind>js</kind>
<related_id>{ID of representation JS file}</related_id>
</Item>
<Item type="fr_RepresentationFile" action="add">
<kind>html</kind>
<related_id>{ID of representation HTML file}<</related_id>
</Item>
</Relationships>
</Item>
</AML>
AML to Get a File Representation to a File.
<AML>
<Item type="fr_Representation" action="get" select="id">
<source_id>{source file ID}</source_id>
<representation_type_id>
<Item type="fr_RepresentationType" action="get">
<name>XML</name>
</Item>
</representation_type_id>
<Relationships>
<Item type="fr_RepresentationFile" select="related_id(id, filename)">
</Item>
</Relationships>
</Item>
</AML>
AML to Get a File Representation to a File.
<AML>
<Item type="fr_Representation" action="get" select="id">
<source_id>{source file ID}</source_id>
<representation_type_id>
<Item type="fr_RepresentationType" action="get">
<name>XML</name>
</Item>
</representation_type_id>
<Relationships>
<Item type="fr_RepresentationFile" select="related_id(id, filename)">
</Item>
</Relationships>
</Item>
</AML>
AML to Delete a File Representation to a File.
The clearest way to delete representations is to first get the representations, and then delete them in a separate action.
<AML>
<Item type="fr_Representation" action="get" select="id">
<source_id>[source file ID]</source_id>
<representation_type_id>
<Item type="fr_RepresentationType" action="get">
<name>XML</name>
</Item>
</representation_type_id>
</Item>
</AML>
<AML>
<Item type="fr_Representation" action="delete" idlist="%idlist%"></Item>
</AML>