@Override public String intercept(ActionInvocation invocation) throws Exception { ValueStack stack = invocation.getStack(); boolean forceRefresh = false; Object v = stack.findValue("refreshConfiguration"); if (v != null) forceRefresh = Boolean.parseBoolean(v.toString()); HttpServletRequest request = ServletActionContext.getRequest(); Map<String, Object> configuration = _configurationService.getConfiguration(forceRefresh, request.getContextPath()); stack.setValue("#configuration", configuration); return invocation.invoke(); } }
@Override public int doStartTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); ValueStack stack = this.getStack(); try { List<HookPointElementContainer> containers = extractElements(request); if (containers.size()>0) { stack.getContext().put(this.getObjectName(), containers); stack.setValue("#attr['" + this.getObjectName() + "']", containers, false); return EVAL_BODY_INCLUDE; } } catch (Throwable t) { throw new JspException("Error detected ", t); } return super.doStartTag(); }
@Override public int doStartTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); ValueStack stack = this.getStack(); try { List<HookPointElementContainer> containers = extractElements(request); if (containers.size()>0) { stack.getContext().put(this.getObjectName(), containers); stack.setValue("#attr['" + this.getObjectName() + "']", containers, false); return EVAL_BODY_INCLUDE; } } catch (Throwable t) { throw new JspException("Error detected ", t); } return super.doStartTag(); }
@Override public int doStartTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); WebApplicationContext wac = ApsWebApplicationUtils.getWebApplicationContext(request); List<PluginSubMenuContainer> containters = new ArrayList<PluginSubMenuContainer>(); ValueStack stack = this.getStack(); try { String[] beanNames = wac.getBeanNamesForType(PluginSubMenuContainer.class); for (int i=0; i<beanNames.length; i++) { PluginSubMenuContainer container = (PluginSubMenuContainer) wac.getBean(beanNames[i]); containters.add(container); } if (containters.size()>0) { stack.getContext().put(this.getObjectName(), containters); stack.setValue("#attr['" + this.getObjectName() + "']", containters, false); return EVAL_BODY_INCLUDE; } } catch (Throwable t) { throw new JspException("Error creating the plugins menu list", t); } return super.doStartTag(); }
@Override public int doStartTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); ValueStack stack = this.getStack(); try { List<HookPointElementContainer> containers = extractElements(request); if (containers.size()>0) { stack.getContext().put(this.getObjectName(), containers); stack.setValue("#attr['" + this.getObjectName() + "']", containers, false); return EVAL_BODY_INCLUDE; } } catch (Throwable t) { throw new JspException("Error detected ", t); } return super.doStartTag(); }
@Override public int doStartTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); WebApplicationContext wac = ApsWebApplicationUtils.getWebApplicationContext(request); List<PluginSubMenuContainer> containters = new ArrayList<PluginSubMenuContainer>(); ValueStack stack = this.getStack(); try { String[] beanNames = wac.getBeanNamesForType(PluginSubMenuContainer.class); for (int i=0; i<beanNames.length; i++) { PluginSubMenuContainer container = (PluginSubMenuContainer) wac.getBean(beanNames[i]); containters.add(container); } if (containters.size()>0) { stack.getContext().put(this.getObjectName(), containters); stack.setValue("#attr['" + this.getObjectName() + "']", containters, false); return EVAL_BODY_INCLUDE; } } catch (Throwable t) { throw new JspException("Error creating the plugins menu list", t); } return super.doStartTag(); }
@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(); }
@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(); }
@Override public int doStartTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); WebApplicationContext wac = ApsWebApplicationUtils.getWebApplicationContext(request); List<PluginSubMenuContainer> containters = new ArrayList<PluginSubMenuContainer>(); ValueStack stack = this.getStack(); try { String[] beanNames = wac.getBeanNamesForType(PluginSubMenuContainer.class); for (int i=0; i<beanNames.length; i++) { PluginSubMenuContainer container = (PluginSubMenuContainer) wac.getBean(beanNames[i]); containters.add(container); } if (containters.size()>0) { stack.getContext().put(this.getObjectName(), containters); stack.setValue("#attr['" + this.getObjectName() + "']", containters, false); return EVAL_BODY_INCLUDE; } } catch (Throwable t) { throw new JspException("Error creating the plugins menu list", t); } return super.doStartTag(); }
@Override public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); try { IActionLogManager loggerManager = (IActionLogManager) ApsWebApplicationUtils.getBean(SystemConstants.ACTION_LOGGER_MANAGER, this.pageContext); UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER); Date lastUpdate = loggerManager.lastUpdateDate(currentUser); if (null != this.getVar()) { ValueStack stack = this.getStack(); stack.getContext().put(this.getVar(), lastUpdate); stack.setValue("#attr['" + this.getVar() + "']", lastUpdate, false); } } catch (Throwable t) { _logger.error("Error on doStartTag", t); throw new JspException("Error on doStartTag", t); } return super.doEndTag(); }
@Override public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); try { IActionLogManager loggerManager = (IActionLogManager) ApsWebApplicationUtils.getBean(SystemConstants.ACTION_LOGGER_MANAGER, this.pageContext); UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER); Date lastUpdate = loggerManager.lastUpdateDate(currentUser); if (null != this.getVar()) { ValueStack stack = this.getStack(); stack.getContext().put(this.getVar(), lastUpdate); stack.setValue("#attr['" + this.getVar() + "']", lastUpdate, false); } } catch (Throwable t) { _logger.error("Error on doStartTag", t); throw new JspException("Error on doStartTag", t); } return super.doEndTag(); }
@Override public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); try { IActionLogManager loggerManager = (IActionLogManager) ApsWebApplicationUtils.getBean(SystemConstants.ACTION_LOGGER_MANAGER, this.pageContext); UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER); List<Integer> ids = loggerManager.getActivityStream(currentUser); if (null != this.getVar()) { ValueStack stack = this.getStack(); stack.getContext().put(this.getVar(), ids); stack.setValue("#attr['" + this.getVar() + "']", ids, false); } } catch (Throwable t) { _logger.error("Error on doStartTag", t); //ApsSystemUtils.logThrowable(t, this, "doStartTag"); throw new JspException("Error on doStartTag", t); } return super.doEndTag(); }
@Override public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); try { IActionLogManager loggerManager = (IActionLogManager) ApsWebApplicationUtils.getBean(SystemConstants.ACTION_LOGGER_MANAGER, this.pageContext); UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER); List<Integer> ids = loggerManager.getActivityStream(currentUser); if (null != this.getVar()) { ValueStack stack = this.getStack(); stack.getContext().put(this.getVar(), ids); stack.setValue("#attr['" + this.getVar() + "']", ids, false); } } catch (Throwable t) { _logger.error("Error on doStartTag", t); //ApsSystemUtils.logThrowable(t, this, "doStartTag"); throw new JspException("Error on doStartTag", t); } return super.doEndTag(); }
@Override public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); try { UserConfigBean config = (UserConfigBean) request.getSession().getAttribute(IMyShortcutConfigAction.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(IMyShortcutConfigAction.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) { ApsSystemUtils.logThrowable(t, this, "doStartTag"); throw new JspException("Error on doStartTag", t); } return super.doEndTag(); }
@Override public int doStartTag() throws JspException { try { IPageActionHelper helper = this.getHelper(this.isOnline()); ITreeNode root = this.getAllowedTreeRootNode(helper); ValueStack stack = this.getStack(); stack.getContext().put(this.getVar(), root); stack.setValue("#attr['" + this.getVar() + "']", root, false); } catch (Throwable t) { _logger.error("error in doStartTag", t); throw new JspException("Error during tag initialization", t); } return super.doStartTag(); }
@Override public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); try { IActionLogManager loggerManager = (IActionLogManager) ApsWebApplicationUtils.getBean(SystemConstants.ACTION_LOGGER_MANAGER, this.pageContext); UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER); List<Integer> ids = loggerManager.getActivityStream(currentUser); if (null != this.getVar()) { ValueStack stack = this.getStack(); stack.getContext().put(this.getVar(), ids); stack.setValue("#attr['" + this.getVar() + "']", ids, false); } } catch (Throwable t) { ApsSystemUtils.logThrowable(t, this, "doStartTag"); throw new JspException("Error on doStartTag", t); } return super.doEndTag(); }
@Override public int doStartTag() throws JspException { try { IPageActionHelper helper = this.getHelper(this.isOnline()); ITreeNode root = this.getAllowedTreeRootNode(helper); ValueStack stack = this.getStack(); stack.getContext().put(this.getVar(), root); stack.setValue("#attr['" + this.getVar() + "']", root, false); } catch (Throwable t) { _logger.error("error in doStartTag", t); throw new JspException("Error during tag initialization", t); } return super.doStartTag(); }
@Override public int doStartTag() throws JspException { UserDetails currentUser = (UserDetails) this.pageContext.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER); try { Object retval = null; IShortcutManager shortcutManager = (IShortcutManager) ApsWebApplicationUtils.getBean(ApsAdminSystemConstants.SHORTCUT_MANAGER, this.pageContext); List<Shortcut> myShortcuts = shortcutManager.getAllowedShortcuts(currentUser); if (this.getType().equalsIgnoreCase(TYPE_LIST_OBJECT)) { retval = (Object) myShortcuts; } else if (this.getType().equalsIgnoreCase(TYPE_LIST_ITEMS)) { retval = (Object) this.getAllowedShortcutSelectItems(myShortcuts, currentUser); } else { _logger.warn("Invalid param for attribute 'value'. Expected '{}' or '{}' but was {}", TYPE_LIST_ITEMS, TYPE_LIST_OBJECT, this.getType()); } ValueStack stack = super.getStack(); stack.getContext().put(this.getVar(), retval); stack.setValue("#attr['" + this.getVar() + "']", retval, false); } catch (Throwable t) { _logger.error("Error extracting shortcuts for user '{}'", currentUser.getUsername() , t); throw new JspException("Error extracting shortcuts", t); } return super.doStartTag(); }
@Override public int doStartTag() throws JspException { UserDetails currentUser = (UserDetails) this.pageContext.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER); try { Object retval = null; IShortcutManager shortcutManager = (IShortcutManager) ApsWebApplicationUtils.getBean(ApsAdminSystemConstants.SHORTCUT_MANAGER, this.pageContext); List<Shortcut> myShortcuts = shortcutManager.getAllowedShortcuts(currentUser); if (this.getType().equalsIgnoreCase(TYPE_LIST_OBJECT)) { retval = (Object) myShortcuts; } else if (this.getType().equalsIgnoreCase(TYPE_LIST_ITEMS)) { retval = (Object) this.getAllowedShortcutSelectItems(myShortcuts, currentUser); } else { _logger.warn("Invalid param for attribute 'value'. Expected '{}' or '{}' but was {}", TYPE_LIST_ITEMS, TYPE_LIST_OBJECT, this.getType()); } ValueStack stack = super.getStack(); stack.getContext().put(this.getVar(), retval); stack.setValue("#attr['" + this.getVar() + "']", retval, false); } catch (Throwable t) { _logger.error("Error extracting shortcuts for user '{}'", currentUser.getUsername() , t); throw new JspException("Error extracting shortcuts", t); } return super.doStartTag(); }
compPagerVo.initPager(pagerVo); stack.getContext().put(this.getObjectName(), compPagerVo); stack.setValue("#attr['" + this.getObjectName() + "']", compPagerVo, false); } catch (Throwable t) { ApsSystemUtils.logThrowable(t, this, "doStartTag");