Search in sources :

Example 1 with ShortcutsBean

use of password.pwm.http.bean.ShortcutsBean in project pwm by pwm-project.

the class ShortcutServlet method processAction.

protected void processAction(final PwmRequest pwmRequest) throws ServletException, IOException, ChaiUnavailableException, PwmUnrecoverableException {
    final PwmSession pwmSession = pwmRequest.getPwmSession();
    final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
    if (!pwmApplication.getConfig().readSettingAsBoolean(PwmSetting.SHORTCUT_ENABLE)) {
        pwmRequest.respondWithError(PwmError.ERROR_SERVICE_NOT_AVAILABLE.toInfo());
        return;
    }
    final ShortcutsBean shortcutsBean = pwmApplication.getSessionStateService().getBean(pwmRequest, ShortcutsBean.class);
    if (shortcutsBean.getVisibleItems() == null) {
        LOGGER.debug(pwmSession, "building visible shortcut list for user");
        final Map<String, ShortcutItem> visibleItems = figureVisibleShortcuts(pwmRequest);
        shortcutsBean.setVisibleItems(visibleItems);
    } else {
        LOGGER.trace(pwmSession, "using cashed shortcut values");
    }
    final ShortcutAction action = readProcessAction(pwmRequest);
    if (action != null) {
        pwmRequest.validatePwmFormID();
        switch(action) {
            case selectShortcut:
                handleUserSelection(pwmRequest, shortcutsBean);
                return;
            default:
                JavaHelper.unhandledSwitchStatement(action);
        }
    }
    forwardToJsp(pwmRequest, shortcutsBean);
}
Also used : PwmApplication(password.pwm.PwmApplication) ShortcutsBean(password.pwm.http.bean.ShortcutsBean) ShortcutItem(password.pwm.config.value.data.ShortcutItem) PwmSession(password.pwm.http.PwmSession)

Aggregations

PwmApplication (password.pwm.PwmApplication)1 ShortcutItem (password.pwm.config.value.data.ShortcutItem)1 PwmSession (password.pwm.http.PwmSession)1 ShortcutsBean (password.pwm.http.bean.ShortcutsBean)1