[opencms-dev] How to map a property with a xml content element ?

Christian Steinert christian_steinert at web.de
Fri Aug 14 23:29:50 CEST 2009


Alain TOMASIAN wrote:
> Hi,
>
> I'd like to know how can I map property (a Title for example) to a xml content
> element. And if is it possible to put the Title value property in this element
> when I edit it ?
>
> I know that it's possible to map the xml content element to a Title property
> like this :
>
> <mapping element="Legend" mapto="property:Title" />
>
> but I need to have the opposite :-)
>   
What should the opposite be?
The mapping works both ways. It should take the old value from the 
property if it is there, otherwise from the XML content field. When 
saving your xml file, the value will be saved both into your xml field 
and into your property. In general, the mapping just works at edit time, 
it will change the way how existing files are interpreted when they are 
only being read.

If you want to somehow re-organize content and merge some properties 
into your XML content so that the data can then be read differently, 
then you might need to write a custom piece of code that does this kind 
of merging, since - as stated before - the mapping will only be 
evaluated, whenever the file is saved in the editor^.

hth
Christian
> Thanks for your answers
>
> Alain.
> __________________________________________
>  Alain TOMASIAN - NAOS Technologies
>  33, avenue Philippe Auguste - 75011 PARIS
>  +33 1 402 402 86 - http://www.naos.com
> __________________________________________
> Découvrez notre solution de communication
>      par email : http://www.enews.fr
> __________________________________________
>
>
>
>
>
> _______________________________________________
> 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
>
>   




More information about the opencms-dev mailing list