Package org.meshcms.core

Examples of org.meshcms.core.PageInfo


          if (!langCode.equalsIgnoreCase(pagePath.getElementAt(0))) {
            Path path = siteMap.getServedPath(pagePath.replace(0, langCode));

            if (!webSite.getFile(path).isFile()) {
              if (userInfo != null && userInfo.canWrite(webSite, path)) {
                PageInfo ppi = siteMap.getParentPageInfo(pagePath);

                if (ppi != null && ppi.getLevel() > 0) {
                  Path pPath = ppi.getPath().replace(0, langCode);

                  if (siteMap.getPageInfo(pPath) != null) {
                    ResourceBundle bundle =
                        ResourceBundle.getBundle("org/meshcms/webui/Locales",
                        WebUtils.getPageLocale(pageContext));
View Full Code Here


      if (webSite != null) {
        SiteMap siteMap = webSite.getSiteMap();
        List pagesList = siteMap.getPagesList();

        for (Iterator iter = pagesList.iterator(); iter.hasNext();) {
          PageInfo pageInfo = (PageInfo) iter.next();

          if (pageInfo.getPath().isRoot() &&
              webSite.getConfiguration().isRedirectRoot() &&
              HitFilter.getPreferredLanguage(request) != null) {
            continue;
          }

          Element url = doc.createElement("url");
          urlset.appendChild(url);

          Element loc = doc.createElement("loc");
          url.appendChild(loc);
          loc.appendChild(doc.createTextNode(baseURL +
              siteMap.getServedPath(pageInfo.getPath())));

          Element lastmod = doc.createElement("lastmod");
          url.appendChild(lastmod);
          lastmod.appendChild(doc.createTextNode(ISO_8601_FORMAT.format(new Date(pageInfo.getLastModified()))));

          Element priority = doc.createElement("priority");
          url.appendChild(priority);

          float value = PRIORITY_WEIGHT / (PRIORITY_WEIGHT +
              pageInfo.getPath().getElementCount());
          priority.appendChild(doc.createTextNode(DECIMAL_FORMAT.format(value)));
        }
      }

      DOMSource domSource = new DOMSource(doc);
View Full Code Here

    SiteMapIterator iter = new SiteMapIterator(webSite, rootPath);
    iter.setSkipHiddenSubPages(allowHiding);
    Writer outWriter = getOut();

    while (iter.hasNext()) {
      PageInfo current = (PageInfo) iter.next();
      Path currentPath = current.getPath();
      Path parentPath = currentPath.getParent();

      if (parentPath.isRelative() || pathInMenu.isContainedIn(parentPath)) {
        if (Utils.isTrue(expand) ||
            pathInMenu.isContainedIn(currentPath) ||
            currentPath.getElementCount() == baseLevel ||
            currentPath.getElementCount() >= pathInMenu.getElementCount()) {
          outWriter.write("<div style=\"padding-left: " +
            (spc * Math.max(current.getLevel() - baseLevel, 0)) + "px;\">");

          if (style != null) {
            outWriter.write("<div class=\"" + style + "\">");
          }

          outWriter.write(bullet + "&nbsp;");

          if (!isEdit && current.getPath().equals(pathInMenu)) {
            outWriter.write(siteInfo.getPageTitle(current));
          } else {
            outWriter.write("<a href=\"" + webSite.getLink(current, pageDirPath) +
              "\">" + siteInfo.getPageTitle(current) + "</a>");
          }
View Full Code Here

      list.add(0, webSite.getSiteMap().getPageInfo(pagePath));
    }*/
   
    if (list != null) {
      if (!Utils.isTrue(current)) {
        PageInfo pageInfo = webSite.getSiteMap().getPageInfo(pagePath);
       
        for (int i = 0; i < list.size(); i++) {
          PageInfo pi = (PageInfo) list.get(i);
         
          if (pi.equals(pageInfo)) {
            list.remove(i--);
          }
        }
      }
     
View Full Code Here

      iter.setSkipHiddenSubPages(Utils.isTrue(allowHiding));
      boolean liUsed = false;
      boolean firstUl = true;

      while (iter.hasNext()) {
        PageInfo currentPageInfo = (PageInfo) iter.next();
        Path currentPath = currentPageInfo.getPath();
        int level = Math.max(baseLevel, currentPageInfo.getLevel());

        for (int i = lastLevel; i < level; i++) {
          if (firstUl) {
            writeIndented(outWriter, "<ul class=\"" +
                (horizontal ? "hmenu" : "vmenu") + "\">", i);
            firstUl = false;
          } else {
            writeIndented(outWriter, "<ul>", i);
          }

          writeIndented(outWriter, "<li>", i + 1);
          liUsed = false;
        }

        for (int i = lastLevel - 1; i >= level; i--) {
          if (liUsed) {
            outWriter.write("</li>");
            liUsed = false;
          } else {
            writeIndented(outWriter, "</li>", i + 1);
          }

          writeIndented(outWriter, "</ul>", i);
        }

        if (liUsed) {
          outWriter.write("</li>");
          writeIndented(outWriter, "<li>", level);
        }

        for ( int i = lastLevel - 1; i >= level; i--) {
            writeIndented(outWriter, "</li>", i);
            writeIndented(outWriter, "<li>", i);
        }

        if ( ! Utils.isNullOrEmpty(currentPathStyle)
                        && ( currentPageInfo.getLevel() >= baseLevel
                               && pathInMenu.isContainedIn(currentPath)
                     || currentPageInfo.getPath().equals(pathInMenu)
                   ) ) {
          outWriter.write("<a href=\"" + webSite.getLink(currentPageInfo, pageDirPath) +
            "\" class='" + currentPathStyle + "'>" +
            siteInfo.getPageTitle(currentPageInfo) + "</a>");
        } else {
View Full Code Here

        String[] temp = new String[last + 1];
        System.arraycopy(outs, 0, temp, 0, last);
        outs = temp;
      }

      PageInfo pageInfo = webSite.getSiteMap().getPageInfo(pagePath);
      outs[last] = (pageInfo == null) ? getPage().getTitle() :
          webSite.getSiteInfo().getPageTitle(pageInfo);
    }

    Writer w = getOut();
View Full Code Here

    iter.setSkipHiddenSubPages(Utils.isTrue(allowHiding));
    boolean styleNotApplied = !Utils.isNullOrEmpty(style);
    int showLastLevel = -1;
   
    while (iter.hasNext()) {
      PageInfo currentPageInfo = (PageInfo) iter.next();
      Path currentPath = currentPageInfo.getPath();
      int level = Math.max(baseLevel, currentPageInfo.getLevel());
     
      if (currentPageInfo.getLevel() <= showLastLevel) {
        showLastLevel = -1;
      }
     
      if (siteInfo.getHideSubmenu(currentPath) && showLastLevel == -1) {
        showLastLevel = currentPageInfo.getLevel();
      }
     
      boolean add = false;
     
      if (itemsAll) {
        add = true;
      } else {
        Path parentPath = currentPath.getParent();
       
        if (parentPath.isRelative() || pathInMenu.isContainedIn(parentPath)) {
          if (itemsOnPath && pathInMenu.isContainedIn(currentPath)) {
            add = true;
          } else if (level <= baseLevel) {
            add = itemsFirstLevel;
          } else if (currentPath.getElementCount() == pathInMenu.getElementCount()) {
            add = itemsLastLevel;
          } else if (currentPath.getElementCount() > pathInMenu.getElementCount()) {
            add = itemsChildren;
          } else {
            add = itemsIntermediateLevels;
          }
        }
      }
     
      if (add) {
        // Close off any pending lower levels
        for (int i = lastLevel - 1; i >= level; i--) {
          writeIndented(outWriter, "</li>", i + 1);
          writeIndented(outWriter, "</ul>", i);
        }
       
        // If we're a level deeper - then create new sub ul+li
        for (int i = lastLevel; i < level; i++) {
          if (styleNotApplied) {
            writeIndented(outWriter, "<ul class=\"" + style + "\">", i);
            styleNotApplied = false;
          } else {
            if (artisteer) {
              writeIndented(outWriter, "<ul class='active'>", i);
            } else {
              writeIndented(outWriter, "<ul>", i);
            }
          }
          writeIndented(outWriter, "<li>", i + 1);
        }
       
        // If we do not have an open li at the right level - then create one
        if (level <= lastLevel) {
          writeIndented(outWriter, "</li>", level);
          writeIndented(outWriter, "<li>", level);
        }
       
        String link = webSite.getLink(currentPageInfo, pageDirPath).toString();
        String artStart, artEnd;
       
        if (currentPageInfo.getLevel() - baseLevel < 1 && artisteer) {
          artStart = "<span class='l'></span><span class='r'></span><span class='t'>";
          artEnd = "</span>";
        } else {
          artStart = artEnd = "";
        }
       
        if (currentPageInfo.getLevel() > 0 && pathInMenu.isContainedIn(currentPath)
            && !(currentPageInfo.getPath().equals(pathInMenu)
                || currentPageInfo.getPath().equals(rootPath)
                || Utils.isNullOrEmpty(currentPathStyle))) {
          outWriter.write("<a href=\"" + link + "\" class='" + currentPathStyle +
              "'>" + artStart + siteInfo.getPageTitle(currentPageInfo) + artEnd + "</a>");
        } else if (currentPageInfo.getPath().equals(pathInMenu)) {
          if (isEdit || linkCurrent) {
            if (!(Utils.isNullOrEmpty(currentStyle) && Utils.isNullOrEmpty(currentPathStyle))) {
              outWriter.write("<a href=\"" + link + "\" class='" + currentPathStyle +
                  " " + currentStyle + "'>" + artStart +
                  siteInfo.getPageTitle(currentPageInfo) + artEnd + "</a>");
View Full Code Here

TOP

Related Classes of org.meshcms.core.PageInfo

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.