New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RESTWS-688: Enable installation of modules through rest calls #315
Conversation
@malmike have you looked at the above travis failure? |
Did you see mksd's response on talk? |
Yes, I have been going through the solutions. Am having difficulty installing powermock into the project, and based on our discussion it might not be good to mix it with context sensitive tests. |
Have you reported that on talk? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
catch (MalformedURLException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
throw new IllegalRequestException(e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 |
Looks Fine |
|
||
@Resource(name = RestConstants.VERSION_1 + "/moduleinstall", supportedClass = ModuleInstall.class, supportedOpenmrsVersions = { | ||
"1.10.*", "1.11.*", "1.12.*", "1.8.*", "1.9.*", "2.0.*", "2.1.*" }) | ||
public class ModuleInstallResource1_8 extends BaseDelegatingResource<ModuleInstall> implements Creatable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating a new resource, why don't you just use this existing resource by adding an install action? https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ModuleActionResource1_8.java
More details can be found here https://issues.openmrs.org/browse/RESTWS-627
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to use the existing resource but it did not pass the delegate of the install URL and was passing an array for the modules. I can modify the delegates but wouldn't that affect the existing functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not seem to understand. Can you explain more and give details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basing on the delegates passed at this line, modules takes an array and I would have to add a delegate for install URI like what I did here. It would also mean that I would have to modify the module action class. Am not sure how the changes would affect the existing functionality and I found it easier to create a new resource. But I will create a new branch that adds the update functionality to the ModuleActionResource1_8 and see how it pans out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes of course you need to modify the switch statement in ModuleActionResource1_8 by including a case for installation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, will be working on the changes
Closing because of #316 |
JIRA TICKET NAME:
RESTWS-688: Enable installation of modules through rest calls
SUMMARY:
Currently a module could not be installed through a REST call. When a REST call is made the module is to be downloaded on to the server, loaded and started.