summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authordeva <deva>2008-05-20 15:01:12 +0000
committerdeva <deva>2008-05-20 15:01:12 +0000
commit44099653bfc6f3124c7c776a81c01ec973995c49 (patch)
tree5f6fb059a16a0880f0e8b080d9ebd9298046932b /server/src
parent556f00e4af55e78836c45f47b0662ab44bbb8b48 (diff)
Added some code for the new output format.
Diffstat (limited to 'server/src')
-rw-r--r--server/src/server.cc14
-rw-r--r--server/src/widgetgenerator.cc2
2 files changed, 15 insertions, 1 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 2f89c73..a82b716 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -131,17 +131,31 @@ static void connection(TCPSocket &socket)
// Map the results
LUAQueryMapper lqm(qp.result);
+ socket.write(" <course name=\"");
+ socket.write(templ->course.attributes["name"]);
+ socket.write("\">\n");
+
// Generate the macro and return it to the client
std::vector< Macro >::iterator mi2 = templ->course.macroes.begin();
while(mi2 != templ->course.macroes.end()) {
Macro &macro = (*mi2);
printf("Macro: %s ?= %s\n", macro.attributes["name"].c_str(), request.macro.c_str());
+
+ socket.write(" <macro name=\"");
+ socket.write(macro.attributes["name"]);
+ socket.write("\">\n");
+
if(macro.attributes["name"] == request.macro) {
widgetgenerator(socket, macro, lqm);
}
+
+ socket.write(" </macro>\n");
+
mi2++;
}
+ socket.write(" </course>\n");
+
i++;
}
diff --git a/server/src/widgetgenerator.cc b/server/src/widgetgenerator.cc
index ced804a..2dcfa35 100644
--- a/server/src/widgetgenerator.cc
+++ b/server/src/widgetgenerator.cc
@@ -73,5 +73,5 @@ static void send_macro_widget(Macro &macro, Widget &widget, TCPSocket &socket, s
void widgetgenerator(TCPSocket &socket, Macro &macro, LUAQueryMapper &mapper)
{
- send_macro_widget(macro, macro.window, socket, " ", mapper);
+ send_macro_widget(macro, macro.window, socket, " ", mapper);
}