First, let me say... you rock.  Thanks for getting this done!

Second, the streamToXML(Document doc) should invoke streamToXML(doc, true).
That was simply an oversight on my part.
The streamFromXML(Element source) I am not so sure about.  If we invoke
streamFromXML(source, true), then any "created" or "modified" times listed
in the xml will be used by the MetaData object; that is the MetaData will be
updated to contain the created and modified times listed in the incoming
xml.  I'm not sure that this is the desired or intended behavior.  It seems
to me that the "modified" time (and "create" time) should be controlled by
the internals of xindice by default, and by default the user should not be
able to alter them by submitting new xml.  If, however, the user truly wants
to change the modified time externally, he or she is empowered by calling
the streamFromXML with true as the second argument.

Does that make sense?  I'm not sure that I'm correct; this is just my gut
instinct.

dave

-----Original Message-----
From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 6:51 AM
To: [EMAIL PROTECTED]
Subject: Re: MetaService and Metadata


Viner, David wrote:

>yes, and i should do this.  however, i first want to understand why the
line
>of code (doc.appendChild(root);) was commented out.
>

David,

I got that part. See comments I'd added in the XMLSerializable interface:
    /**
     * streamToXML streams a Java object to the DOM node.
     *
     * Passed owner document is used to create nodes and should not
     * be modified.
     *
     * @param doc The Owner Document
     * @return A newly created Element
     * @throws DOMException If an error occurs
     */
    Element streamToXML(Document doc) throws DOMException;


Basically, caller of the streamToXML method should add output to 
wherever is needed.


>  i don't want to
>uncomment that line and have other functionality broken.  
>
>can someone explain what the comment means?
>         * 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.
>

Actually this was already de-facto contract. I just documented it.


>once we get the code right, then i'll write the unit test.  (btw - is there
>a good example unit test in our cvs? i'm not very proficient with junit.)
>

I'm preparing integration unit test and commit it soon... Ok, it is 
already in. There is one question though. It does not work till I make 
the following simple change:
Index: java/src/org/apache/xindice/core/meta/MetaData.java
===================================================================
RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/meta/MetaData.java,v
retrieving revision 1.7
diff -u -r1.7 MetaData.java
--- java/src/org/apache/xindice/core/meta/MetaData.java 8 Aug 2003 
13:29:24 -0000       1.7
+++ java/src/org/apache/xindice/core/meta/MetaData.java 8 Aug 2003 
13:49:41 -0000
@@ -423,7 +423,7 @@
      */
     public final Element streamToXML(Document doc) throws DOMException {

-        return streamToXML(doc, false);
+        return streamToXML(doc, true);
     }

     /**
@@ -539,7 +539,7 @@
      */
     public final void streamFromXML(Element source)
             throws DOMException {
-        streamFromXML(source, false);
+        streamFromXML(source, true);
     }

     /**


Can you explain why this parameter is false? This way, creation time and 
modification time are never stored in the collection storage. What did I 
miss here? I don't want to make this change till I hear from you.

Vadim


Reply via email to