public TokenReplacer BuildTokenReplacerFromJobInfo(JobInfo.JobInfo jobInfo) { _tokenReplacer = new TokenReplacer(); AddEnvironmentTokens(); AddDateToken(); AddSourceFileTokens(jobInfo.SourceFiles[0]); AddTokensForDocumentTitle(jobInfo.SourceFiles[0], jobInfo.Metadata); AddUserTokens(jobInfo.SourceFiles); // AddMetaDataTokens should be called last // as they can contain other tokens that might need replacing AddMetaDataTokens(jobInfo.Metadata); return(_tokenReplacer); }
private void AddTokensFromOriginalFilePath(SourceFileInfo sfi, Metadata metadata, JobInfo.JobInfo jobInfo) { var originalFileName = metadata.PrintJobName; var originalDirectory = ""; if (!string.IsNullOrEmpty(jobInfo.OriginalFilePath)) { originalFileName = PathSafe.GetFileNameWithoutExtension(jobInfo.OriginalFilePath); originalDirectory = PathSafe.GetDirectoryName(jobInfo.OriginalFilePath); } else if (_pathUtil.IsValidRootedPath(sfi.DocumentTitle)) { originalFileName = PathSafe.GetFileNameWithoutExtension(sfi.DocumentTitle); originalDirectory = PathSafe.GetDirectoryName(sfi.DocumentTitle); } _tokenReplacer.AddStringToken("InputFilename", originalFileName); _tokenReplacer.AddStringToken("InputDirectory", originalDirectory); _tokenReplacer.AddStringToken("InputFilePath", originalDirectory); }
public void SaveToInfFile(JobInfo jobInfo, string filename) { jobInfo.InfFile = filename; SaveToInfFile(jobInfo); }