Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.
Carlos Rueda edited this page Feb 23, 2017 · 17 revisions

MMI ORR v2 to v3 migration

For any bookmarks out there, https?://mmisw.org/orr/ should redirect to new dispatch at https?://mmisw.org/ont/ once v3 is installed at /ont/.

For this, a new index.html will be deployed at the /orr/ path to take care of the redirection according to the routes supported in v2 and corresponding appropriate handling in v3.

Tests to verify the expected redirection behavior:

From To
http://mmisw.org/orr/sparql http://mmisw.org/ont/sparql
http://mmisw.org/orr/#b http://mmisw.org/ont/
http://mmisw.org/orr/#so/device http://mmisw.org/ont/#/so/device
http://mmisw.org/orr/#st/chlorophyl http://mmisw.org/ont/#/st/chlorophyl
http://mmisw.org/orr/#http://mmisw.org/ont/mmi/platform http://mmisw.org/ont/?uri=http://mmisw.org/ont/mmi/platform
http://mmisw.org/orr/#https://www.w3.org/ns/ssn http://mmisw.org/ont/?uri=https://www.w3.org/ns/ssn

orr/index.html:

<!DOCTYPE html>
<html>
<head>
  <script>
    var hash = (window.location.hash || '').trim();
    console.debug("hash=[" +hash+ "]");
    var targetBase = '/ont_tmp3/';
    var location;

    if (!hash || hash === '#'
      || hash === '#admin'
      || hash === '#b'
      || hash === '#bu'
      || hash === '#ba'
      || hash === '#ua'
      || hash === '#login'
      || hash === '#logout'
      || hash === '#voc2rdf'
      || hash === '#vine'
    ) {
      location = targetBase;
    }
    else if (hash.startsWith('#so')) {
      location = targetBase + '#/so' + hash.substring(3);
    }
    else if (hash.startsWith('#st')) {
      location = targetBase + '#/st' + hash.substring(3);
    }
    else if (hash === '#rx') {
      location = targetBase + '#/rx';
    }
    else if (hash === '#__test') {
      // do not redirect.
    }
    else if (hash.startsWith('#')) {
      location = targetBase + '?uri=' + hash.substring(1);
    }
    else {
      location = targetBase + '?uri=' + hash;
    }
    window.location = location;
  </script>
</head>
<body>
</body>
</html>
Clone this wiki locally