List Info

Thread: svn commit: r449591 - in /lenya/trunk/src: modules-core/sitemanagement/java/src/org/apache/lenya/cms




svn commit: r449591 - in /lenya/trunk/src: modules-core/sitemanagement/java/src/org /apache/lenya/cms
user name
2006-09-25 08:36:59
chestnutapache.org 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.


-- 
"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: pol-adminuni-due.de, Telefon: 0203/379-2736

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

svn commit: r449591 - in /lenya/trunk/src: modules-core/sitemanagement/java/src/org /apache/lenya/cms
user name
2006-09-25 13:13:21

Jörn Nettingsmeier wrote:
> chestnutapache.org 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>

--Doug

> 
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

svn commit: r449591 - in /lenya/trunk/src: modules-core/sitemanagement/java/src/org /apache/lenya/cms
user name
2006-09-25 13:46:46
Doug Chestnut wrote:
> 
> 
> Jörn Nettingsmeier wrote:
>> chestnutapache.org 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: pol-adminuni-due.de, Telefon: 0203/379-2736

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

svn commit: r449591 - in /lenya/trunk/src: modules-core/sitemanagement/java/src/org /apache/lenya/cms
user name
2006-09-25 15:22:48

Jörn Nettingsmeier wrote:
> Doug Chestnut wrote:
> 
>>
>>
>> Jörn Nettingsmeier wrote:
>>
>>> chestnutapache.org 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?

Short term: Use whatever solution you had when multivalue
selects were 
ignored 

I guess that these metadata values need to be stored in
separate 
elements, and accessed as arrays.  This digs deeper into the
code base 
than I have time for today, but I will look into this asap
unless 
someone else beats me to it ;).

--Doug
> 
> 
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )