Package com.agiletec.aps.system.services.page

Examples of com.agiletec.aps.system.services.page.IPage


    boolean checked = false;
    String selectedNode = this.getPageCodeParam();
    if (null == selectedNode || selectedNode.trim().length() == 0) {
      this.addActionError(this.getText("error.noPageSelected"));
    } else {
      IPage targetPage = this.getPage(selectedNode);
      if (targetPage == null) {
        this.addActionError(this.getText("error.noPageSelected"));
      } else {
        if (this.getFrameIdParam() == null) {
          this.addActionError(this.getText("error.invalidWidgetType"));
        } else {
          int frame = this.getFrameIdParam().intValue();
          if (selectedNode.equals(this.getPageCode()) && frame==this.getFrame()) {
            this.addActionError(this.getText("error.target.currentFrame"));
          } else {
            Widget[] showlets = targetPage.getWidgets();
            if (showlets.length <= frame) {
              this.addActionError(this.getText("error.invalidWidgetType"));
            } else {
              Widget showlet = showlets[frame];
              if (showlet != null && this.getInvalidShowletTypes().contains(showlet.getType().getCode())) {
View Full Code Here


    boolean checked = false;
    String selectedNode = this.getPageCodeParam();
    if (null == selectedNode || selectedNode.trim().length() == 0) {
      this.addActionError(this.getText("error.noPageSelected"));
    } else {
      IPage targetPage = this.getPage(selectedNode);
      if (targetPage == null) {
        this.addActionError(this.getText("error.noPageSelected"));
      } else {
        Widget targetFrame = targetPage.getWidgets()[this.getFrameIdParam().intValue()];
        if (targetFrame == null || this.getInvalidShowletTypes().contains(targetFrame.getType().getCode())) {
          this.addActionError(this.getText("error.invalidWidgetType"));
        } else {
          checked = true;
        }
View Full Code Here

   * Return the allowed codes of the group of the nodes to manage.
   * This method has to be extended if the helper manage tree nodes with authority.
   * @return The allowed group codes.
   */
  protected Collection<String> getNodeGroupCodes() {
    IPage page = this.getCurrentPage();
    Set<String> groupCodes = new HashSet<String>();
    groupCodes.add(Group.FREE_GROUP_NAME);
    groupCodes.add(page.getGroup());
    return groupCodes;
  }
View Full Code Here

        if (this.getContentId()!=null){
          Content publishingContent = this.getContentManager().loadContent(this.getContentId(), true);
          if (null == publishingContent) {
            this.addFieldError("contentId", this.getText("Page.specialShowlet.viewer.nullContent"));
          } else {
            IPage currentPage = this.getCurrentPage();
            String mainGroup = currentPage.getGroup();
            if (!publishingContent.getMainGroup().equals(Group.FREE_GROUP_NAME) && !publishingContent.getGroups().contains(Group.FREE_GROUP_NAME) &&
                !publishingContent.getMainGroup().equals(mainGroup) && !publishingContent.getGroups().contains(mainGroup) &&
                !Group.ADMINS_GROUP_NAME.equals(mainGroup)) {
              this.addFieldError("contentId", this.getText("Page.specialShowlet.viewer.invalidContent"));
            }
View Full Code Here

        // if cas client is disactivate normal Authorization on request
        return super.service(reqCtx, retStatus);
      } else {
        HttpServletRequest req = reqCtx.getRequest();
        HttpSession session = req.getSession();
        IPage currentPage =
          (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
        UserDetails currentUser =
          (UserDetails) session.getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
        boolean authorized = this.getAuthManager().isAuth(currentUser, currentPage);
        if (authorized) {
          retStatus = ControllerManager.CONTINUE;
        } else if (SystemConstants.GUEST_USER_NAME.equals(currentUser.getUsername())) {
          _log.info("CAS - user not authorized and guest");
          CasClientUtils casClientUtils = new CasClientUtils();
          String loginBaseUrl = this.getCasClientConfig().getCasLoginURL();
          StringBuilder loginUrl = new StringBuilder(loginBaseUrl);
          loginUrl.append("?service=");
          PageURL pageUrl = this.getUrlManager().createURL(reqCtx);
          String serviceUrl = casClientUtils.getURLStringWithoutTicketParam(pageUrl, reqCtx);
          loginUrl.append(serviceUrl);
          _log.info("CAS - Redirecting to " + loginUrl.toString());
          reqCtx.addExtraParam(RequestContext.EXTRAPAR_REDIRECT_URL, loginUrl.toString());
          retStatus = ControllerManager.REDIRECT;
        } else {
          _log.info("CAS - user authenticated but not authorized");
          Lang currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
                String notAuthPageCode = this.getCasClientConfig().getNotAuthPage();
                IPage page = this.getPageManager().getPage(notAuthPageCode);
                String url = this.getUrlManager().createUrl(page, currentLang, new HashMap<String, String>());
                _log.info("CAS - Redirecting to " + url);
                reqCtx.addExtraParam(RequestContext.EXTRAPAR_REDIRECT_URL, url);
                retStatus = ControllerManager.REDIRECT;
              }
View Full Code Here

      if (lang == null) {
        lang = langManager.getDefaultLang();
      }
    }
    String pageCode = pageUrl.getPageCode();
    IPage page = pageManager.getPage(pageCode);
    if (page == null) {
      page = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
    }
    if (page == null) {
      page = pageManager.getRoot();
    }
    StringBuffer url = new StringBuffer();
    String serverBaseUrl = casClientConfigManager.getClientConfig().getServerBaseURL();
    if (serverBaseUrl.endsWith("/")) {
      serverBaseUrl = serverBaseUrl.substring(0, serverBaseUrl.length()-1);
    }

    url.append(serverBaseUrl);
    url.append(reqCtx.getRequest().getContextPath()).append('/');

    if (!this.isUrlStyleBreadcrumbs(configManager)) {
      url.append(lang.getCode()).append('/');
      url.append(page.getCode()).append(".page");
    } else {
      url.append("pages/");
      url.append(lang.getCode()).append('/');
      StringBuffer fullPath = PageUtils.getFullPath(page, "/");
      url.append(fullPath.append("/"));
View Full Code Here

  }

  public List<IPage> getPages() {
    if (this._pages==null) {
      this._pages = new ArrayList<IPage>();
      IPage root = this.getPageManager().getRoot();
      this.addPages(root, this._pages);
    }
    return this._pages;
  }
View Full Code Here

    RequestContext reqCtx = (RequestContext) req.getAttribute(RequestContext.REQCTX);
    try {
      Widget currentShowlet = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
      String pageCode = currentShowlet.getConfig().getProperty("pageCodeParam");
      IPageManager pageManager = (IPageManager) ApsWebApplicationUtils.getBean(SystemConstants.PAGE_MANAGER, this.pageContext);
      IPage targetPage = pageManager.getPage(pageCode);
      if (null != targetPage) {
        String frameIdString = currentShowlet.getConfig().getProperty("frameIdParam");
        int frameId = Integer.parseInt(frameIdString);
        Widget[] showlets = targetPage.getWidgets();
        if (showlets.length>=frameId) {
          Widget targetShowlet = targetPage.getWidgets()[frameId];
          if (null != targetShowlet) {
            reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, targetShowlet);
            WidgetType WidgetType = targetShowlet.getType();
            if (WidgetType.isLogic()) {
              WidgetType = WidgetType.getParentType();
View Full Code Here

      Lang lang = (null != langCode) ? this.getLangManager().getLang(langCode) : this.getLangManager().getDefaultLang();
      if (null == lang) {
        lang = this.getLangManager().getDefaultLang();
      }
      String pageCode = this.getPageCode();
      IPage page = this.getPage(pageCode);
      return this.getUrlManager().createUrl(page, lang, null);
    }
    return "";
  }
View Full Code Here

    try {
      String result = this.checkBaseParams();
      if (null != result) {
        return result;
      }
      IPage page = this.getPage(this.getPageCode());
      this.setShowlet(page.getWidgets()[this.getFrame()]);
    } catch (Exception e) {
      ApsSystemUtils.logThrowable(e, this, "trashShowlet");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.page.IPage

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.