smart-classic / smart_server

SMArt Bootstrap Server
Apache License 2.0
22 stars 10 forks source link

Eliminate implicit magic URL interpolation when loading smart_manifest.json #10

Closed jmandel closed 12 years ago

jmandel commented 12 years ago

We need a better way to host manifests on sample-apps.smartplatforms.org. Currently the manifests have:

"base_url" : "http://localhost:8001",

which is super-confusing for anyone building a container who wants to load these directly, e.g. from:

http://sample-apps.smartplatforms.org/framework/got_statins/smart_manifest.json

(The OpenMRS team has pointed out how confusing this is.)

jmandel commented 12 years ago
  1. Updated smart_sample_apps to remove {base_url} references from the manifest files https://github.com/chb/smart_sample_apps/commit/09b7e8f5541b46f2e48d3919278e2017d574fffd
  2. Updated smart_server's bootstrap process to handle these new manifests appropriately. We now define an explicit map when loading an app's manifest, so that by default we load a manifest as-is. But if needed, we can override URLs explicitly in smart_server/bootstrap_helpers/application_list.json.default like so:

    {
    "manifest":"http://localhost:8001/framework/med_adherence/smart_manifest.json",
    "override_index": "http://localhost:8001/framework/med_adherence/index.html",
    "override_icon": "http://localhost:8001/framework/med_adherence/icon.png",
    "enabled_by_default": false 
    }, ...
    

https://github.com/chb/smart_server/commit/4d3e56dc152618db43baf242283ed7044367a07d

The current behavior is that, when generating settings files, smart_manager.py will copy this application_list.json.default to application_list.json and substitute in the smart_ui_server's base URI in the process.