/// /// * <param name="previewLeaf"> </param> /// private void setPreviewURL(JDFPreview previewLeaf) { DirectoryInfo share = UrlUtil.urlToFile(previewShare).Directory; FileInfo file; if (bPPF) { file = new FileInfo(previewLeaf.getSheetName() + ".ppf"); } else { file = new FileInfo(previewLeaf.getSheetName() + "_" + previewLeaf.getSide().getName().Substring(0, 1) + "_" + previewLeaf.getSeparation() + ".png"); } file = FileUtil.getFileInDirectory(share, file); previewLeaf.setURL(UrlUtil.fileToUrl(file, false)); previewLeaf.setPreviewUsage(EnumPreviewUsage.Separation); previewLeaf.setPreviewFileType(EnumPreviewFileType.CIP3Single); }
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); }
//public Element createElementNode(QName element) //{ // if (fCurrentNode.getLocalName() != null) // { // ((DocumentJDFImpl)(this.fDocument)).setParentNode(fCurrentNode); // } // Element e = super.createElementNode(element); // ((DocumentJDFImpl)(this.fDocument)).setParentNode(null); // return e; //} /// /// <summary> * parseFile - parse a file specified by strFile /// * </summary> /// * <param name="strFile"> link to the document to parse, may be either a file path or a url </param> /// * <returns> JDFDoc or null if File not found </returns> /// public virtual JDFDoc parseFile(string strFile) { FileInfo file = UrlUtil.urlToFile(strFile); return(parseFile(file)); }