Implement an QueryUpdateService | lewis j mcgibbney | 2015-10-02 11:51 | |||||||||||||||||||||||||||||||||
Status: Closed | |||||||||||||||||||||||||||||||||||
Hi Folks, Having spoken with Adam a few times on this scenario now I thought I would log an issue and begin working on a QueryUpdateService API for the remoteapi Java API. Lets take the following scenario as a driver for understanding what this API should provide. Say we want to learn of both 1) new Studies added to LabKey by our users, and 2) updates to existing Studies e.g. field updates or something similar. Basically a a typical CRUD update which is implemented through QueryService. Right now (with the current remoteapi) we have two options; 1) from time-to-time query everything (all containers containing data) and check for what has been updated. This most likely involves maintaining a signature of what the state was when we last queried. We can then create a new signature and do a diff on the two. A difference is signatures indicates that something has been updated. We then pull the new data and do something with it. This is not ideal as we need to query LabKey frequently!, or 2) develop a listener which binds to some existing LabKey service. This is our integration point and justification behind the implementation of an QueryUpdateService. Updates should be sucked out automatically hence removing the requirement to constantly query the services. Finally, I have looked into the QueryChangeListener which kinda sounds like the same. It exposes the following API void queryChanged(User user, Container container, ContainerFilter scope, SchemaKey schema, QueryChangeListener.QueryProperty property, java.util.Collection<QueryChangeListener.QueryPropertyChange> changes) This method is called when a set of tables or queries are changed in the given container and schema. void queryCreated(User user, Container container, ContainerFilter scope, SchemaKey schema, java.util.Collection<java.lang.String> queries) This method is called when a set of tables or queries are created in the given container and schema. void queryDeleted(User user, Container container, ContainerFilter scope, SchemaKey schema, java.util.Collection<java.lang.String> queries) This method is called when a set of tables or queries are deleted from the given container and schema. java.util.Collection<java.lang.String> queryDependents(User user, Container container, ContainerFilter scope, SchemaKey schema, java.util.Collection<java.lang.String> queries) Get a textual representation of items that depdend on a table or query. The above API does not satisfy the requirement for one to receive updates as and when they come in to LabKey! I am very keen to discuss this here. |
|||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||