R: [opencms-dev] Complete Navigation Tree

opencms at biberbeatz.de opencms at biberbeatz.de
Wed Jan 19 14:56:31 CET 2005


>Hi, 
>you can use this static api CmsJspNavBuilder.getSiteNavigation
>that gives you the tree starting from your dir(name must end with
"/") check
>api doc for parameters.
>Stefano.
>
>
>List list = CmsJspNavBuilder.getSiteNavigation(cmsObj, "/yourDir/",
-1);
>Iterator i = list.iterator();
>while (i.hasNext()) {
>   CmsJspNavElement ne = (CmsJspNavElement)i.next();
>
>   // some nav element methods to use.
>   ne.getParentFolderName()
>   ne.isFolderLink()
>   ne.getResourceName());
>   ne.getNavText()
>   ne.getFileName()
>   ne.getTitle()
>
>}

I tried to rebuilt this example but  my list always is empty.
I also tried other methods regarding the getSiteNavigation

http://www.codedroids.com/javadocs/opencms/HEAD/docs/api/org/opencms/
jsp/CmsJspNavBuilder.html

But all return an empty list.
For demo purposes I placed my jsp in many different folders and
hierachies in the /sites/default

All necessary classes are correctly imported :
<%@ page session="false" %>
<%@ page import="org.opencms.file.*, org.opencms.jsp.*, java.util.*,
org.opencms.frontend.templateone.*" %>

I created the cmsObj with the following code:
CmsJspActionElement cms =  new CmsJspActionElement(pageContext,
request, response);


Any ideas? Thanks in advance.
Jan

[...]



More information about the opencms-dev mailing list