summaryrefslogtreecommitdiff
path: root/rotord/src/rotord.cpp
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-11-02 16:13:41 +0000
committerComment <tim@gray.(none)>2013-11-02 16:13:41 +0000
commit510a5218d5e981db3dde9ed31ddc6f732ed6a22a (patch)
treeb9d09c4dbdefed1ec693e0492841cde426ef6643 /rotord/src/rotord.cpp
parent8864f5da9649c176e472a7fb8913dd8114deec54 (diff)
parenteaccb1437465c6aa49e1d5511876852543e3b0fa (diff)
merge branch
Diffstat (limited to 'rotord/src/rotord.cpp')
-rw-r--r--rotord/src/rotord.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/rotord/src/rotord.cpp b/rotord/src/rotord.cpp
index de853e4..c4c562e 100644
--- a/rotord/src/rotord.cpp
+++ b/rotord/src/rotord.cpp
@@ -212,8 +212,20 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
}
}
else if (command[0]=="listnode") {
- XML.pushTag("rotor");
if (request.getMethod()=="GET") {
+ if (command.size()>1){
+ if (command[1]=="json") {
+ Json::Value root;
+ Json::StyledWriter writer;
+
+ Node_factory factory;
+ factory.list_node(body,root);
+ string content = writer.write(root);
+ status=HTTPResponse::HTTP_OK;
+ return new RenderContextHandler(content, status);
+ }
+ }
+ XML.pushTag("rotor");
Node_factory factory;
if (factory.list_node(body,XML)) status=HTTPResponse::HTTP_OK;
}