[Xsltforms-support] Two questions: about success and failure of PUT, and about cache invalidation
Brought to you by:
alain-couthures
From: C. M. Sperberg-M. <cm...@bl...> - 2013-02-22 01:59:06
|
My apologies if this is a question that's already been asked and clarified; I have not yet found any discussion of it, but I am still looking. I have a form which users employ to make systematic changes to XML documents they are working on. From time to time, I would like them to save their work. So I have a Save button that performs a PUT to the server, and updates nothing (so they can continue to work). Question 1: can I tell somehow whether the PUT was successful or not? I'd like to be able to indicate (maybe with an alert, or just some conditional text int he form) "the document has been saved" or "there was an error, the document was not saved". Question 2: Sometimes my users are feeling paranoid about whether they have successfully saved their work to the server, so they refresh the form, which once again confronts them with a list of documents they can load. They select the document they just saved, and ask to load it. At this point, I would very much like to see a new GET request in the server logs, and the users would like to see the changes they just made, when the document is reloaded. But currently we are both disappointed: the server logs show no trace of a GET request, and the document loaded by the user is the one they just loaded a few minutes earlier -- the changes they just saved are not visible. If I wait long enough -- a day suffices, five minutes does not typically suffice -- I eventually see the new version of the document. I infer from this behavior that either the browser or XSLTForms has a copy of the old form of the document in its cache and is using that form, instead of issuing a fresh GET request. Do any readers of this forum have suggestions on how to tell the browser, or XSLTForms, to ignore any cached copies of the document and do a fresh GET? (Shift-reload works for the form itself, but the document in question here is not a form, but a document instance in the form, which is loaded using a Load Document button which fires the following submission: <xf:submission id="get-document" ref="instance('ui')/document-id" method="get" replace="instance" instance="doc"> <xf:resource value="concat('../sessions/', instance('ui')/document-id)"/> </xf:submission> -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |