c72eff74b25b8df3e80b6666b94baa765c5fc0ec
[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_day"
41                           datatype="date">
42                                 <label>Create Date Joiner</label>
43                                 <description>Date of the copy's cataloging</description>
44                         </field>
45                         <field
46                           name="create_date_hour"
47                           datatype="timestamptz">
48                                 <label>Create Date and Hour Joiner</label>
49                                 <description>Date and Hour of the copy's cataloging</description>
50                         </field>
51 <!--
52                         <field
53                           name="create_date"
54                           datatype="timestamptz"
55                           indexed="true"
56                           default="now()">
57                                 <label>Create Date</label>
58                                 <description>Timestamp of the copy's cataloging</description>
59                         </field>
60                         <field
61                           name="edit_date"
62                           datatype="timestamptz"
63                           indexed="true"
64                           default="now()">
65                                 <label>Edit Date</label>
66                                 <description>Timestamp of the copy's last edit</description>
67                         </field>
68 -->
69                         <field
70                           name="edit_date_day"
71                           datatype="date">
72                                 <label>Edit Date Joiner</label>
73                                 <description>Date of the copy's last edit</description>
74                         </field>
75                         <field
76                           name="edit_date_hour"
77                           datatype="timestamptz">
78                                 <label>Edit Date and Hour Joiner</label>
79                                 <description>Date and Hour of the copy's last edit</description>
80                         </field>
81                         <field
82                           name="item_lang"
83                           datatype="text">
84                                 <label>Language</label>
85                                 <description>MARC Item Language</description>
86                         </field>
87                         <field
88                           name="item_form"
89                           datatype="text">
90                                 <label>Form</label>
91                                 <description>MARC Item Form of Material</description>
92                         </field>
93                         <field
94                           name="item_type"
95                           datatype="text">
96                                 <label>Type</label>
97                                 <description>MARC Item Type</description>
98                         </field>
99                         <field
100                           name="call_number_label"
101                           transform-group="call_number"
102                           widget-family="string-input"
103                           datatype="text">
104                                 <label>Call Number</label>
105                                 <description>Copy Call Number Label</description>
106                         </field>
107                 </fields>
108
109                 <links>
110                         <link
111                           field="create_date_day"
112                           table="generic_day_series"
113                           hidden="false"
114                           id="copy_create_day"
115                           key="date"
116                           type="has_a"/>
117                         <link
118                           field="create_date_hour"
119                           table="generic_hour_series"
120                           hidden="false"
121                           id="copy_create_hour"
122                           key="date_hour"
123                           type="has_a"/>
124                         <link
125                           field="edit_date_day"
126                           table="generic_day_series"
127                           hidden="false"
128                           id="copy_edit_day"
129                           key="date"
130                           type="has_a"/>
131                         <link
132                           field="edit_date_hour"
133                           table="generic_hour_series"
134                           hidden="false"
135                           id="copy_edit_hour"
136                           key="date_hour"
137                           type="has_a"/>
138                         <link
139                           field="owning_lib"
140                           table="org_unit"
141                           hidden="false"
142                           id="copy_owning_lib"
143                           key="id"
144                           type="has_a"/>
145                         <link
146                           field="item_lang"
147                           table="marc_lang_map"
148                           id="copy_language"
149                           key="code"
150                           type="has_a"/>
151                         <link
152                           field="item_form"
153                           table="marc_form_map"
154                           id="copy_item_form"
155                           key="code"
156                           type="has_a"/>
157                         <link
158                           field="item_type"
159                           table="marc_type_map"
160                           id="copy_item_type"
161                           key="code"
162                           type="has_a"/>
163                         <link
164                           field="circ_lib"
165                           table="org_unit"
166                           id="copy_circ_lib"
167                           key="id"
168                           type="has_a"/>
169                 </links>
170
171         </table>
172                 
173         <table id="org_unit" partition="false" fact-table="false">
174                 <label>Organizational Units</label>
175                 <description>Table containing library hierarchy definition</description>
176                 <tablename>actor.org_unit</tablename>
177
178                 <fields>
179                         <field
180                           name="id"
181                           primary="true"
182                           filterable='true'
183                           widget-family="lib-choose"
184                           create-type="serial"
185                           datatype="int">
186                                 <label>Unique Library ID</label>
187                                 <description>Unique Library ID</description>
188                         </field>
189                         <field
190                           name="name"
191                           widget-family="string-choose"
192                           datatype="text">
193                                 <label>Name</label>
194                                 <description>Library Name</description>
195                         </field>
196                         <field
197                           name="shortname"
198                           widget-family="string-choose"
199                           datatype="text">
200                                 <label>Short Name</label>
201                                 <description>Library Short (Policy) Name</description>
202                         </field>
203                 </fields>
204         </table>
205
206         <table id="marc_lang_map" partition="false" fact-table="false">
207                 <label>MARC Language Codes</label>
208                 <description>Table mapping MARC three character codes to language names</description>
209                 <tablename>config.language_map</tablename>
210
211                 <fields>
212                         <field
213                           name="code"
214                           primary='true'
215                           datatype="text">
216                                 <label>Code</label>
217                                 <description>MARC Language Code</description>
218                         </field>
219                         <field
220                           name="value"
221                           widget-family="string-choose"
222                           datatype="text">
223                                 <label>Language Name</label>
224                                 <description>Name associated with the MARC code</description>
225                         </field>
226                 </fields>
227         </table>
228
229         <table id="generic_day_series" partition="false" fact-table="false">
230                 <label>Constant day series</label>
231                 <description>View providing a day series starting at 1900 and ending at 'now'</description>
232                 <tablename>reporter.date_series</tablename>
233
234                 <fields>
235                         <field
236                           name="date"
237                           primary='true'
238                           filterable='true'
239                           datatype="timestamptz">
240                                 <label>Date</label>
241                                 <description>Date</description>
242                         </field>
243                 </fields>
244         </table>
245
246         <table id="generic_hour_series" partition="false" fact-table="false">
247                 <label>Constant hour series</label>
248                 <description>View providing a hour series starting at 1900 and ending at 'now'</description>
249                 <tablename>reporter.date_hour_series</tablename>
250
251                 <fields>
252                         <field
253                           name="date_hour"
254                           primary='true'
255                           filterable='true'
256                           datatype="timestamptz">
257                                 <label>Date and Hour</label>
258                                 <description>Date and Hour</description>
259                         </field>
260                 </fields>
261         </table>
262
263         <table id="marc_form_map" partition="false" fact-table="false">
264                 <label>MARC Item Form Codes</label>
265                 <description>Table mapping MARC three character codes to Item Form names</description>
266                 <tablename>config.item_form_map</tablename>
267
268                 <fields>
269                         <field
270                           name="code"
271                           primary='true'
272                           datatype="text">
273                                 <label>Code</label>
274                                 <description>MARC Item Form Code</description>
275                         </field>
276                         <field
277                           name="value"
278                           widget-family="string-choose"
279                           datatype="text">
280                                 <label>Item Form Name</label>
281                                 <description>Name associated with the MARC code</description>
282                         </field>
283                 </fields>
284         </table>
285
286         <table id="marc_type_map" partition="false" fact-table="false">
287                 <label>MARC Item Type Codes</label>
288                 <description>Table mapping MARC three character codes to Item Type names</description>
289                 <tablename>config.item_type_map</tablename>
290
291                 <fields>
292                         <field
293                           name="code"
294                           primary='true'
295                           datatype="text">
296                                 <label>Code</label>
297                                 <description>MARC Item Type Code</description>
298                         </field>
299                         <field
300                           name="value"
301                           widget-family="string-choose"
302                           datatype="text">
303                                 <label>Item Type Name</label>
304                                 <description>Name associated with the MARC code</description>
305                         </field>
306                 </fields>
307         </table>
308
309         <table id="silly.fact" partition="true" fact-table="false">
310                 <label>Silly Fact table</label>
311                 <description>Base table for creating reports on silly words</description>
312                 <tablename>stats.silly_fact</tablename>
313
314                 <partition>
315                         <field>said_when</field>
316                         <!-- Valid options:  years, months, weeks, days, hours, minutes, seconds  -->
317                         <chunk>months</chunk>
318                         <start>2005-09-01</start>
319                         <end>2005-12-31</end>
320                 </partition>
321
322                 <fields>
323                         <field
324                           name="id"
325                           primary="true"
326                           create-type="serial"
327                           datatype="int">
328                                 <label>Silly entry id</label>
329                                 <description>Silly entry id</description>
330                         </field>
331                         <field
332                           name="silly_word_dim"
333                           datatype="int"
334                           indexed="true">
335                                 <label>Silly word dim</label>
336                                 <description>Silly word entry dimension link</description>
337                         </field>
338                         <field
339                           name="silly_sayer_dim"
340                           datatype="int"
341                           indexed="true">
342                                 <label>Silly sayer dim</label>
343                                 <description>Silly sayer entry dimension link</description>
344                         </field>
345                         <field
346                           name="said_when"
347                           datatype="timestamptz"
348                           core="true"
349                           indexed="true"
350                           default="now()">
351                                 <label>Silly word timestamp</label>
352                                 <description>Silly word entry timestamp</description>
353                         </field>
354                 </fields>
355                 <links>
356                         <link
357                           field="silly_word_dim"
358                           table="silly.word_dim"
359                           key="id"
360                           type="has_a"/>
361                         <link
362                           field="silly_sayer_dim"
363                           table="silly.sayer_dim"
364                           key="id"
365                           type="has_a"/>
366                 </links>
367         </table>
368
369         <table id="silly.word_dim">
370                 <label>Silly word list</label>
371                 <description>Silly word list</description>
372                 <tablename>stats.words</tablename>
373                 <fields>
374                         <field
375                           name="id"
376                           primary="true"
377                           create-type="serial"
378                           datatype="int">
379                                 <label>Silly word id</label>
380                         </field>
381                         <field
382                           name="word"
383                           datatype="text"
384                           indexed="true"
385                           index-type="BTREE">
386                                 <label>Silly word</label>
387                         </field>
388                 </fields>
389         </table>
390
391         <table id="silly.sayer_dim">
392                 <label>Silly word sayer list</label>
393                 <description>Silly word sayer list</description>
394                 <tablename>stats.silly_sayers</tablename>
395                 <fields>
396                         <field
397                           name="id"
398                           primary="true"
399                           create-type="serial"
400                           datatype="int">
401                                 <label>Silly person id</label>
402                         </field>
403                         <field
404                           name="sayer"
405                           widget-family="string-choose"
406                           datatype="text"
407                           indexed="true"
408                           index-type="BTREE">
409                                 <label>Silly person</label>
410                         </field>
411                 </fields>
412         </table>
413
414 </tables>
415