Added setting file example to config
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 6 Dec 2005 21:44:05 +0000 (21:44 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 6 Dec 2005 21:44:05 +0000 (21:44 +0000)
C event code now loads the settings file from the setting server

git-svn-id: svn://svn.open-ils.org/ILS/trunk@2242 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/openils.xml.example
Open-ILS/src/c-apps/oils_event.c

index 5b74fc7..addcdb0 100644 (file)
@@ -26,6 +26,7 @@ For non-core config info, see the inline documentation within this file
                <!-- script for exception strings -->
                <ex_script>/openils/var/templates/strings/ex.ttk</ex_script>
                <perm_script>/openils/var/templates/strings/perm.ttk</perm_script>
+               <ils_events>/openils/var/data/ils_events.xml</ils_events>
 
                <z3950>
 
index 284ff23..d1c9179 100644 (file)
@@ -1,6 +1,7 @@
 #include "oils_event.h"
 #include <libxml/parser.h>
 #include <libxml/tree.h>
+#include "opensrf/osrf_settings.h"
 
 osrfHash* __oilsEventEvents = NULL;
 
@@ -75,9 +76,10 @@ jsonObject* oilsEventToJSON( oilsEvent* event ) {
 
 void _oilsEventParseEvents() {
        
-       char* xml = "/openils/var/data/ils_events.xml"; /* get me from the settings client */
+       char* xml = osrf_settings_host_value("/ils_events");
 
        xmlDocPtr doc = xmlParseFile(xml);
+       free(xml);
        int success = 0;
        __oilsEventEvents = osrfNewHash();
 
@@ -85,7 +87,6 @@ void _oilsEventParseEvents() {
                xmlNodePtr root = xmlDocGetRootElement(doc);
                if( root ) {
                        xmlNodePtr child = root->children;
-                       //osrfLogDebug("Node Name: %s", child->name);
                        while( child ) {
                                if( !strcmp((char*) child->name, "event") ) {
                                        xmlChar* code = xmlGetProp( child, BAD_CAST "code");