<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=832152518-10102006><FONT face=Arial
color=#0000ff size=2>Thanks for the code. Eek! The sooner OpenCms
gets itself an integrated AJAX-like framework for editing XML content the
better.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=832152518-10102006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=832152518-10102006><FONT face=Arial
color=#0000ff size=2>Here's my schema which allows me to use a
multiple-select control. I don't currently use property mapping, so that
isn't shown in this schema - but as far as I recall it worked OK. Ignore
stuff between {{ and }}, and pretend it's replaced with a string of your choice
(I do that with Ant during build time).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=832152518-10102006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=832152518-10102006><FONT face=Arial
color=#0000ff size=2>Jon</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=832152518-10102006><FONT face=Arial
color=#0000ff size=2>======</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><xsd:schema xmlns:xsd="<A
href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>"
elementFormDefault="qualified"><BR> <BR> <xsd:include
schemaLocation="opencms://opencms-xmlcontent.xsd"/><BR> <BR> <xsd:element
name="OrganisationalUnitSets"
type="OpenCmsOrganisationalUnitSets"/><BR> <BR> <xsd:complexType
name="OpenCmsOrganisationalUnitSets"><BR> <xsd:sequence><BR> <xsd:element
name="OrganisationalUnitSet" type="OpenCmsOrganisationalUnitSet" minOccurs="0"
maxOccurs="unbounded"/><BR> </xsd:sequence><BR> </xsd:complexType></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2> <xsd:complexType
name="OpenCmsOrganisationalUnitSet"><BR> <xsd:sequence><BR> <xsd:element
name="OrganisationalUnitShortNames" type="OpenCmsString"
/><BR> </xsd:sequence><BR> <xsd:attribute
name="language" type="OpenCmsLocale"
use="optional"/><BR> </xsd:complexType></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff
size=2> <xsd:annotation><BR> <xsd:appinfo><BR> <resourcebundle
name="{{runtime.opencms.module.name}}.workplace"/><BR> <layouts><BR> <layout
element="OrganisationalUnitShortNames" widget="MultiSelectWidget"
configuration="${key.standingdata.{{runtime.opencms.propertyprefix}}organisationalunit}"/><BR> </layouts><BR> <validationrules/><BR> <defaults><BR> <default
element="OrganisationalUnitShortNames"
value="${key.standingdata.{{runtime.opencms.propertyprefix}}organisationalunit.defaultvalue}"/><BR> </defaults><BR> </xsd:appinfo><BR> </xsd:annotation>
<BR></xsd:schema><BR></FONT></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>dinshaw
gobhai<BR><B>Sent:</B> 10 October 2006 19:13<BR><B>To:</B> The OpenCms mailing
list<BR><B>Subject:</B> Re: [opencms-dev] Multiple values to a single
Property?<BR></FONT><BR></DIV>
<DIV></DIV>Hello there,<BR>Thanks but I think you did have it right.<BR>I am
trying to set the value (add property) to the value of the multi widget.<BR>I do
the same thing as you but it is passted below.<BR>MY problem is that a JAVA
developer here before me made this custom class and I just changed the sql to
return my categories. <BR>I believe that for the multi values i cannot use an
'extention' of the SelectWidget but rather should be usiing the ComboBox as you
are. But not being a JAVA guy and not having a day or two to spend figuring it
out i was trying to get it to workwith the selectWidget. <BR>I changed the
output to multiple="true" but that did not do the trick.<BR><BR>Here is what i
am using: wuold you mind showing me the ComboBox code you are
using?<BR><BR><BR>package com.bhvr.opencms.widgets;<BR><BR>import
com.bhvr.db.DBUtil;<BR><BR>import org.opencms.file.CmsObject;<BR>import
org.opencms.widgets.A_CmsSelectWidget;<BR>import
org.opencms.widgets.CmsSelectWidget;<BR>import
org.opencms.widgets.CmsSelectWidgetOption; <BR>import
org.opencms.widgets.I_CmsWidget;<BR>import
org.opencms.widgets.I_CmsWidgetDialog;<BR>import
org.opencms.widgets.I_CmsWidgetParameter;<BR><BR>import
java.util.Iterator;<BR>import java.util.List;<BR><BR>/**<BR> * Provides a
widget for a standard HTML form select box.<p> <BR> * <BR> *
Please see the documentation of <code>{@link
org.opencms.widgets.CmsSelectWidgetOption}</code> for a description
<BR> * about the configuration String syntax for the select
options.<p><BR> * <BR> * The select widget does use the
following select options:<ul><BR> * <li><code>{@link
org.opencms.widgets.CmsSelectWidgetOption#getValue()}</code> for the
<code>value</code> of the HTML select box <BR> *
<li><code>{@link
org.opencms.widgets.CmsSelectWidgetOption#isDefault()}</code> for
pre-selecting a specific value <BR> * <li><code>{@link
org.opencms.widgets.CmsSelectWidgetOption#getOption ()}</code> for the
<code>option</code> of the HTML select box<BR> *
</ul><BR> * <p><BR> *<BR> * @author Andreas Zahner
<BR> * <BR> * @version $Revision: 1.11 $ <BR> * <BR> *
@since 6.0.0 <BR> */<BR>public class CmsCategorySelectWidget extends
A_CmsSelectWidget {<BR><BR> /**<BR> *
Creates a new select widget.<p><BR>
*/<BR> public CmsCategorySelectWidget()
{<BR><BR> // empty constructor is
required for class registration <BR>
super();<BR> }<BR><BR>
/**<BR> * Creates a select widget with the select
options specified in the given configuration
List.<p><BR> * <BR> * The
list elements must be of type <code>{@link
CmsSelectWidgetOption}</code>.<p> <BR> *
<BR> * @param configuration the configuration (possible
options) for the select widget<BR> *
<BR> * @see
CmsSelectWidgetOption<BR> */<BR>
public CmsCategorySelectWidget(List configuration)
{<BR><BR>
super(configuration);<BR> }<BR><BR>
/**<BR> * Creates a select widget with the specified
select options.<p><BR> *
<BR> * @param configuration the configuration (possible
options) for the select box <BR>
*/<BR> public CmsCategorySelectWidget(String configuration)
{<BR><BR>
super(configuration);<BR> }<BR><BR>
/**<BR> * @see
org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject ,
org.opencms.widgets.I_CmsWidgetDialog,
org.opencms.widgets.I_CmsWidgetParameter)<BR>
*/<BR> public String getDialogWidget(CmsObject cms,
I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
{<BR><BR> String id =
param.getId();<BR> StringBuffer result
= new StringBuffer(16);<BR><BR>
result.append("<td class=\"xmlTd\" style=\"height: 25px;\"><select
multiple=\"true\" class=\"xmlInput");
<BR> if (param.hasError())
{<BR>
result.append(" xmlInputError");<BR>
}<BR> result.append("\"
name=\"");<BR>
result.append(id);<BR> result.append
("\" id=\"");<BR>
result.append(id);<BR>
result.append("\">");<BR><BR> //
get select box options from default value
String<BR>// List options =
parseSelectOptions(cms, widgetDialog, param); <BR><BR>
DBUtil dbUtil = new DBUtil();<BR>
<BR>
javax.sql.rowset.CachedRowSet rs =
dbUtil.getCachedData("java:/comp/env/jdbc/lt", "SELECT CONCAT( REPEAT('-',
COUNT(<A href="http://parent.name"> parent.name</A>) - 1), <A
href="http://node.name">node.name</A>) AS name,"<BR>
+" node.cat_id AS cat_id"<BR>
+" FROM categories AS node,"<BR>
+" categories AS parent" <BR>
+" WHERE node.lft BETWEEN parent.lft AND
parent.rgt"<BR> +" GROUP BY
node.cat_id"<BR> +" ORDER BY
node.lft");<BR> <BR>
List<CmsSelectWidgetOption> options = new
java.util.ArrayList<CmsSelectWidgetOption>();<BR> <BR>
try {<BR>
while (rs.next()) {<BR>
options.add(new
CmsSelectWidgetOption(rs.getString("name"), false, rs.getString("name")));
<BR>
}<BR> } catch (Exception e)
{<BR>
System.err.println(e.getMessage());<BR>
}<BR>
<BR> <BR>
<BR> String
selected = getSelectedValue(cms,
param);<BR> Iterator i =
options.iterator();<BR> while
(i.hasNext())
{<BR>
CmsSelectWidgetOption option =
(CmsSelectWidgetOption)i.next();<BR>
// create the
option<BR>
result.append("<option value=\"");
<BR>
result.append(option.getValue());<BR>
result.append("\"");<BR>
if ((selected != null) && selected.equals(option.getValue()))
{<BR>
result.append(" selected=\"selected\"");
<BR>
}<BR>
result.append(">");<BR>
result.append(option.getOption());<BR>
result.append("</option>");<BR>
}<BR><BR>
result.append("</select>"); <BR>
result.append("</td>");<BR><BR>
return result.toString();<BR> }<BR><BR>
/**<BR> * @see
org.opencms.widgets.I_CmsWidget#newInstance()<BR>
*/<BR> public I_CmsWidget newInstance() {
<BR><BR> return new
CmsCategorySelectWidget(getConfiguration());<BR>
}<BR>}<BR><BR><BR>
<DIV><SPAN class=gmail_quote>On 10/7/06, <B class=gmail_sendername>Jonathan
Woods</B> <<A href="mailto:jonathan.woods@scintillance.com">
jonathan.woods@scintillance.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Dinshaw
-</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>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 <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://www.colfes.com" target=_blank>www.colfes.com</A>: I index XML
docs in Lucene, and query the Lucene index at page rendering time (with some
caching) to select resources matching multiple categories.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>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!</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2>Jon</FONT></SPAN></DIV><BR>
<DIV lang=en-us dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><SPAN class=q><B>From:</B> <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:opencms-dev-bounces@opencms.org"
target=_blank>opencms-dev-bounces@opencms.org</A> [mailto:<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:opencms-dev-bounces@opencms.org"
target=_blank>opencms-dev-bounces@opencms.org</A>] <B>On Behalf Of </B>dinshaw
gobhai<BR></SPAN><B>Sent:</B> 06 October 2006 17:56<BR><B>To:</B> The OpenCms
mailing list<BR><B>Subject:</B> Re: [opencms-dev] Multiple values to a single
Property?<BR></FONT><BR></DIV>
<DIV><SPAN class=e id=q_10e2140cebaa7fbf_3>
<DIV></DIV>Hi Jon,<BR>Thanks very much. I tried your sugestion and still my
values are overwritten.<BR>My relevent schema lines
are:<BR><BR><xsd:element name="Category" type="OpenCmsString"
/><BR><layout element="Category" widget="CmsCategorySelectWidget" />
<BR><mapping element="Category" mapto="property:category" /><BR><BR>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.<BR>The CmsCategorySelectWidget uses a
MySQL nested set modle category table to return a tree stucture. <BR>Thanks
again,<BR>-Dinshaw <BR><BR><BR>
<DIV><SPAN class=gmail_quote>On 10/6/06, <B class=gmail_sendername>Jonathan
Woods</B> <<A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:jonathan.woods@scintillance.com"
target=_blank>jonathan.woods@scintillance.com</A>> wrote: </SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Dinshaw
-</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>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).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2>Jon</FONT></SPAN></DIV><BR>
<DIV lang=en-us dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><B>From:</B> <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:opencms-dev-bounces@opencms.org"
target=_blank>opencms-dev-bounces@opencms.org</A> [mailto:<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:opencms-dev-bounces@opencms.org" target=_blank>
opencms-dev-bounces@opencms.org</A>] <B>On Behalf Of </B>dinshaw
gobhai<BR><B>Sent:</B> 05 October 2006 18:48<BR><B>To:</B> <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:opencms-dev@opencms.org"
target=_blank>opencms-dev@opencms.org</A><BR><B>Subject:</B> [opencms-dev]
Multiple values to a single Property?<BR></FONT><BR></DIV>
<DIV><SPAN>
<DIV></DIV>Hi there,<BR>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.<BR>If anyone could point me to a reference
that would be great. <BR><BR>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.<BR><BR>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. <BR><BR>Currently only the first instance of the Category select
list is mapped to the category property.<BR><BR><mapping
element="Category" mapto="property:category" /><BR><BR>so what i was
looking for (i think) was something like <BR><mapping element="Category"
mapto="property:category" multiple="true" /><BR><BR>But i have been
unable to find it.<BR><BR>Any help would be greatly
appreciated.<BR>Thanks,<BR>-Dinshaw, NYC
<BR><BR></SPAN></DIV></DIV><BR><BR>_______________________________________________<BR>This
mail is sent to you from the opencms-dev mailing list<BR>To change your list
options, or to unsubscribe from the list, please visit<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://lists.opencms.org/mailman/listinfo/opencms-dev"
target=_blank>http://lists.opencms.org/mailman/listinfo/opencms-dev
</A><BR><BR></BLOCKQUOTE></DIV><BR></SPAN></DIV></DIV><BR><BR>_______________________________________________<BR>This
mail is sent to you from the opencms-dev mailing list<BR>To change your list
options, or to unsubscribe from the list, please visit<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://lists.opencms.org/mailman/listinfo/opencms-dev"
target=_blank>http://lists.opencms.org/mailman/listinfo/opencms-dev</A><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>