1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | <xsl:stylesheet version="3.0" |
---|
3 | xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" |
---|
4 | xmlns:ibis="http://www.ibisph.org" |
---|
5 | |
---|
6 | exclude-result-prefixes="ibis" |
---|
7 | > |
---|
8 | <ibis:doc> |
---|
9 | <name>html/query/result/Result</name> |
---|
10 | <summary>query result variables</summary> |
---|
11 | <description> |
---|
12 | Contains the query result variable definitions. |
---|
13 | </description> |
---|
14 | </ibis:doc> |
---|
15 | |
---|
16 | <!-- ~~~~~~~~~~~~~~~~~~~~~~~ PARAMS / VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~ --> |
---|
17 | <xsl:param name="Result.queryModule" select="/QUERY_MODULE" ibis:doc="query module with result."/> |
---|
18 | |
---|
19 | <xsl:param name="Result.useExternalXML" select="true()" |
---|
20 | ibis:doc="Controls where the supplemental XML data resides. If true then |
---|
21 | the XML to be referenced is an external XML file. If false then the |
---|
22 | XML resides within the IP XML file. For adopters that want 100% |
---|
23 | self contained IP XML set this to false. For database/centralized |
---|
24 | data referencing set to true. |
---|
25 | " |
---|
26 | /> |
---|
27 | <xsl:param name="AncillaryValues"/> |
---|
28 | <xsl:param name="Result.ancillaryValues" select="if($Result.useExternalXML) then $AncillaryValues/ANCILLARY_VALUES else $Result.queryModule/ANCILLARY_VALUES"/> |
---|
29 | <xsl:param name="DataSources"/> |
---|
30 | <xsl:param name="Result.dataSources" select="if($Result.useExternalXML) then $DataSources/DATA_SOURCES else $Result.queryModule/DATA_SOURCES"/> |
---|
31 | <xsl:param name="Dimensions"/> |
---|
32 | <xsl:param name="Result.dimensions" select="if($Result.useExternalXML) then $Dimensions/DIMENSIONS else $Result.queryModule/DIMENSIONS"/> |
---|
33 | <xsl:param name="Measures"/> |
---|
34 | <xsl:param name="Result.measure" select="if($Result.useExternalXML) then $Measures/MEASURES/MEASURE[NAME=$Result.queryModule/CONFIGURATIONS/CONFIGURATION/MEASURE_NAME] else $Result.queryModule/MEASURES/MEASURE[NAME=$Result.queryModule/CONFIGURATIONS/CONFIGURATION/MEASURE_NAME]"/> |
---|
35 | <xsl:param name="ValueTypes"/> |
---|
36 | <xsl:param name="Result.valueTypes" select="if($Result.useExternalXML) then $ValueTypes/VALUE_TYPES else $Result.queryModule/VALUE_TYPES"/> |
---|
37 | <xsl:param name="ValueAttributes"/> |
---|
38 | <xsl:param name="Result.valueAttributes" select="if($Result.useExternalXML) then $ValueAttributes/VALUE_ATTRIBUTES else $Result.queryModule/VALUE_ATTRIBUTES"/> |
---|
39 | |
---|
40 | <!-- CLEAN UP ONCE DETERMINE USAGE |
---|
41 | <xsl:param name="Page.dimensions" select="$Page.queryModule/DIMENSIONS"/> |
---|
42 | |
---|
43 | <xsl:param name="Page.queryAncillaryValueNames" select="$Page.configuration/ANCILLARY_VALUE_NAMES/ANCILLARY_VALUE_NAME"/> |
---|
44 | <xsl:param name="Page.ancillaryValues" select="$Result.ancillaryValues/ANCILLARY_VALUE[(NAME = $Page.queryAncillaryValueNames) and (ACTIVE_FLAG = 'x')]"/> |
---|
45 | |
---|
46 | <xsl:param name="Page.queryValueTypeNames" select="$measure/VALUE_TYPE_NAME union $Result.ancillaryValues/VALUE_TYPE_NAME"/> |
---|
47 | <xsl:param name="Page.valueTypes" select="$ValueTypes//VALUE_TYPE[NAME = $Page.queryValueTypeNames]"/> |
---|
48 | |
---|
49 | <xsl:param name="Page.valueAttributes" select="$ValueAttributes/VALUE_ATTRIBUTES"/> |
---|
50 | <xsl:param name="Page.valueAttributes" select="$Page.valueAttributes/VALUE_ATTRIBUITES/VALUE_ATTRIBUITE[NAME = 'x']"/> |
---|
51 | |
---|
52 | <xsl:param name="Page.queryAncillaryValueNames" select="$Page.configuration/ANCILLARY_VALUE_NAMES/ANCILLARY_VALUE_NAME"/> |
---|
53 | <xsl:param name="Page.ancillaryValues" select="$Result.ancillaryValues/ANCILLARY_VALUE[(NAME = $Page.queryAncillaryValueNames) and (ACTIVE_FLAG = 'x')]"/> |
---|
54 | |
---|
55 | <xsl:param name="Page.queryValueTypeNames" select="$measure/VALUE_TYPE_NAME union $Result.ancillaryValues/VALUE_TYPE_NAME"/> |
---|
56 | |
---|
57 | <xsl:param name="Page.valueAttributes" select="$ValueAttributes/VALUE_ATTRIBUTES"/> |
---|
58 | <xsl:param name="Page.valueAttributes" select="$Page.valueAttributes/VALUE_ATTRIBUITES/VALUE_ATTRIBUITE[NAME = 'x']"/> |
---|
59 | --> |
---|
60 | |
---|
61 | <!-- GARTH TODO: this needs to be made easier????? --> |
---|
62 | <xsl:param name="Result.comparisonDimensionName" select="'GeoState'"/> |
---|
63 | <xsl:param name="Result.comparisonDimensionValue" select="'35'"/> |
---|
64 | |
---|
65 | |
---|
66 | <xsl:param name="ShowDimensionValues" select="''" |
---|
67 | ibis:doc="if t, y, or x then shows the dim value in a column for sorting." |
---|
68 | /> |
---|
69 | <xsl:param name="Result.showDimensionValueColumn" select="ibis:isFirstLetter_T_or_Y_or_X($ShowDimensionValues)"/> |
---|
70 | |
---|
71 | |
---|
72 | <!-- value which contains the character that represents an IBISQ total value or an all value. --> |
---|
73 | <xsl:param name="Result.ibisqAllValue" select="'.'" |
---|
74 | ibis:doc="Provides a variable to localize the IBISQ total value |
---|
75 | which is typically the '.' character." |
---|
76 | /> |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | <xsl:param name="Result.supressedCellsMessage" |
---|
81 | ibis:doc="Text message to be displayed when cell supression value found. |
---|
82 | This is implemented as a global var for site specific override. This |
---|
83 | message text also depends on a template that uses it. If an adopter |
---|
84 | needs better format control then they will override the data table |
---|
85 | footnote template which will likely not reference this parameter value. |
---|
86 | GARTH TODO: Remove this stuff... |
---|
87 | " |
---|
88 | > |
---|
89 | <xsl:variable name="countEndsWithStar" select="count(/QUERY_MODULE/IBISQ_QUERY_RESULT/RECORDS/RECORD/MEASURE[ends-with(VALUE, '*')])"/> |
---|
90 | <xsl:variable name="countEndsWithStarStar" select="count(/QUERY_MODULE/IBISQ_QUERY_RESULT/RECORDS/RECORD/MEASURE[ends-with(VALUE, '**')])"/> |
---|
91 | <xsl:if test="($countEndsWithStar != 0) and ($countEndsWithStar != $countEndsWithStarStar)"> |
---|
92 | *Use caution in interpreting, the estimate has a relative standard |
---|
93 | error greater than 30% and does not meet UDOH standards for reliability. |
---|
94 | Consider aggregating years to decrease the relative standard error and |
---|
95 | improve the reliability of the estimate. |
---|
96 | </xsl:if> |
---|
97 | |
---|
98 | <!-- tried adding this inside both with br and whitespace and ignored. |
---|
99 | --> |
---|
100 | <xsl:if test="$countEndsWithStarStar != 0"> |
---|
101 | <xsl:if test="$countEndsWithStar != $countEndsWithStarStar"><br/><br/></xsl:if> |
---|
102 | **The estimate has been suppressed because 1) The relative standard error |
---|
103 | is greater than 50% or when the relative standard error can't be determined. |
---|
104 | Consider aggregating years to decrease the relative standard error and improve |
---|
105 | the reliability of the estimate. 2) the observed number |
---|
106 | of events is very small and not appropriate for publication, or 3) it could be |
---|
107 | used to calculate the number in a cell that has been suppressed. |
---|
108 | </xsl:if> |
---|
109 | </xsl:param> |
---|
110 | |
---|
111 | <xsl:param name="Result.requestErrorMessageContent"> |
---|
112 | <div class="Error"> |
---|
113 | <h2>Error: <xsl:value-of select="/QUERY_MODULE/REQUEST/ERROR/TITLE"/></h2> |
---|
114 | |
---|
115 | There is a problem getting the specified query data from the |
---|
116 | database. This error could be a temporary issue either with |
---|
117 | the servers or the network. Please wait a few minutes and try |
---|
118 | your query again. If the problem persists, please report this |
---|
119 | problem to us (<a href="{$ibis.contextPath}about/ContactInformation.html">contact information</a>). |
---|
120 | The nature of the problem is shown below and will be helpful |
---|
121 | when reporting the problem. We apologize for any inconveniences |
---|
122 | and appreciate your patience and help. |
---|
123 | |
---|
124 | <div class="Note" style="margin-top: 1em;" title="{/QUERY_MODULE/REQUEST/ERROR/TITLE}"> |
---|
125 | <h3>Error Details:</h3> |
---|
126 | <xsl:value-of select="/QUERY_MODULE/REQUEST/ERROR/DESCRIPTION"/> |
---|
127 | </div> |
---|
128 | </div><br/> |
---|
129 | </xsl:param> |
---|
130 | |
---|
131 | <xsl:param name="Result.resultErrorMessageContent"> |
---|
132 | <div class="Error"> |
---|
133 | <h2>SAS/CGI System Error:</h2> |
---|
134 | There is a problem getting the specified query data from the |
---|
135 | database. Please report this problem to us (<a href="{$ibis.contextPath}about/ContactInformation.html">contact information</a>). |
---|
136 | The nature of the problem is shown below and will be helpful |
---|
137 | when reporting the problem. We apologize for any inconveniences |
---|
138 | and appreciate your patience and help. |
---|
139 | <br/><br/> |
---|
140 | |
---|
141 | <div class="Note" title="{/QUERY_MODULE/REQUEST/ERROR/TITLE}"> |
---|
142 | <h3>More Error Detail:</h3> |
---|
143 | <xsl:value-of select="/QUERY_MODULE/REQUEST/ERROR"/> |
---|
144 | </div> |
---|
145 | </div><br/> |
---|
146 | </xsl:param> |
---|
147 | |
---|
148 | <xsl:param name="Result.pleaseWaitMessageContent"> |
---|
149 | <div class="PleaseWait"> |
---|
150 | <h2>Please wait. Processing query.</h2> |
---|
151 | The system is processing your data request. Your browser should |
---|
152 | be actively trying to load a page. This is typically indicated by |
---|
153 | your browser showing something spinning the browser tab. If this |
---|
154 | is not the case click on this <a href="{$Page.resultURL}" title="Resubmit query">get |
---|
155 | query results</a> link. Otherwise be patient as your data will be |
---|
156 | displayed as soon as they are available. |
---|
157 | </div><br/> |
---|
158 | </xsl:param> |
---|
159 | |
---|
160 | <xsl:param name="Result.resultNoDataMessageContent"> |
---|
161 | <div class="Note"> |
---|
162 | <h2>Sorry, no data were returned for your query.</h2> |
---|
163 | The filtering criteria was too specific or no data exists in |
---|
164 | the dataset. If you feel that your query should have worked, |
---|
165 | please contact us and let us know about the problem. Otherwise, |
---|
166 | please go back and modify your query using less specific |
---|
167 | filtering criteria. |
---|
168 | </div><br/> |
---|
169 | </xsl:param> |
---|
170 | |
---|
171 | |
---|
172 | |
---|
173 | <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> |
---|
174 | |
---|
175 | <xsl:template name="Result.dataTableValuesFootnote" |
---|
176 | ibis:doc="Text message to be displayed when cell supression value found. |
---|
177 | This template is implemented to interact with a parameter so that the |
---|
178 | message can be inject. See the template below if you need to have |
---|
179 | fine grained control over formatting and putting in html links etc. |
---|
180 | " |
---|
181 | > |
---|
182 | <xsl:if test="string-length($Result.supressedCellsMessage) != 0"> |
---|
183 | <xsl:call-template name="ContentContainer.fixed"> |
---|
184 | <xsl:with-param name="content" select="$Result.supressedCellsMessage"/> |
---|
185 | <xsl:with-param name="additionalClasses" select="'SupressedCellMessage'"/> |
---|
186 | <xsl:with-param name="addWikiAttribute" select="false()"/> |
---|
187 | </xsl:call-template> |
---|
188 | </xsl:if> |
---|
189 | </xsl:template> |
---|
190 | |
---|
191 | |
---|
192 | <xsl:template name="Result.dataTableValuesFootnote-AnotherVersion" |
---|
193 | ibis:doc="template with ability to control text better..." |
---|
194 | > |
---|
195 | <xsl:if test="exists(//RECORDS/RECORD/MEASURE[ends-with(VALUE, '*')])"> |
---|
196 | <div class="SupressedCellMessage"> |
---|
197 | * Use caution in interpreting, the estimate has a relative standard |
---|
198 | error greater than 30% and does not meet UDOH standards for reliability. |
---|
199 | Consider aggregating years to decrease the relative standard error and |
---|
200 | improve the reliability of the estimate. |
---|
201 | <br/><br/> |
---|
202 | |
---|
203 | <xsl:if test="exists(//RECORDS/RECORD/MEASURE[VALUE = '**'])"> |
---|
204 | ** The estimate has been suppressed because 1) The relative standard error |
---|
205 | is greater than 50% or when the relative standard error can't be determined. |
---|
206 | Consider aggregating years to decrease the relative standard error and improve |
---|
207 | the reliability of the estimate. 2) the observed number of events is very small |
---|
208 | and not appropriate for publication, or 3) it could be used to calculate the |
---|
209 | number in a cell that has been suppressed. |
---|
210 | </xsl:if> |
---|
211 | </div> |
---|
212 | </xsl:if> |
---|
213 | </xsl:template> |
---|
214 | |
---|
215 | |
---|
216 | |
---|
217 | <xsl:template name="Result.leafletKendoScript" ibis:doc="Provides the kendo and leaflet javascript."> |
---|
218 | <xsl:param name="queryModule"/> |
---|
219 | <xsl:param name="configuration"/> |
---|
220 | <xsl:param name="request"/> |
---|
221 | <xsl:param name="showMap"/> |
---|
222 | <xsl:param name="showChart"/> |
---|
223 | <xsl:param name="showValueAttributeColumn" select="false()"/> |
---|
224 | |
---|
225 | <xsl:param name="measure" select="$Result.measure"/> |
---|
226 | <xsl:param name="datasetRecords" select="$queryModule/IBISQ_QUERY_RESULT/RECORDS"/> |
---|
227 | |
---|
228 | <xsl:param name="ancillaryValueNames" select="$configuration/ANCILLARY_VALUE_USAGES/ANCILLARY_VALUE_USAGE/NAME"/> |
---|
229 | <xsl:param name="ancillaryValues" select="$Result.ancillaryValues/ANCILLARY_VALUE[(NAME = $ancillaryValueNames) and (ACTIVE_FLAG = 'x')]"/> |
---|
230 | |
---|
231 | <xsl:param name="dimensions" select="$Result.dimensions"/> |
---|
232 | |
---|
233 | <xsl:param name="measureValueFormatPattern" select="($Result.valueTypes/VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/> |
---|
234 | |
---|
235 | <xsl:message select="'------------garth'"/> |
---|
236 | <xsl:message select="$measure"/> |
---|
237 | <xsl:variable name="dimensionUsages" |
---|
238 | ibis:doc="Builds a dim usages struct like: |
---|
239 | DIMENSION_USAGES |
---|
240 | DIMENSION_USAGE |
---|
241 | USAGE category |
---|
242 | NAME Year |
---|
243 | VALUES |
---|
244 | VALUE 2012 |
---|
245 | VALUE 2011 |
---|
246 | VALUE 2010 |
---|
247 | ... |
---|
248 | DIMENSION_USAGE |
---|
249 | ... |
---|
250 | " |
---|
251 | > |
---|
252 | <xsl:call-template name="getDimensionUsage"> |
---|
253 | <xsl:with-param name="datasetRecords" select="$datasetRecords"/> |
---|
254 | <xsl:with-param name="usage" select="'category'"/> |
---|
255 | <xsl:with-param name="dimensionName" select="$request/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME"/> |
---|
256 | </xsl:call-template> |
---|
257 | <xsl:call-template name="getDimensionUsage"> |
---|
258 | <xsl:with-param name="datasetRecords" select="$datasetRecords"/> |
---|
259 | <xsl:with-param name="usage" select="'series'"/> |
---|
260 | <xsl:with-param name="dimensionName" select="$request/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME"/> |
---|
261 | </xsl:call-template> |
---|
262 | <xsl:call-template name="getDimensionUsage"> |
---|
263 | <xsl:with-param name="datasetRecords" select="$datasetRecords"/> |
---|
264 | <xsl:with-param name="usage" select="'constant'"/> |
---|
265 | <xsl:with-param name="dimensionName" select="$request/ACTUAL_GROUP_BY/CONSTANT_DIMENSION_NAME"/> |
---|
266 | </xsl:call-template> |
---|
267 | </xsl:variable> |
---|
268 | |
---|
269 | <xsl:variable name="recordDimensionFields"> |
---|
270 | <xsl:call-template name="Interactive.getRecordDimensionFields"> |
---|
271 | <xsl:with-param name="dimensions" select="$dimensions"/> |
---|
272 | <xsl:with-param name="dimensionUsages" select="$dimensionUsages"/> |
---|
273 | </xsl:call-template> |
---|
274 | </xsl:variable> |
---|
275 | |
---|
276 | <xsl:variable name="recordAncillaryValueFields"> |
---|
277 | <xsl:call-template name="Interactive.getQueryRecordAncillaryValueFields"> |
---|
278 | <xsl:with-param name="ancillaryValueUsage" select="$configuration/ANCILLARY_VALUE_USAGES"/> |
---|
279 | <xsl:with-param name="ancillaryValues" select="$Result.ancillaryValues"/> |
---|
280 | <xsl:with-param name="valueTypes" select="$Result.valueTypes"/> |
---|
281 | <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> |
---|
282 | </xsl:call-template> |
---|
283 | </xsl:variable> |
---|
284 | |
---|
285 | <!-- tried doing jsonp tech but callback func must be defined before doing the script jsonp |
---|
286 | so you'd have the variable = null, call back, end of script, include jsonp, then contructor |
---|
287 | script. Very messy - decided just to do simple var and include it. |
---|
288 | --> |
---|
289 | <xsl:if test="$showMap"> |
---|
290 | <xsl:call-template name="Graphic.choroplethMapJavaScript"/> |
---|
291 | </xsl:if> |
---|
292 | <script type="text/javascript" src="{$ibis.contextPath}js/jszip.js"/> |
---|
293 | <script type="text/javascript"> |
---|
294 | var records = |
---|
295 | [<xsl:text> </xsl:text> |
---|
296 | <xsl:call-template name="Dataset.getDatasetRecordsJSON"> |
---|
297 | <xsl:with-param name="dimensions" select="$dimensions"/> |
---|
298 | <xsl:with-param name="datasetRecords" select="$datasetRecords"/> |
---|
299 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
300 | <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> |
---|
301 | <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> |
---|
302 | </xsl:call-template> |
---|
303 | ]; |
---|
304 | |
---|
305 | var kendoDataSource = new kendo.data.DataSource( |
---|
306 | <xsl:call-template name="Kendo.dataSourceConstructorJSON"> |
---|
307 | <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/> |
---|
308 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
309 | <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> |
---|
310 | </xsl:call-template> |
---|
311 | ); |
---|
312 | |
---|
313 | <xsl:variable name="recordDimensionCount" select="count($recordDimensionFields/RECORD_DIMENSION_FIELD[VALUE_COUNT != 0])"/> |
---|
314 | <xsl:variable name="grandTotalDatasetRecord" select="$datasetRecords//RECORD[$recordDimensionCount = count(DIMENSIONS/DIMENSION[VALUE/text() = $Result.ibisqAllValue])]"/> |
---|
315 | var kendoGridConstructorJSON = $.extend |
---|
316 | (true, {} |
---|
317 | ,<xsl:call-template name="Kendo.baseGridJSON"/> |
---|
318 | ,<xsl:call-template name="Kendo.namedConfigurationJSON"> |
---|
319 | <xsl:with-param name="configurationName" select="'IndicatorProfileGrid'"/> |
---|
320 | </xsl:call-template> |
---|
321 | ,<xsl:call-template name="Kendo.requestGridJSON"> |
---|
322 | <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/> |
---|
323 | <xsl:with-param name="measure" select="$measure"/> |
---|
324 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
325 | <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> |
---|
326 | <xsl:with-param name="footerValues"> |
---|
327 | <VALUE><xsl:value-of select="ibis:getFormattedNumber($grandTotalDatasetRecord/MEASURE/VALUE, $measureValueFormatPattern)"/></VALUE> |
---|
328 | <xsl:for-each select="$recordAncillaryValueFields/RECORD_ANCILLARY_VALUE_FIELD"> |
---|
329 | <VALUE><xsl:value-of select="ibis:getFormattedNumber($grandTotalDatasetRecord/ANCILLARY_VALUES/ANCILLARY_VALUE[NAME = current()/NAME]/VALUE, current()/XSLT_FORMAT_PATTERN)"/></VALUE> |
---|
330 | </xsl:for-each> |
---|
331 | </xsl:with-param> |
---|
332 | <xsl:with-param name="showValueAttributeColumn" select="$showValueAttributeColumn"/> |
---|
333 | <xsl:with-param name="showNoteColumn" select="false()"/> |
---|
334 | <xsl:with-param name="showLabelColumn" select="false()"/> |
---|
335 | </xsl:call-template> |
---|
336 | ); |
---|
337 | |
---|
338 | <xsl:if test="$showMap"> |
---|
339 | var leafletMapConstructorJSON = $.extend |
---|
340 | (true, {} |
---|
341 | ,<xsl:call-template name="LeafletMap.baseJSON"/> |
---|
342 | ,<xsl:call-template name="LeafletMap.namedConfigurationJSON"> |
---|
343 | <xsl:with-param name="configurationName" select="$configuration/MAP_NAME"/> |
---|
344 | </xsl:call-template> |
---|
345 | ,<xsl:call-template name="LeafletMap.requestJSON"> |
---|
346 | <xsl:with-param name="mapType" select="'choropleth'"/> |
---|
347 | </xsl:call-template> |
---|
348 | |
---|
349 | ,<xsl:call-template name="LeafletMap.choroplethJSON"> |
---|
350 | <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/> |
---|
351 | <xsl:with-param name="geoJSONName" select="$request/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME"/> |
---|
352 | |
---|
353 | <xsl:with-param name="geoIDFieldName" select="'Category'"/> |
---|
354 | <xsl:with-param name="geoIDFieldValuePrefixToRemove" select="concat($request/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME, '.')"/> |
---|
355 | <xsl:with-param name="legendTitle" select="$measure/TITLE"/> |
---|
356 | <xsl:with-param name="geoTypeTitle" select="ibis:getDimensionTitle($queryModule//DIMENSIONS/DIMENSION[NAME = $configuration/MAP_DIMENSION_NAME])"/> |
---|
357 | <xsl:with-param name="reverseColors" select="$measure/DESIRABLE_VALUE = 'HIGH'"/> |
---|
358 | <xsl:with-param name="desirableValue" select="$measure/DESIRABLE_VALUE"/> |
---|
359 | <xsl:with-param name="comparisonValue" select="$datasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Result.comparisonDimensionName) and (VALUE = $Result.comparisonDimensionValue)]]]/MEASURE/VALUE"/> |
---|
360 | </xsl:call-template> |
---|
361 | ); |
---|
362 | </xsl:if> |
---|
363 | |
---|
364 | <xsl:if test="$showChart"> |
---|
365 | var kendoChartConstructorJSON = $.extend |
---|
366 | (true, {} |
---|
367 | ,<xsl:call-template name="Kendo.baseChartJSON"/> |
---|
368 | ,<xsl:call-template name="Kendo.namedConfigurationJSON"> |
---|
369 | <xsl:with-param name="configurationName" select="$request/CHART_NAME"/> |
---|
370 | </xsl:call-template> |
---|
371 | ,<xsl:call-template name="Kendo.requestChartJSON"> |
---|
372 | <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/> |
---|
373 | <xsl:with-param name="seriesTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/TITLE"/> |
---|
374 | <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/TITLE"/> |
---|
375 | <xsl:with-param name="valueTitle" select="$measure/TITLE"/> |
---|
376 | |
---|
377 | <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/NAME"/> |
---|
378 | <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/NAME"/> |
---|
379 | |
---|
380 | <xsl:with-param name="includeDatasetSeries" select="1 < $recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/VALUE_COUNT"/> |
---|
381 | <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> |
---|
382 | </xsl:call-template> |
---|
383 | ); |
---|
384 | |
---|
385 | $(window).resize(resizeKendoChart); |
---|
386 | </xsl:if> |
---|
387 | |
---|
388 | |
---|
389 | var $kendoGrid; |
---|
390 | var $kendoChart; |
---|
391 | var $leafletMap; |
---|
392 | $(document).ready(function() |
---|
393 | { |
---|
394 | <xsl:if test="$showMap"> |
---|
395 | $leafletMap = $("#map").leaflet(leafletMapConstructorJSON); |
---|
396 | </xsl:if> |
---|
397 | <xsl:if test="$showChart"> |
---|
398 | $kendoChart = $("#chart").kendoChart(kendoChartConstructorJSON); |
---|
399 | </xsl:if> |
---|
400 | $kendoGrid = $("#grid").kendoGrid (kendoGridConstructorJSON); |
---|
401 | |
---|
402 | // "read" fires the "change" event of the dataSource and any objects |
---|
403 | // that ref the data source will be bound. This needs to occur |
---|
404 | // after the grid and chart are created because .autoBind = false. |
---|
405 | // Can also fire load by issuing a sort: |
---|
406 | // $kendoGrid.getKendoGrid().dataSource.sort({field: "CategorySortOrder", dir: "asc"}); |
---|
407 | kendoDataSource.read(); |
---|
408 | }); //~~~~~~~~~~~~~~~~~~~~ End of Ready Function ~~~~~~~~~~~~~~~~~~~ |
---|
409 | |
---|
410 | |
---|
411 | // Called via the chart's expandable content input element's onchange |
---|
412 | // firing this code. Also bound to the windonws resize event to |
---|
413 | // properly resize the chart to fit the container. |
---|
414 | function resizeKendoChart() |
---|
415 | { |
---|
416 | $kendoChart.getKendoChart().resize(); |
---|
417 | } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~ |
---|
418 | |
---|
419 | var baseExportFilename = "<xsl:value-of select="$configuration/TITLE"/>"; |
---|
420 | function exportGrid() |
---|
421 | { |
---|
422 | var grid = $("#grid").getKendoGrid(); |
---|
423 | grid.options.excel.fileName = baseExportFilename + " - data.xlsx"; |
---|
424 | grid.saveAsExcel(); |
---|
425 | } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~ |
---|
426 | function exportChart() |
---|
427 | { |
---|
428 | var chart = $("#chart").getKendoChart(); |
---|
429 | |
---|
430 | <!-- |
---|
431 | chart.exportImage().done |
---|
432 | ( |
---|
433 | function(data) |
---|
434 | { |
---|
435 | kendo.saveAs |
---|
436 | ({ |
---|
437 | dataURI: data |
---|
438 | ,fileName: baseExportFilename + ".png" |
---|
439 | }); |
---|
440 | } |
---|
441 | ); |
---|
442 | |
---|
443 | /* doesn't work |
---|
444 | chart.saveAsPDF(); |
---|
445 | chart.exportPDF().done( function(data) { kendo.saveAs(); } ); |
---|
446 | dataURI: "data:text/plain,Report title and text", |
---|
447 | */ |
---|
448 | --> |
---|
449 | chart.exportPDF().done |
---|
450 | ( |
---|
451 | function(data) |
---|
452 | { |
---|
453 | kendo.saveAs |
---|
454 | ({ |
---|
455 | dataURI: data |
---|
456 | ,fileName: baseExportFilename + " - chart.pdf" |
---|
457 | }); |
---|
458 | } |
---|
459 | ); |
---|
460 | } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~ |
---|
461 | |
---|
462 | function exportMap() |
---|
463 | { |
---|
464 | alert("Map export is not current supported."); |
---|
465 | } //~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~ |
---|
466 | </script> |
---|
467 | </xsl:template> |
---|
468 | |
---|
469 | |
---|
470 | <xsl:template name="getDimensionUsage"> |
---|
471 | <xsl:param name="datasetRecords"/> |
---|
472 | <xsl:param name="usage"/> |
---|
473 | <xsl:param name="dimensionName"/> |
---|
474 | |
---|
475 | <xsl:if test="0 != string-length($dimensionName)"> |
---|
476 | <DIMENSION_USAGE> |
---|
477 | <USAGE><xsl:value-of select="$usage"/></USAGE> |
---|
478 | <NAME><xsl:value-of select="$dimensionName"/></NAME> |
---|
479 | <VALUES> |
---|
480 | <xsl:for-each select="distinct-values($datasetRecords/RECORD/DIMENSIONS/DIMENSION[NAME = $dimensionName]/VALUE/text()[1])"> |
---|
481 | <VALUE><xsl:value-of select="."/></VALUE> |
---|
482 | </xsl:for-each> |
---|
483 | </VALUES> |
---|
484 | </DIMENSION_USAGE> |
---|
485 | </xsl:if> |
---|
486 | </xsl:template> |
---|
487 | |
---|
488 | </xsl:stylesheet> |
---|
489 | <!-- ============================= End of File ============================= --> |
---|
490 | <!-- |
---|
491 | |
---|
492 | <xsl:message select="$datasetRecords"/> |
---|
493 | |
---|
494 | <xsl:message select="concat('~~~~~~~~~~~~~~~~~~~~Page.leafletKendoScript - Records count: ', count($datasetRecords/*), ', recordDimensionFields: ', count($recordDimensionFields/*))"/> |
---|
495 | <xsl:message select="$recordDimensionFields"/> |
---|
496 | |
---|
497 | <xsl:message select="'============= start of IV Interactive.'"/> |
---|
498 | <xsl:message select="$recordDimensionFields"/> |
---|
499 | <xsl:message select="'============= end of IV Interactive.'"/> |
---|
500 | |
---|
501 | <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/> |
---|
502 | <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/> |
---|
503 | <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/> |
---|
504 | <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]])"/> |
---|
505 | <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/> |
---|
506 | <xsl:message select="concat('Interactive - Show Map: ', $Interactive.showMap, ', geoDimensionName:', $geoDimensionName)"/> |
---|
507 | |
---|
508 | <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/> |
---|
509 | <xsl:message select="$Page.comparisonDimensionName"/> |
---|
510 | <xsl:message select="$Page.comparisonDimensionValue"/> |
---|
511 | <xsl:message select="$indicatorViewInteractive./RECORD"/> |
---|
512 | |
---|
513 | <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/> |
---|
514 | <xsl:message select="$indicatorView/MAP_DIMENSION_NAME"/> |
---|
515 | <xsl:message select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/> |
---|
516 | |
---|
517 | --> |
---|