reporter cleanup -- ready for mini-release (I think)
[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                           transform-group="call_number"
68                           widget-family="string-input"
69                           datatype="text">
70                                 <label>Call Number</label>
71                                 <description>Copy Call Number Label</description>
72                         </field>
73                 </fields>
74
75                 <links>
76                         <link
77                           field="owning_lib"
78                           table="org_unit"
79                           id="copy_owning_lib"
80                           key="id"
81                           type="has_a"/>
82                         <link
83                           field="item_lang"
84                           table="marc_lang_map"
85                           id="copy_language"
86                           key="code"
87                           type="has_a"/>
88                         <link
89                           field="item_form"
90                           table="marc_form_map"
91                           id="copy_item_form"
92                           key="code"
93                           type="has_a"/>
94                         <link
95                           field="item_type"
96                           table="marc_type_map"
97                           id="copy_item_type"
98                           key="code"
99                           type="has_a"/>
100                         <link
101                           field="circ_lib"
102                           table="org_unit"
103                           id="copy_circ_lib"
104                           key="id"
105                           type="has_a"/>
106                 </links>
107
108         </table>
109                 
110         <table id="org_unit" partition="false" fact-table="false">
111                 <label>Organizational Units</label>
112                 <description>Table containing library hierarchy definition</description>
113                 <tablename>actor.org_unit</tablename>
114
115                 <fields>
116                         <field
117                           name="id"
118                           primary="true"
119                           create-type="serial"
120                           datatype="int">
121                                 <label>ID</label>
122                                 <description>Library ID</description>
123                         </field>
124                         <field
125                           name="name"
126                           widget-family="lib-choose"
127                           datatype="text">
128                                 <label>Name</label>
129                                 <description>Library Name</description>
130                         </field>
131                         <field
132                           name="shortname"
133                           widget-family="string-choose"
134                           datatype="text">
135                                 <label>Short Name</label>
136                                 <description>Library Short (Policy) Name</description>
137                         </field>
138                 </fields>
139         </table>
140
141         <table id="marc_lang_map" partition="false" fact-table="false">
142                 <label>MARC Language Codes</label>
143                 <description>Table mapping MARC three character codes to language names</description>
144                 <tablename>config.language_map</tablename>
145
146                 <fields>
147                         <field
148                           name="code"
149                           primary='true'
150                           datatype="text">
151                                 <label>Code</label>
152                                 <description>MARC Language Code</description>
153                         </field>
154                         <field
155                           name="value"
156                           widget-family="string-choose"
157                           datatype="text">
158                                 <label>Language Name</label>
159                                 <description>Name associated with the MARC code</description>
160                         </field>
161                 </fields>
162         </table>
163
164         <table id="marc_form_map" partition="false" fact-table="false">
165                 <label>MARC Item Form Codes</label>
166                 <description>Table mapping MARC three character codes to Item Form names</description>
167                 <tablename>config.item_form_map</tablename>
168
169                 <fields>
170                         <field
171                           name="code"
172                           primary='true'
173                           datatype="text">
174                                 <label>Code</label>
175                                 <description>MARC Item Form Code</description>
176                         </field>
177                         <field
178                           name="value"
179                           widget-family="string-choose"
180                           datatype="text">
181                                 <label>Item Form Name</label>
182                                 <description>Name associated with the MARC code</description>
183                         </field>
184                 </fields>
185         </table>
186
187         <table id="marc_type_map" partition="false" fact-table="false">
188                 <label>MARC Item Type Codes</label>
189                 <description>Table mapping MARC three character codes to Item Type names</description>
190                 <tablename>config.item_type_map</tablename>
191
192                 <fields>
193                         <field
194                           name="code"
195                           primary='true'
196                           datatype="text">
197                                 <label>Code</label>
198                                 <description>MARC Item Type Code</description>
199                         </field>
200                         <field
201                           name="value"
202                           widget-family="string-choose"
203                           datatype="text">
204                                 <label>Item Type Name</label>
205                                 <description>Name associated with the MARC code</description>
206                         </field>
207                 </fields>
208         </table>
209
210         <table id="silly.fact" partition="true" fact-table="false">
211                 <label>Silly Fact table</label>
212                 <description>Base table for creating reports on silly words</description>
213                 <tablename>stats.silly_fact</tablename>
214
215                 <partition>
216                         <field>said_when</field>
217                         <!-- Valid options:  years, months, weeks, days, hours, minutes, seconds  -->
218                         <chunk>months</chunk>
219                         <start>2005-09-01</start>
220                         <end>2005-12-31</end>
221                 </partition>
222
223                 <fields>
224                         <field
225                           name="id"
226                           primary="true"
227                           create-type="serial"
228                           datatype="int">
229                                 <label>Silly entry id</label>
230                                 <description>Silly entry id</description>
231                         </field>
232                         <field
233                           name="silly_word_dim"
234                           datatype="int"
235                           indexed="true">
236                                 <label>Silly word dim</label>
237                                 <description>Silly word entry dimension link</description>
238                         </field>
239                         <field
240                           name="silly_sayer_dim"
241                           datatype="int"
242                           indexed="true">
243                                 <label>Silly sayer dim</label>
244                                 <description>Silly sayer entry dimension link</description>
245                         </field>
246                         <field
247                           name="said_when"
248                           datatype="timestamptz"
249                           core="true"
250                           indexed="true"
251                           default="now()">
252                                 <label>Silly word timestamp</label>
253                                 <description>Silly word entry timestamp</description>
254                         </field>
255                 </fields>
256                 <links>
257                         <link
258                           field="silly_word_dim"
259                           table="silly.word_dim"
260                           key="id"
261                           type="has_a"/>
262                         <link
263                           field="silly_sayer_dim"
264                           table="silly.sayer_dim"
265                           key="id"
266                           type="has_a"/>
267                 </links>
268         </table>
269
270         <table id="silly.word_dim">
271                 <label>Silly word list</label>
272                 <description>Silly word list</description>
273                 <tablename>stats.words</tablename>
274                 <fields>
275                         <field
276                           name="id"
277                           primary="true"
278                           create-type="serial"
279                           datatype="int">
280                                 <label>Silly word id</label>
281                         </field>
282                         <field
283                           name="word"
284                           datatype="text"
285                           indexed="true"
286                           index-type="BTREE">
287                                 <label>Silly word</label>
288                         </field>
289                 </fields>
290         </table>
291
292         <table id="silly.sayer_dim">
293                 <label>Silly word sayer list</label>
294                 <description>Silly word sayer list</description>
295                 <tablename>stats.silly_sayers</tablename>
296                 <fields>
297                         <field
298                           name="id"
299                           primary="true"
300                           create-type="serial"
301                           datatype="int">
302                                 <label>Silly person id</label>
303                         </field>
304                         <field
305                           name="sayer"
306                           widget-family="string-choose"
307                           datatype="text"
308                           indexed="true"
309                           index-type="BTREE">
310                                 <label>Silly person</label>
311                         </field>
312                 </fields>
313         </table>
314
315 </tables>
316