withjam / ml-lodlive

Significant rewrite of the LodLive tool for RDF visualization and SPARQL generation
Apache License 2.0
17 stars 10 forks source link

Fixed #10: allowed accept header override for MarkLogic #17

Closed grtjn closed 9 years ago

grtjn commented 9 years ago

10

Making it work for MarkLogic was no particular rocket-science. I started with disabling jsonp, which was just a flag in the profile. Next I had to add accepts to all ajax calls. You include accepts as follows in your profile:

        MarkLogicProfile.connection = {
          // http matches all http requests, so this will be the only connection settings used
          'http:': {
            endpoint: '/v1/graphs/sparql',
            accepts: {
              json: 'application/sparql-results+json'
            },
            description: {
              en: 'MarkLogic LodLive'
            }
          }
        };

See also: https://github.com/grtjn/ml-lodlive-ng/blob/master/src/ml-lodlive-profile-factory.js#L108

withjam commented 9 years ago

Nice solution! I was tweaking the ajax object via angular which was no good. This looks much better.