Example usage for org.apache.commons.pipeline Pipeline run

List of usage examples for org.apache.commons.pipeline Pipeline run

Introduction

In this page you can find the example usage for org.apache.commons.pipeline Pipeline run.

Prototype

public void run() 

Source Link

Document

Runs the rendering from start to finish.

Usage

From source file:edu.scripps.fl.pubchem.app.RelatedCurveProcessor.java

public static void main(String[] args) throws Exception {
    CommandLineHandler clh = new CommandLineHandler();
    args = clh.handle(args);/*from  w  w w .  ja  v  a 2s.  co  m*/

    Integer[] list = (Integer[]) ConvertUtils.convert(args, Integer[].class);
    Integer referenceAid = list[0];
    Integer[] relatedAids = new Integer[list.length - 1];
    System.arraycopy(list, 1, relatedAids, 0, list.length - 1);

    URL url = PipelineUtils.class.getClassLoader()
            .getResource("edu/scripps/fl/pubchem/RelatedCurvesPipeline.xml");
    Pipeline pipeline = new PipelineUtils().createPipeline(url, Arrays.asList(relatedAids));
    List<Stage> stages = pipeline.getStages();
    BeanUtils.setProperty(stages.get(1), "referenceAID", referenceAid);
    pipeline.run();
    new PipelineUtils().logErrors(pipeline);
}

From source file:edu.scripps.fl.pubchem.app.CIDDownloader.java

public void process(Iterator<?> iterator) throws Exception {
    URL url = getClass().getResource("/edu/scripps/fl/pubchem/SDFDownloadPipeline.xml");
    Pipeline pipeline = new PipelineUtils().createPipeline(url, iterator);
    List<Stage> stages = pipeline.getStages();
    pipeline.run();
    new PipelineUtils().logErrors(pipeline);
}

From source file:edu.scripps.fl.pubchem.app.AssayDownloader.java

public Pipeline assaySummaries(final Set<Long> processAids) throws Exception {
    URL url = PipelineUtils.class.getClassLoader()
            .getResource("edu/scripps/fl/pubchem/BioAssaySummaryPipeline.xml");
    Pipeline pipeline = new PipelineUtils().createPipeline(url, processAids);
    pipeline.run();
    return pipeline;
}

From source file:edu.scripps.fl.pubchem.app.AssayDownloader.java

public Pipeline assayXML(final Set<Long> processAids) throws Exception {
    URL url = PipelineUtils.class.getClassLoader()
            .getResource("edu/scripps/fl/pubchem/BioAssayXMLPipeline.xml");
    Pipeline pipeline = new PipelineUtils().createPipeline(url, processAids);
    for (Stage stage : pipeline.getStages())
        if (stage instanceof ReadDocumentStage)
            ((ReadDocumentStage) stage).setDataUrl(dataUrl);
    pipeline.run();
    new PipelineUtils().logErrors(pipeline);
    return pipeline;

}

From source file:edu.scripps.fl.pubchem.app.ResultDownloader.java

protected void process(Iterator<Integer> processAids) throws Exception {
    URL url = PipelineUtils.class.getClassLoader()
            .getResource("edu/scripps/fl/pubchem/BioAssayResultsPipeline.xml");
    Pipeline pipeline = new PipelineUtils().createPipeline(url, processAids,
            CollectionUtils.createMap("CsvResultsSource", SourceColumnsInfo.Type.FTP));
    for (Stage stage : pipeline.getStages())
        if (stage instanceof DownloadCsvStage)
            ((DownloadCsvStage) stage).setDataUrl(dataUrl);
    pipeline.run();
    new PipelineUtils().logErrors(pipeline);
}