Search in sources :

Example 71 with XmlElement

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

the class SystemDataPort 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_SYSTEM_DATA);
    return portElement;
}
Also used : XmlElement(org.xmlpull.infoset.XmlElement)

Example 72 with XmlElement

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

the class StreamSourceNode method toXML.

public XmlElement toXML() {
    XmlElement xml = super.toXML();
    xml.setAttributeValue(GraphSchema.NS, GraphSchema.NODE_TYPE_ATTRIBUTE, GraphSchema.NODE_TYPE_STREAM_SOURCE);
    return xml;
}
Also used : XmlElement(org.xmlpull.infoset.XmlElement)

Example 73 with XmlElement

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

the class WorkflowImportWindow method ok.

private void ok() {
    List<RegistrySearchResult> selectedValues = this.list.getSelectedValues();
    try {
        for (RegistrySearchResult result : selectedValues) {
            org.apache.airavata.model.Workflow workflow = getClient().getWorkflow(result.getResourceName());
            XmlElement workflowElement = XMLUtil.stringToXmlElement(workflow.getGraph());
            Workflow w = new Workflow(workflowElement);
            GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
            newGraphCanvas.setWorkflow(w);
            engine.getGUI().getGraphCanvas().setWorkflowFile(null);
        }
        hide();
    } catch (Exception e) {
        engine.getGUI().getErrorWindow().error(e);
    }
}
Also used : RegistrySearchResult(org.apache.airavata.xbaya.ui.experiment.RegistrySearchResult) XmlElement(org.xmlpull.infoset.XmlElement) Workflow(org.apache.airavata.workflow.model.wf.Workflow) GraphCanvas(org.apache.airavata.xbaya.ui.graph.GraphCanvas) InvalidRequestException(org.apache.airavata.model.error.InvalidRequestException) TException(org.apache.thrift.TException) AiravataClientException(org.apache.airavata.model.error.AiravataClientException) AiravataSystemException(org.apache.airavata.model.error.AiravataSystemException)

Example 74 with XmlElement

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

the class ConstantConfigurationDialog method show.

/**
 * Shows the dialog.
 */
public void show() {
    DataType type = this.node.getType();
    XBayaTextComponent textComponent;
    textComponent = this.valueTextField;
    this.valueLabel.setText("Default value");
    this.valueLabel.setLabelFor(textComponent);
    final int index = 7;
    this.gridPanel.remove(index);
    this.gridPanel.add(textComponent, index);
    this.gridPanel.layout(4, 2, 3, 1);
    String name = this.node.getName();
    this.nameTextField.setText(name);
    this.idTextField.setText(this.node.getID());
    this.typeTextField.setText(type.toString());
    Object value = this.node.getValue();
    String valueString;
    if (value == null) {
        valueString = "";
    } else if (value instanceof XmlElement) {
        valueString = XMLUtil.xmlElementToString((XmlElement) value);
    } else {
        valueString = value.toString();
    }
    textComponent.setText(valueString);
    this.dialog.show();
}
Also used : XBayaTextComponent(org.apache.airavata.xbaya.ui.widgets.XBayaTextComponent) DataType(org.apache.airavata.model.appcatalog.appinterface.DataType) XmlElement(org.xmlpull.infoset.XmlElement)

Example 75 with XmlElement

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

the class DifferedInputConfigurationDialog method show.

/**
 * Shows the dialog.
 */
public void show() {
    DataType type = this.node.getParameterType();
    XBayaTextComponent textComponent;
    // boolean knownType = LEADTypes.isKnownType(type);
    textComponent = this.valueTextField;
    this.valueLabel.setText("Default value");
    this.valueLabel.setLabelFor(textComponent);
    final int index = 5;
    this.gridPanel.remove(index);
    this.gridPanel.add(textComponent, index);
    this.gridPanel.layout(new double[] { 0, 1.0 / 2, 0, 1.0 / 2 }, new double[] { 0, 1 });
    // String name = this.node.getConfiguredName();
    // if (name == null) {
    // name = this.node.getName();
    // }
    // Show ID.
    String name = this.node.getID();
    this.nameTextField.setText(name);
    this.descriptionTextArea.setText(this.node.getDescription());
    Object value = this.node.getDefaultValue();
    String valueString;
    if (value == null) {
        valueString = "";
    } else if (value instanceof XmlElement) {
        valueString = XMLUtil.xmlElementToString((XmlElement) value);
    } else {
        valueString = value.toString();
    }
    textComponent.setText(valueString);
    XmlElement metadata = this.node.getMetadata();
    String metadataText;
    if (metadata == null) {
        metadataText = WSConstants.EMPTY_APPINFO;
    } else {
        metadataText = XMLUtil.xmlElementToString(metadata);
    }
    this.metadataTextArea.setText(metadataText);
    this.dialog.show();
}
Also used : XBayaTextComponent(org.apache.airavata.xbaya.ui.widgets.XBayaTextComponent) DataType(org.apache.airavata.model.appcatalog.appinterface.DataType) 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