5758596061626364
super(context); this.beanShellInterpreter.getNameSpace().importCommands("org.webharvest.runtime.scripting"); try { this.beanShellInterpreter.set(CONTEXT_VARIABLE_NAME, this.context); } catch (EvalError e) { throw new ScriptException("Cannot set Web-Harvest context in scripter: " + e.getMessage(), e); } }
7071727374757677
*/ public void setVariable(String name, Object value) { try { this.beanShellInterpreter.set(name, value); } catch (EvalError e) { throw new ScriptException("Cannot set variable in scripter: " + e.getMessage(), e); } }
8485868788899091
pushAllVariablesFromContextToScriptEngine(); try { return this.beanShellInterpreter.eval(expression); } catch (EvalError e) { throw new ScriptException("Error during script execution: " + e.getMessage(), e); } }
5354555657585960
ScraperContext context = (ScraperContext) interpreter.get(ScriptEngine.CONTEXT_VARIABLE_NAME); if (context != null) { context.setVar(name, value); } } catch (EvalError e) { throw new ScriptException("Cannot get web-Harvest context from interpreter: " + e.getMessage(), e); } }