/** Returns whether to use source map to debug. */ private boolean isSourceMapEnabled() { if (_sourceMapEnabled == null) { final WebApp wapp = getWebApp(); if (wapp == null) return false; //zk lighter _sourceMapEnabled = Boolean.valueOf(wapp.getConfiguration().isSourceMapEnabled()); } return _sourceMapEnabled.booleanValue(); } }
public void addPage(Page page) { //We have to synchronize it due to getPage allows concurrent access synchronized (_pages) { _pages.add(page); if (log.isDebugEnabled()) log.debug("After added, pages: {}", _pages); } afterPageAttached(page, this); _wapp.getConfiguration().afterPageAttached(page, this); }
private int getIntPref(String key) { final String s = _desktop.getWebApp().getConfiguration().getPreference(key, null); if (s != null) { try { return Integer.parseInt(s); } catch (NumberFormatException ex) { log.warn("Not a number specified at " + key); } } return -1; }
/** Returns whether to generate JS files that is easy to debug. */ public boolean isDebugJS() { if (_debugJS == null) { final WebApp wapp = getWebApp(); if (wapp == null) return true; //zk lighter _debugJS = Boolean.valueOf(wapp.getConfiguration().isDebugJS()); } return _debugJS.booleanValue(); }
private void incSuspended() { final int v = _wapp.getConfiguration().getMaxSuspendedThreads(); synchronized (this) { if (v >= 0 && _suspCnt >= v) throw new SuspendNotAllowedException(MZk.TOO_MANY_SUSPENDED); ++_suspCnt; } }
public Event beforeSendEvent(Event event) { event = _eis.beforeSendEvent(event); if (event != null) event = _wapp.getConfiguration().beforeSendEvent(event); return event; }
public Event beforeProcessEvent(Event event) throws Exception { event = _eis.beforeProcessEvent(event); if (event != null) event = _wapp.getConfiguration().beforeProcessEvent(event); return event; }
private void beforeComponentPageChanged(Page page) { //ZK-1148, add a @destroy annotation method. if (page == null) WebApps.getCurrent().getConfiguration().invokeCallback("destroy", this); } private void afterComponentPageChanged(Page newpg, Page oldpg) {
public Event beforePostEvent(Event event) { event = _eis.beforePostEvent(event); if (event != null) event = _wapp.getConfiguration().beforePostEvent(event); return event; }
/** Default: If parent is null, execute the @Destroy method if any. * @see ComponentCtrl#beforeParentChanged * @since 3.6.2 */ public void beforeParentChanged(Component parent) { //ZK-1148, add a @destroy annotation method. if (parent == null)//detach WebApps.getCurrent().getConfiguration().invokeCallback("destroy", this); }
private int getIntPref(String key) { final String s = _desktop.getWebApp().getConfiguration() .getPreference(key, null); if (s != null) { try { return Integer.parseInt(s); } catch (NumberFormatException ex) { log.warning("Not a number specified at "+key); } } return -1; }
public void preInit() { if (_desktop != null) throw new IllegalStateException("init twice"); final Execution exec = Executions.getCurrent(); _desktop = exec.getDesktop(); if (_desktop == null) throw new IllegalArgumentException("null desktop"); _desktop.getWebApp().getConfiguration().init(this); }
/** Returns the JavaScript codes to disable (a.k.a., stop) the server push. * It is called by {@link #stopClientPush} to prepare the script * of {@link AuScript} that will be sent to the client. */ protected String getStopScript() { final String stop = _desktop.getWebApp().getConfiguration().getPreference("PollingServerPush.stop", null); return stop != null ? stop : "zk.cpsp.stop('" + _desktop.getId() + "');"; }
/** Returns the JavaScript codes to disable (aka., stop) the server push. * It is called by {@link #stopClientPush} to prepare the script * of {@link AuScript} that will be sent to the client. */ protected String getStopScript() { final String stop = _desktop.getWebApp().getConfiguration() .getPreference("PollingServerPush.stop", null); return stop != null ? stop: "zkCpsp.stop('" + _desktop.getId() + "');"; }
private String getRealUpload() { Desktop desktop = getDesktop(); String upload = getUpload(); if (desktop != null && !Strings.isEmpty(upload) && !upload.contains("maxsize=")) upload = upload.concat(",maxsize=" + desktop.getWebApp().getConfiguration().getMaxUploadSize()); return upload; }
/** Returns the JavaScript codes to disable (aka., stop) the server push. * It is called by {@link #stopClientPush} to prepare the script * of {@link AuScript} that will be sent to the client. */ protected String getStopScript() { final String stop = _desktop.getWebApp().getConfiguration() .getPreference("CometServerPush.stop", null); return stop != null ? stop: "zkCmsp.stop('" + _desktop.getId() + "');"; }
public void call(Component host) { host.getDesktop().getWebApp().getConfiguration().afterShadowDetached(se, host); } });
protected String getSpecialRendererOutput(Component comp) throws IOException { if (_page != null) { final JsContentRenderer renderer = new JsContentRenderer(); PropertiesRenderer[] prs = _page.getDesktop().getWebApp().getConfiguration().getPropertiesRenderers(); for (int j = 0; j < prs.length; j++) prs[j].renderProperties(comp, renderer); return renderer.getBuffer().toString(); } return ""; }
public Object startUpdate(Execution exec) throws IOException { final Desktop desktop = exec.getDesktop(); UiVisualizer uv = doActivate(exec, true, false, null, -1); desktop.getWebApp().getConfiguration().invokeExecutionInits(exec, null); ((DesktopCtrl) desktop).invokeExecutionInits(exec, null); return new UpdateInfo(uv); }
private boolean isEventThreadEnabled(boolean attachedRequired) { Desktop desktop = getDesktop(); if (desktop == null) { if (attachedRequired) throw new SuspendNotAllowedException("Not attached, " + this); final Execution exec = Executions.getCurrent(); if (exec == null || (desktop = exec.getDesktop()) == null) return true; //assume enabled (safer) } return desktop.getWebApp().getConfiguration().isEventThreadEnabled(); }