From d864dc37fe8960ac2b18bf260da684333eb018bc Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 26 Nov 2002 15:02:34 +0000 Subject: [PATCH] Added getInspector() method that returns a inspector/documentation class for the engine's application. For helma.scripting.fesi.FesiEngine this method returns an instance of helma.doc.DocApplication. --- src/helma/scripting/ScriptingEngine.java | 37 ++++++------------------ src/helma/scripting/fesi/FesiEngine.java | 15 ++++++++++ 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/helma/scripting/ScriptingEngine.java b/src/helma/scripting/ScriptingEngine.java index c7a01c8c..ef7ace4d 100644 --- a/src/helma/scripting/ScriptingEngine.java +++ b/src/helma/scripting/ScriptingEngine.java @@ -3,6 +3,7 @@ package helma.scripting; +import helma.framework.IPathElement; import helma.framework.core.Application; import helma.framework.core.Prototype; import helma.framework.core.RequestEvaluator; @@ -66,33 +67,13 @@ public interface ScriptingEngine { */ public boolean hasFunction (Object thisObject, String functionName); + /** + * Get an IPathElement that offers introspection services into the application. + * If this method returns null, no introspection is available for this kind of engine. + * In order to be compatible with the standard Helma management application, this + * class should be compatible with helma.doc.DocApplication. + */ + public IPathElement getIntrospector (); + } - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/helma/scripting/fesi/FesiEngine.java b/src/helma/scripting/fesi/FesiEngine.java index 7782fcf4..910333fd 100644 --- a/src/helma/scripting/fesi/FesiEngine.java +++ b/src/helma/scripting/fesi/FesiEngine.java @@ -9,6 +9,7 @@ import helma.extensions.HelmaExtension; import helma.extensions.ConfigurationException; import helma.framework.*; import helma.framework.core.*; +import helma.doc.DocApplication; import helma.objectmodel.*; import helma.objectmodel.db.DbMapping; import helma.objectmodel.db.Relation; @@ -62,6 +63,8 @@ public final class FesiEngine implements ScriptingEngine { // the global vars set by extensions HashMap extensionGlobals; + // the introspector that provides documentation for this application + DocApplication doc = null; /** * Zero argument constructor. @@ -502,6 +505,18 @@ public final class FesiEngine implements ScriptingEngine { return null; } + /** + * Get a DocApplication object for a specific application. + */ + public IPathElement getIntrospector () { + if (doc == null) { + doc = new DocApplication (app.getName(), app.getAppDir().toString()); + doc.readApplication (); + } + return doc; + } + + /** * Convert an input argument from Java to the scripting runtime * representation.