This file -- not valid XML -- contains illustrative examples of the configuration
[pazpar2-moved-to-github.git] / etc / example-settings
1
2 Each of the following examples is an example target settings file. On startup, 
3 pazpar2 will read any number of these files recursively from a directory hierarchy.
4 Explanations for the examples below.
5
6 The following file explicitly sets name=value for a whole bunch of targets for a
7 bunch of users.. I don't imagine this format will be used much for human
8 entry, but it might be used to export settings from a relational database.. it is
9 also there as one extreme form of a generic format.
10
11 If user is omitted, the setting applies to any user. For target, there are two wildcard
12 forms: * matches any target not otherwise matched, and xx/* matches any database on a given
13 host. A setting for an explicit host/db always overrides a wildcard setting.
14
15 <settings>
16   <set target="xx" name="xx" value="xx" user="xx"/>
17   <set target="xx" name="xx" value="xx" user="xx"/>
18   <set target="xx" name="xx" value="xx" user="xx"/>
19 </settings>
20
21 More useful, you can group a number of settings about a target into one file like this.
22 This comes closer to the conventional target setting files we're used to. 
23
24 <settings target="xx">
25   <set name="xx" value="xx"/>
26   <set name="xx" value="xx"/>
27   <set name="xx" value="xx"/>
28 </settings>
29
30 This file sets a number of name=value pairs for a list of targets. A typical example might
31 be to associate all these targets with a specific category or type, or to otherwise make
32 them part of a set -- like 'all full-text', 'all free-access', etc.
33
34 <settings name="xx" value="xx">
35   <set target="xx"/>
36   <set target="xx"/>
37   <set target="xx"/>
38   <set target="xx"/>
39 </settings>
40
41 Here's the shortest possible file.. it sets one name=value for one target
42
43 <settings target="xx" name="xx" value="xx" user="xx"/>
44
45 This sets different values for a given named setting (attribute) for one target.
46
47 <settings name="xx" target="xx">
48   <set value="xx"/>
49   <set value="xx"/>
50   <set value="xx"/>
51 </settings>
52
53 This sets different values for one attribute for different targets 
54
55 <settings name="xx">
56   <value>xx</value>
57   <value>xx</value>
58   <set target="xx"/>
59   <set target="xx"/>
60   <set target="xx"/>
61 </settings>
62
63 This sets one or more named values for a set of targets.
64
65 <settings>
66   <target>xx</target>
67   <target>xx</target>
68   <target>xx</target>
69   <set name="xx" value="xx"/>
70   <set name="xx" value="xx"/>
71 </settings>
72
73 This is a more concrete example.. it allows specific users access to a given target.
74
75 <settings name="pz:allow" target="xx" value="yes">
76   <set user="xx"/>
77   <set user="xx"/>
78   <set user="xx"/>
79 </settings>
80
81 While this default setting disallows access to anything for everybody not otherwise
82 permitted...
83
84 // Whitelist default -- disallow all access
85 <settings name="pz:allow" target="*" value="no"/>
86
87 .. except these 'free' targets which are open to anyone.
88
89 // Except these ones
90 <settings name="pz:allow" value="yes">
91   <set target="xx"/>
92   <set target="xx"/>
93   <set target="xx"/>
94 </settings>
95
96 The setting below sets a default record normalization stylesheet. Yes, values can be simple
97 strings, or they can be XML trees.
98
99 <settings xmlns="http://www.indexdata.com/pazpar2/1" target="*" name="pz:normalize">
100   <set>
101     <xsl:stylesheet xmlns:xsl="xxx" ..>
102     </xsl:stylesheet>
103   </set>
104 </settings>