added extension mechanism: call initScripting() on every active extension
(list specified by helma.main.Server).
This commit is contained in:
parent
ec40bec475
commit
f1f9afe13f
1 changed files with 14 additions and 0 deletions
|
@ -5,11 +5,14 @@ package helma.scripting.fesi;
|
||||||
|
|
||||||
import helma.scripting.*;
|
import helma.scripting.*;
|
||||||
import helma.scripting.fesi.extensions.*;
|
import helma.scripting.fesi.extensions.*;
|
||||||
|
import helma.extensions.HelmaExtension;
|
||||||
|
import helma.extensions.ConfigurationException;
|
||||||
import helma.framework.*;
|
import helma.framework.*;
|
||||||
import helma.framework.core.*;
|
import helma.framework.core.*;
|
||||||
import helma.objectmodel.*;
|
import helma.objectmodel.*;
|
||||||
import helma.objectmodel.db.DbMapping;
|
import helma.objectmodel.db.DbMapping;
|
||||||
import helma.objectmodel.db.Relation;
|
import helma.objectmodel.db.Relation;
|
||||||
|
import helma.main.Server;
|
||||||
import helma.util.Updatable;
|
import helma.util.Updatable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
@ -76,6 +79,17 @@ public final class FesiEvaluator implements ScriptingEngine {
|
||||||
Database dbx = (Database) evaluator.addExtension ("helma.scripting.fesi.extensions.Database");
|
Database dbx = (Database) evaluator.addExtension ("helma.scripting.fesi.extensions.Database");
|
||||||
dbx.setApplication (app);
|
dbx.setApplication (app);
|
||||||
|
|
||||||
|
// load extensions defined in server.properties
|
||||||
|
Vector extVec = Server.getServer ().getExtensions ();
|
||||||
|
for (int i=0; i<extVec.size(); i++ ) {
|
||||||
|
HelmaExtension ext = (HelmaExtension)extVec.get(i);
|
||||||
|
try {
|
||||||
|
ext.initScripting (app,this);
|
||||||
|
} catch (ConfigurationException e) {
|
||||||
|
app.logEvent ("Couldn't initialize extension " + ext.getName () + ": " + e.getMessage ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// fake a cache member like the one found in ESNodes
|
// fake a cache member like the one found in ESNodes
|
||||||
global.putHiddenProperty ("cache", new ESNode (new TransientNode ("cache"), this));
|
global.putHiddenProperty ("cache", new ESNode (new TransientNode ("cache"), this));
|
||||||
global.putHiddenProperty ("undefined", ESUndefined.theUndefined);
|
global.putHiddenProperty ("undefined", ESUndefined.theUndefined);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue