示例#1
0
        //public bool proceedRecord(AbbyyRSWrapper abbyyRs)
        //{
        //    abbyyRs.setTimeout(60000);

        //    InputFile[] inputFiles = getInputFilesFromRecord(this.record.content);
        //    JobDocument[] jd = null;

        //    List<ExportSettings> exportSettingsList = getExportSettings(this.record.workTypeId);

        //    foreach (ExportSettings es in exportSettingsList)
        //    {
        //        XmlTicket ticket = getManager().getAbbyService().createTicket(es);
        //        byte[] recognizedContent = null;
        //        ticket.InputFiles = inputFiles;
        //        jd = abbyyRs.processTicket(ticket, this.record, es.workFlowName);

        //        if (jd == null) return false;

        //        recognizedContent = jd[0].OutputDocuments[0].Files[0].FileContents;
        //        inputFiles = getInputFilesFromRecord(recognizedContent);

        //        if (recognizedContent == null) return false;

        //        this.record.content = recognizedContent;
        //        return true;
        //    }
        //}
        public bool proceedRecord(AbbyyRSWrapper abbyyRs)
        {
            abbyyRs.setTimeout(60000);

            List <InputFile[]> inputFiles = getInputFilesFromRecord(this.record.content);

            JobDocument[] jds = null;

            List <ExportSettings> exportSettingsList = getExportSettings(this.record.workTypeId);
            int i = 0;

            foreach (ExportSettings es in exportSettingsList)
            {
                i++;
                foreach (InputFile[] infile in inputFiles)
                {
                    XmlTicket ticket = getManager().getAbbyService().createTicket(es);
                    if (ticket == null)
                    {
                        return(false);
                    }

                    ticket.InputFiles = infile;
                    jds = abbyyRs.processTicket(ticket, this.record, es.workFlowName);

                    if (jds == null)
                    {
                        getManager().getOTUtils().incrementIterationsCounter(record, "ABBYY RS Failed to proceed recognition of record content.");
                        return(false);
                    }

                    if (i < exportSettingsList.Count())
                    {
                        inputFiles = getInputFilesFromJobDocuments(jds);
                    }
                    else
                    {
                        addResultToRecognizedContentList(jds);
                    }
                }
            }
            return(true);
        }
示例#2
0
        //public bool proceedRecord(AbbyyRSWrapper abbyyRs)
        //{
        //    abbyyRs.setTimeout(60000);
        //    InputFile[] inputFiles = getInputFilesFromRecord(this.record.content);
        //    JobDocument[] jd = null;
        //    List<ExportSettings> exportSettingsList = getExportSettings(this.record.workTypeId);
        //    foreach (ExportSettings es in exportSettingsList)
        //    {
        //        XmlTicket ticket = getManager().getAbbyService().createTicket(es);
        //        byte[] recognizedContent = null;
        //        ticket.InputFiles = inputFiles;
        //        jd = abbyyRs.processTicket(ticket, this.record, es.workFlowName);
        //        if (jd == null) return false;
        //        recognizedContent = jd[0].OutputDocuments[0].Files[0].FileContents;
        //        inputFiles = getInputFilesFromRecord(recognizedContent);
        //        if (recognizedContent == null) return false;
        //        this.record.content = recognizedContent;
        //        return true;
        //    }
        //}
        public bool proceedRecord(AbbyyRSWrapper abbyyRs)
        {
            abbyyRs.setTimeout(60000);

            List<InputFile[]> inputFiles = getInputFilesFromRecord(this.record.content);
            JobDocument[] jds = null;

            List<ExportSettings> exportSettingsList = getExportSettings(this.record.workTypeId);
            int i = 0;
            foreach (ExportSettings es in exportSettingsList)
            {
                i++;
                foreach (InputFile[] infile in inputFiles)
                {
                    XmlTicket ticket = getManager().getAbbyService().createTicket(es);
                    if (ticket == null) return false;

                    ticket.InputFiles = infile;
                    jds = abbyyRs.processTicket(ticket, this.record, es.workFlowName);

                    if (jds == null)
                    {
                        getManager().getOTUtils().incrementIterationsCounter(record, "ABBYY RS Failed to proceed recognition of record content.");
                        return false;
                    }

                    if (i < exportSettingsList.Count())
                    {
                        inputFiles = getInputFilesFromJobDocuments(jds);
                    }
                    else
                    {
                        addResultToRecognizedContentList(jds);
                    }
                }
            }
            return true;
        }
示例#3
0
 private QueueManager(OTUtils otUtils)
 {
     this.abbyyRs = new AbbyyRSWrapper(otUtils.getSettings());
     this.otUtils = otUtils;
     loadExportSettings();
 }
示例#4
0
 private QueueManager(OTUtils otUtils)
 {
     this.abbyyRs = new AbbyyRSWrapper(otUtils.getSettings());
     this.otUtils = otUtils;
     loadExportSettings();
 }