Yes and it's very easy ...

Look at the example above : all sub pages of a page order by
date of creation.

        <%!

          public void getLastPages (JahiaPage cp, JahiaData
jData, SortedMap sortedMap, org.apache.log4j.Logger logger) {

            // Date de creation de la page
            long cpDate = -1;

            try {
              cpDate = (new Long (cp.getDoc()) ).longValue();
            } catch (Exception e) {
            }

            // Ajout de la page a la sortedMap
            sortedMap.put(new Long(cpDate), cp);

            // Recherche des sous-pages
            try {

              JahiaContainerList linkContainerList =
jData.containers().getAbsoluteContainerList( "linkContainer",
cp.getID() );
              if (linkContainerList != null) {

                Enumeration myContainerList =
linkContainerList.getContainers();
                if (myContainerList != null) {

                  while (myContainerList.hasMoreElements()) {

                    JahiaContainer myContainer =
(JahiaContainer) myContainerList.nextElement();
                    JahiaPage myLink = (JahiaPage)
myContainer.getFieldObject( "link" );
                    if (myLink != null){
                      getLastPages (myLink, jData, sortedMap,
logger);
                    }

                  }
                }
              }

            } catch (Exception e) {
            }

          }
        %>

        <!-- Arborescence des sous pages - DEBUT -->
        <%
          TreeMap sortedPages = new TreeMap();

          JahiaPage currentJahiaPage = jData.page();
          try {

            JahiaContainerList linkContainerList =
jData.containers().getAbsoluteContainerList( "linkContainer",
currentJahiaPage.getID() );
            if (linkContainerList != null) {

              Enumeration myContainerList =
linkContainerList.getContainers();
              if (myContainerList != null) {

                while (myContainerList.hasMoreElements()) {

                  JahiaContainer myContainer =
(JahiaContainer) myContainerList.nextElement();
                  JahiaPage myLink = (JahiaPage)
myContainer.getFieldObject( "link" );
                  if (myLink != null){
                    getLastPages (myLink, jData, sortedPages,
logger);
                  }

                }
              }
            }

          } catch (Exception e) {
          }
        %>
        <!-- Arborescence des sous pages - FIN -->

        <!-- Affichage des sous pages en ordre chronologique
inverse - DEBUT -->
        <%
          Object keys[] = sortedPages.keySet().toArray();
          int numElement = 1;

          for (int i=keys.length-1; i>=0; i--) {
            try {

              PageBean actualitePageBean = new PageBean (
(JahiaPage) sortedPages.get(keys[i]), jData.params() );

              if (isVisiblePageBean(actualitePageBean, jData)) {
                if (!isRubriquePageBean(actualitePageBean)) {

                  out.write(actualitePageBean.getTitle() +
"<br>");
                  numElement++;

                }
              }

            } catch (Exception e) {
            }
          }
        %>
        <!-- Affichage des pages en ordre chronologique
inverse - FIN -->




> Hello Khue Nguyen!
> Is there a possibility to retrieve the childs pageIds
knowing the parent pageId.
> I need to perform search down the certain tree, so it starts
from parent page and goes down to their childs.
>
> Thank you in advance
> Alex
> __________
> www.newmail.ru -- ????? ????? ??? ?????? ?????????.
>

Ghislain CUSSONNEAU
CRIL Technology
Technoparc de l'Aubini�re
44000 Nantes
02 51 89 64 50

Acc�dez au courrier �lectronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34�/mn) ; t�l : 08 92 68 13 50 (0,34�/mn)



Reply via email to