/* This file is part of Pazpar2.
- Copyright (C) 2006-2009 Index Data
+ Copyright (C) 2006-2011 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
#ifndef PAZPAR2_CONFIG_H
#define PAZPAR2_CONFIG_H
-#include <libxslt/xslt.h>
-#include <libxslt/transform.h>
-#include <libxslt/xsltutils.h>
+#include "normalize_cache.h"
#include <yaz/nmem.h>
+#include <yaz/mutex.h>
#include "charsets.h"
+#include "http.h"
+#include "database.h"
enum conf_metadata_type {
Metadata_type_generic, // Generic text field
- Metadata_type_number, // A number
Metadata_type_year, // A number
Metadata_type_date // A number
};
Metadata_sortkey_relevance,
Metadata_sortkey_numeric, // Standard numerical sorting
Metadata_sortkey_skiparticle, // Skip leading article when sorting
- Metadata_sortkey_string // Flat string
+ Metadata_sortkey_string, // Flat string
+ Metadata_sortkey_position // Position
};
// This controls the ability to insert 'static' values from settings into retrieval recs
enum conf_metadata_mergekey {
Metadata_mergekey_no,
- Metadata_mergekey_yes
+ Metadata_mergekey_optional,
+ Metadata_mergekey_required
};
// Describes known metadata elements and how they are to be manipulated
enum conf_metadata_type type;
enum conf_metadata_merge merge;
enum conf_setting_type setting; // Value is to be taken from session/db settings?
- enum conf_metadata_type mergekey;
+ enum conf_metadata_mergekey mergekey;
+ char *facetrule;
};
enum conf_sortkey_type type;
};
+struct conf_server;
+
// It is conceivable that there will eventually be several 'services'
// offered from one server, with separate configuration -- possibly
// more than one services associated with the same port. For now,
// however, only a single service is possible.
struct conf_service
{
+ YAZ_MUTEX mutex;
int num_metadata;
struct conf_metadata *metadata;
int num_sortkeys;
struct setting_dictionary *dictionary;
struct conf_service *next;
char *id;
- char *settings;
NMEM nmem;
int session_timeout;
int z3950_session_timeout;
- int z3950_connect_timeout;
-
+ int z3950_operation_timeout;
+
+ int ref_count;
/* duplicated from conf_server */
- pp2_charset_t relevance_pct;
- pp2_charset_t sort_pct;
- pp2_charset_t mergekey_pct;
+ pp2_charset_fact_t charsets;
struct database *databases;
- struct conf_targetprofiles *targetprofiles;
- struct conf_config *config;
+ struct conf_server *server;
};
-struct conf_service * conf_service_create(struct conf_config *config,
- int num_metadata, int num_sortkeys,
- const char *service_id);
-
int conf_service_metadata_field_id(struct conf_service *service, const char * name);
int conf_service_sortkey_field_id(struct conf_service *service, const char * name);
char *proxy_host;
int proxy_port;
char *myurl;
- struct sockaddr_in *proxy_addr;
- int listener_socket;
- char *server_settings;
+ char *settings_fname;
+ char *server_id;
+
+ pp2_charset_fact_t charsets;
- pp2_charset_t relevance_pct;
- pp2_charset_t sort_pct;
- pp2_charset_t mergekey_pct;
struct conf_service *service;
struct conf_server *next;
-};
-
-struct conf_targetprofiles
-{
- enum {
- Targetprofiles_local
- } type;
- char *src;
+ struct conf_config *config;
+ http_server_t http_server;
+ iochan_man_t iochan_man;
+ database_hosts_t database_hosts;
};
struct conf_config *config_create(const char *fname, int verbose);
void config_destroy(struct conf_config *config);
-xsltStylesheet *conf_load_stylesheet(struct conf_config *config,
- const char *fname);
-
-void config_start_databases(struct conf_config *config);
+void config_process_events(struct conf_config *config);
+void info_services(struct conf_server *server, WRBUF w);
struct conf_service *locate_service(struct conf_server *server,
const char *service_id);
+struct conf_service *service_create(struct conf_server *server,
+ xmlNode *node);
+void service_incref(struct conf_service *service);
+void service_destroy(struct conf_service *service);
int config_start_listeners(struct conf_config *conf,
- const char *listener_override);
+ const char *listener_override,
+ const char *record_fname);
void config_stop_listeners(struct conf_config *conf);
+WRBUF conf_get_fname(struct conf_config *config, const char *fname);
+
#endif
/*