public virtual void tearDown() { JDFElement.setLongID(true); JDFElement.setDefaultJDFVersion(EnumVersion.Version_1_3); JDFAudit.setStaticAgentName(agentName); JDFAudit.setStaticAgentVersion(agentVersion); JDFAudit.setStaticAuthor(author); JDFNodeInfo.setDefaultWorkStepID(false); }
public virtual void testInitMaxVersion() { JDFElement.setDefaultJDFVersion(EnumVersion.Version_1_2); JDFDoc doc = new JDFDoc(ElementName.JMF); JDFJMF jmf = doc.getJMFRoot(); Assert.AreEqual(jmf.getMaxVersion(), jmf.getVersion(false)); JDFCommand c = jmf.appendCommand(); Assert.AreEqual(jmf.getMaxVersion(), c.getMaxVersion(true)); }
private string parseArgs(string[] commandLineArgs) { MyArgs args = new MyArgs(commandLineArgs, "?cmqPQvVntwU", "dlfLuhpTxX", null); if (args.boolParameter('?', false)) { sysOut.println("JDFValidator:\n" + version + '\n' + usage); Application.Exit(); } bWarning = args.boolParameter('w', false); bTiming = args.boolParameter('t', false); bQuiet = args.boolParameter('q', false); bWarnDanglingURL = args.boolParameter('U', false); this.setPrint(!args.boolParameter('Q', false)); xmlOutputName = args.parameterString('x'); xslStyleSheet = args.parameterString('X'); getTranslation(args); pOut = new XMLDoc("CheckOutput", null); KElement xmlRoot = pOut.getRoot(); xmlRoot.setAttribute("Language", "EN"); bool bVersion = !bQuiet || args.boolParameter('V', false); if (bVersion) { sysOut.println('\n' + version + '\n'); sysOut.println(args.ToString()); xmlRoot.setAttribute("Arguments", StringUtil.setvString(commandLineArgs, " ", null, null)); } bPrintNameSpace = args.boolParameter('n', false); bMultiID = args.boolParameter('m', false); if (args.hasParameter('h')) { proxyHost = args.parameterString('h'); proxyPort = args.parameterString('p'); } if (args.hasParameter('c')) { if (args.boolParameter('c', false)) { level = EnumValidationLevel.Complete; } else { level = EnumValidationLevel.Incomplete; } } string parameterString = args.parameterString('L'); if (parameterString != null) { setJDFSchemaLocation(new FileInfo(parameterString)); } string schemaLocation0 = args.parameterString('l'); // convert "," to blank if (schemaLocation0 != null) { VString vs = new VString(schemaLocation0, JDFConstants.COMMA); if (vs.Count % 2 != 0) { sysOut.println("error in schema location: format is \"NameSpaceURI1,Location1,NameSpaceURI2,Location2\"\n - bailing out!" + usage); Application.Exit(); } schemaLocation0 = StringUtil.setvString(vs, JDFConstants.BLANK, JDFConstants.EMPTYSTRING, JDFConstants.EMPTYSTRING); schemaLocation += schemaLocation0; } if (args.hasParameter('d')) { devCapFile = args.parameterString('d'); FileInfo fDC = UrlUtil.urlToFile(devCapFile); if (fDC == null || !fDC.Exists) { sysOut.println("Error reading devcap file: " + devCapFile + "\n - bailing out!\n" + usage); Application.Exit(); } } bValidate = (args.boolParameter('v', false)) || (schemaLocation != null); string jdfVersion = args.parameterString('f'); if (jdfVersion != null) { EnumVersion v = EnumVersion.getEnum(jdfVersion); JDFElement.setDefaultJDFVersion(v); JDFVersions.ForceVersion = true; } if (args.nargs() == 0) { sysOut.println(args.usage(usage)); Application.Exit(); } testlists = EnumFitsValue.Allowed; if (args.boolParameter('P', false)) { testlists = EnumFitsValue.Present; } string url = args.parameterString('u'); setAllFiles(args); return(url); }
protected internal static JDFDoc creatXMDoc() { JDFElement.setDefaultJDFVersion(EnumVersion.Version_1_3); JDFDoc doc = new JDFDoc("JDF"); JDFNode n = doc.getJDFRoot(); n.setJobPartID("P1"); n.setJobID("J1"); n.setType("ConventionalPrinting", true); n.appendElement("NS:Foobar", "www.foobar.com"); n.appendMatchingResource("Layout", JDFNode.EnumProcessUsage.AnyInput, null); JDFComponent comp = (JDFComponent)n.appendMatchingResource("Component", JDFNode.EnumProcessUsage.AnyOutput, null); JDFExposedMedia xm = (JDFExposedMedia)n.appendMatchingResource("ExposedMedia", JDFNode.EnumProcessUsage.Plate, null); JDFNodeInfo ni = n.appendNodeInfo(); JDFMedia m = xm.appendMedia(); m.appendElement("NS:FoobarMedia", "www.foobar.com"); Assert.AreEqual(EnumResourceClass.Consumable, m.getResourceClass(), "m Class"); VString vs = new VString(); vs.Add("SignatureName"); vs.Add("SheetName"); vs.Add("Side"); JDFAttributeMap mPart1 = new JDFAttributeMap("SignatureName", "Sig1"); mPart1.put("SheetName", "S1"); mPart1.put("Side", "Front"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); mPart1.put("Side", "Back"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); mPart1.put("SheetName", "S2"); mPart1.put("Side", "Front"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); mPart1.put("Side", "Back"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); mPart1.put("SignatureName", "Sig2"); mPart1.put("SheetName", "S1"); mPart1.put("Side", "Front"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); comp.appendElement("foo:bar", "www.foobar.com"); mPart1.put("Side", "Back"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); mPart1.put("SheetName", "S2"); mPart1.put("Side", "Front"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); mPart1.put("Side", "Back"); xm.getCreatePartition(mPart1, vs); ni.getCreatePartition(mPart1, vs); comp.getCreatePartition(mPart1, vs); return(doc); }