Search in sources :

Example 6 with UiException

use of org.zkoss.zk.ui.UiException 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

UiException (org.zkoss.zk.ui.UiException)6 Component (org.zkoss.zk.ui.Component)5 MQuery (org.compiere.model.MQuery)2 JSONArray (org.zkoss.json.JSONArray)2 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 HttpSession (javax.servlet.http.HttpSession)1 IDesktop (org.adempiere.webui.desktop.IDesktop)1 DrillEvent (org.adempiere.webui.event.DrillEvent)1 TokenEvent (org.adempiere.webui.event.TokenEvent)1 ZoomEvent (org.adempiere.webui.event.ZoomEvent)1 LoginWindow (org.adempiere.webui.window.LoginWindow)1 MSession (org.compiere.model.MSession)1 MTheme (org.compiere.model.MTheme)1 MUser (org.compiere.model.MUser)1 Language (org.compiere.util.Language)1 Text (org.zkoss.zhtml.Text)1 Execution (org.zkoss.zk.ui.Execution)1 Page (org.zkoss.zk.ui.Page)1 Session (org.zkoss.zk.ui.Session)1