public virtual void testGetProductID()
        {
            JDFMedia m = (JDFMedia)ri.appendResource(ElementName.MEDIA);

            m.setProductID("p1");
            string name = ri.getProductID();

            Assert.AreEqual(m.getProductID(), name);
        }
Exemple #2
0
        public override void setUp()
        {
            base.setUp();
            JDFElement.setLongID(false);
            d = new JDFDoc("JDF");

            n = d.getJDFRoot();
            n.appendXMLComment("Example to illustrate JDF 1.3 Base and MIS compatible amount handling", null);
            n.setType(EnumType.Combined);
            inMedia = (JDFMedia)n.addResource(ElementName.MEDIA, null, EnumUsage.Input, null, null, null, null);
            outXM   = (JDFExposedMedia)n.addResource(ElementName.EXPOSEDMEDIA, EnumUsage.Output);
            outXM.refMedia(inMedia);
            n.addTypes(EnumType.Interpreting);
            n.addTypes(EnumType.Rendering);
            n.addTypes(EnumType.ImageSetting);
            n.setJobID("RIP-job");
            rlXMOut   = n.getLink(outXM, null);
            rlMediaIn = n.getLink(inMedia, null);
            inMedia.setProductID("Media-ProductID");
            inMedia.setMediaType(EnumMediaType.Plate);
            inMedia.setMediaTypeDetails("Aluminum");

            vRL = new VElement();
            vRL.Add(rlMediaIn);
            vRL.Add(rlXMOut);

            JDFExposedMedia xmPart = (JDFExposedMedia)outXM.addPartition(EnumPartIDKey.SignatureName, "Sig1");

            vsSheet = new VString("Cover Sheet1 Sheet2", " ");
            vsCMYK  = new VString("Cyan Magenta Yellow Black Spot1", " ");
            VElement v = xmPart.addPartitions(EnumPartIDKey.SheetName, vsSheet);

            for (int i = 0; i < v.Count; i++)
            {
                JDFResource xmPart2 = (JDFResource)v[i];
                xmPart2.getCreatePartition(EnumPartIDKey.Side, "Front", null).addPartitions(EnumPartIDKey.Separation, vsCMYK);
                // xmPart2.getCreatePartition(EnumPartIDKey.Side,"Back",null).
                // addPartitions(EnumPartIDKey.Separation, vsCMYK);
            }
            statCounter = new StatusCounter(n, null, vRL);
            statCounter.setDeviceID("Rip-DeviceID");
            statCounter.setCopyResInResInfo(rlMediaIn.getrRef(), true);
        }
Exemple #3
0
        public virtual void testMediaCatalog()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            jmf.setSenderID("DeviceSenderID");

            JDFQuery q = jmf.appendQuery(EnumType.Resource);

            q.setXMLComment("This is the query for a catalog");

            JDFResourceQuParams rqp = q.appendResourceQuParams();

            rqp.setExact(true);
            rqp.setXMLComment("Scope=Allowed is a new attribute to describe that we want a complet list of all known resources");
            rqp.setResourceName(ElementName.MEDIA);
            //		rqp.setAttribute("Scope", "Allowed");

            JDFResponse r = q.createResponse().getResponse(0);

            r = (JDFResponse)jmf.moveElement(r, null);
            r.setXMLComment("This is the response to the query - generally it will be in it's own jmf...\nThe list of ResourceInfo + the ResourceQuParams could also be specified in a Signal.");

            for (int i = 1; i < 5; i++)
            {
                JDFResourceInfo ri = r.appendResourceInfo();
                ri.setResourceName("Media");
                JDFMedia m = (JDFMedia)ri.appendResource("Media");
                m.setDescriptiveName("Description of Media #" + i);
                m.setDimensionCM(new JDFXYPair(i * 10, 13 + i % 2 * 20));
                m.setBrand("Brand #" + i);
                m.setProductID("ProductID_" + i);
                m.setMediaType(EnumMediaType.Paper);
                m.setResStatus((i < 2 ? EnumResStatus.Available : EnumResStatus.Unavailable), false);
                ri.setXMLComment("More attributes can be added as needed; Available = loaded");
            }
            doc.write2File(sm_dirTestDataTemp + "MediaCatalog.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
        }
Exemple #4
0
        public virtual void testVariableManifests()
        {
            ruli.setXMLComment("the set / doc / ... structure is transferred from the pre-impositioning pdl");

            JDFPageList pl = (JDFPageList)n.addResource(ElementName.PAGELIST, null);

            pl.setResStatus(EnumResStatus.Available, false);

            JDFContentList cl = (JDFContentList)pl.appendContentList().makeRootResource(null, null, true);

            cl.setResStatus(EnumResStatus.Available, false);
            cl.setXMLComment("Should we allow for content-data cross references to forther contentdata fields?");
            ruli.refPageList(pl);
            comp.refPageList(pl);
            int pageCount = 0;

            digiParams.setSides(EnumSides.TwoSidedFlipY);
            digiParams.setXMLComment("the sides attribute may be overridden by explicitly or implicitly missing runlist input elements");

            VString vRun = new VString("Letter BrochureMale BrochureFemale", null);

            JDFStitchingParams sp = (JDFStitchingParams)n.addResource(ElementName.STITCHINGPARAMS, EnumUsage.Input);

            med.setXMLComment("Media Partitioning is convenience only- the actual media selection is done by the digitalprintingparams MediaRef");
            for (int i = 0; i < vRun.Count; i++)
            {
                string   part      = vRun[i];
                JDFMedia partMedia = (JDFMedia)med.addPartition(EnumPartIDKey.Run, part);
                partMedia.setProductID(part + "Media");

                JDFDigitalPrintingParams digiPart = (JDFDigitalPrintingParams)digiParams.addPartition(EnumPartIDKey.Run, part);
                digiPart.refMedia(partMedia);

                sp.setXMLComment("how are multiple runs stitched together e.g. cover + body?");
                JDFStitchingParams spPart = (JDFStitchingParams)sp.addPartition(EnumPartIDKey.Run, part);
                if (i == 0)
                {
                    spPart.setNoOp(true);
                    spPart.setDescriptiveName("The letter is a loose leaf collection");
                }
                else
                {
                    spPart.setNumberOfStitches(3);
                    spPart.setStitchType(EnumStitchType.Saddle);
                }
            }

            // loop over records
            for (int i = 0; i < 10; i++)
            {
                JDFContentData letter = cl.appendContentData();
                letter.setContentType("Letter");
                JDFContentData brochure = cl.appendContentData();
                brochure.setContentType("Brochure");
                KElement lMeta = letter.appendElement("ContentMetadata");
                // TODO apply new example
                lMeta.setAttribute("Record", "" + i);
                string gender = i % 2 == 0 ? "Male" : "Female";
                lMeta.setAttribute("Gender", gender);
                lMeta.setXMLComment("Note that the final format of the metadata element is open");
                KElement bMeta = brochure.appendElement("Metadata");
                bMeta.setAttribute("Record", "" + i);
                bMeta.setAttribute("Gender", gender);

                JDFRunList runSet = (JDFRunList)ruli.addPartition(EnumPartIDKey.RunSet, "Record" + i);
                JDFRunList run    = runSet.addRun("file://server/tifs/testLetter" + i + ".tif", 0, -1);
                run.setRun("Letter");
                JDFComponent compSet = (JDFComponent)comp.addPartition(EnumPartIDKey.RunSet, runSet.getRunSet());
                JDFComponent co      = (JDFComponent)compSet.addPartition(EnumPartIDKey.Run, run.getRun());
                int          page    = (3 * i) % 7 + 1;
                run.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1)));
                co.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1)));
                co.setSurfaceCount(2 * ((page + 1) / 2));
                run.setPages(new JDFIntegerRangeList("0~" + (page - 1)));
                run.setXMLComment("Cover Letter - record " + i);
                run.setEndOfDocument(true);
                JDFPageData pd = pl.appendPageData();
                pd.refContentData(letter);
                pd.setAttribute("PageIndex", pageCount + " ~ " + (pageCount + page - 1));
                pageCount += page;

                run = runSet.addRun("file://server/tifs/testBrochure" + i + ".tif", 0, -1);
                run.setRun("Brochure" + gender);

                co   = (JDFComponent)compSet.addPartition(EnumPartIDKey.Run, run.getRun());
                page = 2 * ((7 * i) % 13) + 2;
                run.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1)));
                co.setPageListIndex(new JDFIntegerRangeList(new JDFIntegerRange(pageCount, pageCount + page - 1)));
                co.setSurfaceCount(2 * ((page + 1 + 1) / 2)); // the 2nd +1 is for
                // the blank inside
                // cover
                run.setPages(new JDFIntegerRangeList("0~" + (page - 1)));
                run.setXMLComment("Brochure - record " + i);
                run.setEndOfDocument(true);
                runSet.setEndOfSet(true);
                run.setAttribute("SkipBlankOrds", "1");
                run.setNPage(page + 1);
                run.setXMLComment("SkipBlankOrds specifies the relative position of pages to skip\n1 specifies that the first back sheet is skipped\nNPage MUST be incremented by the # of skipped pages.");
                pd = pl.appendPageData();
                pd.refContentData(brochure);
                pd.setAttribute("PageIndex", pageCount + " ~ " + (pageCount + page - 1));
                pageCount += page;
            }
            doc.write2File(sm_dirTestDataTemp + "RunlistManifest.jdf", 2, false);
        }