[opencms-dev] from folder to NavText

Pavel Peringer pavel.peringer at qbizm.cz
Tue May 23 17:13:07 CEST 2006


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.
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

Pavel Peringer

-- 
Pavel Peringer                              Qbizm technologies, a.s.
programator                                 ... the art of software.
____________________________________________________________________
www.qbizm-technologies.cz    www.qbizm.cz      www.qbizm-services.cz




More information about the opencms-dev mailing list