Using the .setLastModified() method TXMLObject

Hi,

I’m using the .setLastModified() method on TXMLObject. I use the (new Timestamp(System.currentTimeMillis())).toString() as parameter.

I execute a .update() method, no problems updating the document. Then I read the same document out of Tamino but when I use the .getLastModified() method this one returns me always an empty string.

Anybody using this .setLastModified() method?

A few things:-

1) as far as I can see the setLastModified() is ignored by the time the document is stored in Tamino. Somewhere along the line (and I believe its not in the API) the the last modified date is updated with the date/time of the update. I suspect this happens within Tamino itself. For example if you store/update a document from Tamino Interactive Interface and GET the document and look at the HTTP headers you will that the Last-Modified header is that of when the store/update took place. (I tried this with telnet to the web server to insert a document with specific Last-Modified field and it is ignored).

2) The getLastModified() method will return blank in cases where you are querying for the document because the Tamino response document can contain 0,1 or more documents, and the Last-Modified HTTP header cannot reflect the modified date/time.

3) To get the last modified date/time you must retreive the single document from Tamino, e.g.

TXMLObject obj = TXMLObject.newInstance(TDOMObjectModel.getInstance()) ;
obj.setId(“1”); // ino:id
obj.setDoctype(“Greeting”); // xml doctype
obj = myAccessor.retrieve(obj);

4) The format specification of the date parameter should conform to RFC2068. IMO though I think the set/getLastModified() method should accept java.util.Date and the API should use the correct date/time syntax.

Maybe someone who knows the internals of Tamino can comment further about the handling of the Last-Modified header.

[This message was edited by Stuart Fyffe-Collins on 10 Jul 2002 at 16:00.]

[This message was edited by Stuart Fyffe-Collins on 10 Jul 2002 at 16:00.]

[This message was edited by Stuart Fyffe-Collins on 10 Jul 2002 at 16:38.]

Just to confirm what Stuart wrote.
1. setLastModified() does not make sense for clients. It is used internally to set this property when retrieving documents from Tamino. We should document this behaviour.
2. Yep!
3. Yep!
4. The format of the date/time from getLastModified() is exactly what we find in the HTTP header (Last-Modified). So, the format depends on the server. As far as I know it should confirm to RFC 1123. But different formats are possible.