Doug Chestnut wrote:
Jörn Nettingsmeier wrote:
[EMAIL PROTECTED] wrote:
Author: chestnut
Date: Mon Sep 25 00:30:55 2006
New Revision: 449591
URL: http://svn.apache.org/viewvc?view=rev&rev=449591
Log:
allow for multivalue metadata when creating a document (Array param
values returned as comma separated string)
i like multivalue metadata. but does that mean that metadata entries
cannot contain commas any longer? if so, that is certainly going to
bite someone badly at some point.
Sure they can, it is just a way to handle multiple values (which was not
supported before, the first value was stored only).
<select name="dublincore.subject" multiple="multiple">
<option value="Reading,Writing,Arithmetic">General Subjects</option>
<option>Art</option>
<option>History</option>
</select>
+ protected String getDublinCoreParameter(String name) {
+ Object param = getParameter(DUBLIN_CORE_PREFIX + name);
+ if (param != null && getParameter(DUBLIN_CORE_PREFIX +
name).getClass().isArray()) {
+ String[] values = (String[])
getParameter(DUBLIN_CORE_PREFIX + name);
say values[] = { "simplestring", "another, more complicated string" };
+ String paramValue = new String("");
+ for (int i = 0; i < values.length; i++ ) {
+ String value = values[i];
+ if (i > 0)
+ paramValue = paramValue + ',' + value;
+ else
+ paramValue = value;
+ }
+ return paramValue;
now paramValue will be "simplestring,another, more complicated string".
which looks like three tokens. in your example, this does not hurt,
since you are using the concatenated string as-is, without looking
inside. but what if i need to get at the single tokens?
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: [EMAIL PROTECTED], Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]