[opencms-dev] Convert CMSResource to CMSJspNavElement
Ayvid B
ayvid_bh at rediffmail.com
Mon Oct 11 17:08:08 CEST 2004
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20041011/1efe4c69/attachment.htm>
-------------- next part --------------
Thanks Thomas.
But when I am trying to retrieve the elements of the list I am getting the root folder elements not the folder elements that i want.
Is there anything that I am missing?
Ayvid
On Sat, 09 Oct 2004 Thomas März wrote :
>"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