The placement of assets from collections is not conducted by the Client but instead on the server. The rules for this purpose are not known to the Client. For this reason, censhare does not filter assets in the Editor for InDesign Documents of the censhare Client.


Introduction

The capability to filter child assets is outsourced to an XSLT transformation which makes it possible to conduct user-definable filtering.

All children of an asset are displayed when you expand the view or update it and a transformation is defined. The transformation can filter the child assets according to the specified criteria.
When displaying a sub-asset, it tests whether a transformation with the output format asset-expand-query-result and the MIME type XML text exists, its source asset filter fits the asset and the target asset filter is applicable to the document asset.
If such a transformation is found, it is executed. If more than one is found, then the first one will be used, however, this should be avoided. If none is found, all child assets are shown.

Example

For example, in the Editor for InDesign Documents this feature allows you to hide assets that are not placed in a layout. For example, a German layout displays only the German text assets. Texts of different languages ​​can be hidden with this function. Of course, this also applies to filter Domain1 and Domain2, any placement categories or other features.

For example, if the Editor for InDesign Documents is used in a Web2Print environment, higher usability can be achieved by filtering.

Configuration

The transformation must deliver the (filtered) children of the asset in the following format:

<data>
  <assets>
    <asset id="10000" ...>
    <asset id="10001" ...>
  </assets>
</data>
XML


By clicking Refresh, the same procedure as the first action is conducted for all expanded nodes.

To filter child assets in the Editor for InDesign Documents in the unfold action or for updating the action, you need an XSLT transformation with appropriate functionality. For this purpose, an asset of the type 'Module' is applied.
The following information must be entered in the metadata of the transformation asset:
Type= 'Module · Transformation'.
Flags · Resource(Transformation) -> Target formats (+):
'Key' = "asset-expand-query-result"
MIME Type = "XML-Text"
The XSLT is assigned as master file.

Sample XSLT
This example filters out assets which do not fit to the layout asset due to their language:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

  <xsl:output omit-xml-declaration="no"/>

  <xsl:param name="transform"/>
 
  <xsl:template match="/">
    <results>
      <assets>
        <xsl:apply-templates>
         <xsl:with-param name="lang" select="asset/@language"/>
        </xsl:apply-templates>
      </assets>
    </results>
  </xsl:template>
  
  <xsl:template match="child_asset_rel">
    <xsl:param name="lang" />
    <xsl:variable name="childAssetID" select="@child_asset"/>
    <xsl:variable name="assetVar" select="cs:get-asset($childAssetID, 0, 0)"/>
    <xsl:variable name="childALang" select="$assetVar/@language"/>
    
    <xsl:if test="$lang = $childALang">
      <xsl:copy-of select="$assetVar"/>
    </xsl:if>
   
  </xsl:template>

</xsl:stylesheet>
XML