You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by johan bos <da...@hotmail.com> on 2005/08/16 19:25:48 UTC

How can we specify own key or ID for inserted document

Hello everyone,

Here my problem
Mail as everyone knows it, have UID specified.
I want instead of creating a document in my collection a generated ID or Key 
want to use the UID of the message
It will simplify processing a lot

Thanks



Re: How can we specify own key or ID for inserted document

Posted by Vadim Gritsenko <va...@reverycodes.com>.
johan bos wrote:
> Here my problem
> Mail as everyone knows it, have UID specified.
> I want instead of creating a document in my collection a generated ID or 
> Key want to use the UID of the message
> It will simplify processing a lot

What's wrong with the org.xmldb.api.base.Collection.createResource() API? It has 
name parameter.

http://xml.apache.org/xindice/api/org/apache/xindice/client/xmldb/XindiceCollection.html#createResource(java.lang.String,%20java.lang.String)

---------- 8< ----------
Parameters:
     name - Name for the new resource. If it is empty or null, a name
            will be assigned when storing the resource in the database.
---------- 8< ----------

Vadim