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

When the client specifies an Accept-Type of xml we should produce better XML

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1
    • Labels:
    • Complexity:
      Medium
    • Sprint:
      RESTWS Sprint - Feb 2013

      Description

      [Note by Darius]
      We're not officially supporting XML yet, so we're getting some default Spring + XStream functionality.
      Particularly, XStream's handler for Map doesn't recognize that our SimpleObject extends LinkedHashMap. It's possible that just addressing this would make the output "good enough".
      [/Note by Darius]

      The serialization of SimpleObject produces a lot of useless information: the parameters of the list and of the hash map, etc. It also produces name/value pairs on successive lines that require counting. It would be nice to have something more like this:

      <SimpleObject type="obs">
        <string name="uuid">c0b2532f-1691-11df-97a5-7038c432aabf</string>
        <string name="display">ANTIRETROVIRAL USE = true</string>
        <SimpleObject type="person" name="person">
          <string name="uuid">dd7f9e40-1691-11df-97a5-7038c432aabf</string>
          <string name="display">Date Mely Kibiwot</string>
          <Hyperlink name="links" anchor="self"> http://localhost:8080/openmrs/ws/rest/v1/person/dd7f9e40-1691-11df-97a5-7038c432aabf
          </Hyperlink>
        </SimpleObject>
        <SimpleObject type="concept" name="concept">
          <string name="uuid">be4cb396-1691-11df-97a5-7038c432aabf</string>
          <string name="display">ANTIRETROVIRAL USE</string>
          <Hyperlink name="links" anchor="self"> http://localhost:8080/openmrs/ws/rest/v1/concept/be4cb396-1691-11df-97a5-7038c432aabf
          </Hyperlink>
        </SimpleObject>
        <string name="value" type="Boolean">true</string>
        <string name="obsDateTime" type="Timestamp">2006-02-06T00:00:00.000-0500</string>
        <string name="accessionNumber" />
        <string name="obsGroup" />
        <List name="groupMembers" />
        <SimpleObject type="location" name="location">
          <string name="uuid">8d6c993e-c2cc-11de-8d13-0010c6dffd0f</string>
          <string name="display">Unknown location</string>
          <Hyperlink name="links" anchor="self"> http://localhost:8080/openmrs/ws/rest/v1/location/8d6c993e-c2cc-11de-8d13-0010c6dffd0f
          </Hyperlink>
        </SimpleObject>
        <SimpleObject type="order" />
        <SimpleObject type="encounter" name="encounter">
          <string name="uuid">bf219b7c-1691-11df-97a5-7038c432aabf</string>
          <string name="display">ADULTRETURN 06/02/2006</string>
          <Hyperlink name="links" anchor="self"> http://localhost:8080/openmrs/ws/rest/v1/encounter/bf219b7c-1691-11df-97a5-7038c432aabf
          </Hyperlink>
        </SimpleObject>
        <string name="voided" type="Boolean">false</string>
        <Hyperlink name="links" anchor="self">
      http://localhost:8080/openmrs/ws/rest/v1/obs/c0b2532f-1691-11df-97a5-7038c432aabf
        </Hyperlink>
        <Hyperlink name="links" anchor="full">
      http://localhost:8080/openmrs/ws/rest/v1/obs/c0b2532f-1691-11df-97a5-7038c432aabf?v=full
        </Hyperlink>
      </SimpleObject>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lluismf Lluis Martinez
              Reporter:
              r.friedman Roger Friedman
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day Original Estimate - 1 day
                  1d
                  Remaining:
                  Time Spent - 7 hours, 5 minutes Remaining Estimate - 2 hours, 55 minutes
                  2h 55m
                  Logged:
                  Time Spent - 7 hours, 5 minutes Remaining Estimate - 2 hours, 55 minutes
                  7h 5m