3 var identityDecoder = function (src) {
7 var mapDecoder = function (src) {
9 var lines = src.split(/\n/);
11 $.each(lines, function () {
12 var m = this.match(/^(\S+)\s+(\S+)$/);
20 var boolDecoder = function (src) {
25 siteName : identityDecoder,
26 baseURI : identityDecoder,
27 defaultPage: identityDecoder,
28 styleSheet : identityDecoder,
29 languages : mapDecoder,
30 globalLock : boolDecoder
33 Rakka.getSystemConfig = function () {
38 url : Rakka.baseURI + "systemConfig",
40 success: function (xml) {
41 $(xml).find("value").each(function () {
42 var path = this.getAttribute("path");
43 var decoder = decoder_of[path];
45 if (decoder == null) {
46 throw new Error("unknown config path: " + path);
49 conf[path] = decoder($(this).text());
53 error : function (req) {
54 throw new Error(req.status + " " + req.statusText);