From 0c9b45d210a5d94b3ba219e32b73233a5a795f61 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 27 Oct 2014 23:16:15 +0100 Subject: Download note as XML and JSON --- lib/response/xmlresponse.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lib/response/xmlresponse.php (limited to 'lib/response/xmlresponse.php') diff --git a/lib/response/xmlresponse.php b/lib/response/xmlresponse.php new file mode 100644 index 0000000..050bbff --- /dev/null +++ b/lib/response/xmlresponse.php @@ -0,0 +1,43 @@ + + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @link http://cweiske.de/grauphel.htm + */ +namespace OCA\Grauphel\Response; + +/** + * Returns XML data + * + * @category Tools + * @package Grauphel + * @author Christian Weiske + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @version Release: @package_version@ + * @link http://cweiske.de/grauphel.htm + */ +class XmlResponse extends \OCP\AppFramework\Http\Response +{ + protected $xml; + + public function __construct($xml) + { + $this->setStatus(\OCP\AppFramework\Http::STATUS_OK); + $this->addHeader('Content-Type', 'text/xml; charset=utf-8'); + $this->xml = $xml; + } + + public function render() + { + return $this->xml; + } +} +?> -- cgit v1.2.3