Details

    • Complexity:
      Medium
    • Sprint:
      2016-11-29 Platform 2.1.0

      Description

      This will allow clients to post complex observations and the data via REST, this depends on first completing TRUNK-4964. The handlers in core i.e ImageHandler, MediaHandler and BinaryDataHandler assume that clients will send the complex obs data as uuencoded text, module custom handlers will need to be updated to be able to support this, they don't have to use uuencoding, i.e they can use other mechanisms e.g URI as references to where the Obs Data is stored as one of the alternatives especially where large objects have to be submitted. The TextHandler in core will still accept plain text instead of uuencoded strings.

      Dev Notes

      • Update ObsResource1_8.setValue to delegate to Obs handler to set the complex data by calling the new method added in TRUNK-4964
      • Update ObsResource1_8.setValue(Obs obs, Object value) to return the serializable value with the URI to be used by clients to fetch the raw complex value, see snippet below
        if (obs.getValueComplex() != null) {
               SimpleObject so = new SimpleObject();
               so.put("display": "some human readable value");// Obs.getValueAsString(Locale) might work
               SimpleObject links = new SimpleObject();
               links.put("rel", "self");
               //Can be got by calling ObsService.getComplexObs(Obs, ComplesObsHandler.URI_VIEW)
               links.put("uri", "uri-to-fetch-raw-complex-value");
               so.put("links", links);
               return so;
        }
        

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                raff Rafal Korytkowski
                Reporter:
                maximosipov Maxim Osipov
              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: