dbKey = (String) idParts.get(0);
id = (String) idParts.get(1);
}
// Get the design db. Either by dbkey in id, by parameter dbkey, by current design db of WebTML or just the current context db
WGDatabase designDB;
if (!WGUtils.isEmpty(dbKey)) {
designDB = db(dbKey);
}
else {
designDB = designdb();
}
if (designDB == null) {
throw new TMLActionException("Could not open design db to load tmlscript action module, because it does not exist.");
}
if (!designDB.isSessionOpen()) {
throw new TMLActionException("Could not open design db '" + designDB.getDbReference() + "' to load tmlscript action module, because you have no access.");
}
WGCSSJSModule mod = designDB.getCSSJSModule(id, WGScriptModule.CODETYPE_TMLSCRIPT);
if (mod == null) {
return null;
}
TMLAction action = TMLAction.buildActionFromScriptModule(mod);
registerAction(action, id, designDB.getDbReference());
return action;
}
catch (WGException e) {
throw new TMLActionException("Could not open design db to load tmlscript action module", e);