As part of my DITA link management system, I need to create and update various indexes and data structures whenever specific documents are added or updated.
I was looking for some sort of trigger or event handler by which I would register an XQuery function and the system would call it on add, update, or delete, but I didn't see anything like that in the docs.
Since my updates are, in my case, being driven by git commit hooks I could have the commit hook call a function following updates and pass that function the list of added, updated, and deleted docs. But that would not support the case where documents were loaded by some other route.
Is such a mechanism available?
Thanks,
Eliot
————— Eliot Kimber, Owner Contrext, LLC http://contrext.com
Is such a mechanism available?
Such a mechanism is indeed planned to be added in a future versoin. It might take a while, though, to make this happen, as we first want to sort out what are the most important use cases (e.g.: do we want synchronous or asynchronous triggers?). You are invited in following the discussion at GitHub:
I will track the conversation.
In thinking about my requirements more I realized that it probably makes sense to build my indexes and cached data structures on demand. At the time a query is made I can determine if the index or cache I need A) already exists and B) is older than the timestamp(s) of the documents involved. If each cache records the paths of the documents that contribute to it then checking that the cache is not older than any contributing docs and that no contributing doc has been deleted should be fast enough. If I have a general "updateCaches()" function, I can simply call that function after any load or update operation from my git hooks. For my current use case that will be as good as having some sort of trigger feature.
Cheers,
E. ————— Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 4/16/15, 12:03 AM, "Christian Grün" christian.gruen@gmail.com wrote:
Is such a mechanism available?
Such a mechanism is indeed planned to be added in a future versoin. It might take a while, though, to make this happen, as we first want to sort out what are the most important use cases (e.g.: do we want synchronous or asynchronous triggers?). You are invited in following the discussion at GitHub:
basex-talk@mailman.uni-konstanz.de