Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example of a curl to this URL

Code Block
xml
xml

<subscriptionHeader id="1">
    <packageHeader id="2" uuid="874f1efb-d73e-4093-9dd9-6e532be3a6fe">
        <dateCreated id="3">2011-08-18 00:30:45</dateCreated>
        <name>Roles</name>
        <description>All available roles</description>
        <openmrsVersion>1.8.2 Build 21762</openmrsVersion>
        <version>5</version>
        <group>7f2d4731-0a98-4118-8fe0-d4b9731986c6</group>
    </packageHeader>
    <contentUri id="4">../7f2d4731-0a98-4118-8fe0-d4b9731986c6/5/download</contentUri>
</subscriptionHeader>

The packageHeader node contains all header information about the package. 

...

The download URL is similar to publish URL, but it ends with: %VERSION/download. This allows us to download any published version of the package, but this feature is not used yet. 

Fetching packages on the fly via the metadata REST webservice

The module provides a REST web service exposing an API. Currently, only one operation is provided i.e to fetch a package from a remote server, both GET or POST are supported.

Packages can be fetched either programmatically or by entering the appropriate url with the expected request parameters in the browser and your will get the download prompt. Packages can be fetched as plain text or as a zip file.

Request Parameters: (* denotes required parameter)

  • key - Required if server has it defined.* *This must be acquired in advance from the admin of the remote server in case it is required
  • type - Required. This is the fully-qualified class name of the type of object you wish to export
  • uuids - This is a comma-separated list of uuids to export (you may specify either uuids, ids, or both)
  • ids - This is a comma-separated list of ids to export (you may specify either uuids, ids, or both)
  • compress - Optional. If set to "true", this will export the file as a metadata zip package. Otherwise as raw xml.
  • modifiedSince - (Date format = dd/mm/yyyy) When specified, items to be returned should have had created or modifications after the specified date

URL Format:

Code Block
xml
xml

[server:url]/ws/module/metadatasharing/getMetadata?&[requestParameters]

Example of the URL

Code Block
xml
xml

http://localhost:8080/openmrs/ws/module/metadatasharing/getMetadata?&type=org.openmrs.Location&ids=1&ids=2&uuids=5b635b8d02812d2e1c97691cd71fc05a&modifiedSince=01/01/2012