[opencms-dev] bug in the template provided : non-existing directory provokes error

Nicolas Delsaux nicolas.delsaux at online.fr
Fri Jun 6 17:08:01 CEST 2003

On Fri, 06 Jun 2003 16:22:09 +0200, Thomas März <thomasmaerz at gmx.de> wrote:
> Why don't you use the code in template-nav-left.jsp of the module
> org.opencms.templates? You don't need the property "locale" to build a
> navigation.

That's what I've done ! In fact, i've copied all the needed templates from 
the org.opencms.templates module to my own module, for more ease (and also 
for keeping references files).
But in this file, there is such a locale property used (see line 49, it's 
guessed, but indeed not used, quite strange ;-)
> ,----
> | com.opencms.file.CmsObject cmsObject = cms.getCmsObject();
> | String uri = cmsObject.getRequestContext().getUri();
> | ArrayList nav1pages = 
> CmsJspNavBuilder.getNavigationForFolder(cmsObject, uri, 1);
> | Iterator i = nav1pages.iterator();
> | while (i.hasNext()) {
> | | }
> `----
> Or did I misunderstand something? Of course you can't get a navigation
> for a not existing folder. What exactly is the problem?

The problem is that my navigation is broken on some pages.
Like I explained before, I've built a articles folder under the release 
folder (since I'm not able to create a new folder just under the root, I'll 
try to correct that with a new project on Tuesday - yes French people are 
on holiday monday).
When I display the default index.jsp in root folder using my modified 
template, all goes right. But when I try to display pages in the release 
folder, like installation.html, I lost the navigation bar, due to a null 
pointer in the nav.isFolder() (in fact, using default template, the page is 
not displayed, and replaced by [jsp] ???, I've put a try...catch around the 
whole nav bar for avoiding this behaviour, and hunting the bug).
This behaviour is also seeable in the release/articles folder, that I've 
OK, I've think a little on that, I'll try to create a new cleaner project.

Well, I've just rebuilt a new project, with this time write access to the 
root, which is better. By the way, I've put the articles folder next to 
release, instead of putting the first under the second.
Now I'll test the rendering (suspense !)
Well, I'm now really confused : my article folder has now disapêared from 
the navigation !
I've corrected my jsp template (yes, it defined as a reference the /release 
folder, what is probably not my best idea ;-)
Well, I now have all my folders (including system and aklacon 
documentation) in my nav bar, what is not a problem. The problem is that 
this nav bar gets updated with the displayed page, that's to say that in, 
as an example, the release folder, only the release folder is displayed 
where I would like to have again all the folders displayed.
In fact, it was more due to my lack of comprehension of OpenCMS than due to 
Anyway, thanks Thomas for putting my eyes in front of my orbs (I do not 
know any good english expression for that, sorry ;-)
> Best Regards,
> Thomas März

Nicolas Delsaux
"Dans l'espace, personne ne vous entend crier"

More information about the opencms-dev mailing list