You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Vadim Gritsenko <va...@verizon.net> on 2003/07/30 05:46:42 UTC

MetaService and Metadata [Was:RE: [PATCH] XTools adds user.dir to absolute paths]

Viner, David wrote:

>For the API, I'm not sure what the best way to access it is.  I made an
>XMLRPC api for it, which is how i access it.  I can send those classes if
>you're interested.  If you want to go for the Service approach, I'd be all
>for seeing a prototype.  To be honest, I'm not sure which is more "correct".
>

Ideally, it should be in XML:DB API. Less then ideal case is the 
extenstion of the API - that's service. Least ideal way is proprietary 
API. At least that's my opinion.

WRT to prototype - attached (patch includes some other changes as well). 
Tested with embed driver, xmlrpc is not tested. Comments are welcome!


>As for the last mod time and the code you point out, the meta object is
>constructed if it needs to be, and has its values set if they are missing.
>Does that make sense?  In other words, if the meta object is already there
>and properly initialized, the created and modified variables are unused.
>

Does not work for me... All the time returns "now" even when I patched 
MetaData to include time into serialization / deserialization. You can 
try it too with attached MyMain program. Output after two runs:

Collection DOES NOT Exist!
Resource DOES NOT Exist!
...
Resource /db/test/MyTest created time: 1059535843558 (Tue Jul 29 
23:30:43 EDT 2003)
Resource /db/test/MyTest modified time: 1059535843558 (Tue Jul 29 
23:30:43 EDT 2003)
Update Resource!
Resource: <?xml version="1.0"?>
<root><data modified="1059535848565" /></root>
Collection /db/test created time: 0 (Wed Dec 31 19:00:00 EST 1969)
Collection /db/test modified time: 1059535848575 (Tue Jul 29 23:30:48 
EDT 2003)
Resource /db/test/MyTest created time: 1059535848605 (Tue Jul 29 
23:30:48 EDT 2003)
Resource /db/test/MyTest modified time: 1059535848605 (Tue Jul 29 
23:30:48 EDT 2003)


Collection ALREADY Exists!
Resource ALREADY Exists!
Resource: <?xml version="1.0"?>
<root><data modified="1059535848565" /></root>
Resource /db/test/MyTest created time: 1059535870787 (Tue Jul 29 
23:31:10 EDT 2003)
Resource /db/test/MyTest modified time: 1059535870787 (Tue Jul 29 
23:31:10 EDT 2003)
Update Resource!
Resource: <?xml version="1.0"?>
<root><data modified="1059535875795" /></root>
Collection /db/test created time: 0 (Wed Dec 31 19:00:00 EST 1969)
Collection /db/test modified time: 1059535875815 (Tue Jul 29 23:31:15 
EDT 2003)
Resource /db/test/MyTest created time: 1059535875825 (Tue Jul 29 
23:31:15 EDT 2003)
Resource /db/test/MyTest modified time: 1059535875825 (Tue Jul 29 
23:31:15 EDT 2003)


What do I miss?


>However, it appears that the codebase no longer supports the metadata
>implementation that I submitted.  See the commit comments
>http://cvs.apache.org/viewcvs.cgi/xml-xindice/java/src/org/apache/xindice/co
>re/Collection.java?rev=1.14&content-type=text/vnd.viewcvs-markup .  The
>comments for putDocument now read 
>
> /**
>    * This is the lowest-level method for storing a record into the backing
>store.
>    * It does not update non-inline metadata.
>    */
>   private void putDocument
>

But this putDocument is not related to MetaData? MetaData is stored just 
like any other regular XML document - AFAIU.

Vadim