From 589fd5ffdeaae87410c31c497083e609e7ae1f53 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 18 Mar 2008 11:24:44 +0000 Subject: Added journal commit code. --- server/AUTHORS | 5 ++++- server/etc/pracrod.conf | 3 +++ server/src/Makefile.am | 2 ++ server/src/macro_parser.cc | 7 +++++++ server/src/server.cc | 13 ++++++++----- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/server/AUTHORS b/server/AUTHORS index fffb7ba..d3d20c2 100644 --- a/server/AUTHORS +++ b/server/AUTHORS @@ -2,4 +2,7 @@ Main developer: Bent Bisballe Nyeng (deva@aasimon.org) Base64 code: - Peter Skaarup (piparum@piparum.dk) \ No newline at end of file + Peter Skaarup (piparum@piparum.dk) + +Qt Client: + Lars Bisballe Jensen (elsenator@gmail.com) \ No newline at end of file diff --git a/server/etc/pracrod.conf b/server/etc/pracrod.conf index ddf1856..c29eb1d 100644 --- a/server/etc/pracrod.conf +++ b/server/etc/pracrod.conf @@ -1 +1,4 @@ port = 12345; + +journal_commit_addr = "localhost"; +journal_commit_port = 4321; diff --git a/server/src/Makefile.am b/server/src/Makefile.am index 672b8e7..f145250 100644 --- a/server/src/Makefile.am +++ b/server/src/Makefile.am @@ -11,6 +11,7 @@ pracrod_SOURCES = \ database.cc \ configuration.cc \ exception.cc \ + journal_commit.cc \ log.cc \ macro_parser.cc \ resumeparser.cc \ @@ -26,6 +27,7 @@ EXTRA_DIST = \ database.h \ debug.h \ exception.h \ + journal_commit.h \ log.h \ macro.h \ macro_parser.h \ diff --git a/server/src/macro_parser.cc b/server/src/macro_parser.cc index aeeb84f..7fc9609 100644 --- a/server/src/macro_parser.cc +++ b/server/src/macro_parser.cc @@ -70,6 +70,13 @@ static void start_hndl(void *p, const char *el, const char **attr) // Do something reasonable with them... + if(name == "macro") { + printf("Macro %s %s\n", attributes["name"].c_str(), attributes["resume"].c_str()); + parser->macro->name = attributes["name"]; + parser->macro->format = attributes["resume"]; + // return; + } + if(name == "include") { Macro inc; diff --git a/server/src/server.cc b/server/src/server.cc index 815f0db..756539f 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -50,6 +50,8 @@ #include "tostring.h" #include +#include "journal_commit.h" + static void send_macro_widget(Widget &widget, TCPSocket &socket, std::string tabs) { socket.write(tabs + "<" + widget.type); @@ -113,14 +115,15 @@ static void connection(TCPSocket &socket) Macro macro; parse_macro(commit.macro, macro); - //parse_macro("example", macro); - - macro.format = "Det koster 50$$\\n\\tLinse: ${linse}D\\n" - "\\y${combo}\\\\\\nHævelse: ${radio}\\n\\n${spl_note}"; std::string resume = resume_parser(macro.format.c_str(), commit); - printf("%s\n", resume.c_str()); + std::string journal_commit_addr = config()->lookup("journal_commit_addr"); + int journal_commit_port = config()->lookup("journal_commit_port"); + + journal_commit(transaction.cpr.c_str(), transaction.user.c_str(), + journal_commit_addr.c_str(), journal_commit_port, + resume.c_str(), resume.length()); i++; } -- cgit v1.2.3