From fbd58d26a45c6efc9de89553c49465d8bef5f5d9 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 26 Apr 2012 00:33:53 +0200 Subject: Script fixes --- resources/boot/SC/ServerNewEntity.xml | 17 +-- .../gui/tabs/outcome/form/OutcomeEditor.java | 4 +- source/com/c2kernel/scripting/Parameter.java | 5 + source/com/c2kernel/scripting/Script.java | 157 ++++++++++++--------- source/com/c2kernel/scripting/ScriptConsole.java | 4 +- 5 files changed, 104 insertions(+), 83 deletions(-) diff --git a/resources/boot/SC/ServerNewEntity.xml b/resources/boot/SC/ServerNewEntity.xml index 2f89927..71753bf 100755 --- a/resources/boot/SC/ServerNewEntity.xml +++ b/resources/boot/SC/ServerNewEntity.xml @@ -3,18 +3,9 @@ diff --git a/source/com/c2kernel/gui/tabs/outcome/form/OutcomeEditor.java b/source/com/c2kernel/gui/tabs/outcome/form/OutcomeEditor.java index 7809480..566d7c5 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/OutcomeEditor.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/OutcomeEditor.java @@ -67,7 +67,7 @@ class OutcomeEditor extends JFrame implements ActionListener { } try { - schemaURL = schemaFile.toURL(); + schemaURL = schemaFile.toURI().toURL(); } catch (Exception e) { System.out.println("Invalid schema URL"); System.exit(1); @@ -78,7 +78,7 @@ class OutcomeEditor extends JFrame implements ActionListener { } try { - instanceURL = instanceFile.toURL(); + instanceURL = instanceFile.toURI().toURL(); } catch (Exception e) { } try { diff --git a/source/com/c2kernel/scripting/Parameter.java b/source/com/c2kernel/scripting/Parameter.java index a518c02..ed9a963 100644 --- a/source/com/c2kernel/scripting/Parameter.java +++ b/source/com/c2kernel/scripting/Parameter.java @@ -13,6 +13,11 @@ public class Parameter { public Parameter(String name) { this.name = name; } + + public Parameter(String name, Class type) { + this.name = name; + this.type = type; + } public void setName(String n) { diff --git a/source/com/c2kernel/scripting/Script.java b/source/com/c2kernel/scripting/Script.java index ad98eb4..7e40003 100644 --- a/source/com/c2kernel/scripting/Script.java +++ b/source/com/c2kernel/scripting/Script.java @@ -6,6 +6,7 @@ import java.util.HashMap; import javax.script.Bindings; import javax.script.ScriptEngine; +import javax.script.ScriptEngineFactory; import javax.script.ScriptEngineManager; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -33,13 +34,12 @@ import com.c2kernel.utils.Logger; **************************************************************************/ public class Script { - Class mOutputClass; - String mOutputName; String mScript = ""; String mName; String mVersion; HashMap mInputParams = new HashMap(); HashMap mAllInputParams = new HashMap(); + HashMap mOutputParams = new HashMap(); ArrayList