Search in sources :

Example 1 with TokenEvent

use of org.adempiere.webui.event.TokenEvent in project adempiere by adempiere.

the class TokenCommand method service.

public boolean service(AuRequest request, boolean everError) {
    if (!TokenEvent.ON_USER_TOKEN.equals(request.getCommand()))
        return false;
    Map<?, ?> map = request.getData();
    String sid = (String) map.get("sid");
    String hash = (String) map.get("hash");
    final String[] data = new String[] { sid, hash };
    final Component comp = request.getComponent();
    if (comp == null)
        throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, this);
    if (data == null || data.length < 2)
        throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, new Object[] { Objects.toString(data), this });
    Events.postEvent(new TokenEvent(request.getCommand(), comp, data));
    return true;
}
Also used : TokenEvent(org.adempiere.webui.event.TokenEvent) UiException(org.zkoss.zk.ui.UiException) Component(org.zkoss.zk.ui.Component)

Aggregations

TokenEvent (org.adempiere.webui.event.TokenEvent)1 Component (org.zkoss.zk.ui.Component)1 UiException (org.zkoss.zk.ui.UiException)1