1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | |
---|
3 | <xsl:stylesheet version="3.0" |
---|
4 | xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" |
---|
5 | xmlns:xs ="http://www.w3.org/2001/XMLSchema" |
---|
6 | xmlns:ibis="http://www.ibisph.org" |
---|
7 | |
---|
8 | exclude-result-prefixes="ibis xs xsl" |
---|
9 | > |
---|
10 | <xsl:import href="../Page.xslt"/> |
---|
11 | |
---|
12 | <xsl:import href="../../../../xml/Interactive.xslt"/> |
---|
13 | <xsl:import href="../../../../json/Dataset.xslt"/> |
---|
14 | <xsl:import href="../../../../json/Kendo.xslt"/> |
---|
15 | <xsl:import href="../../../../json/LeafletMap.xslt"/> |
---|
16 | |
---|
17 | <xsl:import href="../../../Graphic.xslt"/> |
---|
18 | <xsl:import href="UserSelections.xslt"/> |
---|
19 | <xsl:import href="Result.xslt"/> |
---|
20 | |
---|
21 | <ibis:doc> |
---|
22 | <name>html/query/result/interactive/Page</name> |
---|
23 | <summary>Default core code that produces the interactive query result page</summary> |
---|
24 | <description> |
---|
25 | Contains the templates that create the interactive data table, chart |
---|
26 | and map module query results page. This page differs from the basic |
---|
27 | parent query result page code in that it uses the Kendo and Leaflet |
---|
28 | javascript to display interactive charts, data tables, and maps. |
---|
29 | </description> |
---|
30 | </ibis:doc> |
---|
31 | |
---|
32 | <!-- GARTH TODO: use or remove |
---|
33 | <xsl:param name="DataSources"/> |
---|
34 | <xsl:param name="Page.dataSources" select="$DataSources/DATA_SOURCES"/> |
---|
35 | --> |
---|
36 | |
---|
37 | |
---|
38 | <xsl:param name="Page.configurationTitle" select="/QUERY_MODULE/CONFIGURATIONS/CONFIGURATION[NAME=/QUERY_MODULE/REQUEST/CONFIGURATION_NAME]/TITLE"/> |
---|
39 | <xsl:param name="Page.pageTitle" ibis:doc="Page's title text which is based on the '/QUERY_MODULE/TITLE' element."> |
---|
40 | Query Result - <xsl:value-of select="/QUERY_MODULE/TITLE"/> - <xsl:value-of select="$Page.configurationTitle"/> |
---|
41 | </xsl:param> |
---|
42 | <xsl:param name="Page.contentTitle" ibis:doc="Page's content title text which is based on the '/QUERY_MODULE/TITLE' element."> |
---|
43 | Query Results for <xsl:value-of select="/QUERY_MODULE/TITLE"/> - <xsl:value-of select="$Page.configurationTitle"/> |
---|
44 | </xsl:param> |
---|
45 | |
---|
46 | <xsl:param name="Page.dataSourceDelimiter" select="'; '" |
---|
47 | ibis:doc="value to be used when separating the data source values." |
---|
48 | /> |
---|
49 | |
---|
50 | <xsl:param name="Page.resultURL" select="concat($ibis.contextPath, 'query/result/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html')"/> |
---|
51 | |
---|
52 | <xsl:param name="Page.dimensions" select="/QUERY_MODULE/DIMENSIONS"/> |
---|
53 | |
---|
54 | <xsl:param name="Page.showMap" select="ibis:Graphic.showMap( |
---|
55 | /QUERY_MODULE/REQUEST/MAP_NAME, |
---|
56 | /QUERY_MODULE/REQUEST/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME, |
---|
57 | /QUERY_MODULE/REQUEST/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME, |
---|
58 | $Page.dimensions |
---|
59 | )" |
---|
60 | /> |
---|
61 | <xsl:param name="Page.showChart" select="ibis:Graphic.showChart(/QUERY_MODULE/REQUEST/CHART_NAME)"/> |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> |
---|
66 | <xsl:template name="Page.specificHeadContent" |
---|
67 | ibis:doc="If no query result element present then this page needs to |
---|
68 | issue a query result request which the controller will then build |
---|
69 | the query URL, call the Query app, and return to this page again |
---|
70 | but with a result which this page will then display. This function |
---|
71 | used to be done with a confirmation page and separate controller but |
---|
72 | was combined 1/10/08." |
---|
73 | > |
---|
74 | <xsl:if test="not(exists(/QUERY_MODULE/IBISQ_QUERY_RESULT)) and not(exists(/QUERY_MODULE/REQUEST/ERROR))"> |
---|
75 | <meta http-equiv="refresh" content="0;URL={$Page.resultURL}"/> |
---|
76 | </xsl:if> |
---|
77 | |
---|
78 | <xsl:call-template name="Page.metaNoCacheControl"/> |
---|
79 | </xsl:template> |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | <xsl:template name="Page.contentBody" ibis:doc="Main interactive sections content template."> |
---|
84 | <xsl:param name="queryModule" select="/QUERY_MODULE"/> |
---|
85 | |
---|
86 | <xsl:param name="rowDimensionName" select="$queryModule/REQUEST/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME"/> |
---|
87 | <xsl:param name="colDimensionName" select="$queryModule/REQUEST/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME"/> |
---|
88 | <xsl:param name="otherDimensionName" select="$queryModule/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME"/> |
---|
89 | <xsl:param name="rowDimensionTitle" select="$queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/> |
---|
90 | <xsl:param name="colDimensionTitle" select="$queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/> |
---|
91 | <xsl:param name="otherDimensionTitle" select="$queryModule/DIMENSIONS/DIMENSION[NAME=$otherDimensionName]/TITLE"/> |
---|
92 | <xsl:param name="recordCount" select="count($queryModule/IBISQ_QUERY_RESULT/RECORDS/RECORD)"/> |
---|
93 | |
---|
94 | <xsl:param name="configuration" select="$queryModule/CONFIGURATIONS/CONFIGURATION[NAME=/QUERY_MODULE/REQUEST/CONFIGURATION_NAME]"/> |
---|
95 | |
---|
96 | <div class="ContentOptions"> |
---|
97 | <h3><xsl:value-of select="'Query Result Page Options'"/></h3> |
---|
98 | |
---|
99 | <button type="button" accesskey="B" id="modifyButton" |
---|
100 | title="Not seeing what you want? Click this to go to the query builder page." |
---|
101 | onclick="location.href='{$SiteSpecific.builderURL}'" |
---|
102 | > |
---|
103 | Modify Query |
---|
104 | <xsl:call-template name="Help.content"> |
---|
105 | <xsl:with-param name="help"> |
---|
106 | <TEXT> |
---|
107 | Takes you to the query definition or query builder |
---|
108 | page. This page allows you to change filtering |
---|
109 | criteria, how your data is grouped, and the selection |
---|
110 | of which chart and/or map to be used for the |
---|
111 | visualization. |
---|
112 | </TEXT> |
---|
113 | </xsl:with-param> |
---|
114 | </xsl:call-template> |
---|
115 | </button> |
---|
116 | |
---|
117 | <button type="button" accesskey="D" id="defaultQuery" title="Reloads the default query definition" |
---|
118 | onclick="location.href='{concat($ibis.contextPath, 'query/result/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html?Reload=x')}'" |
---|
119 | > |
---|
120 | Run Default Query |
---|
121 | <xsl:call-template name="Help.content"> |
---|
122 | <xsl:with-param name="help"> |
---|
123 | <TEXT> |
---|
124 | Resets your query definition to the default selections |
---|
125 | and settings and runs the query. |
---|
126 | </TEXT> |
---|
127 | </xsl:with-param> |
---|
128 | </xsl:call-template> |
---|
129 | </button> |
---|
130 | |
---|
131 | <button type="button" accesskey="M" id="selectQueryMeasure" title="Select a new query dataset measure" |
---|
132 | onclick="location.href='{concat($ibis.contextPath, /QUERY_MODULE/QUERY_CONFIGURATION_SELECTION/LOCAL_URL)}'" |
---|
133 | > |
---|
134 | Select Query Measure |
---|
135 | <xsl:call-template name="Help.content"> |
---|
136 | <xsl:with-param name="help"> |
---|
137 | <TEXT> |
---|
138 | Allows you to change the dataset measure to be queried. |
---|
139 | </TEXT> |
---|
140 | </xsl:with-param> |
---|
141 | </xsl:call-template> |
---|
142 | </button> |
---|
143 | |
---|
144 | <button type="button" accesskey="D" id="saveDefinition" |
---|
145 | title="Click this button to save the selections as a saved criteria definition" |
---|
146 | onclick="location.href='{concat($ibis.contextPath, 'query/definition/from/result')}'" |
---|
147 | > |
---|
148 | Save Query Definition |
---|
149 | <xsl:call-template name="Help.content"> |
---|
150 | <xsl:with-param name="help"> |
---|
151 | <TEXT> |
---|
152 | Allows you to save your current filtering criteria and |
---|
153 | display selections. These saved query definitions can |
---|
154 | then be ran later and can even be shared with others. |
---|
155 | |
---|
156 | NOTE: you will need to have either a free self registered |
---|
157 | user account or a secure DOH account to be able to save |
---|
158 | your definitions. |
---|
159 | </TEXT> |
---|
160 | </xsl:with-param> |
---|
161 | </xsl:call-template> |
---|
162 | </button> |
---|
163 | |
---|
164 | <button type="button" accesskey="D" id="loadDefinition" |
---|
165 | title="Click this button to access all query definitions" |
---|
166 | onclick="location.href='{concat($ibis.contextPath, 'query/definition/index/MyDefinitions.html')}'" |
---|
167 | > |
---|
168 | Load Query Definition |
---|
169 | <xsl:call-template name="Help.content"> |
---|
170 | <xsl:with-param name="help"> |
---|
171 | <TEXT> |
---|
172 | Takes you to a page that shows a list of all of your |
---|
173 | saved query defintions. You can then choose several |
---|
174 | options to run the definition, refine it, or delete it. |
---|
175 | |
---|
176 | NOTE: you will need to be logged in to be able to see |
---|
177 | your definitions. |
---|
178 | </TEXT> |
---|
179 | </xsl:with-param> |
---|
180 | </xsl:call-template> |
---|
181 | </button> |
---|
182 | </div> |
---|
183 | |
---|
184 | <xsl:call-template name="UserSelections.criteria"> |
---|
185 | <xsl:with-param name="queryModule" select="$queryModule"/> |
---|
186 | <xsl:with-param name="criteriaTitle" select="concat('Query Criteria for the ', $configuration/TITLE, ' Measure')"/> |
---|
187 | <xsl:with-param name="criteriaDescription" |
---|
188 | select="if(exists($configuration/DESCRIPTION)) |
---|
189 | then $configuration/DESCRIPTION |
---|
190 | else 'User query criteria includes filtering and how the data are grouped' |
---|
191 | " |
---|
192 | /> |
---|
193 | <xsl:with-param name="rowDimensionTitle" select="$rowDimensionTitle"/> |
---|
194 | <xsl:with-param name="colDimensionTitle" select="$colDimensionTitle"/> |
---|
195 | <xsl:with-param name="otherDimensionTitle" select="$otherDimensionTitle"/> |
---|
196 | </xsl:call-template> |
---|
197 | <br/> |
---|
198 | |
---|
199 | <xsl:choose> |
---|
200 | <xsl:when test="exists($queryModule/REQUEST/ERROR)"> |
---|
201 | <xsl:copy-of select="$Result.requestErrorMessageContent"/> |
---|
202 | </xsl:when> |
---|
203 | |
---|
204 | <xsl:when test="exists($queryModule/IBISQ_QUERY_RESULT/ERROR)"> |
---|
205 | <xsl:copy-of select="$Result.resultErrorMessageContent"/> |
---|
206 | </xsl:when> |
---|
207 | |
---|
208 | <xsl:when test="not(exists($queryModule/IBISQ_QUERY_RESULT))"> |
---|
209 | <xsl:copy-of select="$Result.pleaseWaitMessageContent"/> |
---|
210 | </xsl:when> |
---|
211 | |
---|
212 | <xsl:when test="$recordCount = 0"> |
---|
213 | <xsl:copy-of select="$Result.resultNoDataMessageContent"/> |
---|
214 | </xsl:when> |
---|
215 | |
---|
216 | <!-- If records, then display the data list table. --> |
---|
217 | <xsl:otherwise> |
---|
218 | <xsl:call-template name="Page.dataContent"> |
---|
219 | <xsl:with-param name="queryModule" select="$queryModule"/> |
---|
220 | </xsl:call-template> |
---|
221 | </xsl:otherwise> |
---|
222 | </xsl:choose> |
---|
223 | |
---|
224 | <h3>Query Date Time Stamp</h3> |
---|
225 | These data were queried on: <xsl:value-of select="$queryModule/REQUEST/FINISHED_DATE"/> |
---|
226 | <xsl:if test="boolean($queryModule/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE)"> |
---|
227 | <br/> |
---|
228 | The dataset was last updated on: <xsl:value-of select="$queryModule/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE"/> |
---|
229 | </xsl:if> |
---|
230 | <br/><br/> |
---|
231 | |
---|
232 | <a href="#" class="Top">Top</a> |
---|
233 | <br/><br/> |
---|
234 | </xsl:template> |
---|
235 | |
---|
236 | |
---|
237 | |
---|
238 | <xsl:template name="Page.dataContent" |
---|
239 | ibis:doc="Standard/basic map, chart, data table, and meta data. This |
---|
240 | allows sub result type pages to Override this standard data content |
---|
241 | with different content. |
---|
242 | " |
---|
243 | > |
---|
244 | <xsl:param name="queryModule" select="/QUERY_MODULE"/> |
---|
245 | <xsl:param name="configuration" select="$queryModule/CONFIGURATIONS/CONFIGURATION[NAME=$queryModule/REQUEST/CONFIGURATION_NAME]"/> |
---|
246 | <xsl:param name="request" select="$queryModule/REQUEST"/> |
---|
247 | <xsl:param name="dimensions" select="$queryModule/DIMENSIONS"/> |
---|
248 | |
---|
249 | <xsl:if test="$Page.showMap"> |
---|
250 | <xsl:call-template name="ContentContainer.expandable"> |
---|
251 | <xsl:with-param name="title" select="'Map'"/> |
---|
252 | <xsl:with-param name="content"> |
---|
253 | <xsl:call-template name="Graphic.mapContainer"> |
---|
254 | <xsl:with-param name="containerID" select="'map'"/> |
---|
255 | <xsl:with-param name="title" select="''"/> |
---|
256 | </xsl:call-template> |
---|
257 | <xsl:call-template name="ContentContainer.contentBlock"> |
---|
258 | <xsl:with-param name="content" select="MAP_NARRATIVE"/> |
---|
259 | <xsl:with-param name="contentBlockType" select="'fixed'" tunnel="yes"/> |
---|
260 | </xsl:call-template> |
---|
261 | </xsl:with-param> |
---|
262 | <xsl:with-param name="show" select="true()"/> |
---|
263 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
264 | <xsl:with-param name="description" select="'Choropleth/thematic map.'"/> |
---|
265 | </xsl:call-template> |
---|
266 | </xsl:if> |
---|
267 | |
---|
268 | <xsl:if test="$Page.showChart"> |
---|
269 | <xsl:call-template name="ContentContainer.expandable"> |
---|
270 | <xsl:with-param name="title" select="if('Line'=$request/CHART_NAME)then 'Trend' else 'Chart'"/> |
---|
271 | <xsl:with-param name="content"> |
---|
272 | <xsl:call-template name="Graphic.chartContainer"> |
---|
273 | <xsl:with-param name="containerID" select="'chart'"/> |
---|
274 | </xsl:call-template> |
---|
275 | <xsl:call-template name="ContentContainer.contentBlock"> |
---|
276 | <xsl:with-param name="content" select="CHART_NARRATIVE/text()"/> |
---|
277 | <xsl:with-param name="contentBlockType" select="'fixed'" tunnel="yes"/> |
---|
278 | </xsl:call-template> |
---|
279 | </xsl:with-param> |
---|
280 | <xsl:with-param name="show" select="true()"/> |
---|
281 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
282 | </xsl:call-template> |
---|
283 | </xsl:if> |
---|
284 | |
---|
285 | <!-- Data Table --> |
---|
286 | <xsl:variable name="valueAttributeNames" select="distinct-values($queryModule/IBISQ_QUERY_RESULT/RECORDS/RECORD/VALUE_ATTRIBUTE_NAME)"/> |
---|
287 | <xsl:call-template name="ContentContainer.expandable"> |
---|
288 | <xsl:with-param name="title" select="'Data Table'"/> |
---|
289 | <xsl:with-param name="content"> |
---|
290 | <div class="Graphic Grid ScrollableContainer"> |
---|
291 | <div id="grid"></div> |
---|
292 | <xsl:call-template name="Graphic.valueAttributeFootnote"> |
---|
293 | <xsl:with-param name="valueAttributeNames" select="$valueAttributeNames"/> |
---|
294 | <xsl:with-param name="valueAttributes" select="$Result.valueAttributes"/> |
---|
295 | </xsl:call-template> |
---|
296 | </div> |
---|
297 | </xsl:with-param> |
---|
298 | <xsl:with-param name="show" select="true()"/> |
---|
299 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
300 | </xsl:call-template> |
---|
301 | |
---|
302 | |
---|
303 | <xsl:call-template name="ContentContainer.expandable"> |
---|
304 | <xsl:with-param name="title" select="'Data Notes'"/> |
---|
305 | <xsl:with-param name="content"> |
---|
306 | |
---|
307 | <!-- Data Notes --> |
---|
308 | <xsl:call-template name="ContentContainer.contentBlockWithDelimitedTitleTextsNodesets"> |
---|
309 | <xsl:with-param name="title" select="'Data Notes'"/> |
---|
310 | <xsl:with-param name="titleAndTextsNodeset" select="$configuration/DATA_NOTES/DATA_NOTE"/> |
---|
311 | <xsl:with-param name="addWikiAttribute" select="true()"/> |
---|
312 | </xsl:call-template> |
---|
313 | |
---|
314 | <!-- Data Sources --> |
---|
315 | <xsl:call-template name="ContentContainer.contentBlock"> |
---|
316 | <xsl:with-param name="title" select="'Data Sources'"/> |
---|
317 | <xsl:with-param name="content"> |
---|
318 | GARTH TODO: |
---|
319 | <ul> |
---|
320 | <xsl:for-each select="$configuration/DATA_SOURCES/DATA_SOURCE"> |
---|
321 | <xsl:sort select="SORT_ODRER" order="ascending" data-type="number"/> |
---|
322 | <li><xsl:value-of select="TEXT"/></li> |
---|
323 | </xsl:for-each> |
---|
324 | </ul> |
---|
325 | </xsl:with-param> |
---|
326 | </xsl:call-template> |
---|
327 | |
---|
328 | <!-- Data Issues --> |
---|
329 | <xsl:call-template name="ContentContainer.contentBlockWithDelimitedTitleTextsNodesets"> |
---|
330 | <xsl:with-param name="title" select="'Data Issues'"/> |
---|
331 | <xsl:with-param name="titleAndTextsNodeset" select="$configuration/DATA_ISSUES/DATA_ISSUE"/> |
---|
332 | <xsl:with-param name="addWikiAttribute" select="true()"/> |
---|
333 | </xsl:call-template> |
---|
334 | |
---|
335 | <xsl:call-template name="ContentContainer.expandable"> |
---|
336 | <xsl:with-param name="title" select="'Data Definitions & Sources'"/> |
---|
337 | <xsl:with-param name="content" select="JUNK"> |
---|
338 | <!-- |
---|
339 | GARTH TODO: |
---|
340 | <xsl:call-template name="Indicator.definition"/> |
---|
341 | <xsl:call-template name="Indicator.howCalculated"/> |
---|
342 | <xsl:call-template name="Indicator.dataSources"/> |
---|
343 | --> |
---|
344 | </xsl:with-param> |
---|
345 | <xsl:with-param name="show" select="false()"/> |
---|
346 | <xsl:with-param name="description" select="'Metadata for this dataset.'"/> |
---|
347 | </xsl:call-template> |
---|
348 | |
---|
349 | </xsl:with-param> |
---|
350 | </xsl:call-template> |
---|
351 | |
---|
352 | <xsl:call-template name="Result.leafletKendoScript"> |
---|
353 | <xsl:with-param name="queryModule" select="$queryModule"/> |
---|
354 | <xsl:with-param name="configuration" select="$configuration"/> |
---|
355 | <xsl:with-param name="request" select="$request"/> |
---|
356 | <xsl:with-param name="showMap" select="$Page.showMap"/> |
---|
357 | <xsl:with-param name="showChart" select="$Page.showChart"/> |
---|
358 | <xsl:with-param name="showValueAttributeColumn" select="0 != count($valueAttributeNames)"/> |
---|
359 | </xsl:call-template> |
---|
360 | </xsl:template> |
---|
361 | |
---|
362 | </xsl:stylesheet> |
---|
363 | <!-- ============================= End of File ============================= --> |
---|