Revision: 1946
          http://svn.sourceforge.net/vexi/?rev=1946&view=rev
Author:   mkpg2
Date:     2007-07-08 09:15:24 -0700 (Sun, 08 Jul 2007)

Log Message:
-----------
Feature. Added params (replaces so called transitory preferences in Vexi1, 
removed in Vexi2 but the functionality was not restored).

Modified Paths:
--------------
    core/branches/vexi2/org.vexi.core/src/org/vexi/core/Main.java

Modified: core/branches/vexi2/org.vexi.core/src/org/vexi/core/Main.java
===================================================================
--- core/branches/vexi2/org.vexi.core/src/org/vexi/core/Main.java       
2007-07-08 16:08:10 UTC (rev 1945)
+++ core/branches/vexi2/org.vexi.core/src/org/vexi/core/Main.java       
2007-07-08 16:15:24 UTC (rev 1946)
@@ -12,6 +12,7 @@
 import org.ibex.js.Fountain;
 import org.ibex.js.JS;
 import org.ibex.js.JSExn;
+import org.ibex.js.JSU;
 import org.ibex.js.Scheduler;
 import org.ibex.js.Fountain.Multiple;
 import org.ibex.util.Basket;
@@ -27,6 +28,8 @@
 
     public static String origin = null;
     public static String initialTemplate = "main";
+    public static JS params = new JS.Obj();
+    
  
     public static final Fountain vera;
     public static final Fountain scar;
@@ -125,7 +128,7 @@
         String startupTemplate = null;
         for (int i=startargs; i<args.length; i++) {
             if (args[i].indexOf('=') != -1) {
-                loadParamValue(args[i], null);//paramValues);
+                loadParam(args[i]);
             }
             else {
                 rr = Resources.cacheableForName(args[i]);
@@ -204,7 +207,7 @@
     
     
 
-    private static void loadParamValue(String param, Basket.Hash values) {
+    private static void loadParam(String param) {
         int pos = param.indexOf('=');
         String key = param.substring(0, pos);
         String value = param.substring(pos+1);
@@ -214,10 +217,12 @@
                 value = value.substring(1, len-1);
             }
             else if (value.charAt(0) == '\'' && value.charAt(len-1) == '\'') {
-                    value = value.substring(1, len-1);
-                }
+                value = value.substring(1, len-1);
+            }
         }
-        values.put(key, value);
+        try{
+               params.put(JSU.S(key), JSU.S(value));
+        }catch(JSExn e){Log.warn(Main.class, e);/*Should not happen */}
     }
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to