public virtual void testPreflightProfile() { JDFDoc d = new JDFDoc("JDF"); n = d.getJDFRoot(); n.setType(EnumType.Preflight); inRun = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null); inRun.setFileURL("input.pdf"); preparms = (JDFPreflightParams)n.appendMatchingResource(ElementName.PREFLIGHTPARAMS, EnumProcessUsage.AnyInput, null); prrp = (JDFPreflightReportRulePool)n.appendMatchingResource(ElementName.PREFLIGHTREPORTRULEPOOL, EnumProcessUsage.AnyInput, null); // new aPool = (JDFActionPool)preparms.appendElement(ElementName.ACTIONPOOL); // now some simple tests... appendTransparency(); appendNumPagesAction(); appendSeparationAction(); appendBWSeparationAction(); appendTrimBoxAction(); appendResolutionAction(); appendResolutionActionBitMap(); appendLineWeightAction(); d.write2File(sm_dirTestDataTemp + "PreflightProfile.jdf", 2, false); }
public virtual void testRunList() { JDFDoc d = new JDFDoc(ElementName.JDF); JDFNode r = d.getJDFRoot(); JDFRunList rl = (JDFRunList)r.addResource("RunList", null, EnumUsage.Input, null, null, null, null); JDFInsertSheet is1 = rl.appendInsertSheet(); is1.setSheetType(EnumSheetType.SeparatorSheet); is1.setSheetUsage(EnumSheetUsage.Slip); JDFInsertSheet is2 = rl.appendInsertSheet(); is2.setSheetType(EnumSheetType.SeparatorSheet); is2.setSheetUsage(EnumSheetUsage.Slip); Assert.AreNotEqual(is2, is1, "two insert sheets"); rl.appendLayoutElement(); // 1 Assert.IsTrue(rl.isValid(EnumValidationLevel.Complete), "runlist valid"); bool b1 = false; try { rl.appendLayoutElement(); } catch (JDFException) { b1 = true; } Assert.IsTrue(b1, "only one layoutelement possible"); }
public virtual void testBuildMimePackageDocJMF() { JDFDoc docJMF = new JDFDoc("JMF"); docJMF.setOriginalFileName("JMF.jmf"); JDFJMF jmf = docJMF.getJMFRoot(); JDFCommand com = (JDFCommand)jmf.appendMessageElement(JDFMessage.EnumFamily.Command, JDFMessage.EnumType.SubmitQueueEntry); com.appendQueueSubmissionParams().setURL("TheJDF"); JDFDoc doc = new JDFDoc("JDF"); doc.setOriginalFileName("JDF.jdf"); JDFNode n = doc.getJDFRoot(); n.setType(EnumType.ColorSpaceConversion); JDFColorSpaceConversionParams cscp = (JDFColorSpaceConversionParams)n.addResource(ElementName.COLORSPACECONVERSIONPARAMS, null, EnumUsage.Input, null, null, null, null); JDFFileSpec fs0 = cscp.appendFinalTargetDevice(); fs0.setURL(StringUtil.uncToUrl(sm_dirTestData + "test.icc", true)); JDFRunList rl = (JDFRunList)n.addResource(ElementName.RUNLIST, null, EnumUsage.Input, null, null, null, null); rl.addPDF(StringUtil.uncToUrl(sm_dirTestData + "url1.pdf", false), 0, -1); for (int i = 0; i < 100; i++) { rl.addPDF(StringUtil.uncToUrl(sm_dirTestData + "url?.pdf", false), 0, -1); } AttachmentCollection m = MimeUtil.buildMimePackage(docJMF, doc, true); MimeUtil.writeToFile(m, sm_dirTestDataTemp + "testMimePackageDoc.mjm", null); }
public virtual void testBuildMimePackageDoc() { for (int i = 0; i < 2; i++) { JDFDoc doc = new JDFDoc("JDF"); if (i == 1) { doc.setOriginalFileName("JDF.jdf"); } JDFNode n = doc.getJDFRoot(); n.setType(EnumType.ColorSpaceConversion); JDFColorSpaceConversionParams cscp = (JDFColorSpaceConversionParams)n.addResource(ElementName.COLORSPACECONVERSIONPARAMS, null, EnumUsage.Input, null, null, null, null); JDFFileSpec fs0 = cscp.appendFinalTargetDevice(); fs0.setURL(StringUtil.uncToUrl(sm_dirTestData + "test.icc", true)); JDFRunList rl = (JDFRunList)n.addResource(ElementName.RUNLIST, null, EnumUsage.Input, null, null, null, null); rl.addPDF(StringUtil.uncToUrl(sm_dirTestData + "url1.pdf", false), 0, -1); rl.addPDF(StringUtil.uncToUrl(sm_dirTestData + "url1.pdf", false), 0, -1); rl.addPDF(StringUtil.uncToUrl(sm_dirTestData + "url2.pdf", false), 0, -1); AttachmentCollection m = MimeUtil.buildMimePackage(null, doc, true); string mimeFile = sm_dirTestDataTemp + "testMimePackageDoc" + (i == 0 ? "0" : "") + ".mjm"; MimeUtil.writeToFile(m, mimeFile, null); AttachmentCollection mp = MimeUtil.GetMultiPart(mimeFile); Assert.AreEqual(4, mp.Count, "JDF, 2* rl, 1 icc"); } }
public virtual void testDirectImage() { JDFElement.setLongID(false); doc = new JDFDoc("JDF"); node = doc.getJDFRoot(); node.setType(EnumType.Combined); VString vTypes = new VString("ImageSetting ConventionalPrinting", " "); node.setTypes(vTypes); nodeInfo = node.appendNodeInfo(); nodeInfo.setResStatus(EnumResStatus.Available, true); JDFRunList rl = (JDFRunList)node.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null); JDFByteMap bm = rl.appendByteMap(); bm.appendFileSpec().setURL("FileInfo:///foo.tif"); JDFExposedMedia xm = (JDFExposedMedia)node.appendMatchingResource(ElementName.EXPOSEDMEDIA, EnumProcessUsage.Plate, null); xm.setDescriptiveName("Real Plate"); xm.appendMedia(); JDFExposedMedia xmCyl = (JDFExposedMedia)node.appendMatchingResource(ElementName.EXPOSEDMEDIA, EnumProcessUsage.Cylinder, null); xmCyl.setDescriptiveName("Optional cylinder"); node.linkMatchingResource(xmCyl, EnumProcessUsage.AnyOutput, null); Assert.AreEqual(3, node.getResourceLinkPool().numChildElements("ExposedMediaLink", null), "2 for cylinder one for plate"); doc.write2File(sm_dirTestDataTemp + "webDirect.jdf", 2, false); }
private void reset() { doc = new JDFDoc("JDF"); n = doc.getJDFRoot(); n.setType(EnumType.Imposition); rl = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null); }
/// /// <summary> * </summary> /// private JDFRunList initConduitRunListOut() { JDFRunList rl = (JDFRunList)theNode.getCreateResource(ElementName.RUNLIST, EnumUsage.Output, 0); rl.setResStatus(EnumResStatus.Unavailable, false); return(rl); }
// (non-Javadoc) // * @see org.cip4.jdflib.goldenticket.BaseGoldenTicket#initDocumentRunList() // protected internal override JDFRunList initDocumentRunList() { JDFRunList rl = base.initDocumentRunList(); theNode.getLink(rl, EnumUsage.Input).setProcessUsage((EnumProcessUsage)null); return(rl); }
/// /// * <exception cref="FormatException"> </exception> /// private void setUpAutomatedInputRunList() { JDFRunList run = rl.addRun("file://host/data/test.ppml", 0, -1); Assert.AreEqual(JDFFileSpec.getMimeTypeFromURL(".ppml"), run.getLayoutElement().getFileSpec().getMimeType()); run.setDocs(new JDFIntegerRangeList("0~99")); rl.setResStatus(EnumResStatus.Available, true); }
public virtual void testProcessUsage() { JDFDoc d = new JDFDoc("JDF"); JDFNode n = d.getJDFRoot(); n.setType("fnarf", false); EnumFitsValue testlists = EnumFitsValue.Allowed; EnumValidationLevel level = KElement.EnumValidationLevel.Complete; VElement vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNull(vExecNodes, "missing resources"); JDFLayout lo = (JDFLayout)n.addResource(ElementName.LAYOUT, null, EnumUsage.Input, null, null, null, null); lo.appendContentObject().setCTM(new JDFMatrix("1 0 0 1 0 0")); lo.appendContentObject().setCTM(new JDFMatrix("1 0 0 1 10 20")); JDFRunList rlDoc = (JDFRunList)n.addResource(ElementName.RUNLIST, null, EnumUsage.Input, EnumProcessUsage.Document, null, null, null); vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNotNull(vExecNodes, "no missing resources"); n.addResource(ElementName.RUNLIST, null, EnumUsage.Input, EnumProcessUsage.Marks, null, null, null); vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNotNull(vExecNodes, "no missing resources"); JDFResourceLink rl = n.getLink(rlDoc, null); rl.setUsage(EnumUsage.Output); vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNull(vExecNodes, "no required runlist doc"); rl.setUsage(EnumUsage.Input); vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNotNull(vExecNodes, "no required runlist doc"); JDFDevCaps dcsRLDoc = devicecap.getDevCapsByName("RunList", null, null, EnumProcessUsage.Document, 0); JDFNameState ns = dcsRLDoc.getDevCap().appendNameState("RunTag"); ns.setRequired(true); vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNull(vExecNodes, "incomplete required runlist doc"); ns.setRequired(false); vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNotNull(vExecNodes, "incomplete required runlist doc"); JDFDevCaps dcsRLMarks = devicecap.getDevCapsByName("RunList", null, null, EnumProcessUsage.Marks, 0); JDFNameState nsMarks = dcsRLMarks.getDevCap().appendNameState("PageNames"); nsMarks.setRequired(true); vExecNodes = devicecap.getExecutableJDF(n, testlists, level); Assert.IsNull(vExecNodes, "incomplete required runlist marks"); }
private void setupRunList(int type) { JDFIntegerRangeList pageRange = new JDFIntegerRangeList(new JDFIntegerRange(0, -1, 16)); rlIn.setPartUsage(EnumPartUsage.Sparse); rlIn.setDescriptiveName("Explicitly partitioned by LayerIDs to enable layer selextion in the link"); JDFRunList rlAll = (JDFRunList)rlIn.addPartition(EnumPartIDKey.LayerIDs, "0"); rlAll.setFileURL("background.pdf"); rlAll.setPages(pageRange); JDFRunList rlLanguage = (JDFRunList)rlIn.addPartition(EnumPartIDKey.LayerIDs, "1"); JDFRunList rlEn = (JDFRunList)rlLanguage.addPartition(EnumPartIDKey.PartVersion, "FR"); rlEn.setFileURL("francais.pdf"); rlEn.setPages(pageRange); rlEn.setLogicalPage(16); JDFRunList rlDe = (JDFRunList)rlLanguage.addPartition(EnumPartIDKey.PartVersion, "De"); rlDe.setFileURL("deutsch.pdf"); rlDe.setPages(pageRange); rlDe.setLogicalPage(16); if (type == 1) { JDFRunList rlCurrency = (JDFRunList)rlIn.addPartition(EnumPartIDKey.LayerIDs, "2"); JDFRunList rlEur = (JDFRunList)rlCurrency.addPartition(EnumPartIDKey.PartVersion, "Euro"); rlEur.setFileURL("€.pdf"); rlEur.setPages(pageRange); rlEur.setLogicalPage(32); JDFRunList rlCHF = (JDFRunList)rlCurrency.addPartition(EnumPartIDKey.PartVersion, "CHF"); rlCHF.setFileURL("Fränkli.pdf"); rlCHF.setPages(pageRange); rlCHF.setLogicalPage(32); } else if (type == 2) { JDFRunList rlCurrency = (JDFRunList)rlIn.addPartition(EnumPartIDKey.LayerIDs, "2"); JDFRunList rlEur = (JDFRunList)rlCurrency.addPartition(EnumPartIDKey.PartVersion, "De"); rlEur.setFileURL("€.pdf"); rlEur.setPages(pageRange); rlEur.setLogicalPage(32); JDFRunList rlEur2 = (JDFRunList)rlCurrency.addPartition(EnumPartIDKey.PartVersion, "Fr"); rlEur2.setIdentical(rlEur); JDFRunList rlCHF = (JDFRunList)rlCurrency.addPartition(EnumPartIDKey.PartVersion, "Ch"); rlCHF.setFileURL("Fränkli.pdf"); rlCHF.setPages(pageRange); rlCHF.setLogicalPage(32); JDFRunList rlCh = (JDFRunList)rlLanguage.addPartition(EnumPartIDKey.PartVersion, "Ch"); rlCh.setIdentical(rlDe); } }
public virtual void testWritePerformance() { long start = JDFDate.ToMillisecs(DateTime.Now); string big = sm_dirTestData + "big.pdf"; string bigger = sm_dirTestDataTemp + "bigger.pdf"; JDFDoc docJMF = new JDFDoc("JMF"); docJMF.setOriginalFileName("JMF.jmf"); JDFJMF jmf = docJMF.getJMFRoot(); JDFCommand com = (JDFCommand)jmf.appendMessageElement(JDFMessage.EnumFamily.Command, JDFMessage.EnumType.SubmitQueueEntry); com.appendQueueSubmissionParams().setURL("TheJDF"); FileInfo fBigger = new FileInfo(bigger); SupportClass.FileSupport.CreateNewFile(fBigger); FileStream fis = new FileStream(big, FileMode.Open); FileStream fos = new FileStream(bigger, FileMode.Create); byte[] b = new byte[10000]; while (true) { int i = fis.Read(b, 0, 10000); if (i <= 0) { break; } for (int j = 0; j < 3; j++) { fos.Write(b, 0, i); } } fis.Close(); fos.Flush(); fos.Close(); JDFDoc doc = new JDFDoc("JDF"); doc.setOriginalFileName("JDF.jdf"); JDFNode n = doc.getJDFRoot(); n.setType(EnumType.Interpreting); JDFRunList rl = (JDFRunList)n.addResource(ElementName.RUNLIST, EnumUsage.Input); rl.addPDF(StringUtil.uncToUrl(bigger, false), 0, -1); long setup = JDFDate.ToMillisecs(DateTime.Now); Console.WriteLine("Setup time: " + (setup - start)); AttachmentCollection m = MimeUtil.buildMimePackage(null, doc, true); long build = JDFDate.ToMillisecs(DateTime.Now); Console.WriteLine("Build time: " + (build - setup)); Assert.IsNotNull(MimeUtil.writeToFile(m, sm_dirTestDataTemp + "performance.mjm", null)); long write = JDFDate.ToMillisecs(DateTime.Now); Console.WriteLine("Write time: " + (write - build)); }
private void setUpDoc() { d = new JDFDoc("JDF"); n = d.getJDFRoot(); n.setJobID("JobID"); n.setType(EnumType.Imposition); rlIn = (JDFRunList)n.appendMatchingResource("RunList", EnumProcessUsage.AnyInput, null); rlIn.setResStatus(EnumResStatus.Available, false); rlOut = (JDFRunList)n.appendMatchingResource("RunList", EnumProcessUsage.AnyOutput, null); }
/// /// <summary> * </summary> /// private void initGBContentCreation() { theNode.setTypes(new VString(EnumType.LayoutElementProduction.getName(), null)); JDFRunList ruli = initDocumentRunList(); JDFResourceLink rl = theNode.getLink(ruli, EnumUsage.Input); rl.setProcessUsage((EnumProcessUsage)null); initLayoutElementProductionParams(); initConduitRunListOut(); }
/// <summary> /// All the setUp calls except for base.setUp. /// Use when you want to redo a setup without doign a teardown. /// </summary> public void reSetUp() { JDFElement.setLongID(false); doc = new JDFDoc("JDF"); n = doc.getJDFRoot(); n.setType(EnumType.Stripping); rl = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null); sp = (JDFStrippingParams)n.appendMatchingResource(ElementName.STRIPPINGPARAMS, EnumProcessUsage.AnyInput, null); bs = (JDFBinderySignature)n.addResource(ElementName.BINDERYSIGNATURE, null, null, null, null, null, null); sp.refBinderySignature(bs); }
public virtual void testGeneratedObject() { n = doc.getJDFRoot(); JDFLayout lo = (JDFLayout)n.addResource("Layout", null, EnumUsage.Input, null, null, null, null); JDFRunList rlo = (JDFRunList)n.addResource("RunList", null, EnumUsage.Output, null, null, null, null); rlo.setFileURL("output.pdf"); lo.appendXMLComment("This is a simple horizontal slug line\nAnchor specifies which of the 9 coordinates is the 0 point for the coordinate system specified in the CTM\nThis slugline describes error and endtime in the lower left corner of the scb", null); JDFMarkObject mark = lo.appendMarkObject(); mark.setCTM(new JDFMatrix("1 0 0 1 0 0")); JDFJobField jf = mark.appendJobField(); jf.setShowList(new VString("Error EndTime", " ")); lo.appendXMLComment("This is a simple vertical slug line\nAnchor specifies which of the 9 coordinates is the 0 point for the coordinate system specified in the CTM\nThis slugline describes the operator name along the right side of the sheet text from top to bottom\nthe slug line (top right of the slug cs) is anchored in the bottom right of the sheet.\nNote that the coordinates in the ctm are guess work. the real coordinates are left as an exercise for the reader;-)", null); mark = lo.appendMarkObject(); mark.setCTM(new JDFMatrix("0 1 -1 0 555 444")); jf = mark.appendJobField(); jf.setShowList(new VString("Operator", " ")); JDFDeviceMark dm = jf.appendDeviceMark(); dm.setAttribute("Anchor", "TopRight"); dm.setFont("Arial"); dm.setFontSize(10); lo.appendXMLComment("This is a formatted vertical slug line\nAnchor specifies which of the 9 coordinates is the 0 point for the coordinate system specified in the CTM\nThis slugline describes a formatted line along the left side of the sheet text from top to bottom\nthe slug line (top left) is anchored in the bottom left of the sheet.\nThe text is defined in @Format with the sequence in ShowList defining the 5 placeholders marked by %s or %i\nAn example instance would be: \"This Cyan plate of Sheet1 was proudly produced by Joe Cool! Resolution: 600 x 600\"\nNote that the coordinates in the ctm are guess work. the real coordinates are left as an exercise for the reader;-)", null); mark = lo.appendMarkObject(); mark.setCTM(new JDFMatrix("0 1 -1 0 0 0")); jf = mark.appendJobField(); jf.setShowList(new VString("Separation SheetName Operator ResolutionX ResolutionY", " ")); jf.setAttribute("Format", "This %s plate of %s was proudly produced by %s!\nResolution: %i x %i"); dm = jf.appendDeviceMark(); dm.setAttribute("Anchor", "TopLeft"); dm.setFont("Arial"); dm.setFontSize(10); lo.appendXMLComment("This is a positioned registermark\nthe center of the mark is translated by 666 999\n the JobField is empty and serves aa a Marker that no external Content is requested", null); mark = lo.appendMarkObject(); mark.setCTM(new JDFMatrix("1 0 0 1 666 999")); jf = mark.appendJobField(); mark.appendXMLComment("The coordinate system origin is defined by the anchor in the center, i.e. 0 0\n the separartions are excluding black", null); JDFRegisterMark rm = mark.appendRegisterMark(); rm.setMarkType("Arc Cross"); rm.setMarkUsage(EnumMarkUsage.Color); rm.setCenter(new JDFXYPair("0 0")); rm.setSeparations(new VString("Cyan Magent Yellow", " ")); dm = jf.appendDeviceMark(); dm.setAttribute("Anchor", "Center"); doc.write2File(sm_dirTestDataTemp + "generatedObject.jdf", 2, false); }
/// <summary> /// All the setUp calls except for base.setUp. /// Use when you want to redo a setup without doign a teardown. /// </summary> public void reSetUp() { JDFElement.setLongID(false); JDFAudit.setStaticAgentName(null); JDFAudit.setStaticAgentVersion(null); JDFAudit.setStaticAuthor(null); doc = new JDFDoc("JDF"); n = doc.getJDFRoot(); n.setJobID("JobID"); rl = (JDFRunList)n.addResource(ElementName.RUNLIST, null, EnumUsage.Input, null, null, null, null); }
public virtual void testContentData() { d = new JDFDoc("JDF"); n = d.getJDFRoot(); n.setType(EnumType.Approval); JDFRunList rl = (JDFRunList)n.addResource(ElementName.RUNLIST, EnumUsage.Input); pl = rl.appendPageList(); pl.makeRootResource("PageList", null, true); cl = pl.appendContentList(); cl.makeRootResource("ContentList", null, true); JDFContentData cd0 = cl.appendContentData(); cd0.setAttribute(AttributeName.CONTENTLISTINDEX, "1 2 3"); KElement book = cd0.appendElement("ContentMetaData"); book.setAttribute("ISBN", "0123456789"); JDFComment abstrakt = (JDFComment)book.appendElement("Comment"); abstrakt.setName("Abstract"); abstrakt.setText("Abstract of the book\nin english"); JDFEmployee editor = (JDFEmployee)book.appendElement(ElementName.EMPLOYEE); editor.appendPerson().setFamilyName("authorName"); editor.setRoles(new VString("Editor", null)); book.setAttribute("Title", "book thing"); int p = 1; for (int i = 1; i < 4; i++) { JDFContentData cd = cl.appendContentData(); cd.setAttribute("ID", "CD_" + i); KElement chap = cd.appendElement("ContentMetaData"); chap.setAttribute("Title", "Chapter " + i); JDFEmployee author = (JDFEmployee)chap.appendElement(ElementName.EMPLOYEE); author.appendPerson().setFamilyName("authorName" + i); author.setRoles(new VString("Author", null)); JDFPageData pd = pl.appendPageData(); JDFIntegerRangeList integerRangeList = new JDFIntegerRangeList(); integerRangeList.Append(p, p + i); p += i + 1; pd.setAttribute("PageIndex", integerRangeList.ToString()); JDFPageElement pe = pd.appendPageElement(); pe.setAttribute("ContentDataRefs", cd.getID()); } pl.setXMLComment("Note that multiple page elements may but need not be specified\nit is also possible to reference only on pageEleemnt that spans the entire book"); d.write2File(sm_dirTestDataTemp + "ContentMetaData.jdf", 2, false); }
/// /// <summary> * </summary> /// private void initGBPrePressPreparation() { if (thePreviousNode != null) { theNode.linkOutputs(thePreviousNode); } else { initDocumentRunList(); } JDFRunList rl = initConduitRunListOut(); theNode.getLink(rl, EnumUsage.Output).setProcessUsage(EnumProcessUsage.Document); }
private void iterateRead(int i) { iterDoc = JDFDoc.parseFile(getIteration(i)); Assert.IsNotNull(iterDoc); iterNode = iterDoc.getJDFRoot(); Assert.IsNotNull(iterNode); iterLepp = (JDFLayoutElementProductionParams)iterNode.getMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null, 0); Assert.IsNotNull(iterLepp); iterApp = (JDFApprovalParams)iterNode.getMatchingResource(ElementName.APPROVALPARAMS, EnumProcessUsage.AnyInput, null, 0); Assert.IsNotNull(iterApp); iterAppSuccess = (JDFApprovalSuccess)iterNode.getMatchingResource(ElementName.APPROVALSUCCESS, EnumProcessUsage.AnyInput, null, 0); Assert.IsNotNull(iterAppSuccess); iterRuli = (JDFRunList)iterNode.getMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null, 0); Assert.IsNotNull(iterRuli); }
/// /// <summary> * </summary> /// protected internal virtual JDFRunList initDocumentRunList() { JDFRunList rl = (JDFRunList)theNode.getCreateResource(ElementName.RUNLIST, EnumUsage.Input, 0); JDFResourceLink rll = theNode.getLink(rl, null); if ("Marks".Equals(rll.getProcessUsage())) { rl = (JDFRunList)theNode.getCreateResource(ElementName.RUNLIST, EnumUsage.Input, 1); rll = theNode.getLink(rl, null); } rll.setProcessUsage(EnumProcessUsage.Document); rl.addPDF(m_pdfFile, 0, -1); rl.setNPage(4); rl.setDescriptiveName("Description of this RunList"); return(rl); }
public virtual void testGetJMFSubmission() { JDFDoc d1 = new JDFDoc("JMF"); d1.setOriginalFileName("JMF.jmf"); JDFJMF jmf = d1.getJMFRoot(); jmf.setDeviceID("gr?n?"); JDFCommand com = (JDFCommand)jmf.appendMessageElement(JDFMessage.EnumFamily.Command, JDFMessage.EnumType.SubmitQueueEntry); com.appendQueueSubmissionParams().setURL("TheJDF"); JDFDoc doc = new JDFDoc("JDF"); doc.setOriginalFileName("JDF.jdf"); JDFNode n = doc.getJDFRoot(); n.setType(EnumType.ColorSpaceConversion); JDFColorSpaceConversionParams cscp = (JDFColorSpaceConversionParams)n.addResource(ElementName.COLORSPACECONVERSIONPARAMS, null, EnumUsage.Input, null, null, null, null); JDFFileSpec fs0 = cscp.appendFinalTargetDevice(); fs0.setURL(StringUtil.uncToUrl(sm_dirTestData + "test.icc", true)); JDFRunList rl = (JDFRunList)n.addResource(ElementName.RUNLIST, null, EnumUsage.Input, null, null, null, null); rl.addPDF(StringUtil.uncToUrl(sm_dirTestData + "url1.pdf", false), 0, -1); for (int i = 0; i < 100; i++) { rl.addPDF("gr?n?" + i + ".pdf", 0, -1); } AttachmentCollection m = MimeUtil.buildMimePackage(d1, doc, true); JDFDoc[] d2 = MimeUtil.GetJMFSubmission(m); Assert.IsNotNull(d2); Assert.AreEqual("cid:JDF.jdf", d2[0].getJMFRoot().getCommand(0).getQueueSubmissionParams(0).getURL()); Assert.AreEqual(EnumType.ColorSpaceConversion, d2[1].getJDFRoot().getEnumType()); // now serialize to file and reread - should still work MimeUtil.writeToFile(m, sm_dirTestDataTemp + "test2.mjm", null); AttachmentCollection m2 = MimeUtil.GetMultiPart(sm_dirTestDataTemp + "test2.mjm"); Assert.IsNotNull(m2); d2 = MimeUtil.GetJMFSubmission(m); Assert.IsNotNull(d2); Assert.AreEqual("cid:JDF.jdf", d2[0].getJMFRoot().getCommand(0).getQueueSubmissionParams(0).getURL()); Assert.AreEqual(EnumType.ColorSpaceConversion, d2[1].getJDFRoot().getEnumType()); }
/// /// <summary> * emulate execution of a runlist by making it available </summary> /// private void executeRunList(EnumUsage usage) { JDFRunList rl = (JDFRunList)theExpandedNode.getResource(ElementName.RUNLIST, usage, 0); if (rl == null) { return; } if (!rl.hasChildElement(ElementName.LAYOUTELEMENT, null)) { rl.addPDF("./folder/Thedoc.pdf", 0, -1); } if (EnumUsage.Output.Equals(usage)) { rl.setResStatus(EnumResStatus.Available, true); } }
/// /// <summary> * </summary> /// private void initGBImpositionPreparation() { theNode.setTypes(new VString(bStripping ? "Stripping" : "ImpositionPreparation", null)); if (bStripping) { initBinderySignature("F4-1"); initBinderySignature("F8-2"); initStrippingParams(); initAssembly(); } initOutputLayout(); JDFRunList rlMarks = initConduitRunListOut(); theNode.getLink(rlMarks, EnumUsage.Output).setProcessUsage(EnumProcessUsage.Marks); }
/// /// <summary> * </summary> /// private void executeMarksRunList(EnumUsage usage) { JDFRunList rl = (JDFRunList)theExpandedNode.getResource(ElementName.RUNLIST, usage, 0); if (!"Marks".Equals(theExpandedNode.getLink(rl, usage).getProcessUsage())) { rl = (JDFRunList)theExpandedNode.getResource(ElementName.RUNLIST, usage, 1); } if (!"Marks".Equals(theExpandedNode.getLink(rl, usage).getProcessUsage())) { rl = null; } if (rl != null && !rl.hasChildElement(ElementName.LAYOUTELEMENT, null)) { rl.addPDF("./folder/TheMarks.pdf", 0, -1); } }
public virtual void testGetLinkRootJMF() { JDFDoc d = new JDFDoc("JMF"); JDFJMF jmf = d.getJMFRoot(); jmf.setSenderID("Elvis"); JDFCommand c = jmf.appendCommand(); c.setType("PipePull"); JDFPipeParams pp = c.appendPipeParams(); pp.setAttribute(AttributeName.PIPEID, "foo", null); JDFRunList ruli = (JDFRunList)pp.appendResource(ElementName.RUNLIST); JDFResourceLink rl = pp.appendResourceLink("RunListLink", true); rl.setrRef(ruli.getID()); Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete), "valid param"); Assert.AreEqual(rl.getTarget(), ruli); }
public virtual void testLayoutPreflight() { JDFElement.setLongID(false); JDFDoc d = new JDFDoc("JDF"); n = d.getJDFRoot(); n.setType(EnumType.LayoutElementProduction); JDFRunList outRun = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyOutput, null); outRun.setFileURL("output.pdf"); JDFLayoutElementProductionParams lep = (JDFLayoutElementProductionParams)n.appendMatchingResource(ElementName.LAYOUTELEMENTPRODUCTIONPARAMS, EnumProcessUsage.AnyInput, null); JDFComment com = lep.appendComment(); com.setName("Instruction"); com.setText("Add any human readable instructions here"); // new aPool = (JDFActionPool)lep.appendElement(ElementName.ACTIONPOOL); // now some simple tests... appendNumPagesAction(); appendSeparationAction(); appendBWSeparationAction(); appendTrimBoxAction(); appendResolutionAction(); StatusUtil su = new StatusUtil(n, null, null); su.setPhase(EnumNodeStatus.InProgress, "Creative Work", EnumDeviceStatus.Running, null, null); su.getDocJMFPhaseTime(); Thread.Sleep(1000); su = new StatusUtil(n, null, null); su.setPhase(EnumNodeStatus.InProgress, "Creative Work", EnumDeviceStatus.Running, null, null); su.getDocJMFPhaseTime(); Thread.Sleep(1000); su = new StatusUtil(n, null, null); su.setPhase(EnumNodeStatus.Completed, "done", EnumDeviceStatus.Idle, null, null); su.getDocJMFPhaseTime(); d.write2File(sm_dirTestDataTemp + "LayoutPreflight.jdf", 2, false); }
/// <summary> /// All the setUp calls except for base.setUp. /// Use when you want to redo a setup without doign a teardown. /// </summary> public void reSetUp() { JDFElement.setLongID(false); JDFAudit.setStaticAgentName(null); JDFAudit.setStaticAgentVersion(null); JDFAudit.setStaticAuthor(null); doc = new JDFDoc("JDF"); n = doc.getJDFRoot(); n.setJobID("JobID"); n.setType(EnumType.Combined); n.setTypes(new VString("Interpreting Rendering DigitalPrinting Stitching", " ")); comp = (JDFComponent)n.addResource(ElementName.COMPONENT, null, EnumUsage.Output, null, null, null, null); rlComp = n.getLink(comp, null); digiParams = (JDFDigitalPrintingParams)n.addResource(ElementName.DIGITALPRINTINGPARAMS, null, EnumUsage.Input, null, null, null, null); med = (JDFMedia)n.appendMatchingResource(ElementName.MEDIA, EnumProcessUsage.AnyInput, null); med.setResStatus(EnumResStatus.Available, false); rlMedia = n.getLink(med, null); ruli = (JDFRunList)n.appendMatchingResource(ElementName.RUNLIST, EnumProcessUsage.AnyInput, null); }
private void iterateThird() { iterateRead(2); JDFPhaseTime pt = iterNode.getAuditPool().setPhase(EnumNodeStatus.InProgress, "Second Iteration Ongoing", null, null); pt.setStart(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 2000000)); pt.setEnd(new JDFDate(JDFDate.ToMillisecs(DateTime.Now) + 2100000)); pt.appendEmployee().setPersonalID("Employee 1"); pt.appendDevice().setDeviceID("Device 2"); iterRuli.setResStatus(EnumResStatus.Unavailable, false); JDFResourceAudit ra = iterNode.cloneResourceToModify(iterNode.getLink(iterRuli, null)); iterRuli = (JDFRunList)ra.getNewLink().getTarget(); iterRuli.setResStatus(EnumResStatus.Draft, false); iterRuli.setFileURL(StringUtil.uncToUrl("C:\\local\\MyUpdatedInOutput.pdf", false)); iterNode.setStatus(EnumNodeStatus.Suspended); iterNode.setAttribute("StatusDetails", ITERATION_PAUSED); iterDoc.write2File(getIteration(3), 2, false); }
public virtual void testLayerRunList() { JDFElement.setLongID(false); setUpDoc(); JDFIntegerRangeList pageRange = new JDFIntegerRangeList(new JDFIntegerRange(0, -1, 16)); rlIn.setDescriptiveName("Layers are just another partversion layer selection in the link is achieved using multiple partversions"); JDFRunList rlAll = (JDFRunList)rlIn.addPartition(EnumPartIDKey.PartVersion, "CMYK"); rlAll.setFileURL("background.pdf"); rlAll.setPages(pageRange); JDFRunList rlEn = (JDFRunList)rlIn.addPartition(EnumPartIDKey.PartVersion, "FR"); rlEn.setFileURL("Francais.pdf"); rlEn.setPages(pageRange); rlEn.setLogicalPage(16); JDFRunList rlDe = (JDFRunList)rlIn.addPartition(EnumPartIDKey.PartVersion, "De"); rlDe.setFileURL("deutsch.pdf"); rlDe.setPages(pageRange); rlDe.setLogicalPage(16); setupLayout(false); n.setPartStatus(new JDFAttributeMap(EnumPartIDKey.PartVersion, "De"), EnumNodeStatus.Completed, null); JDFResourceLink rl = n.getLink(rlIn, null); rl.setPartition(EnumPartIDKey.PartVersion, "CMYK De"); d.write2File(sm_dirTestDataTemp + "LayerList.jdf", 2, false); rl.setPartition(EnumPartIDKey.PartVersion, "De"); rl.setDescriptiveName("Only DE, no bkg partversion is selected"); d.write2File(sm_dirTestDataTemp + "LayerList_BKG.jdf", 2, false); }