libraries are now filtered on id (there are duplicate names, such as "Bookmobile")
[Evergreen.git] / Open-ILS / src / reporter / tables.example.xml
index 6ec6b07..c72eff7 100644 (file)
@@ -1,9 +1,314 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <tables>
 
-       <table id="silly.fact" partition="true">
-               <name>Silly Fact table</name>
-               <description>Silly Fact table</description>
+       <table id="wide-copy" partition="false" fact-table="true">
+               <label>Wide Copy info</label>
+               <description>Base table for creating snapshot reports on copy information</description>
+               <tablename>stats.fleshed_copy</tablename>
+
+               <fields>
+                       <field
+                         name="id"
+                         primary="true"
+                         create-type="serial"
+                         datatype="int">
+                               <label>ID</label>
+                               <description>Copy ID</description>
+                       </field>
+                       <field
+                         name="barcode"
+                         widget-family="string-input"
+                         datatype="text">
+                               <label>Barcode</label>
+                               <description>Copy Barcode</description>
+                       </field>
+                       <field
+                         name="owning_lib"
+                         datatype="int"
+                         indexed="true">
+                               <label>Owner</label>
+                               <description>ID of the Owning Library</description>
+                       </field>
+                       <field
+                         name="circ_lib"
+                         datatype="int"
+                         indexed="true">
+                               <label>Circulator</label>
+                               <description>ID of the Circulating Library</description>
+                       </field>
+                       <field
+                         name="create_date_day"
+                         datatype="date">
+                               <label>Create Date Joiner</label>
+                               <description>Date of the copy's cataloging</description>
+                       </field>
+                       <field
+                         name="create_date_hour"
+                         datatype="timestamptz">
+                               <label>Create Date and Hour Joiner</label>
+                               <description>Date and Hour of the copy's cataloging</description>
+                       </field>
+<!--
+                       <field
+                         name="create_date"
+                         datatype="timestamptz"
+                         indexed="true"
+                         default="now()">
+                               <label>Create Date</label>
+                               <description>Timestamp of the copy's cataloging</description>
+                       </field>
+                       <field
+                         name="edit_date"
+                         datatype="timestamptz"
+                         indexed="true"
+                         default="now()">
+                               <label>Edit Date</label>
+                               <description>Timestamp of the copy's last edit</description>
+                       </field>
+-->
+                       <field
+                         name="edit_date_day"
+                         datatype="date">
+                               <label>Edit Date Joiner</label>
+                               <description>Date of the copy's last edit</description>
+                       </field>
+                       <field
+                         name="edit_date_hour"
+                         datatype="timestamptz">
+                               <label>Edit Date and Hour Joiner</label>
+                               <description>Date and Hour of the copy's last edit</description>
+                       </field>
+                       <field
+                         name="item_lang"
+                         datatype="text">
+                               <label>Language</label>
+                               <description>MARC Item Language</description>
+                       </field>
+                       <field
+                         name="item_form"
+                         datatype="text">
+                               <label>Form</label>
+                               <description>MARC Item Form of Material</description>
+                       </field>
+                       <field
+                         name="item_type"
+                         datatype="text">
+                               <label>Type</label>
+                               <description>MARC Item Type</description>
+                       </field>
+                       <field
+                         name="call_number_label"
+                         transform-group="call_number"
+                         widget-family="string-input"
+                         datatype="text">
+                               <label>Call Number</label>
+                               <description>Copy Call Number Label</description>
+                       </field>
+               </fields>
+
+               <links>
+                       <link
+                         field="create_date_day"
+                         table="generic_day_series"
+                         hidden="false"
+                         id="copy_create_day"
+                         key="date"
+                         type="has_a"/>
+                       <link
+                         field="create_date_hour"
+                         table="generic_hour_series"
+                         hidden="false"
+                         id="copy_create_hour"
+                         key="date_hour"
+                         type="has_a"/>
+                       <link
+                         field="edit_date_day"
+                         table="generic_day_series"
+                         hidden="false"
+                         id="copy_edit_day"
+                         key="date"
+                         type="has_a"/>
+                       <link
+                         field="edit_date_hour"
+                         table="generic_hour_series"
+                         hidden="false"
+                         id="copy_edit_hour"
+                         key="date_hour"
+                         type="has_a"/>
+                       <link
+                         field="owning_lib"
+                         table="org_unit"
+                         hidden="false"
+                         id="copy_owning_lib"
+                         key="id"
+                         type="has_a"/>
+                       <link
+                         field="item_lang"
+                         table="marc_lang_map"
+                         id="copy_language"
+                         key="code"
+                         type="has_a"/>
+                       <link
+                         field="item_form"
+                         table="marc_form_map"
+                         id="copy_item_form"
+                         key="code"
+                         type="has_a"/>
+                       <link
+                         field="item_type"
+                         table="marc_type_map"
+                         id="copy_item_type"
+                         key="code"
+                         type="has_a"/>
+                       <link
+                         field="circ_lib"
+                         table="org_unit"
+                         id="copy_circ_lib"
+                         key="id"
+                         type="has_a"/>
+               </links>
+
+       </table>
+               
+       <table id="org_unit" partition="false" fact-table="false">
+               <label>Organizational Units</label>
+               <description>Table containing library hierarchy definition</description>
+               <tablename>actor.org_unit</tablename>
+
+               <fields>
+                       <field
+                         name="id"
+                         primary="true"
+                         filterable='true'
+                         widget-family="lib-choose"
+                         create-type="serial"
+                         datatype="int">
+                               <label>Unique Library ID</label>
+                               <description>Unique Library ID</description>
+                       </field>
+                       <field
+                         name="name"
+                         widget-family="string-choose"
+                         datatype="text">
+                               <label>Name</label>
+                               <description>Library Name</description>
+                       </field>
+                       <field
+                         name="shortname"
+                         widget-family="string-choose"
+                         datatype="text">
+                               <label>Short Name</label>
+                               <description>Library Short (Policy) Name</description>
+                       </field>
+               </fields>
+       </table>
+
+       <table id="marc_lang_map" partition="false" fact-table="false">
+               <label>MARC Language Codes</label>
+               <description>Table mapping MARC three character codes to language names</description>
+               <tablename>config.language_map</tablename>
+
+               <fields>
+                       <field
+                         name="code"
+                         primary='true'
+                         datatype="text">
+                               <label>Code</label>
+                               <description>MARC Language Code</description>
+                       </field>
+                       <field
+                         name="value"
+                         widget-family="string-choose"
+                         datatype="text">
+                               <label>Language Name</label>
+                               <description>Name associated with the MARC code</description>
+                       </field>
+               </fields>
+       </table>
+
+       <table id="generic_day_series" partition="false" fact-table="false">
+               <label>Constant day series</label>
+               <description>View providing a day series starting at 1900 and ending at 'now'</description>
+               <tablename>reporter.date_series</tablename>
+
+               <fields>
+                       <field
+                         name="date"
+                         primary='true'
+                         filterable='true'
+                         datatype="timestamptz">
+                               <label>Date</label>
+                               <description>Date</description>
+                       </field>
+               </fields>
+       </table>
+
+       <table id="generic_hour_series" partition="false" fact-table="false">
+               <label>Constant hour series</label>
+               <description>View providing a hour series starting at 1900 and ending at 'now'</description>
+               <tablename>reporter.date_hour_series</tablename>
+
+               <fields>
+                       <field
+                         name="date_hour"
+                         primary='true'
+                         filterable='true'
+                         datatype="timestamptz">
+                               <label>Date and Hour</label>
+                               <description>Date and Hour</description>
+                       </field>
+               </fields>
+       </table>
+
+       <table id="marc_form_map" partition="false" fact-table="false">
+               <label>MARC Item Form Codes</label>
+               <description>Table mapping MARC three character codes to Item Form names</description>
+               <tablename>config.item_form_map</tablename>
+
+               <fields>
+                       <field
+                         name="code"
+                         primary='true'
+                         datatype="text">
+                               <label>Code</label>
+                               <description>MARC Item Form Code</description>
+                       </field>
+                       <field
+                         name="value"
+                         widget-family="string-choose"
+                         datatype="text">
+                               <label>Item Form Name</label>
+                               <description>Name associated with the MARC code</description>
+                       </field>
+               </fields>
+       </table>
+
+       <table id="marc_type_map" partition="false" fact-table="false">
+               <label>MARC Item Type Codes</label>
+               <description>Table mapping MARC three character codes to Item Type names</description>
+               <tablename>config.item_type_map</tablename>
+
+               <fields>
+                       <field
+                         name="code"
+                         primary='true'
+                         datatype="text">
+                               <label>Code</label>
+                               <description>MARC Item Type Code</description>
+                       </field>
+                       <field
+                         name="value"
+                         widget-family="string-choose"
+                         datatype="text">
+                               <label>Item Type Name</label>
+                               <description>Name associated with the MARC code</description>
+                       </field>
+               </fields>
+       </table>
+
+       <table id="silly.fact" partition="true" fact-table="false">
+               <label>Silly Fact table</label>
+               <description>Base table for creating reports on silly words</description>
                <tablename>stats.silly_fact</tablename>
 
                <partition>
        </table>
 
        <table id="silly.word_dim">
-               <name>Silly word list</name>
+               <label>Silly word list</label>
                <description>Silly word list</description>
                <tablename>stats.words</tablename>
                <fields>
                          name="id"
                          primary="true"
                          create-type="serial"
-                         datatype="int"/>
+                         datatype="int">
+                               <label>Silly word id</label>
+                       </field>
                        <field
                          name="word"
                          datatype="text"
                          indexed="true"
-                         index-type="BTREE"/>
+                         index-type="BTREE">
+                               <label>Silly word</label>
+                       </field>
                </fields>
        </table>
 
        <table id="silly.sayer_dim">
-               <name>Silly word sayer list</name>
+               <label>Silly word sayer list</label>
                <description>Silly word sayer list</description>
                <tablename>stats.silly_sayers</tablename>
                <fields>
                          name="id"
                          primary="true"
                          create-type="serial"
-                         datatype="int"/>
+                         datatype="int">
+                               <label>Silly person id</label>
+                       </field>
                        <field
                          name="sayer"
                          widget-family="string-choose"
                          datatype="text"
                          indexed="true"
-                         index-type="BTREE"/>
+                         index-type="BTREE">
+                               <label>Silly person</label>
+                       </field>
                </fields>
        </table>