Remove support for deprecated ICU definitions
[pazpar2-moved-to-github.git] / src / pazpar2_config.c
index 3b9d47a..4332397 100644 (file)
@@ -513,7 +513,7 @@ static int parse_metadata(struct conf_service *service, xmlNode *n,
 }
 
 
-static void service_add_metadata(xmlNode *n, int *num_metadata, int *num_sortkeys)
+static void count_metadata(xmlNode *n, int *num_metadata, int *num_sortkeys)
 {
     xmlChar *sortkey = xmlGetProp(n, (xmlChar *) "sortkey");
     (*num_metadata)++;
@@ -549,11 +549,11 @@ static struct conf_service *service_create_static(struct conf_server *server,
                 {
                     if (m->type == XML_ELEMENT_NODE &&
                             !strcmp((const char *) m->name, "metadata"))
-                        service_add_metadata(m, &num_metadata, &num_sortkeys);
+                        count_metadata(m, &num_metadata, &num_sortkeys);
                 }
             }
             else // This is a metadata-element proper, count it right away.
-                service_add_metadata(n, &num_metadata, &num_sortkeys);
+                count_metadata(n, &num_metadata, &num_sortkeys);
         }
 
     service = service_init(server, num_metadata, num_sortkeys, service_id);
@@ -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 <icu_chain id=\"%s\">.. 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 <icu_chain id=\"%s\">.. instead", n->name);
+            return 0;
         }
         else if (!strcmp((const char *) n->name, "service"))
         {
@@ -1263,8 +1253,8 @@ struct conf_config *config_create(const char *fname, int verbose)
 {
     xmlDoc *doc = xmlReadFile(fname,
                               NULL,
-                              XML_PARSE_XINCLUDE + XML_PARSE_NOBLANKS
-                              + XML_PARSE_NSCLEAN + XML_PARSE_NONET );
+                              XML_PARSE_XINCLUDE
+                              + XML_PARSE_NSCLEAN + XML_PARSE_NONET);
     xmlNode *n;
     const char *p;
     int r;