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.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/rotord/src/rotord.cpp b/rotord/src/rotord.cpp
index e7c68cf..a22c6c3 100644
--- a/rotord/src/rotord.cpp
+++ b/rotord/src/rotord.cpp
@@ -187,6 +187,30 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
}
}
}
+ else if (command[0]=="listcategories") {
+ if (command.size()>1){
+ if (command[1]=="json") {
+ Json::Value root;
+ Json::StyledWriter writer;
+ //root["title"]="Lights Down @Rotor";
+ //root["audio"]="filename";
+
+ Node_factory factory;
+ factory.list_categories(root);
+ string content = writer.write(root);
+ status=HTTPResponse::HTTP_OK;
+ return new RenderContextHandler(content, status);
+ }
+ }
+ else {
+ XML.pushTag("rotor");
+ if (request.getMethod()=="GET") {
+ Node_factory factory;
+ factory.list_categories(XML);
+ status=HTTPResponse::HTTP_OK;
+ }
+ }
+ }
else if (command[0]=="listnode") {
XML.pushTag("rotor");
if (request.getMethod()=="GET") {