[opencms-dev] from folder to NavText

Tomáš Adámek tomas.adamek at qbizm.cz
Wed May 24 10:19:29 CEST 2006


Try to use something like this:

CmsJspActionElement cmsJspActionElement = new 
CmsJspActionElement(pageContext, request, response);
CmsJspNavBuilder navBuilder = new CmsJspNavBuilder(cmsJspActionElement);
CmsJspNavElement navElement = navBuilder.getNavigationForResource(path);
out.println(navElement.getNavText());

Christoph P. Kukulies napsal(a):
> On Tue, May 23, 2006 at 05:13:07PM +0200, Pavel Peringer wrote:
> 
>>Christoph P. Kukulies napsal(a):
>>
>>
>>>Slight problem: How can I access (via getNavText()) the Navtext
>>>when I have the folder f? I cannot cast CmsFolder to CmsJspNavElement.
>>>
>>>navtext=((CmsJspNavElement)f).getNavText();
>>>
>>>
>>>
>>>
>>
>>You need initialized CmsObject. CmsFolder extends CmsResource.
> 
> 
> Can you send me this in a more readable form (as program code),please?:
> 
> 
>>String navtext = cmsObject.|*readPropertyObject 
>><../../../org/opencms/file/CmsObject.html#readPropertyObject%28org.opencms.file.CmsResource,%20java.lang.String,%20boolean%29>*(f, 
>>|CmsPropertyDefinition.|*PROPERTY_NAVTEXT 
>><../../../org/opencms/file/CmsPropertyDefinition.html#PROPERTY_NAVTEXT>*||, 
>>false)|.|*getValue 
>><../../../org/opencms/file/CmsProperty.html#getValue%28%29>*();
>>or in case no navtext is found
>>|String navtext = cmsObject.|*readPropertyObject 
>><../../../org/opencms/file/CmsObject.html#readPropertyObject%28org.opencms.file.CmsResource,%20java.lang.String,%20boolean%29>*(f, 
>>|CmsPropertyDefinition.|*PROPERTY_NAVTEXT 
>><../../../org/opencms/file/CmsPropertyDefinition.html#PROPERTY_NAVTEXT>*||, 
>>false)|.|*getValue 
>><../../../org/opencms/file/CmsProperty.html#getValue%28%29>*("predefined 
>>navtext");|
>>
>>HTH
> 
> 
> What are all these vertical bars doing? I could try to decipher the
> %hexcodes. Was it cut/pasted out of a web page or what?
> 
> 
> --
> Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev

-- 
Tomas Adamek                                Qbizm technologies, a.s.
analyst-developer                           ... the art of software.
____________________________________________________________________
www.qbizm-technologies.cz    www.qbizm.cz      www.qbizm-services.cz



More information about the opencms-dev mailing list