summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
authordeva <deva>2009-07-30 08:36:12 +0000
committerdeva <deva>2009-07-30 08:36:12 +0000
commit77272458e7a8906d871b241b5385bbd0f783d861 (patch)
tree7e32f988654c042be251c4ba31b72902402059f3 /server/src/server.cc
parent1f8c58836dfd8dc8c9a0abeeaef6789325189f1b (diff)
Removed the term 'course' everywhere, and replaced it by 'template'. This reduced/simplified the Template class structure a bit.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 924ad84..f75aeab 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -63,13 +63,13 @@ static std::string error_box(std::string message)
std::string errorbox =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<pracro version=\"1.0\">\n"
- " <course name=\"error\">\n"
+ " <template name=\"error\">\n"
" <macro name=\"error\" static=\"true\">\n"
" <window caption=\"ERROR!\" layout=\"vbox\" name=\"error\">\n"
" <textedit name=\"errorlabel\" value=\"" + message + "\"/>\n"
" </window>\n"
" </macro>\n"
- " </course>\n"
+ " </template>\n"
"</pracro>\n";
return errorbox;
}
@@ -77,7 +77,7 @@ static std::string error_box(std::string message)
class NotFoundException : public Exception {
public:
NotFoundException(Request &r)
- : Exception("Macro " + r.macro + " not found in course " + r.course) {}
+ : Exception("Macro " + r.macro + " not found in template " + r.templ) {}
};
@@ -99,7 +99,7 @@ static std::string handleCommits(Transaction *transaction, Database &db,
db.commitTransaction(transaction->user, transaction->cpr, *macro, commit.fields);
if(resume != "") {
- journalwriter.addEntry(*transaction, commit, resume, commit.course);
+ journalwriter.addEntry(*transaction, commit, resume, commit.templ);
}
i++;
@@ -122,26 +122,26 @@ static std::string handleRequest(Transaction *transaction,
while(i != transaction->requests.end()) {
Request &request = *i;
- PRACRO_DEBUG(server, "Handling request - macro: %s, course: %s\n",
- request.macro.c_str(), request.course.c_str());
+ PRACRO_DEBUG(server, "Handling request - macro: %s, template: %s\n",
+ request.macro.c_str(), request.templ.c_str());
// Read and parse the template file.
- TemplateParser tp(templatelist.getLatestVersion(request.course));
+ TemplateParser tp(templatelist.getLatestVersion(request.templ));
tp.parse();
Template *templ = tp.getTemplate();
- answer += " <course name=\"";
- answer += templ->course.attributes["name"];
+ answer += " <template name=\"";
+ answer += templ->attributes["name"];
answer += "\" title=\"";
- answer += templ->course.attributes["title"];
+ answer += templ->attributes["title"];
answer += "\">\n";
bool foundmacro = false;
// Generate the macro and return it to the client
- std::vector< Macro >::iterator mi2 = templ->course.macros.begin();
- while(mi2 != templ->course.macros.end()) {
+ std::vector< Macro >::iterator mi2 = templ->macros.begin();
+ while(mi2 != templ->macros.end()) {
Macro &macro = (*mi2);
if(macro.isHeader) {
@@ -244,7 +244,7 @@ static std::string handleRequest(Transaction *transaction,
if(foundmacro == false && request.macro != "")
throw NotFoundException(request);
- answer += " </course>\n";
+ answer += " </template>\n";
i++;
}
@@ -432,7 +432,7 @@ bool pracro_is_running = true;
char request[] =
"<?xml version='1.0' encoding='UTF-8'?>\n"
"<pracro cpr=\"2003791613\" version=\"1.0\">\n"
- " <request macro=\"example\" course=\"example\"/>\n"
+ " <request macro=\"example\" template=\"example\"/>\n"
"</pracro>\n";
int main()