summaryrefslogtreecommitdiff
path: root/rotord/src/rotord.cpp
diff options
context:
space:
mode:
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;
}