/** Returns the scripting language, or null if the default scripting language * is preferred. */ public String getLanguage() { return _zs.getLanguage(); }
/** Evaluates the deferred zscript. * It is called when the interpreter is loaded */ private void evalDeferredZScripts(Interpreter ip, String zslang) { if (_zsDeferred != null) { for (Iterator<Object[]> it = _zsDeferred.iterator(); it.hasNext();) { final Object[] zsInfo = it.next(); final ZScript zscript = (ZScript) zsInfo[1]; String targetlang = zscript.getLanguage(); if (targetlang == null) targetlang = _zslang; //use default if (targetlang.equalsIgnoreCase(zslang)) { //case insensitive it.remove(); //done final Component parent = (Component) zsInfo[0]; if (parent == null || parent.getPage() == this) { final Scope scope = Scopes.beforeInterpret(parent != null ? (Scope) parent : this); try { ip.interpret(zscript.getContent(this, parent), scope); } finally { Scopes.afterInterpret(); } } } } if (_zsDeferred.isEmpty()) _zsDeferred = null; } }
public void interpret(Page page, Component comp, ZScript zs) { final Scope scope = Scopes.beforeInterpret(comp != null ? (Scope)comp: page); try { page.interpret(zs.getLanguage(), zs.getContent(page, comp), scope); } finally { Scopes.afterInterpret(); } } public void setPageOnly(Execution exec) {
public void doInit(Page page, Map<String, Object> args) throws Exception { final Scope scope = Scopes.beforeInterpret(page); try { page.interpret(_zscript.getLanguage(), _zscript.getContent(page, null), scope); } finally { Scopes.afterInterpret(); } } }
/** @deprecated */ public void interpret(Page page, Component comp, ZScript zs) { final Map backup = new HashMap(); final org.zkoss.zk.scripting.Namespace ns = comp != null ? org.zkoss.zk.scripting.Namespaces.beforeInterpret(backup, comp, false): org.zkoss.zk.scripting.Namespaces.beforeInterpret(backup, page, false); try { page.interpret(zs.getLanguage(), zs.getContent(page, comp), ns); } finally { org.zkoss.zk.scripting.Namespaces.afterInterpret(backup, ns, false); } } /** @deprecated */
/** * A useful method use to invoke zscript. * @param page page instance. * @param parent The owner of zscript segment. * @param zs A ZScript object. * @throws IOException */ public static void processZScript(Page page, Component parent, ZScript zs) throws IOException { if (zs.getLanguage() == null) zs.setLanguage(page.getZScriptLanguage()); if (zs.isDeferred()) ((PageCtrl)page).addDeferredZScript(parent, zs); else ZkProxy.getProxy().interpret(page, parent, zs); }
final int lno = xl != null ? xl.getLineNumber() : 0; final ZScript zscript = ZScript.parseContent(value, lno); if (zscript.getLanguage() == null) zscript.setLanguage(compInfo.getPageDefinition().getZScriptLanguage());
if (zscript != null) { execinf.update(null, null, zscript); page.interpret(zscript.getLanguage(), zscript.getContent(page, this), scope); if (!event.isPropagatable()) return; //done