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);
}
Aggregations