prettimafication for dem dar reporter
[Evergreen.git] / Open-ILS / src / reporter / tables.example.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <tables>
3
4         <table id="wide-copy" partition="false" fact-table="true">
5                 <label>Wide Copy info</label>
6                 <description>Base table for creating snapshot reports on copy information</description>
7                 <tablename>stats.fleshed_copy</tablename>
8
9                 <fields>
10                         <field
11                           name="id"
12                           primary="true"
13                           create-type="serial"
14                           datatype="int">
15                                 <label>ID</label>
16                                 <description>Copy ID</description>
17                         </field>
18                         <field
19                           name="barcode"
20                           widget-family="string-input"
21                           datatype="text">
22                                 <label>Barcode</label>
23                                 <description>Copy Barcode</description>
24                         </field>
25                         <field
26                           name="owning_lib"
27                           datatype="int"
28                           indexed="true">
29                                 <label>Owner</label>
30                                 <description>ID of the Owning Library</description>
31                         </field>
32                         <field
33                           name="circ_lib"
34                           datatype="int"
35                           indexed="true">
36                                 <label>Circulator</label>
37                                 <description>ID of the Circulating Library</description>
38                         </field>
39                         <field
40                           name="create_date"
41                           datatype="timestamptz"
42                           indexed="true"
43                           default="now()">
44                                 <label>Create Date</label>
45                                 <description>Timestamp of the copy's cataloging</description>
46                         </field>
47                         <field
48                           name="item_lang"
49                           datatype="text">
50                                 <label>Language</label>
51                                 <description>MARC Item Language</description>
52                         </field>
53                         <field
54                           name="item_form"
55                           datatype="text">
56                                 <label>Form</label>
57                                 <description>MARC Item Form of Material</description>
58                         </field>
59                         <field
60                           name="item_type"
61                           datatype="text">
62                                 <label>Type</label>
63                                 <description>MARC Item Type</description>
64                         </field>
65                         <field
66                           name="call_number_label"
67                           widget-family="string-input"
68                           datatype="text">
69                                 <label>Call Number</label>
70                                 <description>Copy Call Number Label</description>
71                         </field>
72                 </fields>
73
74                 <links>
75                         <link
76                           field="owning_lib"
77                           table="org_unit"
78                           id="copy_owning_lib"
79                           key="id"
80                           type="has_a"/>
81                         <link
82                           field="item_lang"
83                           table="marc_lang_map"
84                           id="copy_language"
85                           key="code"
86                           type="has_a"/>
87                         <link
88                           field="item_form"
89                           table="marc_form_map"
90                           id="copy_item_form"
91                           key="code"
92                           type="has_a"/>
93                         <link
94                           field="item_type"
95                           table="marc_type_map"
96                           id="copy_item_type"
97                           key="code"
98                           type="has_a"/>
99                         <link
100                           field="circ_lib"
101                           table="org_unit"
102                           id="copy_circ_lib"
103                           key="id"
104                           type="has_a"/>
105                 </links>
106
107         </table>
108                 
109         <table id="org_unit" partition="false" fact-table="false">
110                 <label>Organizational Units</label>
111                 <description>Table containing library hierarchy definition</description>
112                 <tablename>actor.org_unit</tablename>
113
114                 <fields>
115                         <field
116                           name="id"
117                           primary="true"
118                           create-type="serial"
119                           datatype="int">
120                                 <label>ID</label>
121                                 <description>Library ID</description>
122                         </field>
123                         <field
124                           name="name"
125                           widget-family="lib-choose"
126                           datatype="text">
127                                 <label>Name</label>
128                                 <description>Library Name</description>
129                         </field>
130                         <field
131                           name="shortname"
132                           widget-family="string-choose"
133                           datatype="text">
134                                 <label>Short Name</label>
135                                 <description>Library Short (Policy) Name</description>
136                         </field>
137                 </fields>
138         </table>
139
140         <table id="marc_lang_map" partition="false" fact-table="false">
141                 <label>MARC Language Codes</label>
142                 <description>Table mapping MARC three character codes to language names</description>
143                 <tablename>config.language_map</tablename>
144
145                 <fields>
146                         <field
147                           name="code"
148                           primary='true'
149                           datatype="text">
150                                 <label>Code</label>
151                                 <description>MARC Language Code</description>
152                         </field>
153                         <field
154                           name="value"
155                           widget-family="string-choose"
156                           datatype="text">
157                                 <label>Language Name</label>
158                                 <description>Name associated with the MARC code</description>
159                         </field>
160                 </fields>
161         </table>
162
163         <table id="marc_form_map" partition="false" fact-table="false">
164                 <label>MARC Item Form Codes</label>
165                 <description>Table mapping MARC three character codes to Item Form names</description>
166                 <tablename>config.item_form_map</tablename>
167
168                 <fields>
169                         <field
170                           name="code"
171                           primary='true'
172                           datatype="text">
173                                 <label>Code</label>
174                                 <description>MARC Item Form Code</description>
175                         </field>
176                         <field
177                           name="value"
178                           widget-family="string-choose"
179                           datatype="text">
180                                 <label>Item Form Name</label>
181                                 <description>Name associated with the MARC code</description>
182                         </field>
183                 </fields>
184         </table>
185
186         <table id="marc_type_map" partition="false" fact-table="false">
187                 <label>MARC Item Type Codes</label>
188                 <description>Table mapping MARC three character codes to Item Type names</description>
189                 <tablename>config.item_type_map</tablename>
190
191                 <fields>
192                         <field
193                           name="code"
194                           primary='true'
195                           datatype="text">
196                                 <label>Code</label>
197                                 <description>MARC Item Type Code</description>
198                         </field>
199                         <field
200                           name="value"
201                           widget-family="string-choose"
202                           datatype="text">
203                                 <label>Item Type Name</label>
204                                 <description>Name associated with the MARC code</description>
205                         </field>
206                 </fields>
207         </table>
208
209         <table id="silly.fact" partition="true" fact-table="false">
210                 <label>Silly Fact table</label>
211                 <description>Base table for creating reports on silly words</description>
212                 <tablename>stats.silly_fact</tablename>
213
214                 <partition>
215                         <field>said_when</field>
216                         <!-- Valid options:  years, months, weeks, days, hours, minutes, seconds  -->
217                         <chunk>months</chunk>
218                         <start>2005-09-01</start>
219                         <end>2005-12-31</end>
220                 </partition>
221
222                 <fields>
223                         <field
224                           name="id"
225                           primary="true"
226                           create-type="serial"
227                           datatype="int">
228                                 <label>Silly entry id</label>
229                                 <description>Silly entry id</description>
230                         </field>
231                         <field
232                           name="silly_word_dim"
233                           datatype="int"
234                           indexed="true">
235                                 <label>Silly word dim</label>
236                                 <description>Silly word entry dimension link</description>
237                         </field>
238                         <field
239                           name="silly_sayer_dim"
240                           datatype="int"
241                           indexed="true">
242                                 <label>Silly sayer dim</label>
243                                 <description>Silly sayer entry dimension link</description>
244                         </field>
245                         <field
246                           name="said_when"
247                           datatype="timestamptz"
248                           core="true"
249                           indexed="true"
250                           default="now()">
251                                 <label>Silly word timestamp</label>
252                                 <description>Silly word entry timestamp</description>
253                         </field>
254                 </fields>
255                 <links>
256                         <link
257                           field="silly_word_dim"
258                           table="silly.word_dim"
259                           key="id"
260                           type="has_a"/>
261                         <link
262                           field="silly_sayer_dim"
263                           table="silly.sayer_dim"
264                           key="id"
265                           type="has_a"/>
266                 </links>
267         </table>
268
269         <table id="silly.word_dim">
270                 <label>Silly word list</label>
271                 <description>Silly word list</description>
272                 <tablename>stats.words</tablename>
273                 <fields>
274                         <field
275                           name="id"
276                           primary="true"
277                           create-type="serial"
278                           datatype="int">
279                                 <label>Silly word id</label>
280                         </field>
281                         <field
282                           name="word"
283                           datatype="text"
284                           indexed="true"
285                           index-type="BTREE">
286                                 <label>Silly word</label>
287                         </field>
288                 </fields>
289         </table>
290
291         <table id="silly.sayer_dim">
292                 <label>Silly word sayer list</label>
293                 <description>Silly word sayer list</description>
294                 <tablename>stats.silly_sayers</tablename>
295                 <fields>
296                         <field
297                           name="id"
298                           primary="true"
299                           create-type="serial"
300                           datatype="int">
301                                 <label>Silly person id</label>
302                         </field>
303                         <field
304                           name="sayer"
305                           widget-family="string-choose"
306                           datatype="text"
307                           indexed="true"
308                           index-type="BTREE">
309                                 <label>Silly person</label>
310                         </field>
311                 </fields>
312         </table>
313
314 </tables>
315