X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fpazpar2_config.c;h=bc5ba6d54526ee26ab0026e677b2c52123876430;hb=d83ed24b0cf7522f931e689eefb6f7f6d74b8b28;hp=ba1e55ab02adb94db71ef2c92d7ca7d64ea58be6;hpb=d65081fd86127344075a112002adbfa32ff88f11;p=pazpar2-moved-to-github.git diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index ba1e55a..bc5ba6d 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2011 Index Data + Copyright (C) 2006-2012 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 @@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "ppmutex.h" #include "incref.h" #include "pazpar2_config.h" +#include "service_xslt.h" #include "settings.h" #include "eventl.h" #include "http.h" @@ -56,6 +57,13 @@ struct conf_config database_hosts_t database_hosts; }; +struct service_xslt +{ + char *id; + xsltStylesheetPtr xsp; + struct service_xslt *next; +}; + static void conf_metadata_assign(NMEM nmem, struct conf_metadata * metadata, const char *name, @@ -115,6 +123,7 @@ static struct conf_service *service_init(struct conf_server *server, service->nmem = nmem; service->next = 0; service->databases = 0; + service->xslt_list = 0; service->server = server; service->session_timeout = 60; /* default session timeout */ service->z3950_session_timeout = 180; @@ -230,6 +239,7 @@ void service_destroy(struct conf_service *service) { if (!pazpar2_decref(&service->ref_count, service->mutex)) { + service_xslt_destroy(service); pp2_charset_fact_destroy(service->charsets); yaz_mutex_destroy(&service->mutex); nmem_destroy(service->nmem); @@ -542,6 +552,11 @@ static struct conf_service *service_create_static(struct conf_server *server, if (parse_metadata(service, n, &md_node, &sk_node)) return 0; } + else if (!strcmp((const char *) n->name, (const char *) "xslt")) + { + if (service_xslt_config(service, n)) + return 0; + } else { yaz_log(YLOG_FATAL, "Bad element: %s", n->name); @@ -625,7 +640,6 @@ struct conf_service *service_create(struct conf_server *server, if (service) { inherit_server_settings(service); - resolve_databases(service); assert(service->mutex == 0); pazpar2_mutex_create(&service->mutex, "conf"); } @@ -979,7 +993,6 @@ void config_process_events(struct conf_config *conf) for (;s ; s = s->next) { - resolve_databases(s); assert(s->mutex == 0); pazpar2_mutex_create(&s->mutex, "service"); }