Uploaded image for project: 'Webservices REST Module'
  1. Webservices REST Module
  2. RESTWS-758

Add location to session resource, with RESTful endpoints

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • 2.27.0
    • None
    • Low

    Description

      Right now the endpoint to set session location is part of RA: `POST /openmrs/ws/rest/v1/appui/session`. It should be possible to set the session location via a POST to the REST API, for non-RA users.

      So the primary todo here is to add "location" to the session resource, allowing getting and setting this RESTfully on this resource:

      1. Get method:  `session.add("location", ConversionUtil.convertToRepresentation(Context.getUserContext().getLocation(), rep));`
      2. Post method:
        1. Set on usercontext:  `Context.getUserContext.setLocation(...);`
        2. As a short-term fix for compatibility with appui, do what it does directly:  `session.setAttribute("emrContext.sessionLocationId", location.getId());`

      The other component is figuring out what to do with the user of the "emrContext.sessionLocationId" session attribute in appui and the reference application.  Some options:

      1. Change the appui UiSessionContext from using this session attribute to just using the top using the UserContext location 
      2. Do some sanity checking to see if there are any other dependencies on a session attribute named  "emrContext.sessionLocationId" (eg. github search)

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                bistenes Brandon Istenes
                bistenes Brandon Istenes
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: