From 77682ed3596450ab7b3caff707999d2f7977d614 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 25 Feb 2014 14:14:00 +0100 Subject: [PATCH] Remove support for deprecated ICU definitions Elements , , , should be replaced with .. etc. Fixes also PAZ-923 --- etc/edu_turbo.xml | 36 +++++++++++++++--------------------- src/charsets.c | 10 ++-------- src/pazpar2_config.c | 24 +++++++----------------- test/test_icu.cfg | 26 +++++++++++--------------- 4 files changed, 35 insertions(+), 61 deletions(-) diff --git a/etc/edu_turbo.xml b/etc/edu_turbo.xml index 353d5d5..eb7b9e8 100644 --- a/etc/edu_turbo.xml +++ b/etc/edu_turbo.xml @@ -3,29 +3,23 @@ - - - - - - - - + + + + + + - - - - - - + + + + - - - - - - - + + + + + diff --git a/src/charsets.c b/src/charsets.c index 784b03c..32d5f4d 100644 --- a/src/charsets.c +++ b/src/charsets.c @@ -203,15 +203,9 @@ pp2_charset_t pp2_charset_create_xml(xmlNode *xml_node) #if YAZ_HAVE_ICU UErrorCode status = U_ZERO_ERROR; struct icu_chain *chain = 0; - while (xml_node && xml_node->type != XML_ELEMENT_NODE) - xml_node = xml_node->next; chain = icu_chain_xml_config(xml_node, 1, &status); - if (!chain || U_FAILURE(status)){ - //xmlDocPtr icu_doc = 0; - //xmlChar *xmlstr = 0; - //int size = 0; - //xmlDocDumpMemory(icu_doc, size); - + if (!chain || U_FAILURE(status)) + { yaz_log(YLOG_FATAL, "Could not parse ICU chain config:\n" "<%s>\n ... \n", xml_node->name, xml_node->name); diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 1aef7b4..4332397 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -639,14 +639,9 @@ static struct conf_service *service_create_static(struct conf_server *server, || !strcmp((const char *) n->name, "facet")) { - if (!service->charsets) - service->charsets = pp2_charset_fact_create(); - if (pp2_charset_fact_define(service->charsets, - n->children, (const char *) n->name)) - { - yaz_log(YLOG_FATAL, "ICU chain definition error"); - return 0; - } + yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name); + yaz_log(YLOG_LOG, "Use .. instead", n->name); + return 0; } else if (!strcmp((const char *) n->name, (const char *) "metadata")) { @@ -680,7 +675,7 @@ static struct conf_service *service_create_static(struct conf_server *server, service->rank_cluster = 1; else if (!strcmp(rank_cluster, "no")) service->rank_cluster = 0; - else + else { yaz_log(YLOG_FATAL, "service: rank@cluster boolean"); return 0; @@ -942,14 +937,9 @@ static struct conf_server *server_create(struct conf_config *config, || !strcmp((const char *) n->name, "mergekey") || !strcmp((const char *) n->name, "facet")) { - if (!server->charsets) - server->charsets = pp2_charset_fact_create(); - if (pp2_charset_fact_define(server->charsets, - n->children, (const char *) n->name)) - { - yaz_log(YLOG_FATAL, "ICU chain definition error"); - return 0; - } + yaz_log(YLOG_FATAL, "No longer supported: <%s>", n->name); + yaz_log(YLOG_LOG, "Use .. instead", n->name); + return 0; } else if (!strcmp((const char *) n->name, "service")) { diff --git a/test/test_icu.cfg b/test/test_icu.cfg index 85a1b1c..b51dafa 100644 --- a/test/test_icu.cfg +++ b/test/test_icu.cfg @@ -6,22 +6,18 @@ - - - - - - - - - + + + + + + + - - - - - - + + + + -- 1.7.10.4