Implement an QueryUpdateService | Ben Bimber | 2015-10-06 09:53 |
Status: Closed | ||
Hi Lewis, i can think of a couple approaches: 1) There is DatasetListener in StudyManager. This is non-public right now, but appears to fire the events you want (i didnt walk all the way through the code), assuming you only care about datasets. Adding this hook to StudyService so external modules could register their own listeners wouldnt be very invasive. This would mean you'd need to make a LK module running on your server. It would register this listener, and do something on change events. This could mean you ping some external process, or some external process periodically pings your module. 2) if you're dealing specifically w/ studies, the modified field on study.datasets might accomplish #1. this appears to get updated whenever there is a insert/update/delete on the rows of that table. for example: https://yourServer.com/query/executeQuery.view?query.queryName=study&schemaName=study&query.containerFilterName=AllFolders will list all studies (note container filter). if you walk the rows (which has a column for container), you can query study.datasets from each container w/ a study. this table has a field for modified, and you would want any dataset modified after your last sync time. any new study or new dataset would inherently be modified after the last sync. if i'm right about modified, then this would work purely from the client API, without any java code or changes. 3) there is a feature in LK to register javascript trigger scripts. This lets you provide JS code that is called on CRUD events for a given table. We use this very heavily in our modules. This being said, I wish is had java hooks, letting modules more easily register new handlers. This wouldnt be hard to introduce, but is more work than #2. |
||