PipelineParameters pp = new PipelineParameters(); pp.setOutputURI(tmxRawDoc.getInputURI()); // Use same name as this output for now pp.setSourceLocale(tmxRawDoc.getSourceLocale()); pp.setTargetLocale(tmxRawDoc.getTargetLocale()); pp.setOutputEncoding(tmxRawDoc.getEncoding()); // Use same as the output document pp.setInputRawDocument(tmxRawDoc); pp.setFilterConfigurationId(tmxRawDoc.getFilterConfigId()); pp.setBatchInputCount(1); // Only one input file now
private Event createMultiEvent () { List<Event> list = new ArrayList<Event>(); // Change the pipeline parameters for the raw-document-related data PipelineParameters pp = new PipelineParameters(); pp.setOutputURI(rawDoc.getInputURI()); // Use same name as this output for now pp.setSourceLocale(rawDoc.getSourceLocale()); pp.setTargetLocale(rawDoc.getTargetLocale()); pp.setOutputEncoding(rawDoc.getEncoding()); // Use same as the output document pp.setInputRawDocument(rawDoc); // Add the event to the list list.add(new Event(EventType.PIPELINE_PARAMETERS, pp)); // Add raw-document related events list.add(new Event(EventType.RAW_DOCUMENT, rawDoc)); // Return the list as a multiple-event event return new Event(EventType.MULTI_EVENT, new MultiEvent(list)); }
private Event eventIndicatingTargetWasConsumed(Event startDocEvent) { List<Event> list = new ArrayList<Event>(); // Change the pipeline parameters for the raw-document-related data PipelineParameters pp = new PipelineParameters(); pp.setSecondInputRawDocument(null); // Add the PipelineParameters event to the list list.add(new Event(EventType.PIPELINE_PARAMETERS, pp)); // Add the original StartDocument event to the list list.add(startDocEvent); // Return the list as a multiple-event event // now the StartDocument event in subsequent steps won't try to read the target return new Event(EventType.MULTI_EVENT, new MultiEvent(list)); }
pp = new PipelineParameters(startDoc, input, null, null); pp.setSourceLocale(columnDefinedSource); srcLang = columnDefinedSource; if (pp == null) pp = new PipelineParameters(startDoc, input, null, null); if (columnDefinedTargets.size() <= 1) { pp.setTargetLocale(columnDefinedTargets.get(0)); trgLang = columnDefinedTargets.get(0); } else { pp.setTargetLocales(columnDefinedTargets);
pp = new PipelineParameters(startDoc, input, null, null); pp.setSourceLocale(srcLang);
protected Event creatRawDocumentEventSet (String inputPath, String defaultEncoding, LocaleId srcLoc, LocaleId trgLoc) { // Create the raw-document RawDocument rawDoc = new RawDocument(new File(inputPath).toURI(), defaultEncoding, srcLoc, trgLoc); // Create the list of events to send List<Event> list = new ArrayList<Event>(); // Change the pipeline parameters for the raw-document-related data PipelineParameters pp = new PipelineParameters(); pp.setOutputURI(rawDoc.getInputURI()); // Use same name as this output for now pp.setSourceLocale(rawDoc.getSourceLocale()); pp.setTargetLocale(rawDoc.getTargetLocale()); pp.setOutputEncoding(rawDoc.getEncoding()); // Use same as the output document pp.setInputRawDocument(rawDoc); // Add the event to the list list.add(new Event(EventType.PIPELINE_PARAMETERS, pp)); // Add raw-document related events list.add(new Event(EventType.RAW_DOCUMENT, rawDoc)); // Return the list as a multiple-event event return new Event(EventType.MULTI_EVENT, new MultiEvent(list)); }
PipelineParameters pp = new PipelineParameters(); RawDocument rawDoc = new RawDocument(new File(outFilePath).toURI(), defaultEncoding, sourceLocale, targetLocale, filterConfigId); pp.setInputURI(rawDoc.getInputURI()); pp.setOutputURI(rawDoc.getInputURI()); // Use same name as this output for now pp.setSourceLocale(rawDoc.getSourceLocale()); pp.setTargetLocale(rawDoc.getTargetLocale()); pp.setOutputEncoding(rawDoc.getEncoding()); // Use same as the output document pp.setInputRawDocument(rawDoc); pp.setFilterConfigurationId(rawDoc.getFilterConfigId()); pp.setBatchInputCount(1);