Place collections with transformations (censhare Client)
The placement of collections in the InDesign layout and the Layout Editor is processed on the server.
Introduction
Matching Rules
The placement rules do not have to be set in the Client preferences but directly at the transformation command. There are two options. It is possible to configure these rules directly in the command itself and also in the XSLT transformation, with the advantage that the rules must no longer be specified separately for the client and server.
Transformation must be provided
The transformation is controlled by an asset of the type Module/transformation. Such an asset has to be available and configured correctly. Furthermore, an XLST must be provided for this module. This is the default case and for this purpose the conversion "placing collections" exists.
Example
The placement of products in a catalogue. A product is a collection which includes additional assets for that product. In the catalogue, a layout template is prepared accordingly so that the overall structure of a product gets predefined. The placement is defined by a layout group and within this group, there are different frames for the individual assets. Each frame can now have its own transformation, which are regulated by filters that determine what transformation is applied on an individual asset. The assets placed in each frame is controlled by the type of the frame, placement categories and priorities.
When placing a product on a layout (InDesign or Layout Editor) it automatically places the appropriate assets in the right frames followed by a transformation. For example, XML is converted on the fly into an ICML text.
Configuration
Matching Rules
The placement rules can be defined in the XSLT or in the command. The configuration in the XSLT overrides the configuration in the command.
Configuration of the XSLT:
In the XSLT of the transformation asset, the rules are defined:
<matching-rules>
<rule type="attribute" key="@domain" hierarchical="true"/>
<rule type="attribute" key="@domain2" hierarchical="true"/>
<rule type="feature" key="censhare:output-channel"/>
<rule type="placement-category"/>
<rule type="attribute" key="@language"/>
<!--rule type="min-dpi"/-->
</matching-rules>
Configuration for the module: App/Modules/Transformation/layout-group/layout-group-place
<!-- Configuration can alternatively be passed within "config" slot, e.g. from an XSL stylesheet. -->
<!--
<config source-asset-id="" target-asset-id="" include-alternatives="true"">
<matching-rules domain="root.*" domain2="root.*">
<rule type="attribute" key="@domain" hierarchical="true"/>
<rule type="attribute" key="@domain2" hierarchical="true"/>
<rule type="feature" key="censhare:output-channel" target-match-all="false"/>
<rule type="placement-category"/>
<rule type="attribute" key="@language"/>
<rule type="min-dpi"/>
</matching-rules>
</config>
-->
Transformation
The transformation of collections works using the module Module/transformation/layout_group.
This transformation only works for layout groups and not for individual layout frames.
A source asset filter (XPath) defines for which assets a transformation is valid:
:starts-with(asset/@type, 'product.') or starts-with(asset/@type, 'group.')
The filter allows products or groups.
Transformation command in XSLT
The transformation itself calls a JAVA scriplet directly. This is done by the XSL function cs:command. For this purpose the command transformation.layout_group.layout-group-place is always utilized. By this command, the actual transformation in the Java code on the server is performed.
An intervention via customizing of the Java scriplet is not yet intended.
As these rules are now unknown to the Client, it cannot perform the asset filtering. Such filtering must be stored in a separate XSLT: