diff --git a/src/helma/framework/core/ESAppNode.java b/src/helma/framework/core/ESAppNode.java index f80770fc..a22d26d9 100644 --- a/src/helma/framework/core/ESAppNode.java +++ b/src/helma/framework/core/ESAppNode.java @@ -7,6 +7,7 @@ import helma.objectmodel.*; import FESI.Exceptions.*; import FESI.Data.*; import FESI.Interpreter.Evaluator; +import java.util.Iterator; /** * ESApp represents the app node of an application, providing an app-wide transient shared @@ -47,6 +48,21 @@ public class ESAppNode extends ESNode { if ("upSince".equals (propname)) { return createtime; } + if ("skinfiles".equals (propname)) { + ESObject skinz = new ObjectPrototype (null, evaluator); + for (Iterator it = app.typemgr.prototypes.values().iterator(); it.hasNext(); ) { + Prototype p = (Prototype) it.next (); + ESObject proto = new ObjectPrototype (null, evaluator); + for (Iterator it2 = p.skins.values().iterator(); it2.hasNext(); ) { + SkinFile sf = (SkinFile) it2.next (); + String name = sf.getName (); + Skin skin = sf.getSkin (); + proto.putProperty (name, new ESString (skin.getSource ()), name.hashCode ()); + } + skinz.putProperty (p.getName (), proto, p.getName ().hashCode ()); + } + return skinz; + } if ("__app__".equals (propname)) { return new ESWrapper (app, evaluator); } diff --git a/src/helma/framework/core/Skin.java b/src/helma/framework/core/Skin.java index 2009fc55..ca120775 100644 --- a/src/helma/framework/core/Skin.java +++ b/src/helma/framework/core/Skin.java @@ -22,6 +22,7 @@ public class Skin { Object[] parts; Application app; + String source; public Skin (String content, Application app) { this.app = app; @@ -30,6 +31,7 @@ public class Skin { public void parse (String content) { + this.source = content; ArrayList partBuffer = new ArrayList (); int l = content.length (); char cnt[] = new char[l]; @@ -56,7 +58,11 @@ public class Skin { partBuffer.add (new String (cnt, lastIdx, l - lastIdx)); parts = partBuffer.toArray (); - } + } + + public String getSource () { + return source; + } public void render (RequestEvaluator reval, ESNode thisNode, ESObject paramObject) { if (parts == null) diff --git a/src/helma/framework/core/SkinFile.java b/src/helma/framework/core/SkinFile.java index 429b9bab..e2515861 100644 --- a/src/helma/framework/core/SkinFile.java +++ b/src/helma/framework/core/SkinFile.java @@ -71,6 +71,10 @@ public class SkinFile implements Updatable { read (); return skin; } + + public String getName () { + return name; + } public String toString () { return prototype.getName()+"/"+file.getName();