[opencms-dev] how can i get file list from the folder.
Frans Postma
fpostma at xs4all.nl
Tue Apr 12 20:43:40 CEST 2005
Read the javadoc of org.opencms.jsp
Class: CmsJspNavBuilder
(recommended read as well: CmsJspActionElement and NavElement)
The items in said folder need to have a proper NavText ofcourse.
Something like this:
// Create a JSP action element
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
java.util.List list = cms.getNavigation().getNavigationForFolder();
java.util.Iterator i = list.iterator();
// Now build the navigation
out.println("Items in this folder/list:<br>");
while (i.hasNext()) {
CmsJspNavElement ne = (CmsJspNavElement)i.next();
out.print(ne.getNavText()); // never returns null, so this is safe
out.println("<br>");
}
out.println("end entries<br>");
Frans
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of aeonsun
> Sent: dinsdag 12 april 2005 4:14
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] how can i get file list from the folder.
>
> I am a newbie of opencms and I use opencms 6b1.
> Has any way to get the file list from /site/default/myfolder/ ?
>
> It has three file in myfolder.Can i list it?
> thanks all.
More information about the opencms-dev
mailing list