[opencms-dev] All properties of a resource

Christian Steinert christian_steinert at web.de
Tue Feb 28 23:52:45 CET 2006


Yo wrote:
> Hello,
>  I need to know if there is a function in OpenCms API to get all the 
> properties of a resource. I´ve got only the name of the resource.
>
> Thank in you in advance,
>
> Yo
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> 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
//[..] construct the cmsJspActionElement first, I don't have the code in 
mind, but its well documented in the alcacon docs
CmsObject cmsObject = cmsJspActionElement.getCmsObject();
List properties = cmsObject.readPropertyObjects();

int count = properties.size();
for(int i=0; i<count;i++={
  CmsProperty currProperty = (CmsProperty) properties.get(i);

  String propertyName = currProperty.getName();
  String propertyName = currProperty.getValue();
}


I did not test the code but if should be not too wrong.
You can do more with CmsProperty, for example get property values that 
are _shared_ among all siblings of one resource - just look at the api 
doc of the CmsProperty class .

cheers
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060228/5ddf4516/attachment.htm>


More information about the opencms-dev mailing list