Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
[pazpar2-moved-to-github.git] / src / pazpar2_config.c
index b659848..740ac9c 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Pazpar2.
-   Copyright (C) 2006-2010 Index Data
+   Copyright (C) 2006-2011 Index Data
 
 Pazpar2 is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -678,7 +678,7 @@ static void inherit_server_settings(struct conf_service *s)
             pp2_charset_incref(s->relevance_pct);
         }
         else
-            s->relevance_pct = pp2_charset_create(0);
+            s->relevance_pct = pp2_charset_create_a_to_z();
     }
     
     if (!s->sort_pct)
@@ -689,7 +689,7 @@ static void inherit_server_settings(struct conf_service *s)
             pp2_charset_incref(s->sort_pct);
         }
         else
-            s->sort_pct = pp2_charset_create(0);
+            s->sort_pct = pp2_charset_create_a_to_z();
     }
     
     if (!s->mergekey_pct)
@@ -700,7 +700,7 @@ static void inherit_server_settings(struct conf_service *s)
             pp2_charset_incref(s->mergekey_pct);
         }
         else
-            s->mergekey_pct = pp2_charset_create(0);
+            s->mergekey_pct = pp2_charset_create_a_to_z();
     }
 
     if (!s->facet_pct)
@@ -933,6 +933,25 @@ struct conf_service *locate_service(struct conf_server *server,
     return s;
 }
 
+void info_services(struct conf_server *server, WRBUF w)
+{
+    struct conf_service *s = server->service;
+    wrbuf_puts(w, " <services>\n");
+    for (; s; s = s->next)
+    {
+        wrbuf_puts(w, "  <service");
+        if (s->id)
+        {
+            wrbuf_puts(w, " id=\"");
+            wrbuf_xmlputs(w, s->id);
+            wrbuf_puts(w, "\"");
+        }
+        wrbuf_puts(w, "/>");
+
+        wrbuf_puts(w, "\n");
+    }
+    wrbuf_puts(w, " </services>\n");
+}
 
 static int parse_config(struct conf_config *config, xmlNode *root)
 {