Revision: 2427
          http://vexi.svn.sourceforge.net/vexi/?rev=2427&view=rev
Author:   mkpg2
Date:     2007-10-11 06:38:41 -0700 (Thu, 11 Oct 2007)

Log Message:
-----------
Commented out code for resolving absolute resources (probably not the way it 
will be done).

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Template.java
    trunk/core/org.vexi.core/src/org/vexi/core/TemplateBuilder.java
    trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp
    trunk/core/org.vexi.core/src_junit/test/core/CoreTestCase.java

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Template.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Template.java    2007-10-11 
12:39:28 UTC (rev 2426)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Template.java    2007-10-11 
13:38:41 UTC (rev 2427)
@@ -154,7 +154,7 @@
        if (t != null){
                // make sure we have resolved (if were top level)
                if(t.staticPart!=null && t.staticPart.staticObject==null){
-                       t = 
((Blessing)Vexi.resolveString(t.vexi,t.staticPart.sourceName, 
false)).initTemplate(t);
+                       t = 
((Blessing)Vexi.resolveString(t.vexi,t.staticPart.sourceName)).initTemplate(t);
                }
                t.apply(b, args, null);
         }
@@ -426,7 +426,7 @@
                        // Resolve on demand (each prefix resolved once per 
template file)
                        if(resolve && r instanceof String){
                                //  TODO convert to Blessing
-                               r = Vexi.resolveString(vexi,(String)r, true);
+                               r = Vexi.resolveString(vexi,(String)r);
                                map.put(key, r);
                        }
                        

Modified: trunk/core/org.vexi.core/src/org/vexi/core/TemplateBuilder.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/TemplateBuilder.java     
2007-10-11 12:39:28 UTC (rev 2426)
+++ trunk/core/org.vexi.core/src/org/vexi/core/TemplateBuilder.java     
2007-10-11 13:38:41 UTC (rev 2427)
@@ -90,6 +90,7 @@
                        InputStream is = JSU.getInputStream(s);
                        
                        if (is != null) {
+                           // try {
                                parse(new InputStreamReader(is));
                                
if(Log.sLevel==Log.DEBUG)Log.uDebug(TemplateHelper.class, "Parsing template: " 
+ sourceName());
                                JS staticScript = 
parseScript(staticCode.content, staticCode.content_start, sourceName(), 
createStaticChecker(staticCode.uriPrefixes));
@@ -105,6 +106,10 @@
                                }else{
                                        Log.uWarn(LOG_TYPE, "'" +  
unresolved.staticPart.sourceName + ".t' does not declare a template");
                                }
+                               // required?
+                               //}finally{
+                       //is.close();
+                       //}
                        }
                }catch(JSExn e){
                        throw e;

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp 2007-10-11 12:39:28 UTC 
(rev 2426)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp 2007-10-11 13:38:41 UTC 
(rev 2427)
@@ -32,18 +32,19 @@
                Log.uInfo(Main.class, "invoking initial template: "+ 
Main.initialTemplate);
                Thread.beforeNonJS();
                try{
-                       resolveString(this, Main.initialTemplate, 
false).call(null, new JS[]{new Box()});
+                       resolveString(this, Main.initialTemplate).call(null, 
new JS[]{new Box()});
                }finally{
                        Thread.afterNonJS();
                }
                return null;
        }
     
-    static public JS resolveString(JS vexi, String str, boolean 
permitAbsolute) throws JSExn {
-        if (str.indexOf("://") != -1) {
+    static public JS resolveString(JS vexi, String str/*, boolean 
permitAbsolute*/) throws JSExn {
+        /* absolute - REMARK - unused, does it make anysense?
+       if (str.indexOf("://") != -1) {
             if (permitAbsolute) return Resources.fountainForName(str);
             throw new JSExn("absolute URL " + str + " not permitted here");
-        }
+        }*/
         // root-relative
         JS ret = (JS)vexi.getAndTriggerTraps(SC_);
 
@@ -197,6 +198,11 @@
             case "log.error":    if(args.length<1) JSU.error(null); else 
JSU.error(args[0]); return null;
             case "net.rpc.soap": return new SOAP(JSU.toString(args[0]), 
JSU.toString(args[1]), JSU.toString(args[2]));
             case "stream.url":   return Resources.fountainForNames(args);
+            case "stream.cache": return Resources.fountainForNames(args);
+                //try { return args[0] == null ? null : new 
Fountain.CachedStream((Stream)args[0], "resources", true); }
+                //catch (Stream.NotCacheableException e) { throw new 
JSExn("this resource cannot be cached"); }
+
+            case "stream.url":   return Resources.fountainForNames(args);
             //#end
  
             switch (args.length) {
@@ -226,9 +232,6 @@
                        case "regexp": return new JSRegexp(args[0], null);
                        case "stream.unzip": return args[0] == null ? null : 
new Fountain.Zip((Fountain)args[0]);
                        //case "stream.uncab": return a == null ? null : new 
Stream.Cab(a);
-                       case "stream.cache":
-                           //try { return args[0] == null ? null : new 
Fountain.CachedStream((Stream)args[0], "resources", true); }
-                           //catch (Stream.NotCacheableException e) { throw 
new JSExn("this resource cannot be cached"); }
                        case "stream.write.xml": return 
Resources.writeXML(args);
                        case "stream.parse.html": throw new JSExn("not 
implemented yet"); //return null;
                            // FIXME backgrounding

Modified: trunk/core/org.vexi.core/src_junit/test/core/CoreTestCase.java
===================================================================
--- trunk/core/org.vexi.core/src_junit/test/core/CoreTestCase.java      
2007-10-11 12:39:28 UTC (rev 2426)
+++ trunk/core/org.vexi.core/src_junit/test/core/CoreTestCase.java      
2007-10-11 13:38:41 UTC (rev 2427)
@@ -7,7 +7,6 @@
 import org.ibex.js.Thread;
 import org.ibex.util.Callable;
 import org.ibex.util.Log;
-import org.ibex.util.Queue;
 import org.vexi.core.Box;
 import org.vexi.core.DevUtil;
 import org.vexi.core.Main;
@@ -71,7 +70,7 @@
                                Log.uInfo(CoreTestCase.class, "invoking initial 
template: "+ main);
                                Thread.beforeNonJS();
                                try{
-                                       Vexi.resolveString(v, main, 
false).call(null, new JS[]{new Box()});
+                                       Vexi.resolveString(v, main).call(null, 
new JS[]{new Box()});
                                }finally{
                                        Thread.afterNonJS();
                                }


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to