Re: Resource insert/update

Vadim Gritsenko <[email protected]>
Newsgroups gmane.text.xml.xindice.devel
Message-ID <[email protected]>
On Mar 9, 2008, at 9:08 PM, Natalia Shilenkova wrote:

> On Sat, Mar 8, 2008 at 7:23 PM, Vadim Gritsenko  
> <[email protected]> wrote:
>>
>> On Mar 6, 2008, at 9:31 PM, Natalia Shilenkova wrote:
>>
>>> Recently I had to work on some code that would require to add unique
>>> resources to Xindice database. Currently, collections can only  
>>> "store"
>>> resources, which will add new resource if the key does not exist in
>>> the collection and will overwrite the resource with new data if key
>>> already exists. What I needed instead was a way to "insert" or
>>> "update" resource, where collection would get updated only if  
>>> resource
>>> with that key does not exist in case of insert or does exist in case
>>> of update. Since Xindice does not support transactions or  
>>> constraints,
>>> I ended up creating new service that would allow user to insert/ 
>>> update
>>> resources.
>>>
>>> Are there any objections to adding this functionality to trunk?
>>
>> Makes sense to me. What service do you propose to add? Care to
>> describe the interface?
>
> The interface is very straightforward:
>    void insertResource(Resource res) throws XMLDBException
>    void updateResource(Resource res) throws XMLDBException
>    void storeResource(Resource res) throws XMLDBException

Ok. So storeResource() corresponds to existing  
org.xmldb.api.base.Collection.storeResource() method, while  
insertResource and updateResource will delegate to corresponding  
methods on org.apache.xindice.core.Collection?


> I am not sure about service name, though. Any suggestions?

Only ResourceManagementService comes to mind.

Vadim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.