Hi Vadim,
I've had a chance to look again at the non-inline metadata code.
I've made an update to Collection which should properly update the metadata
when any (non-binary) document is inserted. As for the retrieval of the
retrieval of the information, this comment was added to
org.apache.xindice.core.meta.MetaData:
/*
* Usage of streamToXML seems to be vectored through
* Collection.putObject(), which adds the element returned
* by streamToXML to the document. That makes the most sense
* and should be an explicit part of the XMLSerializable contract.
*
doc.appendChild(root);
*/
When I uncomment the doc.appendChild statement, I can fetch the metadata
without a problem. I'm attaching a small perl program to verify it. Here
are my steps to test it:
1. %ANT_HOME%\bin\ant
2. xindice debug
3. uncomment insert statements in dv-xi.pl
4. perl dv-xi.pl
5. comment out insert statements in dv-xi.pl
6. perl dv-xi.pl
This outputs:
$VAR1 = {
'result' => '<?xml version="1.0"?>
<meta xmlns="http://apache.org/xindice/metadata"><system
type="doc"><!--Create t
ime is Mon Aug 04 17:10:13 PDT 2003--><attr name="created"
value="1060042213333"
/><!--Modified time is Mon Aug 04 17:10:13 PDT 2003--><attr name="modified"
val
ue="1060042213333" /></system></meta>'
};
ALL DONE
let me know if this works for you.
dave
-----Original Message-----
From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 10:29 AM
To: [EMAIL PROTECTED]
Subject: Re: MetaService and Metadata [Was:RE: [PATCH] XTools adds
user.dir to absolute paths]
Viner, David wrote:
>Vadim,
> I haven't reviewed your patch yet, but here's why putDocument is (or
>was) connected to metadata creation. When a new document is inserted, or a
>new collection created, the MetaData object/document is created at insert
>time. This is required for knowing things like "Create Time". So,
>previously, when putDocument was invoked, a new MetaData document was
>dynamically constructed with the right information in it. However, since
>the critical lines have been removed, the document is no longer
constructed.
>Therefore, when you request the metadata for an existing document, the code
>constructs a new MetaData object and stores the document. Does that make
>sense?
>
Makes perfect sense!
> Keep in mind that using a Service, all this may be rendered moot.
>In fact, I believe that there are 2 distinct metadata implementations now
>embedded in the core code. I don't quite understand the
>"InlineMetaService", but it appears that that is the only fully functional
>metadata implementation remaining.
>
I'll try and see what is missing (what critical lines are missing) to
make MetaData working.
Vadim
dv-xi.pl
Description: Binary data
