[opencms-dev] Convert CMSResource to CMSJspNavElement

Thomas M�rz thomasmaerz at gmx.de
Sat Oct 9 00:12:00 CEST 2004


"Ayvid B" <ayvid_bh at rediffmail.com> writes:

> I want to know if there is a way to convert a CMSResource to
> CMSJspNavElement?
>
> I am going through a folder which has some resources which are in
> navigation and some resources which are not in navigation.
>
> The folder whose resources I am getting is itself not in navigation.
> So I am using the method cmsObject.getResourcesInFolder for getting
> the contents of the folder.
>
> Now I want to get only those elements of the folder which are in
> navigation.

| CmsResource resource = null;
| ArrayList list = new ArrayList();
| Vector resources = cmsObject.getResourcesInFolder( "/test/" );
| for ( int i = 0; i < subFolders.size(); i++ ) 
| {
|     resource = ( CmsResource ) subFolders.elementAt( i );
|     if ( resource.isFolder() )
|     {
|         list.addAll( CmsJspNavBuilder.getNavigationForFolder( cmsObject, resource.getName() ) );
|     }
| }

But take a look at the source of CmsJspNavBuilder anyway.

HTH,
Thomas




More information about the opencms-dev mailing list