[opencms-dev] Convert CMSResource to CMSJspNavElement

Ayvid B ayvid_bh at rediffmail.com
Mon Oct 11 20:08:20 CEST 2004


An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20041011/2e1bd5df/attachment.htm>
-------------- next part --------------
Thanks.

It worked.I had to put resource.getResourceName() instead of resource.getName();

Ayvid


On Mon, 11 Oct 2004 Ayvid B wrote :
>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
> >
>
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev


More information about the opencms-dev mailing list