]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/reporter/widgets.example.xml
clark knows how to use custom widget filter code now
[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                                 $full_col = "EXTRACT('week' FROM $full_col)";
114                                 $where_clause = "$full_col = ?"
115                                 push @$bind_list, $val;
116                         </filter-code>
117                 </widget>
118                 
119                 <widget name="multimonth">
120                         <label>Choose a range of months</label>
121                         <description>
122                                 This widget allows the user to pick a range of month on which to
123                                 report.
124                         </description>
125                         <filter-code type="perl">
126                                 $where_clause = 
127                                         "DATE_TRUNC($full_col, 'month') ".
128                                                 "BETWEEN CAST(? AS DATE) AND CAST(? AS DATE)";
129                                 push @$bind_list,
130                                         sprintf('%d/%02d/01', @$val{qw/start-year start-month/}),
131                                         sprintf('%d/%02d/01', @$val{qw/end-year end-month/});
132                         </filter-code>
133                 </widget>
134                 
135                 <widget name="quarter">
136                         <label>Choose a specific year and quarter</label>
137                         <description>
138                                 This widget allows the user to pick a specific year and
139                                 quarter on which to report.
140                         </description>
141                 </widget>
142                 
143                 <widget name="multiquarter">
144                         <label>Choose a range of quarters</label>
145                         <description>
146                                 This widget allows the user to pick a range of quarter on which
147                                 to report.
148                         </description>
149                 </widget>
150                 
151                 <widget name="year">
152                         <label>Choose a specific year</label>
153                         <description>
154                                 This widget allows the user to pick a specific year on which to
155                                 report.
156                         </description>
157                         <filter-code type="perl">
158                                 $where_clause = "EXTRACT('year' FROM $full_col) = ?";
159                                 push @$bind_list, $val;
160                         </filter-code>
161                 </widget>
162                 
163                 <widget name="multiyear">
164                         <label>Choose a range of years</label>
165                         <description>
166                                 This widget allows the user to pick a range of years on which to
167                                 report.
168                         </description>
169                         <filter-code type="perl">
170                                 $where_clause = "EXTRACT('year' FROM $full_col) BETWEEN ? AND ?";
171                                 push @$bind_list, $$val{year}, $$val{year} + $$val{year-count};
172                         </filter-code>
173                 </widget>
174         </widget-family>
175         
176         <!-- Specific time range selection family -->
177         <widget-family name="relative-timerange" datatype="timestamptz">
178                 <label>Relative time-range widgets</label>
179                 
180                 <widget name="day">
181                         <label>Choose a date relative to the report runtime</label>
182                         <description>
183                                 This widget allows the user to pick a date relative to the
184                                 report runtime on which to report.
185                         </description>
186                 </widget>
187                 
188                 <widget name="week">
189                         <label>Choose a week (sun-sat) relative to the report runtime</label>
190                         <description>
191                                 This widget allows the user to pick a week (sun-sat)  relative
192                                 to the report runtime on which to report.
193                         </description>
194                 </widget>
195                 
196                 <widget name="month">
197                         <label>Choose a month relative to the report runtime</label>
198                         <description>
199                                 This widget allows the user to pick a month relative to the
200                                 report runtime on which to report.
201                         </description>
202                 </widget>
203                 
204                 <widget name="quarter">
205                         <label>Choose a quarter relative to the report runtime</label>
206                         <description>
207                                 This widget allows the user to pick a quarter relative to the
208                                 report runtime on which to report.
209                         </description>
210                 </widget>
211                 
212                 <widget name="year">
213                         <label>Choose a year relative to the report runtime</label>
214                         <description>
215                                 This widget allows the user to pick a year relative to the
216                                 report runtime on which to report.
217                         </description>
218                 </widget>
219         </widget-family>
220
221         <!-- Library selection from in-database data - special to OpenILS -->
222         <widget-family name="lib-choose" datatype="text">
223                 <label>String filter from known data</label>
224         
225                 <widget name="dropdown">
226                         <label>Exactly match a Library chosen from a dropdown</label>
227                         <description>
228                                 This widget filters on an exact Library Name match.
229                         </description>
230                 </widget>
231                 
232                 <widget name="multiselect">
233                         <label>Match multiple Libraries chosen from a multiselect box</label>
234                         <description>
235                                 This widget filters based on multiple Library names.
236                         </description>
237                 </widget>
238         </widget-family>
239         </widgets>
240