You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Felix Röthenbacher <fe...@wyona.com> on 2005/12/09 11:13:04 UTC

Multi-valued meta data

Hi

I stumbled over an issue that is not clear to me. It seems that
multiple values can be stored per key in the meta data but there
is a getAvailableKey2Value() method that returns a HashMap which
does clearly not contain multiple values per key.

     /**
      * @return All keys and values that exist in the metadata doc.
      * @throws DocumentException
      */
     HashMap getAvailableKey2Value();

Is this a design bug or is there any other explanation for choosing
a HashMap as return type?

Thanks

- Felix

-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Multi-valued meta data

Posted by "J. Wolfgang Kaltz" <ka...@interactivesystems.info>.
Felix Röthenbacher schrieb:
> 
>> (...)
>> I stumbled over an issue that is not clear to me. It seems that
>> multiple values can be stored per key in the meta data but there
>> is a getAvailableKey2Value() method that returns a HashMap which
>> does clearly not contain multiple values per key.
>>
>>     /**
>>      * @return All keys and values that exist in the metadata doc.
>>      * @throws DocumentException
>>      */
>>     HashMap getAvailableKey2Value();
>>
>> Is this a design bug or is there any other explanation for choosing
>> a HashMap as return type?
> 
> 
> Actually, the abstract implementation of the MetaData interface
> uses a HashMap as the storage container for meta data which will
> not allow multiple values per key. Is it a requirement to allow
> multiple meta data values per key at all? It's misleading at the
> moment. As a side note, JCR allows to have "same name" properties.

AFAIK yes, it is a requirement to have multiple values for a meta-data 
key. For example in Dublin Core you have one DC.contributor value for 
each co-author.

Of course, there are several ways to implement this requirement ... I 
agree that the method signature above is not clear.


--
Wolfgang

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Multi-valued meta data

Posted by Thorsten Scherler <th...@apache.org>.
El vie, 09-12-2005 a las 14:15 +0100, Felix Röthenbacher escribió:
> Sorry for the noise, the method mentioned below was actually
> proposed by Thorsten but not implemented in Lenya yet.
> 

jeje, now I know what you are talking about. 

The method was/is for a customer project which does not needed multi
values per key so I have chosen the hashmap. In general Wolfgang is
right and we would need multiple values per key.

Anyway long talk short the main focus of the method was more 
getAvailableKey() then getAvailableKey2Value() (in the end I used a
shortcut) ;-) and I reckon I should commit this method getAvailableKey()
to the impl because there is nothing comparable yet. 

It will give you an array of used metadata keys (elements) in the
document and you will need to request the actual value by looking it up.

wdyt?

salu2

> So everything's up and working.
> 
> - Felix
> 
> 
> Felix Röthenbacher wrote:
> > 
> > 
> > Felix Röthenbacher wrote:
> > 
> >> Hi
> >>
> >> I stumbled over an issue that is not clear to me. It seems that
> >> multiple values can be stored per key in the meta data but there
> >> is a getAvailableKey2Value() method that returns a HashMap which
> >> does clearly not contain multiple values per key.
> >>
> >>     /**
> >>      * @return All keys and values that exist in the metadata doc.
> >>      * @throws DocumentException
> >>      */
> >>     HashMap getAvailableKey2Value();
> >>
> >> Is this a design bug or is there any other explanation for choosing
> >> a HashMap as return type?
> > 
> > 
> > Actually, the abstract implementation of the MetaData interface
> > uses a HashMap as the storage container for meta data which will
> > not allow multiple values per key. Is it a requirement to allow
> > multiple meta data values per key at all? It's misleading at the
> > moment. As a side note, JCR allows to have "same name" properties.
> > 
> > - Felix
> > 
> >>
> >> Thanks
> >>
> >> - Felix
> >>
> > 
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Multi-valued meta data

Posted by Felix Röthenbacher <fe...@wyona.com>.
Sorry for the noise, the method mentioned below was actually
proposed by Thorsten but not implemented in Lenya yet.

So everything's up and working.

- Felix


Felix Röthenbacher wrote:
> 
> 
> Felix Röthenbacher wrote:
> 
>> Hi
>>
>> I stumbled over an issue that is not clear to me. It seems that
>> multiple values can be stored per key in the meta data but there
>> is a getAvailableKey2Value() method that returns a HashMap which
>> does clearly not contain multiple values per key.
>>
>>     /**
>>      * @return All keys and values that exist in the metadata doc.
>>      * @throws DocumentException
>>      */
>>     HashMap getAvailableKey2Value();
>>
>> Is this a design bug or is there any other explanation for choosing
>> a HashMap as return type?
> 
> 
> Actually, the abstract implementation of the MetaData interface
> uses a HashMap as the storage container for meta data which will
> not allow multiple values per key. Is it a requirement to allow
> multiple meta data values per key at all? It's misleading at the
> moment. As a side note, JCR allows to have "same name" properties.
> 
> - Felix
> 
>>
>> Thanks
>>
>> - Felix
>>
> 

-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Multi-valued meta data

Posted by Felix Röthenbacher <fe...@wyona.com>.

Felix Röthenbacher wrote:
> Hi
> 
> I stumbled over an issue that is not clear to me. It seems that
> multiple values can be stored per key in the meta data but there
> is a getAvailableKey2Value() method that returns a HashMap which
> does clearly not contain multiple values per key.
> 
>     /**
>      * @return All keys and values that exist in the metadata doc.
>      * @throws DocumentException
>      */
>     HashMap getAvailableKey2Value();
> 
> Is this a design bug or is there any other explanation for choosing
> a HashMap as return type?

Actually, the abstract implementation of the MetaData interface
uses a HashMap as the storage container for meta data which will
not allow multiple values per key. Is it a requirement to allow
multiple meta data values per key at all? It's misleading at the
moment. As a side note, JCR allows to have "same name" properties.

- Felix

> 
> Thanks
> 
> - Felix
> 

-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org