pazpar2  1.13.0
pazpar2_config.h
Go to the documentation of this file.
1 /* This file is part of Pazpar2.
2  Copyright (C) Index Data
3 
4 Pazpar2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8 
9 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 
18 */
19 
20 #ifndef PAZPAR2_CONFIG_H
21 #define PAZPAR2_CONFIG_H
22 
23 #include "normalize_cache.h"
24 
25 #include <yaz/nmem.h>
26 #include <yaz/mutex.h>
27 #include <yaz/ccl.h>
28 #include "charsets.h"
29 #include "http.h"
30 #include "database.h"
31 
33  Metadata_type_generic, // Generic text field
34  Metadata_type_year, // year YYYY - YYYY
35  Metadata_type_date, // date YYYYMMDD - YYYYMMDD
36  Metadata_type_float, // float number
41 };
42 
44  Metadata_merge_no, // Don't merge
45  Metadata_merge_unique, // Include unique elements in merged block
46  Metadata_merge_longest, // Include the longest (strlen) value
47  Metadata_merge_range, // Store value as a range of lowest-highest
48  Metadata_merge_all, // Just include all elements found
49  Metadata_merge_first // All from first target
50 };
51 
52 // This controls the ability to insert 'static' values from settings into retrieval recs
55  Metadata_setting_postproc, // Insert setting value into normalized record
56  Metadata_setting_parameter // Expose value to normalization stylesheets
57 };
58 
63 };
64 
65 // Describes known metadata elements and how they are to be manipulated
66 // An array of these structure provides a 'map' against which
67 // discovered metadata elements are matched. It also governs storage,
68 // to minimize number of cycles needed at various tages of processing
70 {
71  char *name; // The field name. Output by normalization stylesheet
72  int brief; // Is this element to be returned in the brief format?
73  int termlist;// Is this field to be treated as a termlist for browsing?
74  const char *rank;
75  int sortkey_offset; // -1 if it's not a sortkey, otherwise index
76  // into service/record_cluster->sortkey array
79  enum conf_setting_type setting; // Value is to be taken from session/db settings?
81  char *facetrule;
82 
83  char *limitmap; // Should be expanded into service-wide default e.g. pz:limitmap:<name>=value setting
84  char *limitcluster;
85  char *icurule;
86 };
87 
88 
89 
90 // Controls sorting
92 {
93  char *name;
95 };
96 
97 struct conf_server;
98 
100 {
101  YAZ_MUTEX mutex;
109  char *id;
110  NMEM nmem;
116  double rank_follow;
117  double rank_lead;
120 
122  /* duplicated from conf_server */
124 
126 
127  CCL_bibset ccl_bibset;
130  char *xml_node;
131 };
132 
133 int conf_service_metadata_field_id(struct conf_service *service, const char * name);
134 
135 int conf_service_sortkey_field_id(struct conf_service *service, const char * name);
136 
138 {
139  char *host;
140  char *port;
141  char *proxy_host;
143  char *myurl;
145  char *server_id;
146 
148 
150  struct conf_server *next;
154 };
155 
156 struct conf_config *config_create(const char *fname);
157 void config_destroy(struct conf_config *config);
158 void config_process_events(struct conf_config *config);
159 void info_services(struct conf_server *server, WRBUF w);
160 
162  const char *service_id);
163 
165  xmlNode *node);
166 void service_incref(struct conf_service *service);
167 void service_destroy(struct conf_service *service);
168 
169 int config_start_listeners(struct conf_config *conf,
170  const char *listener_override,
171  const char *record_fname);
172 
173 void config_stop_listeners(struct conf_config *conf);
174 
175 WRBUF conf_get_fname(struct conf_config *config, const char *fname);
176 
177 #endif
178 
179 /*
180  * Local variables:
181  * c-basic-offset: 4
182  * c-file-style: "Stroustrup"
183  * indent-tabs-mode: nil
184  * End:
185  * vim: shiftwidth=4 tabstop=8 expandtab
186  */
187 
http_server_t http_server
enum conf_setting_type setting
conf_setting_type
struct conf_config * config
conf_metadata_type
iochan_man_t iochan_man
struct conf_server * next
CCL_bibset ccl_bibset
WRBUF conf_get_fname(struct conf_config *config, const char *fname)
char * settings_fname
struct service_xslt * xslt_list
struct conf_metadata * metadata
struct conf_service * service
struct conf_server * server
enum conf_metadata_merge merge
void config_stop_listeners(struct conf_config *conf)
char * proxy_host
void service_destroy(struct conf_service *service)
void config_destroy(struct conf_config *config)
int config_start_listeners(struct conf_config *conf, const char *listener_override, const char *record_fname)
int z3950_operation_timeout
struct database * databases
enum conf_metadata_type type
conf_metadata_merge
struct conf_service * locate_service(struct conf_server *server, const char *service_id)
int conf_service_sortkey_field_id(struct conf_service *service, const char *name)
struct conf_config * config_create(const char *fname)
enum conf_metadata_mergekey mergekey
Pazpar2 Character set facilities.
double rank_follow
YAZ_MUTEX mutex
pp2_charset_fact_t charsets
char * server_id
const char * rank
conf_metadata_mergekey
int z3950_session_timeout
int conf_service_metadata_field_id(struct conf_service *service, const char *name)
void info_services(struct conf_server *server, WRBUF w)
pp2_charset_fact_t charsets
struct conf_service * next
void config_process_events(struct conf_config *config)
struct conf_sortkey * sortkeys
struct settings_array * settings
void service_incref(struct conf_service *service)
struct setting_dictionary * dictionary
char * default_sort
char * limitcluster
struct conf_service * service_create(struct conf_server *server, xmlNode *node)