protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) { final Event evt = (Event) request.getAttribute(CURRENT_EVENT); return Objects.equals(getFilterProcessesUrl(), request.getAttribute("j_loginurl")) && ZkAuthenticationEntryPoint.ON_ACEGILOGIN.equals(evt.getName()); //must check the event name otherwise authentication would be called twice. //1st the login model window's button click event //2nd the resumed onAcegiLogin thread resume and "cleanup". //we now check only on 2nd event }
private boolean doSaveEvent(Component comp, Event evt, Set<Property> notifys) { final String evtnm = evt == null ? null : evt.getName(); if (_log.isDebugEnabled()) { _log.debug("doSaveEvent comp=[{}],evtnm=[{}],notifys=[{}]", comp, evtnm, notifys); } final BindingKey bkey = getBindingKey(comp, evtnm); return _propertyBindingHandler.doSaveEvent(bkey, comp, evt, notifys); }
private String getConditionString(BindContext ctx) { StringBuilder condition = new StringBuilder(); if (getConditionType() == ConditionType.BEFORE_COMMAND) { condition.append("before = '").append(getCommandName()).append("'"); } else if (getConditionType() == ConditionType.AFTER_COMMAND) { condition.append("after = '").append(getCommandName()).append("'"); } else { condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName()); } return condition.length() == 0 ? null : condition.toString(); }
private String getConditionString(BindContext ctx) { StringBuilder condition = new StringBuilder(); if (getConditionType() == ConditionType.BEFORE_COMMAND) { condition.append("before = '").append(getCommandName()).append("'"); } else if (getConditionType() == ConditionType.AFTER_COMMAND) { condition.append("after = '").append(getCommandName()).append("'"); } else { condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName()); } return condition.length() == 0 ? null : condition.toString(); }
private String getConditionString(BindContext ctx) { StringBuilder condition = new StringBuilder(); if (getConditionType() == ConditionType.BEFORE_COMMAND) { condition.append("before = '").append(getCommandName()).append("'"); } else if (getConditionType() == ConditionType.AFTER_COMMAND) { condition.append("after = '").append(getCommandName()).append("'"); } else { condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName()); } return condition.length() == 0 ? null : condition.toString(); }
private String getConditionString(BindContext ctx) { StringBuilder condition = new StringBuilder(); if (getConditionType() == ConditionType.BEFORE_COMMAND) { condition.append("before = '").append(getCommandName()).append("'"); } else if (getConditionType() == ConditionType.AFTER_COMMAND) { condition.append("after = '").append(getCommandName()).append("'"); } else { condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName()); } return condition.length() == 0 ? null : condition.toString(); }
private String getConditionString(BindContext ctx) { StringBuilder condition = new StringBuilder(); if (getConditionType() == ConditionType.BEFORE_COMMAND) { condition.append("before = '").append(getCommandName()).append("'"); } else if (getConditionType() == ConditionType.AFTER_COMMAND) { condition.append("after = '").append(getCommandName()).append("'"); } else { condition.append(ctx.getTriggerEvent() == null ? "" : "event = " + ctx.getTriggerEvent().getName()); } return condition.toString(); }
/** * Returns the event log for the given event. * * @param event event. * @return the event log for the given event. */ public EventLog getEventLog(Event event) { return getEventLog(event.getTarget(), event.getName(), null, true, false); }
/** Constructor. * * <p>Notice that {@link #getTarget} is the same as the target of the given * event. To retrieve the real target (passed thru the argument), please * use {@link #getRealTarget} instead. * * @param realTarget the real target. If null, it means broadcast. * @param event the proxied event. */ public ProxyEvent(Component realTarget, Event event) { super(event.getName(), event.getTarget(), event.getData()); _realTarget = realTarget; _event = event; }
public void service(Event event, Scope scope) throws Exception { final String evtnm = event.getName(); final Method mtd = ComponentsCtrl.getEventMethod(getClass(), evtnm); if (_auxinf != null) service(event, scope, _auxinf.listeners != null ? _auxinf.listeners.get(evtnm) : null, _auxinf.evthds != null ? _auxinf.evthds.get(this, evtnm) : null, mtd, false); else service(event, scope, null, null, mtd, false); }
/** Echos an event. * By echo we mean the event is fired after the client receives the AU * responses and then echoes back. * In other words, the event won't be processed in the current execution. * Rather, it executes after the client receives the AU responses * and then echoes back the event back. * * <p>It is usually if you want to prompt the user before doing a long * operation. A typical case is to open a highlighted window to * prevent the user from clicking any button before the operation gets done. * * @since 5.0.4 * @see #sendEvent */ public static final void echoEvent(Event event) { echoEvent(event.getName(), event.getTarget(), event.getData()); }
public void onEvent(Event event) { if (event instanceof AfterEvent) { handleEvent((Event) event.getData()); } else { //post AfterEvent to make sure it is called after //enforce the event is the last processed Events.postEvent(-10100, new AfterEvent(event.getName() + "LoadAfter", event)); } } }
public void onEvent(Event event) { if (event instanceof AfterEvent) { handleEvent((Event) event.getData()); } else { //post AfterEvent to make sure it is called after //enforce the event is the last processed Events.postEvent(-10100, new AfterEvent(event.getName() + "SaveAfter", event)); } } }
public void onEvent(Event event) throws Exception { BindingExecutionInfoCollector collector = getBindingExecutionInfoCollector(); try { if (collector != null) { collector.pushStack("ON_EVENT"); collector.addInfo(new EventInfo(event.getTarget(), event.getName(), null)); } onEvent0(event); } catch (Exception x) { _log.error(x.getMessage(), x); throw x; } finally { if (collector != null) { collector.popStack(); } } }
public void select() { ComponentAgent parent = AuUtility.lookupEventTarget(target, Events.ON_SELECT); Set<String> items = new HashSet<String>(); items.add(target.getUuid()); String desktopId = target.getDesktop().getId(); Event event = new SelectEvent(Events.ON_SELECT, (Component)parent.getDelegatee(), items, (Component)target.getDelegatee()); Map<String, Object> data = EventDataManager.getInstance().build(event); ((ClientCtrl) target.getClient()).postUpdate(desktopId, parent.getUuid(), event.getName(), data, false); ((ClientCtrl) getClient()).flush(desktopId); } }
public void select() { Set<String> items = new HashSet<String>(); items.add(target.getUuid()); Component ancestry = getEventTarget(); Event event = new SelectEvent(Events.ON_SELECT, ancestry, items, (Component)target.getDelegatee()); Map<String, Object> data = EventDataManager.getInstance().build(event); contributeExtraInfo(data); String desktopId = target.getDesktop().getId(); ((ClientCtrl) getClient()).postUpdate(desktopId, ancestry.getUuid(), event.getName(), data, false); ((ClientCtrl) getClient()).flush(desktopId); }
public void onEvent(Event event) { if (event instanceof PagingEvent) { PagingEvent pe = (PagingEvent) event; int pgsz = pe.getPageable().getPageSize(); int actpg = pe.getActivePage(); if (PageableModel.INTERNAL_EVENT.equals(pe.getName())) { if (pgsz > 0) //min page size is 1 _pgi.setPageSize(pgsz); if (actpg >= 0) //min page index is 0 _pgi.setActivePage(actpg); } else if (_model instanceof Pageable) { //Bug ZK-1696: model also preserves paging information ((Pageable) _model).setActivePage(actpg); } Events.postEvent(new PagingEvent(event.getName(), Grid.this, pe.getPageable(), actpg)); } }
public void afterProcessEvent(Event event) throws Exception { _eis.afterProcessEvent(event); _wapp.getConfiguration().afterProcessEvent(event); if (Events.ON_DESKTOP_RECYCLE.equals(event.getName())) { if (_bookmark.length() > 0) addResponse(new AuBookmark(_bookmark)); l_out: for (Page page : _pages) for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) if (Events.isListened(root, Events.ON_CLIENT_INFO, false)) { setAttribute("org.zkoss.desktop.clientinfo.enabled", true); addResponse(new AuClientInfo(this)); break l_out; } l_out: for (Page page : _pages) for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) if (Events.isListened(root, Events.ON_VISIBILITY_CHANGE, false)) { setAttribute("org.zkoss.desktop.visibilitychange.enabled", true); break l_out; } } }
private void postUpdate(Component component, Set<String> selected) { String desktopId = target.getDesktop().getId(); Event event = new SelectEvent(Events.ON_SELECT, component, selected, (Component)target.getDelegatee()); Map<String, Object> data = EventDataManager.getInstance().build(event); ClientCtrl ctrl = (ClientCtrl) target.getClient(); ctrl.postUpdate(desktopId, component.getUuid(), event.getName(), data, false); ctrl.flush(desktopId); }