Search in sources :

Example 46 with XmlElement

use of org.xmlpull.infoset.XmlElement in project airavata by apache.

the class EdgeImpl method parse.

/**
 * @param edgeElement
 */
protected void parse(XmlElement edgeElement) {
    XmlElement fromPortElement = edgeElement.element(GraphSchema.EDGE_FROM_PORT_TAG);
    this.fromPortID = fromPortElement.requiredText();
    XmlElement toPortElement = edgeElement.element(GraphSchema.EDGE_TO_PORT_TAG);
    this.toPortID = toPortElement.requiredText();
}
Also used : XmlElement(org.xmlpull.infoset.XmlElement)

Example 47 with XmlElement

use of org.xmlpull.infoset.XmlElement in project airavata by apache.

the class PortImpl method toXML.

/**
 * @return the XML representation of this Port
 */
protected XmlElement toXML() {
    XmlElement portElement = XMLUtil.BUILDER.newFragment(GraphSchema.NS, GraphSchema.PORT_TAG);
    XmlElement idElement = portElement.addElement(GraphSchema.NS, GraphSchema.PORT_ID_TAG);
    idElement.addChild(getID());
    if (this.name != null) {
        // TODO control ports might have name?
        XmlElement nameElement = portElement.addElement(GraphSchema.NS, GraphSchema.PORT_NAME_TAG);
        nameElement.addChild(this.name);
    }
    XmlElement nodeElement = portElement.addElement(GraphSchema.NS, GraphSchema.PORT_NODE_TAG);
    nodeElement.addChild(this.node.getID());
    return portElement;
}
Also used : XmlElement(org.xmlpull.infoset.XmlElement)

Example 48 with XmlElement

use of org.xmlpull.infoset.XmlElement in project airavata by apache.

the class WorkflowWSDL method setupParameterType.

/**
 * @param name
 * @param appinfo
 * @param schema
 * @return The sequence element.
 */
private XmlElement setupParameterType(String name, XmlElement appinfo, XmlElement schema) {
    XmlElement element = schema.addElement(WSConstants.ELEMENT_TAG);
    element.setAttributeValue(WSConstants.NAME_ATTRIBUTE, name);
    String type = name + TYPE_SUFFIX;
    element.setAttributeValue(WSConstants.TYPE_ATTRIBUTE, WSConstants.TYPE_NS_PREFIX + ":" + type);
    // add metadata
    if (appinfo != null) {
        XmlElement annotation = element.addElement(WSConstants.ANNOTATION_TAG);
        try {
            annotation.addElement(XMLUtil.deepClone(appinfo));
        } catch (AiravataException e) {
            log.error(e.getMessage(), e);
        }
    }
    XmlElement complex = schema.addElement(WSConstants.COMPLEX_TYPE_TAG);
    complex.setAttributeValue(WSConstants.NAME_ATTRIBUTE, type);
    XmlElement sequence = complex.addElement(WSConstants.SEQUENCE_TAG);
    return sequence;
}
Also used : XmlElement(org.xmlpull.infoset.XmlElement) AiravataException(org.apache.airavata.common.exception.AiravataException)

Example 49 with XmlElement

use of org.xmlpull.infoset.XmlElement in project airavata by apache.

the class ControlEdge method toXML.

/**
 * @see org.apache.airavata.workflow.model.graph.impl.EdgeImpl#toXML()
 */
@Override
protected XmlElement toXML() {
    XmlElement edgeElement = super.toXML();
    edgeElement.setAttributeValue(GraphSchema.NS, GraphSchema.EDGE_TYPE_ATTRIBUTE, GraphSchema.EDGE_TYPE_CONTROL);
    return edgeElement;
}
Also used : XmlElement(org.xmlpull.infoset.XmlElement)

Example 50 with XmlElement

use of org.xmlpull.infoset.XmlElement in project airavata by apache.

the class ControlPort method toXML.

/**
 * @see org.apache.airavata.workflow.model.graph.impl.PortImpl#toXML()
 */
@Override
protected XmlElement toXML() {
    XmlElement portElement = super.toXML();
    portElement.setAttributeValue(GraphSchema.NS, GraphSchema.PORT_TYPE_ATTRIBUTE, GraphSchema.PORT_TYPE_CONTROL);
    return portElement;
}
Also used : XmlElement(org.xmlpull.infoset.XmlElement)

Aggregations

XmlElement (org.xmlpull.infoset.XmlElement)79 AiravataException (org.apache.airavata.common.exception.AiravataException)5 GraphException (org.apache.airavata.workflow.model.graph.GraphException)5 IOException (java.io.IOException)4 Iterator (java.util.Iterator)4 DataType (org.apache.airavata.model.appcatalog.appinterface.DataType)4 WorkflowRuntimeException (org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException)4 InputNode (org.apache.airavata.workflow.model.graph.system.InputNode)4 LinkedList (java.util.LinkedList)3 ComponentException (org.apache.airavata.workflow.model.component.ComponentException)3 Workflow (org.apache.airavata.workflow.model.wf.Workflow)3 XmlAttribute (org.xmlpull.infoset.XmlAttribute)3 JsonObject (com.google.gson.JsonObject)2 File (java.io.File)2 AiravataClientException (org.apache.airavata.model.error.AiravataClientException)2 AiravataSystemException (org.apache.airavata.model.error.AiravataSystemException)2 InvalidRequestException (org.apache.airavata.model.error.InvalidRequestException)2 WSComponent (org.apache.airavata.workflow.model.component.ws.WSComponent)2 WorkflowException (org.apache.airavata.workflow.model.exceptions.WorkflowException)2 OutputNode (org.apache.airavata.workflow.model.graph.system.OutputNode)2