sortkey->type = type;
}
-static struct conf_service *service_init(struct conf_server *server,
+struct conf_service *service_init(struct conf_server *server,
int num_metadata, int num_sortkeys,
const char *service_id)
{
struct conf_service * service = 0;
NMEM nmem = nmem_create();
+
service = nmem_malloc(nmem, sizeof(struct conf_service));
service->mutex = 0;
service->ref_count = 1;
service->charsets = 0;
service->id = service_id ? nmem_strdup(nmem, service_id) : 0;
+ // Setup a dictionary from server.
+ service->dictionary = 0;
+
+ service->settings = nmem_malloc(nmem, sizeof(struct settings));
+ service->settings->num_settings = PZ_MAX_EOF;
+ service->settings->settings = nmem_malloc(nmem, sizeof(struct setting*) * service->settings->num_settings);
+ memset(service->settings->settings, 0, sizeof(struct setting*) * service->settings->num_settings);
+ // inherit_server_settings_values(service);
+
+ service->next = 0;
+
service->num_metadata = num_metadata;
+
service->metadata = 0;
if (service->num_metadata)
service->metadata
service->sortkeys
= nmem_malloc(nmem,
sizeof(struct conf_sortkey) * service->num_sortkeys);
- service->dictionary = 0;
+
+
return service;
}
else if (!xmlStrcmp(attr->name, BAD_CAST "mergekey") &&
attr->children && attr->children->type == XML_TEXT_NODE)
xml_mergekey = attr->children->content;
- else if (!xmlStrcmp(attr->name, BAD_CAST "limitmap") &&
- attr->children && attr->children->type == XML_TEXT_NODE)
- xml_limitmap = attr->children->content;
else if (!xmlStrcmp(attr->name, BAD_CAST "facetrule") &&
attr->children && attr->children->type == XML_TEXT_NODE)
xml_icu_chain = attr->children->content;
+ else if (!xmlStrcmp(attr->name, BAD_CAST "limitmap") &&
+ attr->children && attr->children->type == XML_TEXT_NODE)
+ xml_limitmap = attr->children->content;
else
{
yaz_log(YLOG_FATAL, "Unknown metadata attribute '%s'", attr->name);
if (service_xslt_config(service, n))
return 0;
}
+ else if (!strcmp((const char *) n->name, (const char *) "set"))
+ {
+ xmlChar *name= xmlGetProp(n, (xmlChar *) "name");
+ xmlChar *value = xmlGetProp(n, (xmlChar *) "value");
+ if (service->dictionary && name && value) {
+ yaz_log(YLOG_DEBUG, "service set: %s=%s (Not implemented)", (char *) name, (char *) value);
+ //service_aply_setting(service, name, value);
+ }
+ }
else
{
yaz_log(YLOG_FATAL, "Bad element: %s", n->name);
}
else
{
- yaz_log(YLOG_WARN, "service '%s' has no settings",
- s->id ? s->id : "unnamed");
+ yaz_log(YLOG_WARN, "server '%s' has no settings", s->id ? s->id : "unnamed");
init_settings(s);
}
}
struct conf_service *service_create(struct conf_server *server,
xmlNode *node)
{
- struct conf_service *service = service_create_static(server,
- node, 0);
+ struct conf_service *service = service_create_static(server, node, 0);
if (service)
{
inherit_server_settings(service);