Examples of DataPort


Examples of edu.indiana.extreme.xbaya.graph.DataPort

            index = outputPorts.indexOf(port);
        } else {
            throw new XBayaRuntimeException();
        }

        DataPort inputPort1 = inputPorts.get(index);
        DataPort inputPort2 = inputPorts.get(size + index);
        DataPort outputPort = outputPorts.get(index);

        QName inputType1 = inputPort1.getType();
        QName inputType2 = inputPort2.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort1) {
            // input1 -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of input "
                        + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input1 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }

        } else if (port == inputPort2) {
            // input2 -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of input "
                        + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input2 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " ("
                        + inputType2 + ") of " + getID()
View Full Code Here

Examples of edu.indiana.extreme.xbaya.graph.DataPort

            // propagate to the connected ports.
            Kind kind = getKind();
            for (DataEdge edge : getEdges()) {
                if (kind == Kind.DATA_IN) {
                    DataPort fromPort = edge.getFromPort();
                    fromPort.copyType(this);
                } else if (kind == Kind.DATA_OUT) {
                    DataPort toPort = edge.getToPort();
                    toPort.copyType(this);
                } else {
                    new XBayaRuntimeException();
                }
            }
        }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.graph.DataPort

    if (node.getOutputPorts().size() != 1) {
      throw new GraphException("Number of out ports in WS node "
          + node.getName() + "is invalid:"
          + node.getOutputPorts().size());
    }
    DataPort outputPort = node.getOutputPort(0);

    WSComponent component = node.getComponent();
    String inputPartName = component.getInputPartName();
    String inputTypeName = component.getInputTypeName();

    XmlElement complexType = extensions.addElement(scuflNS, "complextype");
    complexType.addAttribute("optional", "false");
    complexType.addAttribute("unbounded", "false");
    complexType.addAttribute("typename", inputTypeName);

    String spliterName = inputPartName;
    complexType.addAttribute("name", spliterName);
    complexType.addAttribute("qname", inputName.toString());
   
   
    XmlElement element = complexType.addElement(scuflNS, "elements");
    for (DataPort port : inputPorts) {
      if ("http://www.w3.org/2001/XMLSchema".equals(port.getType()
          .getNamespaceURI())) {
        XmlElement baseType = element.addElement(scuflNS, "basetype");
        baseType.addAttribute("optional", "false");
        baseType.addAttribute("unbounded", "false");
        baseType
            .addAttribute("typename", port.getType().getLocalPart());
        baseType.addAttribute("name", port.getName());
        baseType.addAttribute("qname", inputTypeName + ">"
            + port.getName());

       
      }
      // all the sources are written here
      // the links from input nodes to the spiters are done here
      // links from the from node output splitter to the this service's
      // inputsplitter is done here

      if (port.getFromNode() instanceof InputNode) {
        XmlElement source = builder.newFragment(scuflNS, "source");
        source.addAttribute("name", port.getFromNode().getID());
        if (!sourceExist(port.getFromNode().getID())) {
          this.sources.put(port.getFromNode().getID(), source);
        }
        XmlElement link = builder.newFragment(scuflNS, "link");
        link.addAttribute("source", port.getFromNode().getID());
        link.addAttribute("sink", getValidName(node)
            + "InputMessagePartXML:" + port.getName());
        this.links.add(link);

      } else if (port.getFromNode() instanceof WSNode) {
        XmlElement link = builder.newFragment(scuflNS, "link");
        if (port.getFromNode().getOutputPorts().size() != 1) {
          throw new GraphException(
              "Number of out ports in from WS node "
                  + port.getFromNode().getName()
                  + "is invalid:"
                  + node.getOutputPorts().size());
        }
        link.addAttribute("source", getValidName((WSNode) port
            .getFromNode())
            + "OutputMessagePartXML:"
            + port.getFromNode().getOutputPort(0).getName());
        link.addAttribute("sink", getValidName(node)
            + "InputMessagePartXML:" + port.getName());
        this.links.add(link);
      } else {
        throw new GraphException("Unhandled from node type:"
            + port.getFromNode() + " for node" + node.getName());
      }
    }

    // link from the spliter to the service

    XmlElement link = builder.newFragment(scuflNS, "link");
    link.addAttribute("source", getValidName(node)
        + "InputMessagePartXML:output");
    link.addAttribute("sink", getValidName(node) + ":" + spliterName);
    this.links.add(link);

    // link from service out to the ouput spliter

    link = builder.newFragment(scuflNS, "link");
    link.addAttribute("source", getValidName(node) + ":"
        + node.getComponent().getOutputPartName());
    link.addAttribute("sink", getValidName(node)
        + "OutputMessagePartXML:input");
    this.links.add(link);

    // /outspiltor
    XmlElement outProcessor = scufl.addElement(scuflNS, "processor");
    outProcessor.addAttribute("name", getValidName(node)
        + "OutputMessagePartXML");
    XmlElement outLocal = outProcessor.addElement(scuflNS, "local");
    outLocal.addChild(0,
        "org.embl.ebi.escience.scuflworkers.java.XMLOutputSplitter");
    XmlElement outExtensions = outLocal.addElement(scuflNS, "extensions");
    XmlElement outComplextype = outExtensions.addElement(scuflNS,
        "complextype");
    outComplextype.addAttribute("optional", "false");
    outComplextype.addAttribute("unbounded", "false");
    outComplextype.addAttribute("typename", component.getOutputTypeName());
    outComplextype.addAttribute("name", component.getOutputPartName());
    QName outputName = getOutputElementName(node);
    if (null == outputName) {
      throw new GraphException("No Valid output type found for WS Node"
          + node.getName());
    }
    outComplextype.addAttribute("qname", outputName.toString());
    XmlElement elements = outComplextype.addElement(scuflNS, "elements");
    XmlElement outBaseType = elements.addElement(scuflNS, "basetype");
    outBaseType.addAttribute("optional", "false");
    outBaseType.addAttribute("unbounded", "false");

    outBaseType.addAttribute("typename", outputPort.getType()
        .getLocalPart());
    String Z = component.getOutputPort(0).getName();
    outBaseType.addAttribute("name", Z);
   
    outBaseType.addAttribute("qname", component.getOutputTypeName()
        + ">" +Z);

   

    List<DataPort> outputPorts = node.getOutputPorts();
    for (DataPort port : outputPorts) {
      List<Node> toNodes = port.getToNodes();
      for (Node toNode : toNodes) {
        if (toNode instanceof OutputNode) {
          if ("http://www.w3.org/2001/XMLSchema".equals(port
              .getType().getNamespaceURI())) {
            XmlElement sink = builder.newFragment(scuflNS, "sink");
            sink.addAttribute("name", toNode.getID());
            sinks.add(sink);
            link = builder.newFragment(scuflNS, "link");
            link.addAttribute("source", getValidName(node)
                + "OutputMessagePartXML:" + outputPort.getName());
            link.addAttribute("sink", toNode.getID());
            this.links.add(link);
          }
        }
      }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.graph.DataPort

      Port fromPort = inPort.getFromPort();
      Node fromNode = inPort.getFromNode();
      if (fromNode instanceof WSNode) {
        WSNode fromWsNode = (WSNode) fromNode;
        if (null != fromPort && fromPort instanceof DataPort) {
          DataPort fromDataPort = (DataPort) fromPort;
          WsdlDefinitions wsdl = engine.getWorkflow().getWSDLs().get(
              fromWsNode.getWSDLID());
          System.out.println(xsul5.XmlConstants.BUILDER
              .serializeToString(wsdl.xml()));
          Iterator<XmlNamespace> itr = wsdl.xml().namespaces()
              .iterator();
          try {
            XmlElement schema = wsdl.getTypes().element("schema")
                .clone();
            // do not change the following ordering of setting
            // namespaces.
            schema
                .setNamespace(xsul5.XmlConstants.BUILDER
                    .newNamespace("http://www.w3.org/2001/XMLSchema"));
            while (itr.hasNext()) {
              XmlNamespace next = itr.next();
              if (!"".equals(next.getPrefix())
                  && null != next.getPrefix()) {
                schema.setAttributeValue("xmlns:"
                    + next.getPrefix(), next.getName());
              }

            }

            try {
              xsul5.XmlConstants.BUILDER
                  .serializeToOutputStream(schema,
                      new FileOutputStream(rootDir
                          .getCanonicalPath()
                          + File.separatorChar
                          + "types.xsd"));
            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }

            System.out.println(fromDataPort.getType());

            typesPath = rootDir.getCanonicalPath() + File.separatorChar
                + "mytype.jar";
            String[] args = new String[] {
                "-d",
View Full Code Here

Examples of edu.indiana.extreme.xbaya.graph.DataPort

      Port fromPort = inPort.getFromPort();
      Node fromNode = inPort.getFromNode();
      if (fromNode instanceof WSNode) {
        WSNode fromWsNode = (WSNode) fromNode;
        if (null != fromPort && fromPort instanceof DataPort) {
          DataPort fromDataPort = (DataPort) fromPort;

        } else {
          return false;
        }
      } else {
View Full Code Here

Examples of org.apache.airavata.workflow.model.graph.DataPort

            if (graphPiece instanceof DynamicNode) {
                if (this.draggedPort.getKind() == Kind.DATA_OUT && draggedPort instanceof DataPort) {
                    this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
                    DynamicNode dynamicNode = (DynamicNode) graphPiece;
                    dynamicNode.getComponent();
                    DataPort freePort = dynamicNode.getFreeInPort();
                    try {
                        freePort.copyType((DataPort) draggedPort);
                    } catch (GraphException e) {
                        engine.getGUI().getErrorWindow().error(e);
                        return;
                    }
                    // selectInputPort(freePort);
View Full Code Here

Examples of org.apache.airavata.workflow.model.graph.DataPort

            index = outputPorts.indexOf(port);
        } else {
            throw new WorkflowRuntimeException();
        }

        DataPort inputPort1 = inputPorts.get(index);
        DataPort inputPort2 = inputPorts.get(size + index);
        DataPort outputPort = outputPorts.get(index);

        QName inputType1 = inputPort1.getType();
        QName inputType2 = inputPort2.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort1) {
            // input1 -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input1 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }

        } else if (port == inputPort2) {
            // input2 -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input2 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " (" + inputType2 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
View Full Code Here

Examples of org.apache.airavata.workflow.model.graph.DataPort

        List<DataEdge> edges = getEdges();
        QName parameterType = super.getParameterType();
        if (parameterType == null && getEdges().size() > 0) {
            // This happens when the graph XML doesn't have parameterType.
            DataEdge edge = edges.get(0);
            DataPort toPort = edge.getToPort();
            parameterType = toPort.getType();
        }
        return parameterType;
    }
View Full Code Here

Examples of org.apache.airavata.workflow.model.graph.DataPort

        super.edgeWasAdded(edge);

        // TODO organize this.
        if (edge instanceof DataEdge) {
            DataEdge dataEdge = (DataEdge) edge;
            DataPort toPort = dataEdge.getToPort();
            QName toType = toPort.getType();

            List<DataEdge> edges = getEdges();
            if (edges.size() == 1) {
                // The first edge.
                setParameterType(toType);
View Full Code Here

Examples of org.apache.airavata.workflow.model.graph.DataPort

     * Adds additional input port.
     */
    public void addInputPort() {
        EndForEachComponent component = getComponent();
        ComponentDataPort input = component.getInputPort();
        DataPort port = input.createPort();
        addInputPort(port);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.