Package com.agiletec.plugins.jpmyportalplus.aps.system.services.userconfig

Examples of com.agiletec.plugins.jpmyportalplus.aps.system.services.userconfig.IPageUserConfigManager


      req.getSession().setAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_LANG, lang);
      UserDetails currentUser = (UserDetails) session.getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
      if (!currentUser.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
        PageUserConfigBean userConfigBean = (PageUserConfigBean) session.getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_USER_PAGE_CONFIG);
        if (null == userConfigBean || !currentUser.getUsername().equals(userConfigBean.getUsername())) {
          IPageUserConfigManager pageUserConfigManager = (IPageUserConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.PAGE_USER_CONFIG_MANAGER, pageContext);
          userConfigBean = pageUserConfigManager.getUserConfig(currentUser);
          if (null != userConfigBean) {
            session.setAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_USER_PAGE_CONFIG, userConfigBean);
          } else {
            session.removeAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_USER_PAGE_CONFIG);
          }
View Full Code Here


  @Override
  protected void buildWidgetOutput(IPage page, String[] showletOutput) throws JspException {
    HttpServletRequest req =  (HttpServletRequest) this.pageContext.getRequest();
    RequestContext reqCtx = (RequestContext) req.getAttribute(RequestContext.REQCTX);
    try {
      IPageUserConfigManager pageUserConfigManager = (IPageUserConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.PAGE_USER_CONFIG_MANAGER, pageContext);
      CustomPageConfig customPageConfig = null;
      UserDetails currentUser = (UserDetails) this.pageContext.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
      if (currentUser.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
        customPageConfig = pageUserConfigManager.getGuestPageConfig(page, req);
      } else {
        PageUserConfigBean userConfigBean = (PageUserConfigBean) req.getSession().getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_USER_PAGE_CONFIG);
        if (null != userConfigBean) {
          customPageConfig = userConfigBean.getConfig().get(page.getCode());
        }
      }
      if (null == customPageConfig || customPageConfig.getConfig() == null || !customPageConfig.getPageCode().equals(page.getCode())) {
        req.getSession().removeAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_PAGE_CONFIG);
        super.buildWidgetOutput(page, showletOutput);
        return;
      }
      req.getSession().setAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_PAGE_CONFIG, customPageConfig);
      Widget[] customShowlets = customPageConfig.getConfig();
      Widget[] showletsToRender = pageUserConfigManager.getShowletsToRender(page, customShowlets);
      List<IFrameDecoratorContainer> decorators = this.extractDecorators();
      BodyContent body = this.pageContext.pushBody();
      for (int scan = 0; scan < showletsToRender.length; scan++) {
        reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME, new Integer(scan));
        body.clearBody();
View Full Code Here

public class CustomizableWidgetsTag extends TagSupport {

    public int doStartTag() throws JspException {
        RequestContext reqCtx = (RequestContext) this.pageContext.getRequest().getAttribute(RequestContext.REQCTX);
        List<WidgetCheckInfo> checkInfos = new ArrayList<WidgetCheckInfo>();
        IPageUserConfigManager pageUserConfigManager = (IPageUserConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.PAGE_USER_CONFIG_MANAGER, pageContext);
        try {
            Lang currentLang = (Lang) this.pageContext.getSession().getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_LANG);
            IPage currentPage = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
            Widget[] customShowletConfig = this.getCustomShowletConfig(currentPage);
            Widget[] showletsToRender = pageUserConfigManager.getShowletsToRender(currentPage, customShowletConfig);
            List<String> allowedShowlets = new ArrayList<String>();
            Map<String, WidgetType> customizableShowlets = this.getCustomizableShowlets(pageUserConfigManager);
            allowedShowlets.addAll(customizableShowlets.keySet());
            Frame[] frames = ((MyPortalPageModel) currentPage.getModel()).getFrameConfigs();
            for (int i = 0; i < frames.length; i++) {
View Full Code Here

  @Override
  public int doStartTag() throws JspException {
    RequestContext reqCtx = (RequestContext) this.pageContext.getRequest().getAttribute(RequestContext.REQCTX);
    List<FrameSelectItem> selectItems = new ArrayList<FrameSelectItem>();
    IPageUserConfigManager pageUserConfigManager = (IPageUserConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.PAGE_USER_CONFIG_MANAGER, pageContext);
    try {
      Integer currentFrame = (Integer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME);
      IPage currentPage = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
      MyPortalPageModel pageModel = (MyPortalPageModel) currentPage.getModel();
      Integer currentColumnId = pageModel.getFrameConfigs()[currentFrame].getColumn();
      if (null == currentColumnId) {
        return super.doStartTag();
      }
      Lang currentLang = (Lang) this.pageContext.getSession().getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_LANG);
      Widget[] customShowletConfig = this.getCustomShowletConfig(currentPage, pageUserConfigManager);
      Widget[] showletsToRender = pageUserConfigManager.getShowletsToRender(currentPage, customShowletConfig);

      String voidShowletCode = pageUserConfigManager.getVoidShowlet().getCode();
      for (int i = 0; i < showletsToRender.length; i++) {
        Frame frame = pageModel.getFrameConfigs()[i];
        Integer columnId = frame.getColumn();
        if (frame.isLocked() || null == columnId || i == currentFrame.intValue()) continue;
        Widget showlet = showletsToRender[i];
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpmyportalplus.aps.system.services.userconfig.IPageUserConfigManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.