Lazy properties: is there an example?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2007 05:48 AM
Hi,
I would like to equip my content-type with a property whose value is dynamically computed ("lazy evaluation"). Is this technique being used somewhere in Alfresco? Could somebody point me to some file for an example?
My goal is to refer to the property from the JavaScript API via
Thanks for any hint,
Kaspar
I would like to equip my content-type with a property whose value is dynamically computed ("lazy evaluation"). Is this technique being used somewhere in Alfresco? Could somebody point me to some file for an example?
My goal is to refer to the property from the JavaScript API via
mynode.properties["my:propname"]
and behind the scences my Java code is called and performs the lazy evaluation.Thanks for any hint,
Kaspar
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2007 08:13 AM
It's an interesting idea (although may have some performance impact depending on how much calculation you perform lazily). You may be able to use Node Policies for this. It is possible to fire arbitary java code when nodes are created, deleted and properties set etc.
http://wiki.alfresco.com/wiki/Services_Framework#Component_Policies
http://wiki.alfresco.com/wiki/Policy_Component
Thanks,
Kevin
http://wiki.alfresco.com/wiki/Services_Framework#Component_Policies
http://wiki.alfresco.com/wiki/Policy_Component
Thanks,
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2007 12:05 PM
You may find this article on Alfresco Behaviours interesting - it sounds more appropriate to what you want to do:
http://ecmarchitect.com/archives/2007/09/26/770
Kevin
http://ecmarchitect.com/archives/2007/09/26/770
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2007 12:26 AM
You may find this article on Alfresco Behaviours interesting - it sounds more appropriate to what you want to do:
http://ecmarchitect.com/archives/2007/09/26/770
Kevin
Calculated properties could have some interesting applications. For example content ranking based on weighted values of other properties etc.
I've never really liked calculated fields in databases though they are neat but they are slow in large sets our when the calculation gets too complex.
