CIP4 Tools The CIP4 JDF APIs –Java –C++ The CIP4 JDF Editor CheckJDF Elk.

Post on 23-Dec-2015

251 views 1 download

transcript

CIP4 Tools

• The CIP4 JDF APIs

– Java

– C++

• The CIP4 JDF Editor

• CheckJDF

• Elk

Reasons for an open source JDF API

• JDF uses XML as a Database, not as a Markup Language

– lots of ID-IDREF linking

– Inheritance by nesting

– Enhanced Validation in addition to XML Schema

• Use of the same code base simplifies interoperability between vendors

– Compile-time code validation through type safe classes instead of

generic string based calls

– Same spec interpretation through a common high level code base

• Providing an open source API reduces barriers to adapting a JDF workflow

Technical Requirements

• Platform independent

– Mapping of new C++ interfaces to preexisting

JAVA interfaces

• thread safety

– Not thread-safe other than standard xerces

• Support any character encodings

– Unicode inside

Xerces

• Open source validating XML parser

• Freely usable in commercial code

• C++ and Java version exist

• Validating and non-validating parsers

– Schema

• based on SUN and IBM XML parsers

• Use version

– 2.2 or higher in C++

– 2.4 in JAVA

• download site:xml.apache.org

NameSpaces in the JDFLib (DOM Standard)

• Namespaces (DOM Lvl1/Lvl2) are supported!

• Prefix != NameSpaceURI:

• Example: xmlns:HDM=“www.heidelberg.com” Prefix Handling: GetElement(“HDM:MoonPhase”);

XMLNS Handling:

GetElement(“MoonPhase”,”www.heidelberg.com”);

Mixed XMLNS / Prefix handling is not supported

GetElement(“MoonPhase”,”HDM”);

GetElement(“HDM:MoonPhase”,”www.heidelberg.com”);

Mixing DOM lvl 1 and 2 may be hazardous to your code:

<JDF:JDF ID=“i1” JDF:ID=“i2”>

High Level Design Features

• Xerces provides both SAX and DOM Parsers

• JDF requires an object tree in memory in order to navigate links / references

• ==> Use the DOM implementation as base

• (C++) No pointers, only lightweight DOM wrapper classes.

• (C++) Standard Template Library

– Strings

– Vectors

– Maps

• (C++) gracefully handles Null elements

– nullElement.GetAttribute(“foo”) returns “”;

• Java implementation relies on standard Java interfaces

Type-Safe Code Generator • Java and C++ are generated• Schema still has limits:

– requires element ordering or unlimited Cardinality

– nesting support not available

– API validation is always stronger than Schema validation

• Based on standard schema with additional meta-data (annotations)

• Naming Conventions based on the JDF Specification

Schema Generator Automatic Classes

JDF Parser Class Layers

DOM_Element: Xerces

KElement: STL String wrapper

JDFElement: First JDF specific layer

JDFResource: Resource Abstraction layer

JDFAutoRunList: Automatic Schema-GeneratedRunList Abstraction layer JDFRunList: Hand-CodedRunList Abstraction layer

Additional Open Source Utilities (C++ Only – Included in Java.xxx)

• Not directly parser related

• Simplify JDF implementation

– Mime Handling

– HTTP Message Client interface

• SSL Support

– PNG Support

• PNG GreyScale Separations

– File IO abstraction

CIP4 JDF Editor

• Java based tool to display JDF and JMF

– Validating

– Based on JDFLib-J

• Mac and Win version

• Pros

– very nice Process view

– free

• Future

– improved Process view

– CheckJDF validation

Screenshot JDF editor

JDF Validators

• check complete context, links

• CheckJDF

• future: CIP4 JDF Editor

CheckJDF

• CIP4 DOS tool to check against

– schema (Xerces parser, XML limitations)

– JDF rules (more strict)

• Correct links between resources– Name mangling

– Unlinked Resources

– Links that reference Nirvana

• Correct Partitioning

• Misspelt separation names

• Pros

– check if file is valid or not (or nearly valid)

• Cons

– output is difficult to read in case of errors

• also available as service on CIP4 website

CheckJDF output

Output of the XERCES schema validation follows:

error Datatype error: Type:InvalidDatatypeValueException, Message:Value 'Ready' is not in enumeration .

error ID attribute 'RNL00O_D' was referenced but never declared

**********************************************************

Output of checkJDF proper follows:

dangling ResLink:

<RunListLink xmlns="http://www.CIP4.org/JDFSchema_1_1" ProcessUsage="Document" Usage="Input"

rRef="RNL00O_D"/>

Warning: Separation Name not in ColorPool: Zwart

!!! InValid Element: /JDF/ResourcePool[1]/ColorPool[1] ColorPool !!!

Invalid Attribute: Status = Ready

!!! InValid Element: /JDF/ResourcePool[1]/ColorantControl[1] ColorantControl !!!

Invalid Element - (potential reference to invalid element): ColorPoolRef

!!! InValid Element: /JDF/JDF[1]/JDF[1]/JDF[3]/ResourceLinkPool[1]/RunListLink[1] !!!

ElkA JDF Device Frameworkbased on CIP4’s JDFLib-J

•Claes BuckwalterCCMT, Linköping University, Sweden

•http://media.itn.liu.se

Goal

• To design and implement an application framework, in Java, that provides the basic services needed by a JDF device and that allows pluggable JDF device implementations.

The Elk Framework

• Package name: org.cip4.elk

• Interfaces and abstract classes that specify the services needed by a Device:

– Incoming/outgoing message dispatchers

– JMF processors/handlers

– JMF servlet

– Queue

– Process

– Subscription manager

– Factory for JDF elements

Incoming JMF Dispatcher

Incoming JMF Dispatcher

QueueStatusProcessor

QueueStatusProcessor

Outgoing JMF Dispatcher

Outgoing JMF Dispatcher

SubmitQueueEntryProcessor

SubmitQueueEntryProcessor

EventsProcessor

EventsProcessor

Other JMFProcessors

Other JMFProcessors

KnownMessagesProcessor

KnownMessagesProcessor

StatusProcessor

StatusProcessor

ProcessProcessQueueQueue Subscription Manager

Subscription Manager

Events

Poll for new job

SignalAcknowledge

Signal

JMFCommand/Query/Signal

Asynchronous

Synchronous

JMF Acknowledge/SignalJDF

Events

Dispatches subscription queries

Registers subscriptions

Reference Implementation

• Package name: org.cip4.elk.impl• Concrete implementations of the classes defined in

the Elk Framework:– Dispatching JMF servlet

– Synchronous message dispatchers

– 10 JMF processors

– Memory-based subscription manager

– Memory-based queue

– Approval process

– MIME package reader

– Tool for accessing URLs (http, https, file, ftp)

Approval DeviceApproval Device

SubscribingIncoming

JMFDispatcher

SubscribingIncoming

JMFDispatcher

SynchronousHttpOutgoing

JMFDispatcher

SynchronousHttpOutgoing

JMFDispatcher

ApprovalProcessApprovalProcess

MemoryQueueMemoryQueue

SimpleSubscriptionManager

SimpleSubscriptionManager

DispatchingJMFServlet

DispatchingJMFServlet

KnownMessagesJMFProcessorKnownMessagesJMFProcessor

QueueStatusJMFProcessorQueueStatusJMFProcessor

HoldQueueJMFProcessorHoldQueueJMFProcessor

SubmitQueueEntryJMFProcessorSubmitQueueEntryJMFProcessor

OpenQueueJMFProcessorOpenQueueJMFProcessor

CloseQueueJMFProcessorCloseQueueJMFProcessor

ResumeQueueJMFProcessorResumeQueueJMFProcessor

StatusJMFProcessorStatusJMFProcessor

EventsJMFProcessorEventsJMFProcessor

StopPersChannelJMFProcessorStopPersChannelJMFProcessor

DeviceConfigDeviceConfig

FileUtilFileUtil

ElkStartupServletElkStartupServlet

Test Tools

• Command-line client for sending JMF, JDF and MIME

– Proxy support

– HTTPS support

• Servlet for testing MIME-sending clientshttp://cog.itn.liu.se:8080/elk/mime

To be done...

• The Elk Framework

– Refactor JMFProcessor into 3 interfaces

• SignalProcessor

• QueryProcessor

• CommandProcessor

– More inter-device events

– Add/refactor as reference implementation evolves

• Reference implementation

– Add support for all (38) JMF message types

– Asynchronous messaging

– Full subscription/persistent channel support

– Receive and submit MIME

– Full queue support

– Better process implementation

Release 0.5

• A binary and source release will be posted on the project web site this week

http://cog.itn.liu.se/~clabu/files/elk/

Live Demo

• http://cog.itn.liu.se:8080/elk/jmfSend a KnownMessages query to it

• http://cog.itn.liu.se:8080/elk/mimeSend MIME packages to it