From: Pierrick B. <pie...@cu...> - 2005-08-30 07:25:09
|
Hi, Piotr Kaminski wrote: > I've been trying to integrate eXist's triggers into my database interfa= ce > layer, and found some issues with the code. I've squashed a number of = minor > bugs, but my fixes to a couple of these issues might require > backwards-incompatible changes, As fas as I am concerned, I don't mind. > The first problem is that "prepare" callbacks into DocumentTrigger only= give > the name of the document rather than its entire path. Yes. That's a more generic problem in eXist IMHO. We should definitely=20 opt for pathes rather than the current collection name + resource name=20 approach. I would be glad to have XMLDBPath.separator,=20 XMLDBPath.canRead(), XMLDBPath.createTempFile(),=20 createTempFile.getCanonicalPath()... well, see java.io.file package :-) > The other problem is that DocumentTrigger's "finish" methods are not ca= lled > when creating and updating documents in the current codebase. The "fin= ish" > would need to be called from Collection's "store" method, which > unfortunately doesn't know whether it's processing a creation or an upd= ate > since it doesn't get passed (or otherwise need) the oldDoc reference. I see. > For > now, I've hacked in a check against the new document's creation and > lastModified timestamps to make a guess, but this method may not be > reliable. Properly fixing this, however, would require changing the > signature of store, or merging validate and store, and the methods are = so > widely used I didn't dare to make the change. Opinions or other option= s? What would give the merge ? > Finally, as part of my refactoring of Collection's validate/store metho= ds to > consolidate reams of duplicated code, I changed the order in which > DocumentTrigger methods are called. What would be the new sequence ? > Sorry, that was a long message; thanks for reading this far and I hope = I get > at least one or two responses. :-) 2 questions actually :-) Cheers, --=20 Pierrick Brihaye, informaticien Service r=E9gional de l'Inventaire DRAC Bretagne mailto:pie...@cu... +33 (0)2 99 29 67 78 |