[opencms-dev] Problem with CmsObject.getChilds()
Stefan Uldum Grinsted
sug at interactive.as
Thu Jul 28 10:15:24 CEST 2005
Hi List
I'm having a problem with CmsObject.getGroups(...).
Initially i used the 6.0 release and got a null-pointer exception. But as
http://www.opencms.org/cvs/viewcvs.cgi/opencms/history.txt#rev1.667
reads, a correction was made to CmsDriverManager.getChilds() after the
release of version 6.
So I checked out the newest version from the CVS just this morning, ran
the compile and jar targets from the ant build, and put the new
opencms.jar into WEB-INF/lib and restarted tomcat.
No null pointer exception occurs now, but the results is always empty. The
CmsObject.getChild() seems to work as expected though.
I made a simple group-structure like this:
+ ParentGroup
| + ChildGroup
| | + ChildChildGroup
And this is my JSP test code:
--------------------------------------
CmsJspActionElement cms = new CmsJspActionElement(pageContext,
request, response);
CmsObject cmso = cms.getCmsObject();
List groups = cmso.getChild("ParentGroup");
out.write("getChild()<br>");
out.write("Size: " + groups.size() + "<br>");
out.write("Items: " + groups.toString() + "<br><br>");
groups = cmso.getChild("ChildGroup");
out.write("getChild()<br>");
out.write("Size: " + groups.size() + "<br>");
out.write("Items: " + groups.toString() + "<br><br>");
groups = cmso.getChilds("ParentGroup");
out.write("getChilds()<br>");
out.write("Size: " + groups.size() + "<br>");
out.write("Items: " + groups.toString() + "<br>");
--------------------------------------
And its results:
--------------------------------------
getChild()
Size: 1
Items: [[Group] name:ChildGroup id:f7b905de-feaf-11d9-9146-bf8f88ce6f5b
description:]
getChild()
Size: 1
Items: [[Group] name:ChildChildGroup
id:a6fb3fb3-ff3a-11d9-ae38-bf8f88ce6f5b description:]
getChilds()
Size: 0
Items: []
--------------------------------------
I would, however, expect the getChilds() method to return both ChildGroup
and ChildChildGroup, is that not correct?
I hate to ask this question, but is there a possible bug?
Enviroment:
OpenCMS 6.0 (with opencms.jar compiled from CVS Checkout at
2005-07-28, 09:00)
Tomcat 5.5.9
MySQL 4.1.10
Java: jdk1.5.0_02
Best Regards
Stefan Uldum Grinsted
---------------------------------
Par No 1 Interactive a|s
sug at interactive.as
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050728/e0bf61e4/attachment.htm>
More information about the opencms-dev
mailing list