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.
This commit is contained in:
parent
30d593119b
commit
d864dc37fe
2 changed files with 24 additions and 28 deletions
|
@ -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 ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue