bolt on support for simple JSON-returning services by EGWeb
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 18 May 2018 18:34:16 +0000 (14:34 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 18 May 2018 21:32:06 +0000 (17:32 -0400)
commitec45e84e04df20e47525b6443b940d51689d2856
treed187cc73709fad2e9bf2ea0ddf77cde6494aec22
parent1ea0bb2b2ab608a4b4b14cd0c335eda33d85ad3e
bolt on support for simple JSON-returning services by EGWeb

This patch adds a way for EGWeb context loaders to specify that
a response should be emitted as JSON rather than rendering an HTML
page using Template::Toolkit.

Specifically, if the context as munged by the context loader contains
a json_response key, the contents of that key will to provide a
JSON reponse. The json_response_cookie key, if present, can be used
to set a cookie as part of the response.

Template Toolkit processing is bypassed entirely when emitting a JSON
response, so the context loader would be entirely reponsible for
localization of strings in the response meant for direct human
consumption.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm