Loading

File structure

The mapping file is used for extracting the job characteristics from the JDF ticket and creating the PRISMAdirect ticket with it. The structure of the file is quite simple; it consists in a list of mapping nodes. For each ticket item in the default PRISMAdirect ticket there is a mapping node Sample from the default JDF-to-PD mapping file:

<? xml version = "1.0" encoding="utf-8"?>

<jc:Mappings SchemaVersion="1.0" AttachmentPath="/jdf:JDF/jdf:ResourcePool/jdf:FileSpec/@URL" xsi:schemaLocation="oce-com-pa-jc GrayBoxMappings.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jc="oce-com-pa-jc">

<jc:TextMapping Prefix="" Name="FirstName" Optional="false" Separator="">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool/…/@FirstName"/>

</jc:TextMapping>

...

<jc:NumberMapping Name="Copies" Optional="false">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourceLinkPool/…/@Amount"/>

</jc:NumberMapping>

...

<jc:EnumMapping Name="DocumentMediaColor" Optional="true">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool…/@MediaColorName"/>

<jc:EnumValueMapping JdfValue="White" AccessEnumValue="White"/>

<jc:EnumValueMapping JdfValue="Blue" AccessEnumValue="Blue"/>

<jc:EnumValueMapping JdfValue="Red" AccessEnumValue="Red"/>

<jc:EnumValueMapping JdfValue="Green" AccessEnumValue="Green"/>

<jc:EnumValueMapping JdfValue="Yellow" AccessEnumValue="Yellow"/>

<jc:EnumValueMapping JdfValue="Gray" AccessEnumValue="Gray"/>

<jc:EnumValueMapping JdfValue="Orange" AccessEnumValue="Orange"/>

<jc:EnumValueMapping JdfValue="Pink" AccessEnumValue="Pink"/> <jc:EnumValueMapping JdfValue="Black" AccessEnumValue="Black"/>

</jc:EnumMapping>

...

<jc:ConditionalEnumMapping Name="CoverPlace" Optional="false">

<jc:ConditionalEnumValue AccessEnumValue="None">

<jc:StringCondition JdfField="/jdf:JDF/jdf:ResourcePool/…/@FrontCoatings" ExpectedValue="None"/>

<jc:StringCondition JdfField="/jdf:JDF/jdf:ResourcePool/…/@BackCoatings" ExpectedValue="None"/>

</jc:ConditionalEnumV

<jc:ConditionalEnumValue AccessEnumValue="Front">

<jc:StringCondition JdfField="/jdf:JDF/jdf:ResourcePool/…/@FrontCoatings" ExpectedValue="Coated"/>

<jc:StringCondition JdfField="/jdf:JDF/jdf:ResourcePool/…/@BackCoatings" ExpectedValue="None"/>

</jc:ConditionalEnumValue >

<jc:ConditionalEnumValue AccessEnumValue="Back">

<jc:StringCondition JdfField="/jdf:JDF/jdf:ResourcePool/…/@FrontCoatings" ExpectedValue="None"/>

<jc:StringCondition JdfField="/jdf:JDF/jdf:ResourcePool/…/@BackCoatings" ExpectedValue="Coated"/>

</jc:ConditionalEnumValue>

</jc:ConditionalEnumMapping>

...

</jc:Mappings>

Depending on the type of the ticket item in PRISMAdirect there are several types of mapping nodes:

  • NumberMapping

  • DateMapping

  • TextMapping

  • EnumMapping

  • ConditionalEnumMappin

  • BooleanMapping

  • TimeSpanMapping

  • MediaMapping (MediaEnumMapping, MediaConditionalEnumMapping)

Common fields

There are some common fields for all the mapping nodes independent of the type. Let’s take a random example of a mapping node:

<jc:TextMapping Prefix="" Name="FirstName" Optional="false" Separator="">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool/…/@FirstName"/>

</jc:TextMapping>

XPath="/jdf:JDF/…/@FirstName" – This is an essential attribute in a mapping node. It  specifies the location in the JDF structure where the value to be set in the PRISMAdirect ticket will be taken from. It uses an XPath expression to point to the desired location in the xml structure of the JDF.

It is not in the same place in each type of node, but every mapping node must contain at least one XPath expression.

Name="FirstName" – The attribute specifies the name of the ticket item in PRISMAdirect whose value will be changed with the one obtained from the JDF.

Optional="[true/false]" – The attribute is related to the interpretation of the mapping  node. It specifies if applying the mapping is mandatory or not.

NumberMapping

<jc:NumberMapping Name="Copies" Optional="false">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourceLinkPool/…/@Amount"/>

</jc:NumberMapping>

The NumberMapping node is a simple node. It contains only the common attributes defined above.

DateMapping

<jc:DateMapping Name="Date" Optional="true">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool/…/@LastEnd"/>

</jc:DateMapping>

The DateMapping node is similar to the number mapping. It contains only the common attributes defined above.

TextMapping

<jc:TextMapping Prefix="Address:" Name="Location" Optional="false" Separator=",">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool/…/jdf:Address/@Street"/>

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool/…/jdf:Address/@City"/>

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool/…/jdf:Address/@PostalCode"/>

</jc:TextMapping>

The TextMapping can contain more than one XPath expression.

Prefix="Address:" - The attribute specifies a prefix to be placed in the PRISMAdirect ticket item in front of the value retrieved from JDF.

Separator="," – The attribute specifies a character or a string to be used as separator between multiple values taken from the JDF.

EnumMapping

<jc:EnumMapping Name="DocumentMediaColor" Optional="true">

<jc:JdfField XPath="/jdf:JDF/jdf:ResourcePool/…/@MediaColorName"/>

<jc:EnumValueMapping JdfValue="White" AccessEnumValue="White"/>

<jc:EnumValueMapping JdfValue="Blue" AccessEnumValue="Blue"/>

<jc:EnumValueMapping JdfValue="Red" AccessEnumValue="Red"/>

<jc:EnumValueMapping JdfValue="Green" AccessEnumValue="Green"/>

<jc:EnumValueMapping JdfValue="Yellow"AccessEnumValue="Yellow"/>

<jc:EnumValueMapping JdfValue="Gray"AccessEnumValue="Gray"/>

<jc:EnumValueMapping JdfValue="Orange"AccessEnumValue="Orange"/>

<jc:EnumValueMapping JdfValue="Pink"AccessEnumValue="Pink"/>

<jc:EnumValueMapping JdfValue="Black"AccessEnumValue="Black"/>

</jc:EnumMapping>

This mapping type is usually used for the PRISMAdirect ticket items of type choice which have a list of options defined.

Aside from the common attributes the EnumMapping contains a list of EnumValueMapping nodes each for one of the options of the ticket item in the PRISMAdirect ticket.

JdfValue="White" - The attribute refers to the value found in the JDF ticket at the specified XPath.

AccessEnumValue="White" - The attribute represents the corresponding option in the ticket item in PRISMAdirect.

ConditionalEnumMapping

<jc:ConditionalEnumMapping Name="CoverPlace"Optional="false">

<jc:ConditionalEnumValue AccessEnumValue="None">

<jc:StringCondition JdfField="/jdf:JDF/…/jdf:Media/@FrontCoatings"ExpectedValue="None"/>

<jc:StringCondition JdfField="/jdf:JDF/…/jdf:Media/@BackCoatings"ExpectedValue="None"/>

</jc:ConditionalEnu

<jc:ConditionalEnumValue AccessEnumValue="Front">

<jc:StringCondition JdfField="/jdf:JDF/…/jdf:Media/@FrontCoatings"ExpectedValue="Coated"/>

<jc:StringCondition JdfField="/jdf:JDF/…/jdf:Media/@BackCoatings"ExpectedValue="None"/>

</jc:ConditionalEn

<jc:ConditionalEnumValue AccessEnumValue="Back"

<jc:StringCondition JdfField="/jdf:JDF/…/jdf:Media/@FrontCoatings"ExpectedValue="None"/>

<jc:StringCondition JdfField="/jdf:JDF/…/jdf:Media/@BackCoatings"ExpectedValue="Coated"/>

</jc:ConditionalEnumValue>

<jc:ConditionalEnumValue AccessEnumValue="FrontAndBack">

<jc:StringConditionJdfField="/jdf:JDF/…/jdf:Media/@FrontCoatings"ExpectedValue="Coated"/>

<jc:StringCondition JdfField="/jdf:JDF/…/jdf:Media/@BackCoatings"ExpectedValue="Coated"/>

</jc:ConditionalEnumValue>

</jc:ConditionalEnumMapping>

This mapping type is usually used for the PRISMAdirect ticket items of type choice which have a list of options defined.

The mapping node contains a list of ConditionalEnumValue nodes with an attribute:

AccessEnumValue="None" – The attribute refers to one of the options of the choice ticket item in the PRISMAdirect ticket.

It is recommended that the mapping contains one ConditionalEnumValue node for each option in the choice ticket item specified in the Name. But this is not mandatory.

Each ConditionalEnumValue element contains one or more conditions represented by StringCondition or NumericJdfFieldCondition or NumericComparisonCondition nodes (see Conditions below).

BooleanMapping

<jc:BooleanMapping Name="Collate" Optional="true" EvaluateTo="false">

<jc:StringCondition JdfField="/jdf:JDF/…/@Collate"ExpectedValue="None"/>

<jc:StringCondition JdfField="/jdf:JDF/@Types"ContainedValue="DigitalPrinting"/>

</jc:BooleanMapping>

This mapping type is used for PRISMAdirect ticket items that have a true/false value. The node can contain one or more condition nodes (see Conditions below).

Additionally it contains a specific attribute:

EvaluateTo="true/false" – The attribute specifies the value of the ticket item as a result  of the evaluation of the contained condition nodes.

TimeSpanMapping

<jc:TimeSpanMapping Name="FinishingTime" Optional="true">

<jc:TimeSpan Start="/jdf:JDF/jdf:AuditPool/…/@Start" End="/jdf:JDF/jdf:AuditPool/…/@End"/>

</jc:TimeSpanMapping>

This type of mapping is used for ticket items that hold a numeric value representing a time span. It contains a TimeSpan node with two attributes: 

Start="/jdf:JDF/jdf:AuditPool/…/@Start" – The attribute contains an XPath that  should point to a date value in the JDF ticket. This is the start date for the time span.

End="/jdf:JDF/jdf:AuditPool/…/@End" - The attribute contains an XPath that should  point to a date value in the JDF ticket. This is the end date for the time span.

MediaMapping

Two types of nodes are used for mapping the Media attributes. Both are specific nodes and cannot be used for ticket items other than the ones related to Media: MediaEnumMapping and MediaConditionalEnumMapping.

Examples:

<jc:MediaEnumMapping Name="CoverMediaColor" Type="Cover" MediaPartitioner="/jdf:JDF/jdf:ResourcePool/jdf:DigitalPrintingParams" Optional="true">

<jc:JdfField XPath="/jdf:JDF/…/jdf:Media[@ID='${MediaID}']/@MediaColorName"/>

<jc:EnumValueMapping JdfValue="White" AccessEnumValue="White"/>

<jc:EnumValueMapping JdfValue="Blue" AccessEnumValue="Blue"/>

...

<jc:EnumValueMapping JdfValue="Black" AccessEnumValue="Black"/>

</jc:MediaEnumMapping>

<jc:MediaConditionalEnumMapping Name="DocumentMediaSize" Type="Content" MediaPartitioner="/jdf:JDF/jdf:ResourcePool/jdf:DigitalPrintingParams" Optional="true">

<jc:ConditionalEnumValue AccessEnumValue="A0">

<jc:NumericCondition ExpectedValue="2383.9344"JdfField="/jdf:JDF/…/jdf:Media[@ID='${MediaID}']/@Dimension[0]"/>

<jc:NumericCondition ExpectedValue="3370.392"JdfField="/jdf:JDF/…/jdf:Media[@ID='${MediaID}']/@Dimension[1]"/>

</jc:ConditionalEnumValue>

<jc:ConditionalEnumValue AccessEnumValue="A0">

<jc:NumericCondition ExpectedValue="2383.9344"JdfField="/jdf:JDF/…/jdf:Media[@ID='${MediaID}']/@Dimension[1]"/>

<jc:NumericCondition ExpectedValue="3370.392"JdfField="/jdf:JDF/…/jdf:Media[@ID='${MediaID}']/@Dimension[0]"/>

</jc:ConditionalEnumValue>

...

</jc:MediaConditionalEnumMapping>

Both mapping structures build on existing mapping types with some additional attributes:

Type="Cover/Content" – A JDF ticket can defined multiple Media nodes, some to be used  for the Content of the document to be printed, some for the Cover. The Type attribute specifies if the Media referred by the JdfField node should be the Media used for Cover or Content.

MediaPartitioner="/jdf:JDF/jdf:ResourcePool/jdf:DigitalPrintingParams" - A document can be printed on multiple types of Media. This attribute points to the location in the JDF ticket that specifies which media is used for which parts of the document.

The MediaEnumMapping builds on top of the EnumMapping type and has the same structure  (see EnumMapping above).

The MediaConditionalEnumMapping builds on top of the ConditionalEnumMapping type  and has the same structure (see ConditionalEnumMapping above).

Conditions

Additionally every type of mapping node can contain one or more condition nodes. The conditions can be: StringCondition, NumericJdfFieldCondition or  NumericComparisonCondition.

StringCondition and NumericJdfFieldCondition both have a similar structure:

JdfField="/jdf:JDF/…/jdf:Media/@FrontCoatings" - The attribute has the same  meaning as the one defined in the Common Fields section. It refers to a location in the JDF ticket where a value should be taken from.

ExpectedValue="None" - The attribute refers to the expected value to be found in the JDF   at the XPath specified by the JdfField attribute.

ContainedValue="Front" – The attribute can be used instead of the ExpectedValue  attribute. In this case it refers to the value that should be contained in the JDF at the XPath specified by the JdfField attribute.

Both StringCondition and NumericJdfFieldCondition nodes can be used without an  ExpectedValue or a ContainedValue attribute.

<jc:NumericComparisonCondition Value_1="/jdf:JDF/…/@Dimension[0]"Value_2="/jdf:JDF/…/@Dimension[1]" Comparison="LessThan"/>

The condition defines two values to be compared and the expected relation between them.

Value_1="/jdf:JDF/…/@Dimension[0]"

Value_2="/jdf:JDF/…/@Dimension[1]" – The attributes define the two values that will be  compared. The XPath must point to a numeric value in the JDF ticket.

Comparison="LessThan" - The attribute specifies the expected relation between the two  values. The possible values for this attribute are limited to: LessThan, GreaterThan and Equal.