File Representations

Starting in Aras Innovator 11.0 SP11, it is possible to represent files with the contents of another file, which is available to the end user. The most common use cases for this feature are:

  • Providing a web-capable image for another, less available file type. For example, a CGM file cannot be displayed by browsers, but could be represented by an SVG file.
  • Providing multiple resolutions of an image. For example, a high-resolution JPEG could be used as the main image on an item. This image then could have multiple representations at different resolutions, which could be used as a thumbnail or a mobile view.

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 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>

File Representations make use of the new XProperty model to distinguish between different representations of the same RepresentationType. For example, a resolution characteristic may be defined to allow different values for different representations within a RepresentationType.

Note that there is a known issue that modifications to the RepresentationType can take a significant amount of server processing (see the Release Notes for details on IR-053121). This will cause the server to appear frozen to end users.

We recommend performing any modifications to characteristics as an offline action. Additionally, the database should be backed up prior to modifying the characteristics.