[Hippo-cms7-user] DerivedDataFunction dynamic value of document field

Frank van Lankvelt f.vanlankvelt at onehippo.com
Thu Jun 21 08:58:39 CEST 2012


On Wed, Jun 20, 2012 at 10:52 PM, Romuald Guyonnet Duluc
<rguyonnet at alogient.com> wrote:
> Thanks for your answer .
>
> Unfortunately, I need to store the value , because I use the Bs Documents in a facet .For the moment , I use a link to document A in Documents B but that could be boring for cms users  and error prone.
>
if the value in document A never changes, and the property path for
the derived data function didn't work out, you could also try workflow
events:
  http://www.onehippo.org/cms7/documentation/development/content+repository/workflow/workflow-events.html
If you then register a callback workflow for new document creation
(folderworkflow#add), you can then use the jcr session from the
workflow context to set the property to its required value.  This will
not update the value when it changes in A, though.

cheers, Frank

> Romuald
>
> -----Original Message-----
> From: hippo-cms7-user-bounces at lists.onehippo.org [mailto:hippo-cms7-user-bounces at lists.onehippo.org] On Behalf Of Niels van Kampenhout
> Sent: June-20-12 4:47 PM
> To: Hippo CMS 7 development public mailinglist
> Subject: Re: [Hippo-cms7-user] DerivedDataFunction dynamic value of document field
>
> On Tue, Jun 19, 2012 at 2:52 PM, rmtl <rguyonnet at alogient.com> wrote:
>> in a folder , there is one document A and several document B.  but if
>> there is 2 folders , there is will be document A1 in folder F1 and
>> document A2 infolder F2.
>>
>> What I need , is that multiple document B  has the a field computed
>> from a document A  field in the same folder.
>
> Do you actually need to store the value from A in all the Bs as well, or do you only need to display the value from A in the editing template for the Bs?
> In the latter case, you can create a custom field plugin. You will have access to the document node (through its JcrNodeModel) so you can use the JCR API to look up node A. I've done this in a project a few years ago.
>
> Hope this helps.
>
> Regards,
> Niels
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



-- 
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com



More information about the Hippo-cms7-user mailing list