Package org.apache.airavata.xbaya.jython.script

Examples of org.apache.airavata.xbaya.jython.script.JythonScript


    public boolean saveWorkflow() {
        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
            try {

                Workflow workflow = this.engine.getGUI().getWorkflow();
                JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());

                // Check if there is any errors in the workflow first.
                ArrayList<String> warnings = new ArrayList<String>();
                if (!script.validate(warnings)) {
                    StringBuilder buf = new StringBuilder();
                    for (String warning : warnings) {
                        buf.append("- ");
                        buf.append(warning);
                        buf.append("\n");
View Full Code Here


    public boolean saveWorkflow() {
        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
            try {

                Workflow workflow = this.engine.getGUI().getWorkflow();
                JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());

                // Check if there is any errors in the workflow first.
                ArrayList<String> warnings = new ArrayList<String>();
                if (!script.validate(warnings)) {
                    StringBuilder buf = new StringBuilder();
                    for (String warning : warnings) {
                        buf.append("- ");
                        buf.append(warning);
                        buf.append("\n");
View Full Code Here

    public boolean saveWorkflow() {
        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
            try {

                Workflow workflow = this.engine.getGUI().getWorkflow();
                JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());

                // Check if there is any errors in the workflow first.
                ArrayList<String> warnings = new ArrayList<String>();
                if (!script.validate(warnings)) {
                    StringBuilder buf = new StringBuilder();
                    for (String warning : warnings) {
                        buf.append("- ");
                        buf.append(warning);
                        buf.append("\n");
View Full Code Here

        String workflowFile2String = IOUtil.readFileToString(workflowFile2);
        assertEquals(workflowFileString, workflowFile2String);

        // Create a Jython script
        File jythonFile = new File(this.temporaryDirectory, "web-complex-math.py");
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
        IOUtil.writeToFile(script.getJythonString(), jythonFile);
    }
View Full Code Here

            return;
        }

        // Check if the workflow is valid before the user types in input
        // values.
        JythonScript jythonScript = new JythonScript(this.workflow, this.engine.getConfiguration());
        ArrayList<String> warnings = new ArrayList<String>();
        if (!jythonScript.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
View Full Code Here

    /**
     * Exports a Jython script to the local file
     */
    public void exportJythonScript() {
        Workflow workflow = this.engine.getGUI().getWorkflow();
        JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());

        // Check if there is any errors in the workflow first.
        ArrayList<String> warnings = new ArrayList<String>();
        if (!script.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getGUI().getErrorWindow().warning(buf.toString());
            return;
        }

        int returnVal = this.jythonFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.jythonFileChooser.getSelectedFile();
            logger.info(file.getPath());

            // Put ".py" at the end of the file name
            String path = file.getPath();
            if (!path.endsWith(XBayaConstants.JYTHON_SCRIPT_SUFFIX)) {
                file = new File(path + XBayaConstants.JYTHON_SCRIPT_SUFFIX);
            }

            try {
                // Create the script.
                script.create();
                // Write to a file
                IOUtil.writeToFile(script.getJythonString(), file);
            } catch (IOException e) {
                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
            } catch (GraphException e) {
                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
            } catch (RuntimeException e) {
View Full Code Here

        this.engine = engine;
        this.workflow = this.engine.getGUI().getWorkflow();
        this.topicTextField = topicTextField;
        this.parameterTextFields = parameterTextFields;
        this.gfacTextField = new XBayaTextField();
        this.script = new JythonScript(this.workflow, this.engine.getConfiguration());

        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
View Full Code Here

    /**
     * Shows the dialog.
     */
    public void show() {
        this.workflow = this.engine.getGUI().getWorkflow();
        this.script = new JythonScript(this.workflow, this.engine.getConfiguration());

        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
View Full Code Here

    /**
     * Shows the dialog.
     */
    public void show() {
        this.workflow = this.engine.getGUI().getWorkflow();
        this.script = new JythonScript(this.workflow, this.engine.getConfiguration());

        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
View Full Code Here

        File workflowFile = new File("tmp/simple-math.xwf");
        XMLUtil.saveXML(workflow.toXML(), workflowFile);

        // Creates a Jython script
        File jythonFile = new File("tmp/simple-math.py");
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
        IOUtil.writeToFile(script.getJythonString(), jythonFile);
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.jython.script.JythonScript

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.