[opencms-dev] getFieldMethods
Stephan Hartmann
beffe at beffe.de
Wed Oct 29 21:24:02 CET 2003
You don`t need that.
When you edit a content definition it will be instantiated by calling the constructor that gets a CmsObject and an Integer id. You can store this CmsObject in a member variable which you can reference from your getter.
For lists it is up to you. Your filter method that returns the vector of content definitions can accept a CmsObject. For that you should use a constructor that gets a CmsObject and all the fields of your content definition.
Bye,
Stephan
----- Original Message -----
From: Mark Miller
To: 'OpenCMS Mailing List'
Sent: Wednesday, October 29, 2003 5:20 PM
Subject: [opencms-dev] getFieldMethods
Is it possible to pass the cms object to a getXXX method ???
Eg.
Can I use something like this
methods.addElement(AlbumContentDefinition.class.getMethod("getNumberOfImages", new Class[] {CmsObject.class} ));
if so . how do I let the backoffice template to call the method with it's cms object ? . I have a getter that requires use of the vfs, ie. it dynamically works out the number of files in a folder in the VFS . hence why I need a way to pass the cms object so I can then use
cms.getResourcesInFolder(getImageLocation()).size();
within the getter.
Does this make sense ? if so, how do I implement it ?
Many thanks in advance,
mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20031029/5be4a407/attachment.htm>
More information about the opencms-dev
mailing list