reporter stuff
[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                           datatype="text">
21                                 <label>Barcode</label>
22                                 <description>Copy Barcode</description>
23                         </field>
24                         <field
25                           name="owning_lib"
26                           datatype="int"
27                           indexed="true">
28                                 <label>Owner</label>
29                                 <description>ID of the Owning Library</description>
30                         </field>
31                         <field
32                           name="circ_lib"
33                           datatype="int"
34                           indexed="true">
35                                 <label>Circulator</label>
36                                 <description>ID of the Circulating Library</description>
37                         </field>
38                         <field
39                           name="create_date"
40                           datatype="timestamptz"
41                           indexed="true"
42                           default="now()">
43                                 <label>Create Date</label>
44                                 <description>Timestamp of the copy's cataloging</description>
45                         </field>
46                         <field
47                           name="item_lang"
48                           datatype="text">
49                                 <label>Language</label>
50                                 <description>MARC Item Language</description>
51                         </field>
52                         <field
53                           name="item_form"
54                           datatype="text">
55                                 <label>Form</label>
56                                 <description>MARC Item Form of Material</description>
57                         </field>
58                         <field
59                           name="item_type"
60                           datatype="text">
61                                 <label>Type</label>
62                                 <description>MARC Item Type</description>
63                         </field>
64                         <field
65                           name="call_number_label"
66                           datatype="text">
67                                 <label>Call Number</label>
68                                 <description>Copy Call Number Label</description>
69                         </field>
70                 </fields>
71
72                 <links>
73                         <link
74                           field="owning_lib"
75                           table="org_unit"
76                           id="copy_owning_lib"
77                           key="id"
78                           type="has_a"/>
79                         <link
80                           field="circ_lib"
81                           table="org_unit"
82                           id="copy_circ_lib"
83                           key="id"
84                           type="has_a"/>
85                 </links>
86
87         </table>
88                 
89         <table id="org_unit" partition="false" fact-table="false">
90                 <label>Organizational Units</label>
91                 <description>Table containing library hierarchy definition</description>
92                 <tablename>actor.org_unit</tablename>
93
94                 <fields>
95                         <field
96                           name="id"
97                           primary="true"
98                           create-type="serial"
99                           datatype="int">
100                                 <label>ID</label>
101                                 <description>Library ID</description>
102                         </field>
103                         <field
104                           name="name"
105                           datatype="text">
106                                 <label>Name</label>
107                                 <description>Library Name</description>
108                         </field>
109                         <field
110                           name="shortname"
111                           datatype="text">
112                                 <label>Short Name</label>
113                                 <description>Library Short (Policy) Name</description>
114                         </field>
115                 </fields>
116         </table>
117
118         <table id="silly.fact" partition="true" fact-table="false">
119                 <label>Silly Fact table</label>
120                 <description>Base table for creating reports on silly words</description>
121                 <tablename>stats.silly_fact</tablename>
122
123                 <partition>
124                         <field>said_when</field>
125                         <!-- Valid options:  years, months, weeks, days, hours, minutes, seconds  -->
126                         <chunk>months</chunk>
127                         <start>2005-09-01</start>
128                         <end>2005-12-31</end>
129                 </partition>
130
131                 <fields>
132                         <field
133                           name="id"
134                           primary="true"
135                           create-type="serial"
136                           datatype="int">
137                                 <label>Silly entry id</label>
138                                 <description>Silly entry id</description>
139                         </field>
140                         <field
141                           name="silly_word_dim"
142                           datatype="int"
143                           indexed="true">
144                                 <label>Silly word dim</label>
145                                 <description>Silly word entry dimension link</description>
146                         </field>
147                         <field
148                           name="silly_sayer_dim"
149                           datatype="int"
150                           indexed="true">
151                                 <label>Silly sayer dim</label>
152                                 <description>Silly sayer entry dimension link</description>
153                         </field>
154                         <field
155                           name="said_when"
156                           datatype="timestamptz"
157                           core="true"
158                           indexed="true"
159                           default="now()">
160                                 <label>Silly word timestamp</label>
161                                 <description>Silly word entry timestamp</description>
162                         </field>
163                 </fields>
164                 <links>
165                         <link
166                           field="silly_word_dim"
167                           table="silly.word_dim"
168                           key="id"
169                           type="has_a"/>
170                         <link
171                           field="silly_sayer_dim"
172                           table="silly.sayer_dim"
173                           key="id"
174                           type="has_a"/>
175                 </links>
176         </table>
177
178         <table id="silly.word_dim">
179                 <label>Silly word list</label>
180                 <description>Silly word list</description>
181                 <tablename>stats.words</tablename>
182                 <fields>
183                         <field
184                           name="id"
185                           primary="true"
186                           create-type="serial"
187                           datatype="int">
188                                 <label>Silly word id</label>
189                         </field>
190                         <field
191                           name="word"
192                           datatype="text"
193                           indexed="true"
194                           index-type="BTREE">
195                                 <label>Silly word</label>
196                         </field>
197                 </fields>
198         </table>
199
200         <table id="silly.sayer_dim">
201                 <label>Silly word sayer list</label>
202                 <description>Silly word sayer list</description>
203                 <tablename>stats.silly_sayers</tablename>
204                 <fields>
205                         <field
206                           name="id"
207                           primary="true"
208                           create-type="serial"
209                           datatype="int">
210                                 <label>Silly person id</label>
211                         </field>
212                         <field
213                           name="sayer"
214                           widget-family="string-choose"
215                           datatype="text"
216                           indexed="true"
217                           index-type="BTREE">
218                                 <label>Silly person</label>
219                         </field>
220                 </fields>
221         </table>
222
223 </tables>
224