]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/reporter/widgets.example.xml
5d9c5562ee27f27a61867b260b85fbda1514e209
[Evergreen.git] / Open-ILS / src / reporter / widgets.example.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <widgets>
3         
4         <!-- String selection from user input -->
5         <widget-family name="string-input" datatype="text">
6                 <label>String matching from user input</label>
7         
8                 <widget name="exact">
9                         <label>Exactly match a user supplied string</label>
10                         <description>
11                                 This widget filters a column based on an exact string
12                                 match.
13                         </description>
14                 </widget>
15         
16                 <widget name="multistring">
17                         <label>Exactly match one of several user supplied strings</label>
18                         <description>
19                                 This widget filters a column based on an set of strings.
20                         </description>
21                 </widget>
22         
23                 <widget name="initial-substring">
24                         <label>Match the begining of a string from user input</label>
25                         <description>
26                                 This widget filters a column based on an initial substring
27                                 match.
28                         </description>
29                 </widget>
30         </widget-family>
31         
32         
33         <!-- String selection from in-database data -->
34         <widget-family name="string-choose" datatype="text">
35                 <label>String filter from known data</label>
36         
37                 <widget name="dropdown">
38                         <label>Exactly match a string chosen from a dropdown</label>
39                         <description>
40                                 This widget filters a column based on an exact string match.
41                         </description>
42                 </widget>
43                 
44                 <widget name="multiselect">
45                         <label>Match multiple strings chosen from a multiselect box</label>
46                         <description>
47                                 This widget filters a column based on multiple strings.
48                         </description>
49                 </widget>
50         </widget-family>
51         
52         
53         <!-- Specific time range selection family -->
54         <widget-family name="specific-timerange" datatype="timestamptz">
55                 <label>Specific time-range widgets</label>
56         
57                 <widget name="any">
58                         <label>User defined time range</label>
59                         <description>
60                                 This widget allows the user to pick an arbitrary time range
61                                 on which to report.
62                         </description>
63                 </widget>
64                 
65                 <widget name="day">
66                         <label>Choose a specific date</label>
67                         <description>
68                                 This widget allows the user to pick a specific date on which
69                                 to report.
70                         </description>
71                         <filter-code type="perl">
72                                 $full_col = "DATE_TRUNC($full_col, 'day')";
73                                 $where_clause = "$full_col = CAST(? AS DATE)";
74                                 push @$bind_list, sprintf('%d/%02d/%02d', @$val{qw/year month day/});
75                         </filter-code>
76                 </widget>
77         
78                 <widget name="week">
79                         <label>Choose a specific week of the year</label>
80                         <description>
81                                 This widget allows the user to pick a specific week of the year
82                                 on which to report.
83                         </description>
84                         <filter-code type="perl">
85                                 $full_col = "EXTRACT('week' FROM $full_col)";
86                                 $where_clause = "$full_col = ?";
87                                 push @$bind_list, $val;
88                         </filter-code>
89                 </widget>
90                 
91                 <widget name="multiweek">
92                         <label>Choose a range of weeks of the year</label>
93                         <description>
94                                 This widget allows the user to pick a range of weeks of the year
95                                 on which to report.
96                         </description>
97                         <filter-code type="perl">
98                                 $where_clause =
99                                         "EXTRACT('year' FROM $full_col) = ? ".
100                                         "AND EXTRACT('week' FROM $full_col) ".
101                                                 "BETWEEN ? AND ?";
102                                 push @$bind_list, $$val{year}, $$val{start}, $$val{end};
103                         </filter-code>
104                 </widget>
105                 
106                 <widget name="month">
107                         <label>Choose a specific year and month</label>
108                         <description>
109                                 This widget allows the user to pick a specific year and month
110                                 on which to report.
111                         </description>
112                         <filter-code type="perl">
113                                 $where_clause =
114                                         "EXTRACT('year' FROM $full_col) = ? ".
115                                         "AND EXTRACT('month' FROM $full_col) = ?";
116                                 push @$bind_list, $$val{'start-year'}, $$val{'start-month'};
117                         </filter-code>
118                 </widget>
119                 
120                 <widget name="multimonth">
121                         <label>Choose a range of months</label>
122                         <description>
123                                 This widget allows the user to pick a range of month on which to
124                                 report.
125                         </description>
126                         <filter-code type="perl">
127                                 $where_clause = 
128                                         "DATE_TRUNC($full_col, 'month') ".
129                                                 "BETWEEN CAST(? AS DATE) AND CAST(? AS DATE)";
130                                 push @$bind_list,
131                                         sprintf('%d/%02d/01', @$val{qw/start-year start-month/}),
132                                         sprintf('%d/%02d/01', @$val{qw/end-year end-month/});
133                         </filter-code>
134                 </widget>
135                 
136                 <widget name="quarter">
137                         <label>Choose a specific year and quarter</label>
138                         <description>
139                                 This widget allows the user to pick a specific year and
140                                 quarter on which to report.
141                         </description>
142                 </widget>
143                 
144                 <widget name="multiquarter">
145                         <label>Choose a range of quarters</label>
146                         <description>
147                                 This widget allows the user to pick a range of quarter on which
148                                 to report.
149                         </description>
150                 </widget>
151                 
152                 <widget name="year">
153                         <label>Choose a specific year</label>
154                         <description>
155                                 This widget allows the user to pick a specific year on which to
156                                 report.
157                         </description>
158                         <filter-code type="perl">
159                                 $where_clause = "EXTRACT('year' FROM $full_col) = ?";
160                                 push @$bind_list, $val;
161                         </filter-code>
162                 </widget>
163                 
164                 <widget name="multiyear">
165                         <label>Choose a range of years</label>
166                         <description>
167                                 This widget allows the user to pick a range of years on which to
168                                 report.
169                         </description>
170                         <filter-code type="perl">
171                                 $where_clause = "EXTRACT('year' FROM $full_col) BETWEEN ? AND ?";
172                                 push @$bind_list, $$val{year}, $$val{year} + $$val{year-count};
173                         </filter-code>
174                 </widget>
175         </widget-family>
176         
177         <!-- Specific time range selection family -->
178         <widget-family name="relative-timerange" datatype="timestamptz">
179                 <label>Relative time-range widgets</label>
180                 
181                 <widget name="day">
182                         <label>Choose a date relative to the report runtime</label>
183                         <description>
184                                 This widget allows the user to pick a date relative to the
185                                 report runtime on which to report.
186                         </description>
187                 </widget>
188                 
189                 <widget name="week">
190                         <label>Choose a week (sun-sat) relative to the report runtime</label>
191                         <description>
192                                 This widget allows the user to pick a week (sun-sat)  relative
193                                 to the report runtime on which to report.
194                         </description>
195                 </widget>
196                 
197                 <widget name="month">
198                         <label>Choose a month relative to the report runtime</label>
199                         <description>
200                                 This widget allows the user to pick a month relative to the
201                                 report runtime on which to report.
202                         </description>
203                 </widget>
204                 
205                 <widget name="quarter">
206                         <label>Choose a quarter relative to the report runtime</label>
207                         <description>
208                                 This widget allows the user to pick a quarter relative to the
209                                 report runtime on which to report.
210                         </description>
211                 </widget>
212                 
213                 <widget name="year">
214                         <label>Choose a year relative to the report runtime</label>
215                         <description>
216                                 This widget allows the user to pick a year relative to the
217                                 report runtime on which to report.
218                         </description>
219                 </widget>
220         </widget-family>
221
222         <!-- Library selection from in-database data - special to OpenILS -->
223         <widget-family name="lib-choose" datatype="text">
224                 <label>String filter from known data</label>
225         
226                 <widget name="dropdown">
227                         <label>Exactly match a Library chosen from a dropdown</label>
228                         <description>
229                                 This widget filters on an exact Library Name match.
230                         </description>
231                 </widget>
232                 
233                 <widget name="multiselect">
234                         <label>Match multiple Libraries chosen from a multiselect box</label>
235                         <description>
236                                 This widget filters based on multiple Library names.
237                         </description>
238                 </widget>
239         </widget-family>
240         </widgets>
241