Example #1
0
 private void initializePipeLine() {
   fcMapper = new FilterConfigurationMapper();
   DefaultFilters.setMappings(fcMapper, false, true);
   fcMapper.setCustomConfigurationsDirectory(configData.filterConfigurationDirectory);
   fcMapper.updateCustomConfigurations();
   context = new ExecutionContext();
   driver = new PipelineDriver();
   driver.setFilterConfigurationMapper(fcMapper);
   // driver.setRootDirectories(new File("bin").getAbsolutePath(), new
   // File("bin").getAbsolutePath());
   driver.setRootDirectories(new File("").getAbsolutePath(), new File("").getAbsolutePath());
   driver.setExecutionContext(context);
 }
Example #2
0
  private void addRawDocumentsIntoPipeline(LocaleId locale) {
    String.format("adding RawDocuments (locale: [%s]) to pipeline", locale);

    for (L10nFile f : project.getFiles()) {

      RawDocument rd = null;
      if (!project.createTM) {
        rd = new RawDocument(f.getURI(), f.getEncoding(), project.sourceLocale, locale);
      } else {
        rd = new RawDocument(f.getURI(locale), f.getEncoding(locale), locale, locale);
      }
      rd.setFilterConfigId(f.getFilterConfigurationId());

      URI targetUri;
      if (!project.createTM) targetUri = new File(f.getLocalXliffPath(locale)).toURI();
      else {
        targetUri =
            new File(f.getLocalXliffPath_SourceWithLocaleCodeBeforeXliffExtension(locale)).toURI();
      }

      driver.addBatchItem(rd, targetUri, f.getEncoding(locale));

      projetLogger.debug(
          String.format(
              "[%s] added to the pipeline driver (target uri: [%s])",
              f.getURI(), targetUri.toString()));
    }
  }
Example #3
0
  private void addSaveXliffStep() {
    // adding step to write .xlf file
    FilterEventsWriterStep fewStep = new FilterEventsWriterStep();
    XLIFFWriterParameters paramsXliff;
    XLIFFWriter writer = new XLIFFWriter();
    fewStep.setFilterWriter(writer);
    paramsXliff = (XLIFFWriterParameters) writer.getParameters();

    paramsXliff.setPlaceholderMode(true);
    // paramsXliff.setCopySource(extOptCopy);
    // paramsXliff.setIncludeAltTrans(extOptAltTrans);
    // paramsXliff.setIncludeCodeAttrs(extOptCodeAttrs);

    // OfewStep.setDocumentRoots(baseDir.getAbsolutePath());
    driver.addStep(fewStep);
  }
Example #4
0
 private void addInvestigateTextUnitStep() {
   InvestigateTextUnitStep itus = new InvestigateTextUnitStep();
   driver.addStep(itus);
   Helper.LogAddStep(itus);
 }
Example #5
0
 private void addTextUnitLoggerStep() {
   TextUnitLogger tul = new TextUnitLogger();
   driver.addStep(tul);
   Helper.LogAddStep(tul);
 }
Example #6
0
 public void addFilterEventsWriterStep() {
   FilterEventsWriterStep fewStep = new FilterEventsWriterStep();
   driver.addStep(fewStep);
   Helper.LogAddStep(fewStep);
 }
Example #7
0
 private void addSyncStep() {
   SyncStep syncStep = new SyncStep(project);
   driver.addStep(syncStep);
   Helper.LogAddStep(syncStep);
 }
Example #8
0
 private void addRawDocumentToFilterEventStep() {
   RawDocumentToFilterEventsStep rd2feStep = new RawDocumentToFilterEventsStep();
   driver.addStep(rd2feStep);
   Helper.LogAddStep(rd2feStep);
 }
Example #9
0
 private void addPseudoLocalizationStep() {
   PseudoLocalizationStep pls = new PseudoLocalizationStep(project);
   driver.addStep(pls);
   Helper.LogAddStep(pls);
 }
Example #10
0
 private void processSyncFlowPipeline() {
   driver.processBatch();
 }