package Test;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import CLInterface.ConverterConfig;
import Taverna.Tree.Workflow;
import LONI.tree.module.Output;
import LONI.tree.module.Parameter;
import LONI.tree.workflow.Pipeline;
import LONI.visitor.LoniToGalaxyConverter;
import Taverna.Visitor.TavernaToLoniConverter;
import Specification.GalaxySpecification;
import Specification.TavernaSpecification;
import Specification.LoniSpecification;
public class NickTestTavToPipe {
public static void main(String[] args){
testTavToPipe("data/Taverna/input/INPUT_OUTPUT_ONE_CONNECTION.t2flow", "data/Taverna/output/IOOCOutput.pipe");
//testTavToPipe("data/Taverna/input/OneLink.t2flow", "data/Taverna/output/OneLinkOutput.pipe");
}
private static void testTavToPipe(String inputPath, String outputPath){
System.out.println("==="+inputPath+"===");
Workflow workflow;
try {
System.out.println("Before parsing...");
workflow = TavernaSpecification.getXMLParser().parse(new File(inputPath));
System.out.println("After parsing...");
TavernaToLoniConverter tlc = new TavernaToLoniConverter();
System.out.println("After creating a Tav to Loni converter...");
Pipeline pipeline = (Pipeline) tlc.visit(workflow);
System.out.println("After creating the Pipeline object via visit(Workflow)...");
LoniSpecification.getXMLGenerator().generate(pipeline, outputPath);
System.out.println("After generating output file...");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException ex){
ex.printStackTrace();
}
}
}