[opencms-dev] Multiple values to a single Property?

Jonathan Woods jonathan.woods at scintillance.com
Sat Oct 7 07:29:34 CEST 2006


Dinshaw -
 
I'm sorry; I misunderstood your question, anyway.  As far I can tell, you
want the value of multiple elements to map on to a single property, whereas
in my case I was merely setting an element's 'value' (and thereby a mapped
property) using values derived from a multi-select widget.
 
Are you restricted to using a PHP application layer?  If you used Java
executing in the OpenCms context, you'd have far more flexibility - e.g.
Java could process the XML document instance whenever it wanted, maybe
setting a property to help in later querying for category-matching
resources.  I take a different approach at www.colfes.com: I index XML docs
in Lucene, and query the Lucene index at page rendering time (with some
caching) to select resources matching multiple categories.
 
By the way, is the code to your CmsCategorySelectWidget something you can
share?  I currently flatten a hierarchical value structure and represent it
in a simple SelectorWidget - ugly!
 
Jon

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of dinshaw gobhai
Sent: 06 October 2006 17:56
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Multiple values to a single Property?


Hi Jon,
Thanks very much. I tried your sugestion and still my values are
overwritten.
My relevent schema lines are:

<xsd:element name="Category" type="OpenCmsString" />
<layout element="Category" widget="CmsCategorySelectWidget" /> 
<mapping element="Category" mapto="property:category" />

If you have a second to see if there is anything dumb in here (like I
shouldn't be using String) that would be great.
The CmsCategorySelectWidget uses a MySQL nested set modle category table to
return a tree stucture. 
Thanks again,
-Dinshaw 



On 10/6/06, Jonathan Woods <jonathan.woods at scintillance.com> wrote: 

Dinshaw -
 
I use a SelectorWidget to render a multiple-select list in a couple of my
XSDs, and I used to map the (multiple) value of this using an ordinary
<mapping> element.  OpenCms populated the property with the values selected,
separating them with a comma (or was it a semicolon? can't recall).
 
Jon

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of dinshaw gobhai
Sent: 05 October 2006 18:48
To: opencms-dev at opencms.org
Subject: [opencms-dev] Multiple values to a single Property?



Hi there,
I am fairly new to OpenCMS and have found references to that fact that i can
map multiple values to a single property however I can not find a guide as
to how.
If anyone could point me to a reference that would be great. 

The problem is that I  have a category select list for a content type
my_article.xsd that needs to occur multiple times so that it can appear on
different category pages simultaneously.

The catch is that the system I am working on has built a php application
layer to get and parse the OpenCMS content and they sql query needs the
property value to target the articles that should be included. 

Currently only the first instance of the Category select list is mapped to
the category property.

<mapping element="Category" mapto="property:category" />

so what i was looking for (i think) was something like 
<mapping element="Category" mapto="property:category" multiple="true" />

But i have been unable to find it.

Any help would be greatly appreciated.
Thanks,
-Dinshaw, NYC 




_______________________________________________
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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20061007/adb4a498/attachment.htm>


More information about the opencms-dev mailing list