Ejemplo n.º 1
0
 protected internal virtual void appendNumPagesAction()
 {
     {
         JDFAction a = aPool.appendActionTest(EnumTerm.IntegerEvaluation, false);
         a.setSeverity(EnumSeverity.Error);
         JDFIntegerEvaluation numPages = (JDFIntegerEvaluation)((JDFnot)a.getTestTerm()).getTerm(null, 0);
         numPages.appendBasicPreflightTest("NumberOfPages");
         numPages.appendValueList(4);
         a.setDescriptiveName("set number of pages to 4");
     }
 }
Ejemplo n.º 2
0
        public virtual void testIntegerEvaluation()
        {
            JDFDoc d = new JDFDoc(ElementName.INTEGEREVALUATION);
            JDFIntegerEvaluation ie = (JDFIntegerEvaluation)d.getRoot();

            ie.appendValueList(1);
            Assert.AreEqual("1", ie.getAttribute(AttributeName.VALUELIST));
            ie.appendValueList(3);
            Assert.AreEqual("1 3", ie.getAttribute(AttributeName.VALUELIST));
            ie.appendValueList(4);
            Assert.AreEqual("1 3 ~ 4", ie.getAttribute(AttributeName.VALUELIST));
            ie.appendValueList(5);
            Assert.AreEqual("1 3 ~ 5", ie.getAttribute(AttributeName.VALUELIST));
            ie.appendValueList(int.MaxValue);
            Assert.AreEqual("1 3 ~ 5 INF", ie.getAttribute(AttributeName.VALUELIST));
            Assert.AreEqual(new JDFIntegerRangeList("1 3 ~ 5 INF"), ie.getValueList());
        }
Ejemplo n.º 3
0
        protected internal virtual void appendBWSeparationAction()
        {
            JDFAction a = aPool.appendActionSetTest(EnumTerm.StringEvaluation, EnumTerm.IntegerEvaluation, false);

            a.setSeverity(EnumSeverity.Error);

            JDFStringEvaluation numSeparations = (JDFStringEvaluation)((JDFnot)a.getTestTerm()).getTerm(null, 0);

            numSeparations.appendBasicPreflightTest("SeparationList");
            a.setDescriptiveName("separation to black only on page 1 and 2");
            numSeparations.appendValueValue("Black");

            JDFIntegerEvaluation setEval = (JDFIntegerEvaluation)a.getPreflightActionSetTerm();

            setEval.appendBasicPreflightTest("PageNumber");
            setEval.appendValueList(1);
            setEval.appendValueList(2);
        }
Ejemplo n.º 4
0
        protected internal virtual void appendSeparationAction()
        {
            {
                JDFAction a = aPool.appendActionSetTest(EnumTerm.StringEvaluation, EnumTerm.IntegerEvaluation, false);
                a.setSeverity(EnumSeverity.Error);

                JDFStringEvaluation   numSeparations = (JDFStringEvaluation)((JDFnot)a.getTestTerm()).getTerm(null, 0);
                JDFBasicPreflightTest testSeps       = numSeparations.appendBasicPreflightTest("SeparationList");
                a.setDescriptiveName("set number of separations to 6 on page 0 and 3");
                testSeps.setMinOccurs(6);
                testSeps.setMaxOccurs(6);
                testSeps.setListType(EnumListType.UniqueList);

                JDFIntegerEvaluation setEval = (JDFIntegerEvaluation)a.getPreflightActionSetTerm();
                setEval.appendBasicPreflightTest("PageNumber");
                setEval.appendValueList(0);
                setEval.appendValueList(3);
            }
        }
Ejemplo n.º 5
0
        public virtual void testTagMap()
        {
            JDFLayout lo   = (JDFLayout)root.addResource(ElementName.LAYOUT, null, EnumUsage.Input, null, null, null, null);
            JDFMedia  med  = (JDFMedia)root.addResource(ElementName.MEDIA, null, EnumUsage.Input, null, null, null, null);
            JDFMedia  medM = (JDFMedia)med.addPartition(EnumPartIDKey.RunTags, "MaleCover");
            JDFMedia  medF = (JDFMedia)med.addPartition(EnumPartIDKey.RunTags, "FemaleCover");
            JDFMedia  medB = (JDFMedia)med.addPartition(EnumPartIDKey.RunTags, "MaleBigBody MaleSmallBody FemaleBigBody FemaleSmallBody");

            JDFLayout loM = (JDFLayout)lo.addPartition(EnumPartIDKey.RunTags, "MaleCover");

            loM.refElement(medM);
            JDFLayout loF = (JDFLayout)lo.addPartition(EnumPartIDKey.RunTags, "FemaleCover");

            loF.refElement(medF);
            JDFLayout loBB = (JDFLayout)lo.addPartition(EnumPartIDKey.RunTags, "MaleBigBody FemaleBigBody");

            loBB.refElement(medB);
            JDFLayout loSB = (JDFLayout)lo.addPartition(EnumPartIDKey.RunTags, "MaleSmallBody FemaleSmallBody");

            loSB.refElement(medB);
            lo.setXMLComment("Layout for versioned product");

            KElement metaMap = rl.appendElement(METADATA_MAP);

            metaMap.setXMLComment("The MetadataMap element maps arbitrary tags in the document to a structural RunTag partition key\n" + "Note that any partition key may be mapped.\n" + "Note also that although an XPath syntax is used, this may be mapped to any hierarchical structure including but not limited to XML.\n");

            metaMap.setAttribute("Name", "RunTags");
            metaMap.setAttribute(AttributeName.DATATYPE, "PartIDKey");
            metaMap.setAttribute(AttributeName.VALUEFORMAT, "%s%s");
            metaMap.setAttribute(AttributeName.VALUETEMPLATE, "sex,section");

            KElement expr = metaMap.appendElement(EXPR);

            expr.setXMLComment("This expression maps the value of /Dokument/Rezipient/@Sex to a variable \"sex\"\n" + "The Mapping is unconditional, therefore no Term is required");
            expr.setAttribute("Name", "sex");
            expr.setAttribute("Path", "/Dokument/Rezipient/@Sex");

            expr = metaMap.appendElement(EXPR);
            expr.setXMLComment("Maps all elements with /Dokument/Sektion=Einband to Cover");
            expr.setAttribute("Name", "section");
            expr.setAttribute("Value", "Cover");
            JDFNameEvaluation nev = (JDFNameEvaluation)expr.appendElement(ElementName.NAMEEVALUATION);

            nev.setAttribute("Path", "/Dokument/Sektion");
            nev.setRegExp("Einband");

            expr = metaMap.appendElement(EXPR);
            expr.setXMLComment("Maps all elements with /Dokument/Sektion=HauptTeil and >50 pages to BigBody");
            expr.setAttribute("Name", "section");
            expr.setAttribute("Value", "BigBody");

            JDFand and = (JDFand)expr.appendElement("and");

            nev = (JDFNameEvaluation)and.appendElement(ElementName.NAMEEVALUATION);
            nev.setAttribute("Path", "/Dokument/Sektion");
            nev.setRegExp("HauptTeil");
            JDFIntegerEvaluation iev = (JDFIntegerEvaluation)and.appendTerm(EnumTerm.IntegerEvaluation);

            iev.setAttribute("Path", "count(PAGE)");
            iev.setValueList(new JDFIntegerRangeList("51~INF"));

            expr = metaMap.appendElement(EXPR);
            expr.setXMLComment("Maps all elements with /Dokument/Sektion=HauptTeil and <=50 pages to SmallBody");
            expr.setAttribute("Name", "section");
            expr.setAttribute("Value", "SmallBody");

            and = (JDFand)expr.appendElement("and");
            nev = (JDFNameEvaluation)and.appendElement(ElementName.NAMEEVALUATION);
            nev.setAttribute("Path", "/Dokument/Sektion");
            nev.setRegExp("HauptTeil");
            iev = (JDFIntegerEvaluation)and.appendTerm(EnumTerm.IntegerEvaluation);
            iev.setAttribute("Path", "count(PAGE)");
            iev.setValueList(new JDFIntegerRangeList("0~INF"));

            rl.setFileURL("bigVariable.ppml");
            rl.setXMLComment("this runlist points to a ppml with arbitrary structural tagging");

            JDFResourceLink rll = root.getLink(rl, null);

            rll.appendPart().setDocIndex(new JDFIntegerRangeList("10 ~ 20"));
            rll.setXMLComment("this link selects the 11-20 document");

            doc.write2File(sm_dirTestDataTemp + "metadataMap.jdf", 2, false);
        }