We have not had an up-to-date version of RESTWS in the module repo for quite a while, and there have been a lot of important changes. Darius would like to get something into the repo, and I agree, but I don't think the current version is sufficiently complete and correct to just move on. I have four reasons for this: (1) we don't have all the 1.8 data model in REST; (2) we have some known anomalies to fix; (3) we haven't had much experience with the subclass model; and (4) there will be a competition for resources due to the need for a version that supports the 1.9 data model.
If I understand Darius correctly, he never thought version 1.0 would be a complete exposure of the data model, but only a sufficient proof of concept to assure that the interface would not change drastically. But I believe everyone who has tried to use RESTWS has found a data object they needed which was not exposed. If a needed object is not exposed, then the user can't really put RESTWS to the test. I don't really care what the 1.8-compatible and the 1.9-compatible releases are called, I just want a clear path to a fully capable 1.8-compatible version. I don't want issues (1)-(3) to be lost as we pursue 1.9.
It is not clear how we are going to revise RESTWS as the data model changes. If I understand Darius correctly, the "v1.0" portion of the URL will indicate that the module supports 1.8, and will be changed to another value (most likely "v2.0") when the module supports 1.9. There will probably not be much backporting (maybe additional queries or custom reps or a resource-specific catalog call) because most of the changes will depend on the data model (in the case of 1.8-1.9, location attributes, providers, provider attributes, visits, multiple providers per encounter, concept mapping, complex concepts). It seems to make sense to make a new 2.0 head and keep a 1.0 branch, but I don't think we've ever worked on both a branch and the head at the same time. So I think it would be better to get 1.0 to a more complete, correct state before we start work on 2.0.
Maybe the sprint schedule needs to be revised to have an RESTWS 1.1 (or whatever) sprint sooner, and tickets that address 1.9 issues should be given a new future release fix 2.0 (or whatever). Maybe we can have simultaneous 1.1 and 2.0 sprints.
Click here to unsubscribe from OpenMRS Developers' mailing list
-Spencer
On further review, it seems to me that while there are certain types of changes to the data model that can be made without breaking RESTWS, others cannot. For example, adding a new nullable field to a table requires a change to the creatable and updatable field lists and to the could-be-missing field list within the resource (as well as corresponding changes in the .hbm and pojo), but existing calls to the resource will still work correctly, so it doesn't break anything. But adding providers and using them as a mapped collection in encounters instead of a user reference does break things, you can no longer create an encounter with a user.
I am beginning to think that we should roll RESTWS into core so that it moves with its version-appropriate data model. So 1.9.1 should include a RESTWS appropriate to its data model. That would leave the "v1.0" portion of the URL to handle changes in the semantics of the calls, should that ever happen. And 1.8 would be the only version to use the RESTWS module (or we could roll it into 1.8.4 or whatever is next).
Unable to refresh the WebApplicationContext Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in URL [jar:file:/C:/Users/Spencer/AppData/Local/Temp/1337224327577.openmrs-lib-cache/webservices.rest/webservices.rest.jar!/webModuleApplicationContext.xml]: Initialization of bean failed; nested exception is java.lang.ArrayStoreException org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) ** org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:780) ** org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:793) ** org.openmrs.module.web.WebModuleUtil.startModule(WebModuleUtil.java:317) ** org.openmrs.module.web.controller.ModuleListController.onSubmit(ModuleListController.java:222) org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:272) org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:268) org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) javax.servlet.http.HttpServlet.service(HttpServlet.java:820) org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) ** org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) ** org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76) ** org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) ** org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) ** org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) ** org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) ** org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) org.mortbay.jetty.Server.handle(Server.java:324) org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843) org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648) org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
-Spencer
I think both Darius and Saptarshi have highlighted the fact that there are two different aspects to the issue. One is from the developer side, having to do with version control and packaging. The other is from the client side, having to do with making the appropriate calls to each instance of OpenMRS it is accessing.
From the packaging side, I think the most straightforward thing is to branch, so that it is always possible to package a version of the module with a version of core and have them work together. I think this fits a use case where the client accesses only a single instance of OpenMRS, such as JSS or Andy's need to connect the child health program with OpenMRS.
For a use case such as Darius' metadata sharing or a central registry manager for the Rwanda enterprise architecture, we need the module to be totipotent, i.e., it needs to work with the version of OpenMRS being run on the particular instance it is trying to communicate with at any moment. This goes with Saptarshi's idea of the version number changing whenever there is a change that breaks what was there before. It also seems to be why Darius has the series of module extensions. I still don't like the idea, because of the complicated packaging; but it does imply that the version of RESTWS that matches the 1.9 data model should consist of the 1.8 version as v1.0, plus v2.0 of the resources that have been superseded, such as encounter. I think this use case could be helped by a resource version discovery mechanism, such as ws/catalog/<resource> returning version number and field names for the host. I think we might also need to look at the routines in the abstract classes that find the appropriate resource to make sure that it finds the version-appropriate one.
But I still don't want to lose track of the need to have full coverage for the data model in a 1.8 version.
But I still don't want to lose track of the need to have full coverage for the data model in a 1.8 version.
-- OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org
Unsubscribe: dev+uns...@openmrs.org