Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by CIP4 xJdfLib 0.4 -->
<xjdf:XJDF xmlns:xjdf="http://www.CIP4.org/JDFSchema_2_0" ID="XJDF_CCC45NIM" 
    DescriptiveName="My lovely Poster" JobID="FA-SIG-123456"
    Category="Web2Print" Version="2.0">
    <xjdf:ProductList>
        <xjdf:Product DescriptiveName="FA-PRD-123456" Amount="1500"
            ProductType="Poster" ProductTypeDetails="PTD Value">
            <xjdf:Intent Name="MediaIntent">
                <xjdf:MediaIntent MediaQuality="IPM_90"/>
            </xjdf:Intent>
        </xjdf:Product>
    </xjdf:ProductList>
    <xjdf:ParameterSet Name="RunList">
        <xjdf:Parameter>
            <xjdf:RunList>
                <xjdf:FileSpec URL="test_file.pdf"/>
            </xjdf:RunList>
        </xjdf:Parameter>
    </xjdf:ParameterSet>
    <xjdf:ParameterSet Name="Contact">
        <xjdf:Parameter>
            <xjdf:Contact>
                <xjdf:Person FamilyName="Meissner" FirstName="Stefan"/>
                <xjdf:Company OrganizationName="flyeralarm GmbH"/>
                <xjdf:ComChannel ChannelType="Phone"
                    Locator="tel:+49.931.465840"/>
                <xjdf:Address PostalCode="97082" City="Wuerzburg"
                    Street="Alfred-Nobel-Strasse 15"/>
            </xjdf:Contact>
        </xjdf:Parameter>
    </xjdf:ParameterSet>
</xjdf:XJDF>

Following the associated Java code snippet which shows how to create such an XJDF Document as shown above:

Code Block
languagejava
// new factory instance
XJdfNodeFactory nf = new XJdfNodeFactory();

// create XJDF Document
ProductBuilder productBuilder = new ProductBuilder(1500, "Poster",
    "PTD Value", "FA-PRD-123456");
productBuilder.addIntent(nf.createMediaIntent("IPM_90"));
Product product = productBuilder.build();

ContactBuilder contactBuilder = new ContactBuilder();
contactBuilder.addCompany("flyeralarm GmbH");
contactBuilder.addPerson("Meissner", "Stefan", null);
contactBuilder.addAddress("Alfred-Nobel-Strasse 15", "97082", "Wuerzburg");
contactBuilder.addComChannel("Phone", "tel:+49.931.465840");
Contact contact = contactBuilder.build();

XJdfBuilder xJdfBuilder = new XJdfBuilder("FA-SIG-123456", "Web2Print",
    "My lovely Poster");
xJdfBuilder.addParameter(nf.createRunList("test_file.pdf"));
xJdfBuilder.addParameter(contact);
xJdfBuilder.addProduct(product);
XJDF xjdf = xJdfBuilder.build();

// parse document
byte[] bytes = new XJdfParser().parseXJdf(xjdf);

// output
System.out.println(new String(bytes));

The current version of CIP4 XJdfLib provides the following builder classes:

  • XJdfBuilder
    Creation of XJDF Documents. Manages the dealing with Products and Parameters.

  • ProductBuilder
    Creation of Product-Nodes. Handles all Intent nodes.

  • ContactBuilder
    Creation of Contact-Nodes. Organize the handling with contact details.