Job Ticket Parser: JSON
Note: This node works with JSON and Zip (JSON+PDF) files. The JSON file must be in UTF-8(No BOM) format.
The Job Ticket Parser: JSON Node is used to parse the information in a JSON file, and then write the parsed information as metadata. The JSON file should contain a job ticket field and a job ticket value field. The node reads the job ticket field and its corresponding job ticket values, and then updates the metadata. A mapping table is used to map the job ticket data to the metadata values.
The PDF file location is noted in the JSON file’s URL field and the PDF file is downloaded to the node using that information. If the input file is a ZIP file (JSON + PDF), the file is unzipped, and then the JSON file is processed.
Using the Job Ticket Parser: JSON Node
Add the Job Ticket Parser: JSON Node to the workflow by dragging the node’s icon onto the Workflow Builder canvas, and then double-clicking on the icon to open the Job Ticket Parser: JSON Node:
Use the window to create or import a mapping table by using a dependent UI component mapping table editor.
-
Select the Enabled checkbox so that the process will run. When unchecked, this process is ignored. Documents pass through as if the node were not present (i.e., continue along the default or positive path). Note that a disabled node will not check for logic or error conditions.
-
In the Node Name field, enter a meaningful name for the Job Ticket Parser: JSON Node.
-
In the Description field, enter a description for the Job Ticket Parser: JSON Node. This is not required, but can be helpful with multiple collection points. If the description is long, hover the mouse over the field to read its entire contents.
-
In the Measurement Unit panel, select a measurement unit radio button. Three types of measurement units are available: mm, inch, and point.
Note: By default, inch displays for all English locale systems. All other locales default to mm. Regardless of the locale, any option may be selected.
-
Click the Save button to save the changes. If Cancel is selected and the window is closed, the changes are not saved.
-
Click the Help button to access online help.
Category Panel
There are eleven job ticket parameter Categories (all noted in the image below). To display the setting values of a Category, click one of the eleven options:
-
Job Settings: Select this option to edit the job ticket parameters of the following values: Job Ticket Number, Job Ticket Name, Job Priority, Due Date, Color Mode, High Quality Color, or Job Description.
-
Basic Settings: Select Basic Settings to edit the job ticket parameter of Copies, Collate, Offset, Offset Copies, Offset Pages, Paper Catalog ID, Paper Name, Paper Source, Paper Weight, Paper Type, Paper Color, Paper User Color, Use Perforated Paper, Paper Size, Paper Unit, or Orientation.
-
Layout Settings: Select this option to edit the job ticket parameters of the following values: Imposition, or Printing Type.
-
Cover Sheet Settings: Select this option to edit the job ticket parameters of the following values: Front Cover, Front Cover Paper Name, Back Cover, or Back Cover Paper Name.
-
Finishing Settings: Select Finishing Settings to edit the job ticket parameter of Binding Position, Saddle Stitch, Trim, Staple, Punch, Folding, Perfect Binding, Perfect Binding Mode, Perfect Binding Tray, Perfect Binding Duplex, Perfect Binding Spine, Perfect Binding Cover Size, Perfect Binding Cover Weight, Ring Binding, Ring Binding Front Cover, or Ring Binding Back Cover.
-
Inter Sheet Settings: Select Inter Sheet Settings to edit the job ticket parameter of PPS Print Type, PPS Binding, PPS Paper Catalog ID, PPS Paper Name, PPS Paper Source, PPS Paper Type, PPS Paper Size, PPS Paper Weight, PPS Paper Color, PPS Paper User Color, PPS Use Perforated Paper, PPS Paper Tab Type, PPS Number of Inserts, PPS Staple, PPS Punch Setting, PPS Punch, or PPS Finish Stapling.
-
Tab Settings: Select Tab Paper Size, Tab Paper Weight, Tab Text, Tab Sheet Page Number, File Order, or Number of Tabs.
-
Image Quality Settings: Select this option to edit the job ticket parameters of the following value: Resolution.
-
Customer Information: Select this option to edit the job ticket parameters of the following values: Comment URL, Customer’s First Name, Customer’s Last Name, Customer’s Address 1, Customer’s Address 2, Customer’s City, Customer’s State, Customer’s Zip Code, Customer’s Country, Customer’s Company, Customer’s Phone, Customer’s Fax, Customer’s Email, or Job Created By.
-
Job Download: Select this option to specify which Print File Option will be used to retrieve a print file: Retrieve from Local Path, Download from URL, Retrieve Encoded base64 from Job Ticket, or Retrieve from Network share.
-
Others: Select this option to if a job contains a custom job ticket parameter that cannot be found in any of categories. Add a new field for this option using the Others Category.
Tool Bar
The Tool Bar only appears when the Inter Sheet Settings and the Others Category options are selected. The example below displays when the Others Category option is selected. The Inter Sheet Settings Tool Bar varies from this example. All available Tool Bar options are noted below:
-
Add New: Use this option to add a new entry parameter and define its conversion rule. This is only available in the Others category.
-
Delete: Use this option to delete a parameter entry. This is only available in the Others category.
-
Add New Per Page Settings: Use this option to add another set of Per Page Settings. This is only available in the Inter Sheet Settings category.
-
Delete Per Page Settings: Use this option to delete a Per Page settings entry. This is only available in the Inter Sheet Settings category.
-
Import Mapping Table: Click to open a file dialog then select a mapping table xml file to import.
-
Export Mapping Table: Use this function to save any configuration changes applied to the external mapping table’s xml file.
-
Show/Hide JT Reference: Use this option to show or hide the Job Ticket Reference Panel.
Mapping Table Panel
Use this panel to define the mapping values between the job ticket parameters and the Dispatcher Metadata. Click each category option to open the Parameter Name/Metadata Key values in the main panel.
-
Parameter Name: This column notes user-friendly names for the job ticket parameters.
-
Metadata Key: This column notes the Dispatcher Metadata Keys for each parameter name.
-
Job Ticket Paths: This column is initially blank. In it, enter the JSON Path that corresponds to each job ticket parameter.
Value Map Panel
Click on the table above to display the Metadata Key panel. Use this panel to define the conversion rules between the Metadata and Job Ticket values. Enter the values into the table. Metadata Key(s) and Job Ticket Path(s) are listed in a header. Entries may be added or deleted, as required.
-
Add New Metadata Key: Click this button to add a new Metadata Key.
-
Add New Job Ticket Path: Click this button to add a new Job Ticket Path.
-
Add New Row: Click this button to add a new value map Row.
-
Use default Job Ticket Value: If this is enabled, values in the Job Ticket remain with their corresponding Metadata Keys and are saved without any conversion being applied.
Note: The check box is only available in the case of 1-to-1 mapping. In all other conditions, this option is grayed out and cannot be enabled.
Job Ticket Reference Panel
To open a sample job ticket file, click the Open button (). Once a job ticket is selected, all possible JSON Paths are listed in the table. Drag-and-drop items in the list to the desired Job Ticket Paths column in the Mapping Table Panel.
Click the Clear button () to clean up the list.
Basic Operations of the Mapping Table
Job Ticket parameters often need to be converted into a different format, either for storage or so that a certain task may be performed on the job ticket. Conversion (or parsing) of a job ticket into metadata makes it possible for the job ticket to be read for such tasks. This node supports conversion to the JSON format.
Job Ticket File
Before starting to work with this node, a JSON job ticket file must be generated.
Note: Once the Job Ticket Parser: JSON Node has been added to Dispatcher Phoenix via the add-in manager, sample job ticket files are available for viewing. Use the path below to locate them:
\Program Files\Common Files\Konica Minolta\Phoenix\Resources\JobTicketParserJSONNode
The sample job ticket noted above contains all possible job ticket parameters. The sample job ticket can be modified so it contains the parameters required to support a file. A job ticket file can also be generated using an external, third-party application. This job ticket file may then be used as a sample file.
The Job Ticket Parser: JSON Node defines job ticket parameters using Document- and Per Page Settings-level values. For the discussion that follows, a sample job ticket is modified with simple Document-and Per Page Settings-level values. This sample job ticket is used for the discussion that follows:
{
"Ticket": {
"Name": "Sample JSON Job",
"Quantity": 5,
"Duplex": "On",
"Media":{
"Color": "Yellow"
},
"File": "file",
"Src": "C:\Temp\Testfile.pdf",
"PageException": [
{
"Range": "1-5",
"Media": {
"PaperName": "A4"
}
}
]
}
}
Configure the Mapping Table Using the Job Ticket File
-
Using a text editor, copy the sample JSON file above.
-
The Source Path(“Src”) noted in the sample job ticket (explained in the example above), needs to be changed so that the path is valid.
-
Save the sample locally as json_sample_jobticket_file.json.
-
Double-click on the Job Ticket Parser: JSON Node. The settings screen opens:
-
In the left panel, set the following values:
- Enabled checkbox: Select the checkbox so that the process will run.
- Node Name: Assign a name value to the node in the text field.
- Measurement unit: Select a radio button.
Note: If the metadata value {job:paper.unit} is included in the input Job Ticket, that value will overwrite any value selected in the Measurement Unit field.
-
In the Job Ticket Reference panel (far-right), locate the Open icon:
-
Click the icon and on the screen that opens, navigate to and select the file saved in Step 3 above_(json_sample_jobticket_file.json)_.
-
When the file opens, its contents (or XPaths) display in the Job Ticket Reference panel, as noted in the following image:
Note: When a job ticket is loaded, it needs to be mapped by dragging-and-dropping the correct values from the Job Ticket reference panel. If a value DOES NOT appear in the Job Ticket Reference panel, manually enter the value noted in the instructions in this Help file.
Mapping XPaths
Once the XPath values are available, they need to be mapped to the Parameter Name/Metadata Key values in the main panel. Do this by clicking on a value in the Job Ticket Reference panel, and then dragging the value to the corresponding Job Ticket Paths cell in the main panel.
The Category panel is available to the left and contains several options. Click a category option. The Parameter Name/Metadata Key values it contains display in the main panel.
Mapping Basic Parameter Name/Metadata Keys Values
-
In the Category panel, click the Basic Settings option. The Parameter Name, Metadata Keys, and Job Ticket Paths columns display in the main panel:
-
Values from the Job Ticket Reference panel need to be moved to the Job Tickets Paths column, to the open cell that corresponds to the value’s Parameter Name.
-
Drag-and-drop $.Ticket.Quantity to the Job Ticket Paths cell of the Copies row. Drag-and-drop $.Ticket.Media.Color to the Job Ticket Paths cell of the Paper Color row.
-
The values that were dragged-and-dropped are removed from the Job Ticket Reference panel:
-
In the Category panel, click the Layout Settings option. The Parameter Name, Metadata Keys, and Job Ticket Paths columns display in the main panel:
-
Values from the Job Ticket Reference panel need to be moved to the Job Tickets Paths column, to the open cell that corresponds to the value’s Parameter Name.
-
Drag-and-drop $.Ticket.Duplex to the Job Ticket Paths cell of the Printing Type row.
-
All values that were dragged-and-dropped from the Job Ticket Reference panel are removed from the panel.
-
Repeat the same procedure for other Category options, as required.
Mapping Inter Sheet Settings Parameter Name/Metadata Keys Values
The Inter Sheet Settings Category is used to configure Per Page Settings. Enable and then map the XPath values to activate these settings. These Inter Sheet Settings generate page-level metadata.
-
In the Category panel, click the Inter Sheet Settings option. The Page Range Path 1 field and the Parameter Name, Metadata Keys, and Job Ticket Paths columns display in the main panel:
-
From the Job Ticket Reference panel, drag-and-drop $.Ticket.PageException.Range to the Page Range Path 1 text box.
Note: Page Range Path value should start with “$.” pattern.
-
From the Job Ticket Reference panel, drag-and-drop $.Ticket.PageException[0].Media.PaperName to the Job Ticket Paths cell of the PPS Paper Name row.
Note: Change PageException[0] to PageException.
-
Once these actions are completed, the screen will appear as shown in the following image:
-
All values that were dragged-and-dropped from the Job Ticket Reference panel are removed from the panel.
-
Repeat the same procedure for other Category options, as required.
Mapping Job Download Parameter Name/Metadata Keys Values
Use the Job Download Category to enable the input source from which a job’s PDF file can be received. Four values are supported: Retrieve from Local Path, Download from URL, Retrieve Encoded base64 from Job Ticket (the PDF data in the form of embedded base64 format), and Retrieve from Network share.
Sample JSON job ticket files:
The following examples show how the code will display the PDF file for each of the job download options:
Retrieve from Local Path
“File”: “file”
“Src”: “C:\Temp\Testfile.pdf”
Note: The file type keyword “file” and the file type keyword written in the input job ticket file must match.
Download from URL
“File”: “http”
“Src”: “http://10.146.171.98/testapp8/Testfile.pdf”
Note: The file type keyword “http” and the file type keyword written in the input job ticket file must match.
Retrieve Encoded base64 from Job Ticket
“File”: “base64”
“Src”: “xxddgdfexdgfgngn…”
Note: The file type keyword “base64” and the file type keyword written in the input job ticket file must match.
Retrieve from Network share
“File”: “share”
“Src”: “\\11.12.13.14\Temp\Testfile.pdf”
Note: The file type keyword “share” and the file type keyword written in the input job ticket file must match.
-
In the Category panel, click the Job Download option. The Documentation Source and Job Ticket Path: File Type fields and the Retrieve Print File Option checkboxes display in the main panel:
-
In the Retrieve from File Option column, select the checkboxes of all four options: Retrieve from Local Path, Download from URL, Retrieve Encoded base64 from Job Ticket, and Retrieve from Network share.
-
From the Job Ticket Reference panel, drag-and-drop $.Ticket.Src to the Documentation Source field.
-
From the Job Ticket Reference panel, drag-and-drop $.Ticket.File to the Job Ticket Path: File Type field.
-
Once these actions are completed, the screen will appear as shown in the following image:
Note: If Retrieve from Network share is selected, you will need to enter network credentials. Select the Network Credentials button to access the Network Credentials window; on this window, you can enter username and appropriate password.
-
All values that were dragged-and-dropped from the Job Ticket Reference panel are removed from the panel.
-
Repeat the same procedure for other Category options, as required.
Value Map Configuration
Use this feature to configure one or more values for job ticket paths. In the example that follows, Printing Type’s XPath value is mapped. Once that is completed, the setting is then edited to specify the value map for Duplex.
-
In the Category panel, click the Layout Settings option.
-
Click on the Printing Type row to open the Value Map panel:
-
By default, a single value map row displays. Since there are two values that need to be mapped, click Add New Row to add a second value map row:
-
In the first row, select Double-Sided from the Metadata Key drop-down menu and enter On for the Job Ticket Path.
-
If a job is sent to a node that has a Duplex On value and Double-Sided printing is selected, then Double-Sided printing is output in the metadata.
-
In the second row, select One-Sided from the Metadata Key drop-down menu and enter Off for the Job Ticket Path.
-
If a job is sent to a node that has a Duplex Off value and One-Sided printing is selected, then One-Sided printing is output in the metadata.
-
When finished, click Save. To undo the changes, click Cancel.
Sample of a Job Ticket Parser: JSON Node Workflow
In the workflow above, a job ticket file (e.g., json_sample_jobticket_file.json) is moved to the Input Folder. This is sent to the Job Ticket Parser: JSON Node where the JSON job ticket is converted to job ticket metadata using the mapped values that have been created using the Job Ticket Parser: XML node’s settings. When this is completed, the data is transferred to the Metadata to File Node where it is converted to an XML document. From there, the XML document is transferred to an Output Folder.
Input Folder Node: Configure the Input Folder to collect files and forward them to the Job Ticket Parser: JSON Node.
Job Ticket Parser: JSON Node: The purpose and instructions for setting up this node are noted in the discussion that precedes this section.
Metadata to File Node: This node extracts the configured metadata, saves it as an XML file, and then sends the file to the next node in the workflow. Follow these steps to configure the Metadata to File Node:
-
Open the Metadata to File Node by double-clicking the node’s icon.
-
Make sure the Enabled checkbox is selected.
-
In the Output Settings panel, select the Output the original file checkbox, and then select XML (*.xml) from the Metadata file format drop-down.
-
In the Metadata file extension panel, select the Output File extension plus metadata file extension radio button.
-
In the Select metadata to extract panel, select the Job checkbox.
-
Click Save to apply the changes.
Output Folder Node: Once all workflow processes have been successfully applied, a job is routed to the folder path configured in the Output Folder Node.
The output metadata that follows is based upon the settings noted in the previous sections of this document:
<meta group="job" name="copy">
<document>5</document>
</meta>
<meta group="job" name="file.URL">
<document>C:\Temp\Testfile.pdf</document>
</meta>
<meta group="job" name="file.type">
<document>file</document>
</meta>
<meta group="job" name="paper.color">
<document>Yellow</document>
</meta>
<meta group="job" name="paper.name">
<page number="1">A4</page>
<page number="2">A4</page>
<page number="3">A4</page>
<page number="4">A4</page>
<page number="5">A4</page>
</meta>
<meta group="job" name="printtype">
<document>Double-Sided</document>
</meta>
<meta group="job" name="ticket.file">
<document>C:\ProgramData\Konica Minolta\conopsd\var\blox\node_4\tmp.d\170711124550.049_000001json_sample_job_ticket_file.json</document>
</meta>
Limitations
Important!
- The ZIP file that can be input to this node should contain PDF and JSON files only. When folder containing PDF and JSON files is zipped and given as input, this type of ZIP file is not supported.