Package LONI.tree.module

Examples of LONI.tree.module.Parameter


    String sinkLinkType = "";
    String sinkPort = "";
    String sinkProcessor = "";
    Link source;
    Link sink;
    Parameter parameter = null;
    Output output = null;
    Format format;
    FileTypes fileTypes;
   

    for(DataLink d : datalinks){
      source = d.getSource();
      sourceLinkType = source.getLinkType();
      sourcePort = source.getPort();
      sourceProcessor = source.getProcessor();
     
      sink = d.getSink();
      sinkLinkType = sink.getLinkType();
      sinkPort = sink.getPort();
      sinkProcessor = sink.getProcessor();
     
     
      // Even if the Taverna port is a SOURCE, that will correspond to Output.class in LONI. It's weird, but you have to be careful. In side the Input of LONI, the dataModule actually contains <output>, not <input>!
      if(sinkPort == inputPortName){
        parameter = new Parameter();
        parameter.setId(dataModule.getId() +".Input");
        parameter.setName(inputPortName);
        parameter.setDescription("Input description");
        parameter.setRequired(true);
        parameter.setEnabled(true);
        parameter.setOrder(tavernaContext.getNextOrder());
        parameter.setLink("");
        parameter.setValues(new Values());
        // Create a new Format for parameter
        format = new Format();
        format.setType("File");
        format.setCardinality(1);
        format.setCardinalityBase("");
          format.setTransformationBase("");
         
        // Create and fill in file types for format
        fileTypes = new FileTypes();
        fileTypes.addFileType(new FileType(TavernaType, "", ""));
        format.setFileTypes(fileTypes);
       
        // Give parameter the newly created Format object
        parameter.setFileFormat(format);
       
        dataModule.addInput(parameter);
        break;
      }
      else if(sourcePort == inputPortName){
View Full Code Here


 
  /* (non-Javadoc)
   * @see Taverna.Visitor.DataFlowImplVisitor#visit(Taverna.Tree.Processor.ActivityInputPortDefinitionBean)
   */
  public Object visit(ActivityInputPortDefinitionBean input){
    Parameter p = new Parameter();
    p.setName( input.getName());
    p.setPrefix(input.getName()+"=");
    p.setEnabled(true);
    p.setOrder(1);
    p.setPrefixSpaced(false);
    p.setFileFormat(new Format());
    p.getFormat().setCardinality(1);
    p.getFormat().setType("File");
    if(input.getTranslatedElementType() != null){
      String elem_class = input.getTranslatedElementType();
      if(elem_class.equals("java.lang.String")){
        p.getFormat().setType("String");
      }
    }
    return p;
  }
View Full Code Here

  public Object visit(lWACBInputs inputs){
    List<Parameter> params = new ArrayList<Parameter>();
   
    if(inputs.getiWACBInputs() != null){
      for(ActivityInputPortDefinitionBean o : inputs.getiWACBInputs()){
        Parameter p = (Parameter)visit(o);
        if(p != null)
          params.add(p);
      }
     
    }
View Full Code Here

    String location= ConverterConstants.LOCALHOST_PATH +
             ConverterConfig.TAVERNA_BEANSHELL_LOCATION;
    String wrapper = ConverterConfig.GALAXY_SCRIPT_DIR + ConverterConstants.BEANSHELL_WRAPPER;
    List<Parameter> args = new ArrayList<Parameter>();
   
    Parameter scriptParam = new Parameter();
    scriptParam.setName("Beanshell wrapper script");
    scriptParam.setEnabled(true);
    scriptParam.setOrder(0);
    scriptParam.setFileFormat(new Format());
    scriptParam.getFileFormat().setType("String");
    scriptParam.getFileFormat().setCardinality(1);
    Value val = new Value();
    val.setValue(wrapper);
    scriptParam.getValues().addValue(val);
    args.add(scriptParam);       
   
    if(c.getlWACB() != null){
      Parameter scriptBody = new Parameter();
      scriptBody.setName("Beanshell script body");
      scriptBody.setEnabled(true);
      scriptBody.setOrder(1);
      scriptBody.setPrefix("@");
      scriptBody.setPrefixSpaced(false);
      scriptBody.setFileFormat(new Format());
      scriptBody.getFileFormat().setType("String");
      scriptBody.getFileFormat().setCardinality(1);
      Value myval = new Value();
      myval.setValue(cleanStringValue(c.getlWACB().getScript()));
      scriptBody.getValues().addValue(myval);
      args.add(scriptBody);
     
      List<Parameter> inputs = (List<Parameter> ) visit(c.getlWACB().getIWACBIn());
      List<Output> outputs = (List<Output>) visit(c.getlWACB().getiWACBOut());
      if(inputs !=null)
View Full Code Here

TOP

Related Classes of LONI.tree.module.Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.