use of org.entando.entando.apsadmin.system.services.shortcut.model.UserConfigBean in project entando-core by entando.
the class MyShortcutConfigAction method setUserConfig.
protected void setUserConfig(String[] config) {
UserConfigBean userConfig = new UserConfigBean(this.getCurrentUser().getUsername(), config);
this.setUserConfigBean(userConfig);
}
use of org.entando.entando.apsadmin.system.services.shortcut.model.UserConfigBean in project entando-core by entando.
the class MyShortcutConfigAction method getUserConfigBean.
public UserConfigBean getUserConfigBean() {
UserConfigBean config = null;
try {
config = (UserConfigBean) this.getRequest().getSession().getAttribute(SESSION_PARAM_MY_SHORTCUTS);
if (null == config || !this.getCurrentUser().getUsername().equals(config.getUsername())) {
config = this.getShortcutManager().getUserConfigBean(this.getCurrentUser());
this.setUserConfigBean(config);
}
} catch (Throwable t) {
_logger.error("Error extracting user config bean by user {}", this.getCurrentUser(), t);
throw new RuntimeException("Error extracting user config bean by user " + this.getCurrentUser(), t);
}
return config;
}
use of org.entando.entando.apsadmin.system.services.shortcut.model.UserConfigBean in project entando-core by entando.
the class UserShortcutsConfigTag method doEndTag.
@Override
public int doEndTag() throws JspException {
HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
try {
UserConfigBean config = (UserConfigBean) request.getSession().getAttribute(MyShortcutConfigAction.SESSION_PARAM_MY_SHORTCUTS);
UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
if (null == config || !currentUser.getUsername().equals(config.getUsername())) {
request.getSession().removeAttribute(MyShortcutConfigAction.SESSION_PARAM_MY_SHORTCUTS);
IShortcutManager shortcutManager = (IShortcutManager) ApsWebApplicationUtils.getBean(ApsAdminSystemConstants.SHORTCUT_MANAGER, this.pageContext);
config = shortcutManager.getUserConfigBean(currentUser);
}
if (null != this.getVar()) {
ValueStack stack = this.getStack();
stack.getContext().put(this.getVar(), config);
stack.setValue("#attr['" + this.getVar() + "']", config, false);
}
} catch (Throwable t) {
_logger.error("Error on doStartTag", t);
throw new JspException("Error on doStartTag", t);
}
return super.doEndTag();
}
Aggregations