Thank you very much for clarification.
@mksd So one of the proect tasks is to modify controllers (such as the one you mentioned )to behave RESTfully?
This is ATT-4 but this ticket is already being worked on, and will be completed soon.
Looking at the pending issues, quite a few of them are rather UI-related.
However in term of REST support there would be two things to do that have not been framed by actual tickets:
- Enable the āgeneric file uploadā feature. See my response on this thread here.
- Enable
AttachmentResource
to return lists of attachments based on a query parameter.
I would rather have you start with the latter for now. Is that something youād be interested to spike at?
@mksd ofcourse I would love to work in that area, I was trying to design the extension of HTML Form Entry to behave RESTfully. So I suppose this task is not a lot different.
@madushan there is an easier task and more complex one (that I just created), look at those two:
@mksd Thanks I will try them and get started.
I would suggest to start with ATT-22 as itās easier.
@mksd I made a PR on ATT-22. I will soon begin work on ATT-24. Thank you very much for the guidance.
@mksd I am working on drafting a proposal, and found out the following rest end points needed to be implemented.
- add attachent (POST)
- update attachment (PUT)
- Search for attachments ( GET)
What could be the other REST endpoints needed ?
- add attachent (POST) - Thatās ATT-4, so this covers the bytes content part of the GET too.
- update attachment (PUT) - Thatās also possibly part of ATT-4. I think the bottom line here was that if the user wanted to bring in a different file, then she would just create a new attachment, this is what this has been overlooked.
- Search for attachments (GET) - Thatās ATT-24.
Is that something that is required by GSoC? Iām asking because all the above is pretty much already framed by JIRA tickets (except the specifics about 2).
Since @zouchine and I were IM-ing about 2 yesterday, Iām pinging him here so that he knows as well.
thanks @mksd for pinging me , Yes as you said, ATT-4 already covers add attachment and get attachment
@madushan FYI something else that should be streamlined while making Attachments RESTful is the definition and use of appropriate privileges.
There is already a ticket covering the topic to a certain extent, see ATT-9.
Hi @mksd and mentors ,
I would like to work on this project in GSOC 2108. I read the all information included in this talk thread. So I am still understanding code base of the attachment module. And I am willing to contribute some issues related this module.
Thanks , Ridmal.
While I tried to debug the attachment module using remote debugging , new attachment upload is going through the non-rest controller. not through the AttachmentResource1_10.upload method.Any idea about the reason ? (I am run the module with openmrs-sdk 2.1.2 )
@mksd Yes GSoC needs a proposal to be submitted relevant to the project. These days I have been working on that too. So I will include the descriptions of the tickets and way to tackle them. Thank you very much for all these valuable information.
@mksd @zouchine I am starting to work on ATT-24. The ticket describes about implementing search of attachments. How should I start the work, should I create a new controller or use an existing one ? It would be great if you could me with some tips.
@mksd I would like to know more details about the packaging of OWA. Are we hoping to use Angular1 or Angular 2 ?
Hi @ridmal, AttachmentsController
is being deprecated as part of ATT-4. The global constant UPLOAD_ATTACHMENT_URL
was updated as part of this commit. To experience going through the REST resource when debugging you would have to run the latest snapshot of Attachments using version 2.0.0-SNAPSHOT when fetching with Maven.
@zouchine that makes me think that the last commit for your work on ATT-4 will need to actually mark this controller as deprecated using @Deprecated
(see here).
If you look on the ticketās description, I pointed to an example from another resource (ProviderResource
), the short answer is that everything will happen in AttachmentResource1_10
with unit tests in AttachmentController1_10Test
.
Btw making Attachments RESTful will also require to document its REST API via Swagger. See here for more about this topic: āDocumenting REST Resourcesā.
Yes, i am using the latest snapshot of attachment module.And I saw that it use rest URL to upload the image but still, debugger go through that previous controller? Thatās why I got confused.