*/
public void tmlEndTag() throws TMLException, WGAPIException {
Status status = (Status) getStatus();
de.innovationgate.webgate.api.WGContent content = this.getTMLContext().content();
ExpressionEngine engine;
engine = ExpressionEngineFactory.getEngine(status.language);
if (engine == null) {
this.addWarning("Unknown expression type: " + status.language, true);
return;
}
int exprType = (status.type.equals("script") ? ExpressionEngine.TYPE_SCRIPT : ExpressionEngine.TYPE_EXPRESSION);
String expr = this.getResultString(false);
Map additionalObjects = new HashMap();
String timeoutStr = getTimeout();
if (timeoutStr != null) {
try {
additionalObjects.put(RhinoExpressionEngine.PARAM_SCRIPTTIMEOUT, Integer.valueOf(timeoutStr));
}
catch (NumberFormatException e) {
addWarning("Unable to set timeout value because it cannot be parsed as a number", false);
}
}
String tmlScriptDebug = getPageContext().getRequest().getParameter("tmlscriptDebug");
if (tmlScriptDebug != null && tmlScriptDebug.equals(getId())) {
additionalObjects.put("$tmlscriptDebug", new Boolean(true));
}
additionalObjects.put(RhinoExpressionEngine.PARAM_SCRIPTNAME, getTagDescription());
ExpressionResult result = engine.evaluateExpression(expr, this.getChildTagContext(), exprType, additionalObjects);
if (result.isError()) {
addExpressionWarning(expr, result);
}
this.setResult(result.getResult());