[opencms-dev] dealing with changing NavTreeLevel

Nigel Kersten nigel at cofa.unsw.edu.au
Sun Aug 28 22:17:54 CEST 2005


Hi there.

We've only just started working on our OpenCMS install, and we ran  
into something that was a little confusing at first.

We've got things set up like this (from opencms-system.xml, I haven't  
set up the Apache integration yet)

<site server="http://opencms.cofa.unsw.edu.au:8080" uri="/sites/ 
default/"/>
<site server="http://new.cofa.unsw.edu.au:8080" uri="/sites/cofa/"/>

and it was confusing us how when building a hierarchical menu, the  
NavTreeLevel of "/sites/cofa" would be different whether you were  
previewing the Offline project while logged in, or looking at the  
Online project as a web user.

This is how we got around it, and then we build the hierarchical menu  
based upon this cofaRootNavLevel:

java.util.List findCofaList = cms.getNavigation 
().getNavigationBreadCrumb();
java.util.Iterator fn = findCofaList.iterator();
while (fn.hasNext())
{
     CmsJspNavElement fne = (CmsJspNavElement)fn.next();
     if (fne.getFileName().equals("cofa/"))
     {
     cofaRootNavLevel = fne.getNavTreeLevel();
     }
}


But I'm just wondering if there is a more elegant method that people  
often use to distinguish between the two cases?





--
Nigel Kersten [Senior Technical Officer]
College of Fine Arts, University of NSW, Australia.
CRICOS Provider Code: 00098G





More information about the opencms-dev mailing list