Changeset 24448 in main
- Timestamp:
- 01/10/22 21:49:48 (4 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ibisph-view/src/main/webapp/css/PleaseWait.css
r22244 r24448 12 12 border-bottom: 3px solid #114477; 13 13 font-size: 16px; 14 min-height: 48px; 14 15 background: transparent url("../image/processing.gif") no-repeat 5px 5px; 15 16 margin: 32px 0 0 3px; -
trunk/ibisph-view/src/main/webapp/xslt/html/DataViz.xslt
r23505 r24448 246 246 <xsl:param name="measure"/> 247 247 <xsl:param name="measureTitle" select="$measure/TITLE"/> 248 <xsl:param name="measure FormatPattern"/>248 <xsl:param name="measureValueType"/> 249 249 250 250 <xsl:param name="showMap" select="false()"/> … … 276 276 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 277 277 <xsl:with-param name="valueAttributes" select="$valueAttributes"/> 278 <xsl:with-param name="measure FormatPattern" select="$measureFormatPattern"/>278 <xsl:with-param name="measureValueType" select="$measureValueType"/> 279 279 </xsl:call-template> 280 280 ]; … … 283 283 ( 284 284 <xsl:call-template name="Kendo.dataSourceConstructorJSON"> 285 <xsl:with-param name="javascriptRecordArrayVariableName" select="$externalDataVizRecordsReference"/> 286 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 287 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 285 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="$externalDataVizRecordsReference"/> 286 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 287 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 288 <xsl:with-param name="measureValueType" select="$measureValueType"/> 288 289 </xsl:call-template> 289 290 ); … … 301 302 </xsl:call-template> 302 303 ,<xsl:call-template name="LeafletMap.choroplethJSON"> 303 <xsl:with-param name=" javascriptRecordArrayVariableName" select="$externalDataVizRecordsReference"/>304 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="$externalDataVizRecordsReference"/> 304 305 <xsl:with-param name="geoDimension" select="$dimensions/DIMENSION[NAME = $geoDimensionName]"/> 305 306 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 306 307 <xsl:with-param name="legendTitle" select="$measureTitle"/> 308 <!-- 309 <xsl:with-param name="kendoDataSource" select="concat($dataVizObjectName, '.kendoDataSource')"/> 310 311 <xsl:with-param name="legendMeasureFormatter"> 312 313 Can put the number formatter into the datasource which is NOT standard 314 or can inject it and have future expandability/options??? Though not likely 315 needed as it's only for choros 316 317 318 ,"getFormattedNumber": function(number, patternName) 319 { 320 var name = patternName ? patternName : "measure"; 321 var pattern = this.options.formatPattern[name]; 322 if(pattern) return(this.toString(number, pattern); 323 console.error('kendo .getFormattedValue no pattern match. number: " +number+ ", patternName: " +patternName+ ", lookup name: " +name); 324 return(number); 325 } 326 </xsl:with-param> 327 --> 307 328 <xsl:with-param name="reverseColors" select="$measure/DESIRABLE_VALUE = 'HIGH'"/> 308 329 <xsl:with-param name="desirableValue" select="$measure/DESIRABLE_VALUE"/> … … 356 377 </xsl:call-template> 357 378 ,<xsl:call-template name="Kendo.requestChartJSON"> 358 379 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="$externalDataVizKendoDataSourceReference"/> 359 380 <xsl:with-param name="title" select="$chartTitle"/> 360 381 <xsl:with-param name="seriesTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/TITLE"/> 361 382 <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/TITLE"/> 362 383 <xsl:with-param name="valueTitle" select="$measureTitle"/> 363 364 <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/RECORD_FIELD_NAME"/> 365 <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/RECORD_FIELD_NAME"/> 384 <xsl:with-param name="measureValueType" select="$measureValueType"/> 385 386 <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/NAME"/> 387 <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/NAME"/> 366 388 <xsl:with-param name="includeDatasetSeries" select="1 lt number($recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/DIMENSION_VALUES_COUNT)"/> 367 389 … … 369 391 370 392 <xsl:with-param name="baseExportFilename" select="$baseExportFilename"/> 393 371 394 </xsl:call-template> 372 395 ); … … 402 425 var series = { name: "Series Name", type: "scatter", xField: "Date", yField: "Amount", data: data }; 403 426 */ 404 405 $("#<xsl:value-of select="$gridContainerID"/> .k-grid-content tr[role='row']").on("mouseenter", function () { 406 var row = $("#grid").data("kendoGrid").dataItem(this); //get the data item attached to this row being hovered 407 var chart = $("#chart").data("kendoChart"); //get the chart 408 chart.toggleHighlight(true, function(point) { return point.dataItem.Id === row.Id; }); //highlight the point where the Ids match 409 chart.showTooltip(function(point) { return point.dataItem.Id === row.Id; }); //show the tooltip for the point where the Ids match 410 }); 411 412 $("#<xsl:value-of select="$gridContainerID"/> .k-grid-content tr[role='row']").on("mouseleave", function () { 413 var chart = $("#<xsl:value-of select="$chartContainerID"/>").data("kendoChart"); //get the chart 414 chart.toggleHighlight(false, "Series"); //remove all highlights for the Series the point is in 415 chart.hideTooltip("<xsl:value-of select="$hideToolTipName"/>"); //hide tooltips for all points in the Series the point is in 416 }); 417 418 var chart = $("#chart").data("kendoChart"); //get the chart 419 $("#grid tr[role='row']").on("mouseenter mouseover", function () { 420 var row = $("#grid").data("kendoGrid").dataItem(this); //get the data item attached to this row being hovered 421 chart.toggleHighlight(true, 422 function(point) 423 { 424 return point.dataItem.Id === row.rowID; 425 } 426 ); //highlight the point where the Ids match 427 chart.showTooltip( 428 function(point) 429 { 430 return point.dataItem.Id === row.Id; 431 } 432 ); //show the tooltip for the point where the Ids match 433 }); 427 var chart = $("#<xsl:value-of select="$chartContainerID"/>").data("kendoChart"); //get the chart 428 var grid = $("#<xsl:value-of select="$gridContainerID"/>").data("kendoGrid"); //get the Grid 429 // var gridRowElement = $("#<xsl:value-of select="$gridContainerID"/> tr[role='row']"); 430 431 // mouse over/on - highlight the chart's point and show tool tip 432 $("#<xsl:value-of select="$gridContainerID"/> .k-grid-content tr[role='row']").on("mouseenter mouseover", 433 function () 434 { 435 // get the data item attached to "this" row being hovered 436 var record = gridRow.dataItem(this); 437 438 // highlight the point where the Ids match 439 chart.toggleHighlight(true, 440 function(point) 441 { 442 return(point.dataItem.Id == record.Id); 443 } 444 ); 445 446 // show the tooltip for the point where the Ids match 447 chart.showTooltip( 448 function(point) 449 { 450 return(point.dataItem.Id == record.Id); 451 } 452 ); 453 } 454 ); 455 456 // mouse out/off - clear all chart point highlighting and hide all tool tips. 457 $("#<xsl:value-of select="$gridContainerID"/> .k-grid-content tr[role='row']").on("mouseleave", 458 function () 459 { 460 chart.toggleHighlight(false, "Series"); //remove all highlights for the Series the point is in 461 chart.hideTooltip("<xsl:value-of select="$hideToolTipName"/>"); //hide tooltips for all points in the Series the point is in 462 } 463 ); 434 464 435 465 </script> -
trunk/ibisph-view/src/main/webapp/xslt/json/IndicatorContentJavaScript.xslt
r23665 r24448 18 18 <summary>JSON structure for IP and IPV data fields based on request params</summary> 19 19 <description> 20 Provides access to IP/IPV data and script to plug in json data into HTML elements. 21 20 Provides access to IP/IPV data and data visuals via script inclusion 21 to plug in json data into HTML elements. 22 23 Dependencies: 24 jquery for extend and onload. 25 22 26 Params are the HTML elemenet ID. If param then json code created. 23 27 If no param then no json created. … … 117 121 <xsl:param name="Grid" ibis:doc="grid container element id"/> 118 122 119 <!-- handled via DataViz.xslt120 123 <xsl:param name="ChartName" ibis:doc="view's chart name override"/> 121 124 <xsl:param name="MapName" ibis:doc="view's map name override"/> 122 125 <xsl:param name="GridName" ibis:doc="view's grid name override"/> 123 --> 124 126 127 <xsl:param name="ObjectName" ibis:doc="main javascript name."/> 125 128 126 129 … … 168 171 <xsl:param name="measure" select="$measures/MEASURE[NAME=$indicatorView/MEASURE_NAME]"/> 169 172 <xsl:param name="measureTitle" select="ibis:getMeasureTitle($indicatorView/MEASURE_TITLE_OVERRIDE, $measure)"/> 170 <xsl:param name="measure FormatPattern" select="($valueTypes/VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/>173 <xsl:param name="measureValueType" select="($valueTypes/VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME])[1]"/> 171 174 172 175 … … 197 200 <xsl:with-param name="ancillaryValues" select="$ancillaryValues"/> 198 201 <xsl:with-param name="valueTypes" select="$valueTypes"/> 199 <xsl:with-param name="measure FormatPattern" select="$measureFormatPattern"/>202 <xsl:with-param name="measureValueType" select="$measureValueType"/> 200 203 </xsl:call-template> 201 204 </xsl:param> … … 209 212 <xsl:param name="geoDimensionName" select="$indicatorView/MAP_DIMENSION_NAME"/> 210 213 211 <xsl:param name="javascriptVariableName" select="concat(212 ibis:firstLetterLowerCase( replace($indicatorView/NAME, '\.', '_') ),213 'Content'214 )"/>215 216 217 214 <xsl:param name="completeIndicatorViewTitle" select="ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView, $dimensions)"/> 218 215 <xsl:param name="chartTitle" select="ibis:getIndicatorViewChartTitle($indicatorView, $completeIndicatorViewTitle)"/> 219 216 <xsl:param name="mapTitle" select="ibis:getIndicatorViewMapTitle($indicatorView, $completeIndicatorViewTitle)"/> 220 217 221 218 <xsl:param name="javascriptContentName" select=" 219 if(boolean($ObjectName)) then $ObjectName 220 else concat( 221 ibis:firstLetterLowerCase( replace($indicatorView/NAME, '\.', '_') ), 222 'Content' 223 )" 224 /> 222 225 223 226 … … 229 232 </xsl:fallback> 230 233 231 var <xsl:sequence select="$javascript VariableName"/> = function()234 var <xsl:sequence select="$javascriptContentName"/> = 232 235 { 233 var data = 234 { 235 "indicatorName": "<xsl:sequence select="$indicator/NAME"/>" 236 ,"indicatorViewURL": 237 [ 238 <!-- 239 "<xsl:sequence select="ibis:getCompleteURL($indicator/DEFAULT_INDICATOR_VIEW_NAME)"/>" 240 ,"<xsl:sequence select="ibis:getCompleteURL($indicator/INDICATOR_VIEWS/INDICATOR_VIEW/NAME)"/>" 241 --> 242 ] 243 ,"stringField": 244 [ 245 {"START": ""} 246 <xsl:call-template name="stringField"> 247 <xsl:with-param name="elementID" select="$Definition"/> 248 <xsl:with-param name="text" select="$indicator/DEFINITION"/> 236 "indicatorName": "<xsl:sequence select="$indicator/NAME"/>" 237 ,"indicatorView": 238 [ 239 <xsl:for-each select="$indicator/INDICATOR_VIEWS/INDICATOR_VIEW"> 240 <xsl:sort select="SORT_ORDER" data-type="number" order="ascending"/> 241 <xsl:sort select="NAME" data-type="text" order="ascending"/> 242 <xsl:if test="1 != position()">,</xsl:if> 243 {"<xsl:sequence select="NAME"/>": "<xsl:sequence select="TITLE"/>" } 244 </xsl:for-each> 245 ] 246 247 ,"textField": 248 [ 249 {"DUMMY": ""} 250 <xsl:call-template name="textField"> 251 <xsl:with-param name="elementID" select="$Definition"/> 252 <xsl:with-param name="text" select="$indicator/DEFINITION"/> 253 </xsl:call-template> 254 255 <xsl:call-template name="textField"> 256 <xsl:with-param name="elementID" select="$Numerator"/> 257 <xsl:with-param name="text" select="if(0 = string-length($indicatorView/NUMERATOR_OVERRIDE)) then $indicator/NUMERATOR else $indicatorView/NUMERATOR_OVERRIDE"/> 258 </xsl:call-template> 259 260 <xsl:call-template name="textField"> 261 <xsl:with-param name="elementID" select="$Denominator"/> 262 <xsl:with-param name="text" select="if(0 = string-length($indicatorView/DENOMINATOR_OVERRIDE)) then $indicator/DENOMINATOR else $indicatorView/DENOMINATOR_OVERRIDE"/> 263 </xsl:call-template> 264 265 <xsl:call-template name="textField"> 266 <xsl:with-param name="elementID" select="$RiskFactors"/> 267 <xsl:with-param name="text" select="$indicator/RELATIONS/RELATION[NAME='RiskFactors']/TEXT"/> 268 </xsl:call-template> 269 270 <xsl:call-template name="textField"> 271 <xsl:with-param name="elementID" select="$WhyImportant"/> 272 <xsl:with-param name="text" select="$indicator/WHY_IMPORTANT"/> 273 </xsl:call-template> 274 275 <xsl:call-template name="textField"> 276 <xsl:with-param name="elementID" select="$OtherObjectives"/> 277 <xsl:with-param name="text" select="$indicator/OTHER_OBJECTIVE_DESCRIPTION"/> 278 </xsl:call-template> 279 280 <xsl:call-template name="textField"> 281 <xsl:with-param name="elementID" select="$HowDoing"/> 282 <xsl:with-param name="text" select="$indicator/HOW_DOING"/> 283 </xsl:call-template> 284 285 <xsl:call-template name="textField"> 286 <xsl:with-param name="elementID" select="$HowCompare"/> 287 <xsl:with-param name="text" select="$indicator/STATE_VS_US"/> 288 </xsl:call-template> 289 290 <xsl:call-template name="textField"> 291 <xsl:with-param name="elementID" select="$WhatDoing"/> 292 <xsl:with-param name="text" select="$indicator/WHAT_DOING"/> 293 </xsl:call-template> 294 295 <xsl:call-template name="textField"> 296 <xsl:with-param name="elementID" select="$EvidenceBasedPractices"/> 297 <xsl:with-param name="text" select="$indicator/EVIDENCE_BASED_PRACTICES"/> 298 </xsl:call-template> 299 300 <xsl:call-template name="textField"> 301 <xsl:with-param name="elementID" select="$FootnoteReferences"/> 302 <xsl:with-param name="text" select="$indicator/FOOTNOTE_REFERENCES"/> 303 </xsl:call-template> 304 305 <xsl:call-template name="textField"> 306 <xsl:with-param name="elementID" select="$AvailableServices"/> 307 <xsl:with-param name="text" select="$indicator/SERVICES_AVAILABLE_TO_PUBLIC"/> 308 </xsl:call-template> 309 310 <xsl:call-template name="textField"> 311 <xsl:with-param name="elementID" select="$MoreResources"/> 312 <xsl:with-param name="text" select="$indicator/MORE_RESOURCES"/> 313 </xsl:call-template> 314 315 <xsl:call-template name="textField"> 316 <xsl:with-param name="elementID" select="$OtherInformation"/> 317 <xsl:with-param name="text" select="$indicator/OTHER_PROGRAM_INFORMATION"/> 318 </xsl:call-template> 319 320 <xsl:call-template name="textField"> 321 <xsl:with-param name="elementID" select="$MapNarrative"/> 322 <xsl:with-param name="text" select="$indicatorView/MAP_NARRATIVE"/> 323 </xsl:call-template> 324 <xsl:call-template name="textField"> 325 <xsl:with-param name="elementID" select="$ChartNarrative"/> 326 <xsl:with-param name="text" select="$indicatorView/CHART_NARRATIVE"/> 327 </xsl:call-template> 328 329 <xsl:call-template name="textField"> 330 <xsl:with-param name="elementID" select="$DataAsOfDate"/> 331 <xsl:with-param name="text" select="$indicator/DATA_AS_OF_DATE"/> 332 </xsl:call-template> 333 334 <xsl:call-template name="textField"> 335 <xsl:with-param name="elementID" select="$PublishedDate"/> 336 <xsl:with-param name="text" select="$indicator/PUBLISHED_DATE"/> 337 </xsl:call-template> 338 339 <xsl:call-template name="textField"> 340 <xsl:with-param name="elementID" select="$ModifiedDate"/> 341 <xsl:with-param name="text" select="$indicator/MODIFIED_DATE"/> 342 </xsl:call-template> 343 ] 344 345 <xsl:if test="boolean($showMap) or boolean($showChart) or boolean($showGrid)"> 346 ,datasetRecords: 347 [ 348 <xsl:call-template name="Dataset.datasetRecordsJSON"> 349 <xsl:with-param name="dimensions" select="$dimensions"/> 350 <xsl:with-param name="datasetRecords" select="$datasetRecords"/> 351 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 352 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 353 <xsl:with-param name="valueAttributes" select="$valueAttributes"/> 354 <xsl:with-param name="measureValueType" select="$measureValueType"/> 249 355 </xsl:call-template> 250 251 <xsl:call-template name="stringField"> 252 <xsl:with-param name="elementID" select="$Numerator"/> 253 <xsl:with-param name="text" select="if(0 = string-length($indicatorView/NUMERATOR_OVERRIDE)) then $indicator/NUMERATOR else $indicatorView/NUMERATOR_OVERRIDE"/> 356 ] 357 358 359 <!-- 360 this needs to be a variable to be consistent. 361 externalDataVizRecordsReference 362 datasetRecordsJSONJavascriptVariableName 363 datasetRecordsJSON 364 --> 365 ,"kendoDataSource": new kendo.data.DataSource 366 ( 367 <xsl:call-template name="Kendo.dataSourceConstructorJSON"> 368 <!-- 369 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="concat($javascriptContentName, '.datasetRecords')"/> 370 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="'this.datasetRecords'"/> 371 --> 372 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName"> 373 [ 374 <xsl:call-template name="Dataset.datasetRecordsJSON"> 375 <xsl:with-param name="dimensions" select="$dimensions"/> 376 <xsl:with-param name="datasetRecords" select="$datasetRecords"/> 377 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 378 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 379 <xsl:with-param name="valueAttributes" select="$valueAttributes"/> 380 <xsl:with-param name="measureValueType" select="$measureValueType"/> 254 381 </xsl:call-template> 255 256 <xsl:call-template name="stringField"> 257 <xsl:with-param name="elementID" select="$Denominator"/> 258 <xsl:with-param name="text" select="if(0 = string-length($indicatorView/DENOMINATOR_OVERRIDE)) then $indicator/DENOMINATOR else $indicatorView/DENOMINATOR_OVERRIDE"/> 259 </xsl:call-template> 260 261 <xsl:call-template name="stringField"> 262 <xsl:with-param name="elementID" select="$RiskFactors"/> 263 <xsl:with-param name="text" select="$indicator/RELATIONS/RELATION[NAME='RiskFactors']/TEXT"/> 264 </xsl:call-template> 265 266 <xsl:call-template name="stringField"> 267 <xsl:with-param name="elementID" select="$WhyImportant"/> 268 <xsl:with-param name="text" select="$indicator/WHY_IMPORTANT"/> 269 </xsl:call-template> 270 271 <xsl:call-template name="stringField"> 272 <xsl:with-param name="elementID" select="$OtherObjectives"/> 273 <xsl:with-param name="text" select="$indicator/OTHER_OBJECTIVE_DESCRIPTION"/> 274 </xsl:call-template> 275 276 <xsl:call-template name="stringField"> 277 <xsl:with-param name="elementID" select="$HowDoing"/> 278 <xsl:with-param name="text" select="$indicator/HOW_DOING"/> 279 </xsl:call-template> 280 281 <xsl:call-template name="stringField"> 282 <xsl:with-param name="elementID" select="$HowCompare"/> 283 <xsl:with-param name="text" select="$indicator/STATE_VS_US"/> 284 </xsl:call-template> 285 286 <xsl:call-template name="stringField"> 287 <xsl:with-param name="elementID" select="$WhatDoing"/> 288 <xsl:with-param name="text" select="$indicator/WHAT_DOING"/> 289 </xsl:call-template> 290 291 <xsl:call-template name="stringField"> 292 <xsl:with-param name="elementID" select="$EvidenceBasedPractices"/> 293 <xsl:with-param name="text" select="$indicator/EVIDENCE_BASED_PRACTICES"/> 294 </xsl:call-template> 295 296 <xsl:call-template name="stringField"> 297 <xsl:with-param name="elementID" select="$FootnoteReferences"/> 298 <xsl:with-param name="text" select="$indicator/FOOTNOTE_REFERENCES"/> 299 </xsl:call-template> 300 301 <xsl:call-template name="stringField"> 302 <xsl:with-param name="elementID" select="$AvailableServices"/> 303 <xsl:with-param name="text" select="$indicator/SERVICES_AVAILABLE_TO_PUBLIC"/> 304 </xsl:call-template> 305 306 <xsl:call-template name="stringField"> 307 <xsl:with-param name="elementID" select="$MoreResources"/> 308 <xsl:with-param name="text" select="$indicator/MORE_RESOURCES"/> 309 </xsl:call-template> 310 311 <xsl:call-template name="stringField"> 312 <xsl:with-param name="elementID" select="$OtherInformation"/> 313 <xsl:with-param name="text" select="$indicator/OTHER_PROGRAM_INFORMATION"/> 314 </xsl:call-template> 315 316 <xsl:call-template name="stringField"> 317 <xsl:with-param name="elementID" select="$MapNarrative"/> 318 <xsl:with-param name="text" select="$indicatorView/MAP_NARRATIVE"/> 319 </xsl:call-template> 320 <xsl:call-template name="stringField"> 321 <xsl:with-param name="elementID" select="$ChartNarrative"/> 322 <xsl:with-param name="text" select="$indicatorView/CHART_NARRATIVE"/> 323 </xsl:call-template> 324 325 <xsl:call-template name="stringField"> 326 <xsl:with-param name="elementID" select="$DataAsOfDate"/> 327 <xsl:with-param name="text" select="$indicator/DATA_AS_OF_DATE"/> 328 </xsl:call-template> 329 330 <xsl:call-template name="stringField"> 331 <xsl:with-param name="elementID" select="$PublishedDate"/> 332 <xsl:with-param name="text" select="$indicator/PUBLISHED_DATE"/> 333 </xsl:call-template> 334 335 <xsl:call-template name="stringField"> 336 <xsl:with-param name="elementID" select="$ModifiedDate"/> 337 <xsl:with-param name="text" select="$indicator/MODIFIED_DATE"/> 338 </xsl:call-template> 339 ] 340 341 342 <xsl:variable name="recordDimensionFields"> 343 <xsl:call-template name="Interactive.recordDimensionFields"> 344 <xsl:with-param name="dimensions" select="$dimensions"/> 345 <xsl:with-param name="dimensionUsages" select="$indicatorView/DIMENSION_USAGES"/> 346 </xsl:call-template> 347 </xsl:variable> 348 349 <xsl:if test="boolean($showMap) or boolean($showChart) or boolean($showGrid)"> 350 351 ,"datasetRecords" : [ 352 <xsl:call-template name="Dataset.datasetRecordsJSON"> 353 <xsl:with-param name="dimensions" select="$dimensions"/> 354 <xsl:with-param name="datasetRecords" select="$datasetRecords"/> 355 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 356 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 357 <xsl:with-param name="valueAttributes" select="$valueAttributes"/> 358 <xsl:with-param name="measureFormatPattern" select="$measureFormatPattern"/> 359 </xsl:call-template> 360 ] 361 </xsl:if> 362 363 <xsl:if test="boolean($showChart) or boolean($showGrid)"> 364 ,"kendoDataSourceOptions" : 365 <xsl:call-template name="Kendo.dataSourceConstructorJSON"> 366 <xsl:with-param name="javascriptRecordArrayVariableName" select="'this.datasetRecords'"/> 382 ] 383 </xsl:with-param> 384 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 385 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 386 <xsl:with-param name="measureValueType" select="$measureValueType"/> 387 </xsl:call-template> 388 ) 389 390 <xsl:if test="$showGrid"> 391 ,"kendoGridOptions": $.extend 392 ( 393 true, {} 394 ,<xsl:call-template name="Kendo.baseGridJSON"/> 395 ,<xsl:call-template name="Kendo.namedConfigurationJSON"> 396 <xsl:with-param name="configurationName" select="$indicatorView/GRID_NAME"/> 397 </xsl:call-template> 398 ,<xsl:call-template name="Kendo.requestGridJSON"> 399 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'this.kendoDataSource'"/> 400 <!-- not needed unless using KendoLeafletDataViz.getGridDataSourceViewItems 401 <xsl:with-param name="dataVizObjectName" select="$dataVizObjectName"/> 402 --> 403 <xsl:with-param name="measure" select="$measure"/> 404 <xsl:with-param name="measureTitle" select="$measureTitle"/> 367 405 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 368 406 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 369 </xsl:call-template> 407 <!-- 408 <xsl:with-param name="showValueAttributeColumn" select="$showValueAttributeColumn"/> 409 <xsl:with-param name="showLabelColumn" select="$showLabelColumn"/> 410 <xsl:with-param name="showNoteColumn" select="$showNoteColumn"/> 411 <xsl:with-param name="datasetRecordTotalValues" select="$datasetRecordTotalValues"/> 412 <xsl:with-param name="baseExportFilename" select="$baseExportFilename"/> 413 --> 414 </xsl:call-template> 415 ) 370 416 </xsl:if> 371 417 372 <xsl:if test="$show Grid">373 kendoGridOptions =$.extend418 <xsl:if test="$showChart"> 419 ,"kendoChartOptions": $.extend 374 420 ( 375 421 true, {} 376 ,<xsl:call-template name="Kendo.baseGridJSON"/>377 378 <xsl:with-param name="configurationName" select="$indicatorView/GRID_NAME"/>379 380 ,<xsl:call-template name="Kendo.requestGridJSON">381 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'this. datasetRecords'"/>382 <!-- not needed unless using KendoLeafletDataViz.getGridDataSourceViewItems383 <xsl:with-param name="dataVizObjectName" select="$dataVizObjectName"/>384 -->385 <xsl:with-param name="measure" select="$measure"/>386 <xsl:with-param name="measureTitle" select="$measureTitle"/>387 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 388 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/>389 <!-- 390 <xsl:with-param name="showValueAttributeColumn" select="$showValueAttributeColumn"/>391 <xsl:with-param name="showLabelColumn" select="$showLabelColumn"/> 392 <xsl:with-param name="showNoteColumn" select="$showNoteColumn"/>393 <xsl:with-param name="datasetRecordTotalValues" select="$datasetRecordTotalValues"/> 394 <xsl:with-param name="baseExportFilename" select="$baseExportFilename"/>395 --> 396 397 ) ;422 ,<xsl:call-template name="Kendo.baseChartJSON"/> 423 ,<xsl:call-template name="Kendo.namedConfigurationJSON"> 424 <xsl:with-param name="configurationName" select="$indicatorView/CHART_NAME"/> 425 </xsl:call-template> 426 ,<xsl:call-template name="Kendo.requestChartJSON"> 427 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'this.kendoDataSource'"/> 428 <xsl:with-param name="title" select="$chartTitle"/> 429 <xsl:with-param name="seriesTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/TITLE"/> 430 <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/TITLE"/> 431 <xsl:with-param name="valueTitle" select="$measureTitle"/> 432 <xsl:with-param name="measureValueType" select="$measureValueType"/> 433 434 <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/NAME"/> 435 <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/NAME"/> 436 <xsl:with-param name="includeDatasetSeries" select="1 lt number($recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/DIMENSION_VALUES_COUNT)"/> 437 438 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 439 <!-- 440 <xsl:with-param name="baseExportFilename" select="$baseExportFilename"/> 441 --> 442 </xsl:call-template> 443 ) 398 444 </xsl:if> 399 445 400 <xsl:if test=" $showChart">401 kendoChartOptions =$.extend446 <xsl:if test="boolean($showMap)"> 447 ,"leafletMapOptions": $.extend 402 448 ( 403 449 true, {} 404 ,<xsl:call-template name="Kendo.baseChartJSON"/> 405 ,<xsl:call-template name="Kendo.namedConfigurationJSON"> 406 <xsl:with-param name="configurationName" select="$indicatorView/CHART_NAME"/> 407 </xsl:call-template> 408 ,<xsl:call-template name="Kendo.requestChartJSON"> 409 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'this.datasetRecords'"/> 410 <xsl:with-param name="title" select="$chartTitle"/> 411 <xsl:with-param name="seriesTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/TITLE"/> 412 <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/TITLE"/> 413 <xsl:with-param name="valueTitle" select="$measureTitle"/> 414 415 <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/RECORD_FIELD_NAME"/> 416 <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/RECORD_FIELD_NAME"/> 417 <xsl:with-param name="includeDatasetSeries" select="1 lt number($recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/DIMENSION_VALUES_COUNT)"/> 418 419 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 420 <!-- 421 <xsl:with-param name="baseExportFilename" select="$baseExportFilename"/> 422 --> 423 </xsl:call-template> 424 ); 425 </xsl:if> 426 427 <xsl:if test="$showMap"> 428 ,"leafletMapOptions" : $.extend 429 ( 430 true, {} 431 ,<xsl:call-template name="LeafletMap.baseJSON"/> 432 ,<xsl:call-template name="LeafletMap.namedConfigurationJSON"> 433 <xsl:with-param name="configurationName" select="$indicatorView/MAP_NAME"/> 434 </xsl:call-template> 435 ,<xsl:call-template name="LeafletMap.requestJSON"> 436 <xsl:with-param name="mapType" select="'choropleth'"/> 437 </xsl:call-template> 438 ,<xsl:call-template name="LeafletMap.choroplethJSON"> 439 <xsl:with-param name="javascriptRecordArrayVariableName" select="'this.datasetRecords'"/> 440 <xsl:with-param name="geoDimension" select="$dimensions/DIMENSION[NAME = $geoDimensionName]"/> 441 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 442 <xsl:with-param name="legendTitle" select="$measureTitle"/> 443 <xsl:with-param name="reverseColors" select="$measure/DESIRABLE_VALUE = 'HIGH'"/> 444 <xsl:with-param name="desirableValue" select="$measure/DESIRABLE_VALUE"/> 445 <xsl:with-param name="betterWorseComparisonValue" select="NULL"/> 446 <xsl:with-param name="mapRecordDimensionFilters"> 447 <xsl:call-template name="Interactive.mapRecordDimensionFilters"> 448 <xsl:with-param name="geoDimensionName" select="$geoDimensionName"/> 449 <xsl:with-param name="dimensions" select="$dimensions"/> 450 <xsl:with-param name="dimensionUsages" select="$indicatorView/DIMENSION_USAGES"/> 451 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 452 </xsl:call-template> 453 </xsl:with-param> 454 </xsl:call-template> 455 ); 456 </xsl:if> 457 458 }; 459 460 <xsl:if test="$showMap"> 450 ,<xsl:call-template name="LeafletMap.baseJSON"/> 451 ,<xsl:call-template name="LeafletMap.namedConfigurationJSON"> 452 <xsl:with-param name="configurationName" select="$indicatorView/MAP_NAME"/> 453 </xsl:call-template> 454 ,<xsl:call-template name="LeafletMap.requestJSON"> 455 <xsl:with-param name="mapType" select="'choropleth'"/> 456 </xsl:call-template> 457 ,<xsl:call-template name="LeafletMap.choroplethJSON"> 458 <!-- 459 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="concat($javascriptContentName, '.datasetRecords')"/> 460 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="'this.datasetRecords'"/> 461 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="'this.kendoDataSource.options.data'"/> 462 --> 463 <xsl:with-param name="datasetRecordsJSONJavascriptVariableName" select="'this.datasetRecords'"/> 464 465 <xsl:with-param name="geoDimension" select="$dimensions/DIMENSION[NAME = $geoDimensionName]"/> 466 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 467 <xsl:with-param name="legendTitle" select="$measureTitle"/> 468 <xsl:with-param name="reverseColors" select="$measure/DESIRABLE_VALUE = 'HIGH'"/> 469 <xsl:with-param name="desirableValue" select="$measure/DESIRABLE_VALUE"/> 470 <xsl:with-param name="betterWorseComparisonValue" select="NULL"/> 471 <xsl:with-param name="mapRecordDimensionFilters"> 472 <xsl:call-template name="Interactive.mapRecordDimensionFilters"> 473 <xsl:with-param name="geoDimensionName" select="$geoDimensionName"/> 474 <xsl:with-param name="dimensions" select="$dimensions"/> 475 <xsl:with-param name="dimensionUsages" select="$indicatorView/DIMENSION_USAGES"/> 476 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 477 </xsl:call-template> 478 </xsl:with-param> 479 </xsl:call-template> 480 ) 481 </xsl:if> <!-- end of map --> 482 ,"kendoGrid": null 483 ,"kendoChart": null 484 ,"leafletMap": null 485 </xsl:if> <!-- if any dataviz --> 486 487 488 <!-- called by onload etc. --> 489 ,"init": function() 490 { 491 alert("init - before setting fields"); 492 for(var i=1; i < this.textField.length; i++) 493 { 494 for(var textFieldID in this.textField[i]) 495 { 496 console.log("key: " + textFieldID + ", value: " + this.textField[i][textFieldID]); 497 var destElement = document.getElementById(textFieldID); 498 if(null != destElement) destElement.textContent = this.textField[i][textFieldID]; 499 } 500 } 501 502 503 <xsl:if test="boolean($showChart) or boolean($showGrid)"> 504 this.kendoDataSource.read(); 461 505 </xsl:if> 462 506 507 508 509 <xsl:if test="boolean($showMap)"> 510 // console.error(this.kendoDataSource.options.data); 511 this.leafletMapOptions.layerSets.sets.choropleth.layers.<xsl:value-of select="$indicatorView/MAP_DIMENSION_NAME"/>.options.dataObject.data = this.kendoDataSource.data(); 512 // <xsl:sequence select="concat($javascriptContentName, '.datasetRecords')"/>; 513 //this.datasetRecords; 514 this.leafletMap = $("#<xsl:sequence select="$Map"/>").leaflet(this.leafletMapOptions); 515 </xsl:if> 516 463 517 <xsl:if test="$showChart"> 518 this.kendoChart = $("#<xsl:sequence select="$Chart"/>").kendoChart(this.kendoChartOptions).data("kendoChart"); 519 this.kendoChart.setDataSource(this.kendoDataSource); 520 // this.kendoChart.resize(); 521 522 $(window).resize(function () { 523 // this.kendoChart.resize(); 524 }); 464 525 </xsl:if> 465 526 466 527 <xsl:if test="$showGrid"> 528 this.kendoGrid = $("#<xsl:sequence select="$Grid"/>").kendoGrid(this.kendoGridOptions).data("kendoGrid"); 529 this.kendoGrid.setDataSource(this.kendoDataSource); 467 530 </xsl:if> 468 531 469 470 471 472 <!-- 473 if inline script function then need to register the init call... 474 if json data struct then 475 var <xsl:value-of select="$DataVizJavascriptName"/> = new KendoLeafletDataViz(); 476 <xsl:call-template name="DataViz.populateKendoLeafletDataVizObject"> 477 <xsl:with-param name="dataVizObjectName" select="$DataVizJavascriptName"/> 478 <xsl:with-param name="containerIDPrefix" select="$DataVizContainerIDPrefix"/> 479 480 <xsl:with-param name="dimensions" select="$dimensions"/> 481 <xsl:with-param name="dimensionUsages" select="$indicatorView/DIMENSION_USAGES"/> 482 <xsl:with-param name="datasetRecords" select="$indicatorViewDatasetRecords"/> 483 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 484 <xsl:with-param name="recordAncillaryValueFields"> 485 <xsl:call-template name="recordAncillaryValueFields"/> 486 </xsl:with-param> 487 <xsl:with-param name="valueAttributes" select="$ValueAttributes"/> 488 489 <xsl:with-param name="measure" select="$measure"/> 490 <xsl:with-param name="measureTitle" select="ibis:getMeasureTitle($indicatorView/MEASURE_TITLE_OVERRIDE, $measure)"/> 491 <xsl:with-param name="measureFormatPattern" select="$measureFormatPattern"/> 492 493 <xsl:with-param name="showMap" select="$showMap"/> 494 <xsl:with-param name="mapName" select="$indicatorView/MAP_NAME"/> 495 <xsl:with-param name="geoDimensionName" select="$indicatorView/MAP_DIMENSION_NAME"/> 496 497 <xsl:with-param name="showChart" select="$showChart"/> 498 <xsl:with-param name="chartName" select="$indicatorView/CHART_NAME"/> 499 <xsl:with-param name="chartTitle" select="ibis:getIndicatorViewChartTitle($indicatorView, $completeIndicatorViewTitle)"/> 500 501 <xsl:with-param name="showGrid" select="$showGrid"/> 502 <xsl:with-param name="showValueAttributeColumn" select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(VALUE_ATTRIBUTE_NAME)])"/> 503 <xsl:with-param name="showLabelColumn" select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/> 504 <xsl:with-param name="baseExportFilename" select="$completeIndicatorViewTitle"/> 505 </xsl:call-template> 506 507 <xsl:value-of select="$DataVizJavascriptName"/>.init(); 508 --> 509 510 <xsl:if test="$showChart"> 511 $(window).resize(function () { 512 <xsl:value-of select="DataVizJavascriptName"/>.resizeKendoChart(); 513 }); 514 </xsl:if> 515 516 517 518 519 520 521 alert("hi"); 522 $(document).ready( 523 function() 524 { 525 alert(data); 526 for(var i=1; i < data.stringField.length; i++) 527 { 528 for(var elementID in data.stringField[i]) 529 { 530 console.log("key: " + elementID + ", value: " + data.stringField[i][elementID]); 531 var destElement = document.getElementById(elementID); 532 if(null != destElement) destElement.textContent = data.stringField[i][elementID]; 533 } 534 } 535 } 532 <xsl:if test="boolean($showChart) or boolean($showGrid)"> 533 // "read" fires the "change" event of the dataSource and any objects 534 // that ref the data source will be bound. This needs to occur 535 // after the grid and chart are created because .autoBind = false. 536 // Can also fire load by issuing a sort: 537 // $kendoGrid.getKendoGrid().dataSource.sort({field: "CategorySortOrder", dir: "asc"}); 538 console.log("-----------datasetRecords: " + this.datasetRecords); 539 540 // this.kendoDataSource = new kendo.data.DataSource(this.kendoDataSourceOptions); 541 // this.kendoDataSource.data(this.datasetRecords); 542 // this.kendoDataSource.online(false); 543 // this.kendoDataSource.options.data = this.datasetRecords; 544 // this.kendoDataSource.fetch(); 545 this.kendoDataSource.read(); 546 // this.kendoDataSource.read(this.datasetRecords); 547 548 </xsl:if> 549 550 } /* End of init func */ 551 552 }; /* End of main object */ 553 554 555 <!-- non jquery onload mechanism: 556 window.addEventListener('load', (event) => { 557 <xsl:sequence select="$javascriptContentName"/>.init(); 558 }); 559 --> 560 561 //alert("before doc ready"); 562 //console.log(<xsl:sequence select="$javascriptContentName"/>); 563 564 $(document).ready( function() { 565 <xsl:sequence select="$javascriptContentName"/>.init(); 566 } 536 567 ); 537 568 </xsl:template> 538 569 539 570 540 <xsl:template name=" stringField">571 <xsl:template name="textField"> 541 572 <xsl:param name="elementID"/> 542 573 <xsl:param name="text"/> -
trunk/ibisph-view/src/main/webapp/xslt/json/Kendo.xslt
r23488 r24448 57 57 58 58 <xsl:param name="Kendo.missingValueReplacementValue" select="'null'"/> 59 <!-- the .## makes decimal places optional - if none then no dec - if up to 2 then you get 1 or 2. -->60 <xsl:param name="Kendo.defaultMeasureFormatPattern" select="',##0.##'"/>61 62 59 63 60 … … 90 87 " 91 88 > 92 <xsl:param name="javascriptRecordArrayVariableName" select="'records'" 93 ibis:doc="Name of the js variable that is the source/contains the 94 IPV or QM array record structs (built by the XSLT code). This 95 js var is passed into the Kendo constructor. 89 <xsl:param name="datasetRecordsJSONJavascriptVariableName" 90 ibis:doc="Actual dataset records JSON array or the name of the js 91 variable that points to a dataset record JSON array. 96 92 " 97 93 /> … … 99 95 <xsl:param name="recordDimensionFields" 100 96 ibis:doc="Data records dimensions struct of: RECORD_DIMENSION_FIELD/ 101 RECORD_FIELD_NAME, TITLE, DIMENSION_USAGE, DIMENSION_NAMES, and97 NAME, TITLE, DIMENSION_USAGE, DIMENSION_NAMES, and 102 98 DIMENSION_VALUES_COUNT elements. The DIMENSION_USAGE is a 103 generic value like series, category, constant. The RECORD_FIELD_NAME104 istypically the same value as usage but camel cased. It does99 generic value like series, category, constant. The NAME is 100 typically the same value as usage but camel cased. It does 105 101 not matter to the Kendo code - it just needs to match the JSON 106 102 data array (that was built by the XSLT). 107 103 108 Note that the RECORD_FIELD_NAME provides the base of other109 related field names. The record array includes the actual110 xxx name field, the xxx'Title', and the xxx'SortOrder' fields111 that were builtwhen creating the array.104 Note that the NAME provides the base of other related field 105 names. The record array includes the actual xxx name field, 106 the xxx'Title', and the xxx'SortOrder' fields that were built 107 when creating the array. 112 108 " 113 109 /> 114 110 <xsl:param name="recordAncillaryValueFields" 115 111 ibis:doc="Analogous to the dimension struct - but represents the data 116 array's measure field(s). The measure struct is of the form: 117 ANCILLARY_RECORD_VALUE_FIELD 112 array's other associated value field(s). The AV struct is of 113 the form: 114 RECORD_ANCILLARY_VALUE_FIELD 118 115 NAME - complete data array/datasource fieldname 119 116 TITLE 120 XSLT_FORMAT_PATTERN ~~ not used in this code 121 Note that the NAME element value is complete but also serve as the 122 base field name for the assoc formatted value xxxTitle fields etc. 123 The sub datasource fields are the dependent, related measure field 124 names like: numer, denom, LCL, UCL, label, and note fields. 117 XSLT_FORMAT_PATTERN 118 JAVASCRIPT_FORMAT_PATTERN 119 120 Note that the NAME element value serves as the base field name 121 for the assoc formatted value xxxTitle fields etc. 122 These AV fields are the dependent, related measure field names 123 like: numer, denom, LCL, UCL, label, and note fields. 125 124 " 126 125 /> 126 <xsl:param name="measureValueType"/> 127 127 128 128 <xsl:param name="kendoDatasourceSortOrderFieldNames" … … 136 136 " 137 137 /> 138 139 138 <xsl:text>{</xsl:text> 140 "data": <xsl:value-of select="$javascriptRecordArrayVariableName"/> 139 "data": <xsl:value-of select="$datasetRecordsJSONJavascriptVariableName"/> 140 141 <!-- GARTH TODO: 142 GeoStats = execute first thing on load before creating chart or map. 143 sets the datasource's PEER GROUP field 144 uses the determinent values to set each PEER GROUP's TITLE e.g. legend value 145 146 Need to have the map's classes used if map is specified because they likely 147 could have different groupings per map. NM only has HLS, (2) static Ranks 148 149 EPHT only has HLS and jenks 150 151 ,"PERCENTAGE-WORKS": ",##0.0'%'" 152 ,"Garth": "$###,##0" 153 --> 154 ,"formatPattern": 155 { 156 "measure": "<xsl:sequence select="$measureValueType/JAVASCRIPT_FORMAT_PATTERN"/>" 157 <xsl:for-each select="$recordAncillaryValueFields/RECORD_ANCILLARY_VALUE_FIELD"> 158 ,"<xsl:value-of select="NAME"/>": "<xsl:value-of select="JAVASCRIPT_FORMAT_PATTERN"/>" 159 </xsl:for-each> 160 } 161 <!-- probably should do this as a prototype on the data source option? 162 163 ,"getFormattedNumber": function(number, patternName) 164 { 165 var name = patternName ? patternName : "measure"; 166 var pattern = this.options.formatPattern[name]; 167 if(pattern) return(this.toString(number, pattern); 168 console.error('~~~~~~~~~kendo .getFormattedValue no pattern match. number: " +number+ ", patternName: " +patternName+ ", lookup name: " +name); 169 return(number); 170 } 171 --> 172 141 173 ,"schema": 142 174 { … … 148 180 "rowID": { type: "string", editable: false } 149 181 <xsl:for-each select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_VALUES_COUNT != 0]"> 150 ,"<xsl:value-of select=" RECORD_FIELD_NAME"/>": { type: "string" }151 ,"<xsl:value-of select=" RECORD_FIELD_NAME"/>Title": { type: "string" }152 ,"<xsl:value-of select=" RECORD_FIELD_NAME"/>SortOrder": { type: "number" }182 ,"<xsl:value-of select="NAME"/>": { type: "string" } 183 ,"<xsl:value-of select="NAME"/>Title": { type: "string" } 184 ,"<xsl:value-of select="NAME"/>SortOrder": { type: "number" } 153 185 </xsl:for-each> 154 186 ,"MeasureValue": { type: "number" } … … 168 200 ,"group": 169 201 [ 170 {field: "<xsl:value-of select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/ RECORD_FIELD_NAME"/>SortOrder"}202 {field: "<xsl:value-of select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='series']/NAME"/>SortOrder"} 171 203 ] 172 204 </xsl:if> 173 205 ,"sort": 174 206 [ 175 {"field": "<xsl:value-of select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/ RECORD_FIELD_NAME"/>SortOrder", dir: "asc"}<xsl:text/>207 {"field": "<xsl:value-of select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='category']/NAME"/>SortOrder", dir: "asc"}<xsl:text/> 176 208 <xsl:if test="0 != $recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='constant']/DIMENSION_VALUES_COUNT"> 177 ,{"field": "<xsl:value-of select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='constant']/ RECORD_FIELD_NAME"/>SortOrder", dir: "asc"}<xsl:text/>209 ,{"field": "<xsl:value-of select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_USAGE='constant']/NAME"/>SortOrder", dir: "asc"}<xsl:text/> 178 210 </xsl:if> 179 211 ]<xsl:text/> … … 214 246 <xsl:param name="recordDimensionFields" 215 247 ibis:doc="Data records JSON dimensions struct of: 216 RECORD_DIMENSION_FIELD/ RECORD_FIELD_NAME, TITLE, DIMENSION_NAMES, DIMENSION_VALUES_COUNT248 RECORD_DIMENSION_FIELD/NAME, TITLE, DIMENSION_NAMES, DIMENSION_VALUES_COUNT 217 249 elements with the NAME value typically being the IBIS-Q dimension 218 250 NAMEs or for IPs a generic value like SERIES, CATEGORY, CONSTANT. … … 244 276 <xsl:if test="1 lt number($seriesDimensionField/DIMENSION_VALUES_COUNT)"> 245 277 { 246 "field": "<xsl:value-of select="$seriesDimensionField/ RECORD_FIELD_NAME"/>SortOrder"278 "field": "<xsl:value-of select="$seriesDimensionField/NAME"/>SortOrder" 247 279 ,"title": "<xsl:value-of select="$seriesDimensionField/TITLE"/> Sort Order" 248 280 ,"groupHeaderTemplate": "#=items[0].SeriesTitle#" … … 250 282 } 251 283 ,{ 252 "field": "<xsl:value-of select="$seriesDimensionField/ RECORD_FIELD_NAME"/>Title"284 "field": "<xsl:value-of select="$seriesDimensionField/NAME"/>Title" 253 285 ,"title": "<xsl:value-of select="$seriesDimensionField/TITLE"/>" 254 286 ,"attributes": {"class": "SeriesColumn Dimension"} … … 261 293 </xsl:if> 262 294 { 263 "field": "<xsl:value-of select="$categoryDimensionField/ RECORD_FIELD_NAME"/>Title"295 "field": "<xsl:value-of select="$categoryDimensionField/NAME"/>Title" 264 296 ,"title": "<xsl:value-of select="$categoryDimensionField/TITLE"/>" 265 297 ,"attributes": {"class": "Dimension"} … … 268 300 }<xsl:text/> 269 301 ,{ 270 "field": "<xsl:value-of select="$categoryDimensionField/ RECORD_FIELD_NAME"/>SortOrder"302 "field": "<xsl:value-of select="$categoryDimensionField/NAME"/>SortOrder" 271 303 ,"title": "<xsl:value-of select="$categoryDimensionField/TITLE"/> Sort Order" 272 304 ,"groupHeaderTemplate": "#=items[0].CategoryTitle#" … … 276 308 <xsl:if test="1 lt number($constantDimensionField/DIMENSION_VALUES_COUNT)"> 277 309 ,{ 278 "field": "<xsl:value-of select="$constantDimensionField/ RECORD_FIELD_NAME"/>Title"310 "field": "<xsl:value-of select="$constantDimensionField/NAME"/>Title" 279 311 ,"title": "<xsl:value-of select="$constantDimensionField/TITLE"/>" 280 312 ,"attributes": {"class": "Dimension"} … … 284 316 ,{ 285 317 "field": "MeasureValueTitle" 286 ,"title": "<xsl:value-of select="$measureTitle"/>" 287 ,"template": "#=MeasureValueTitle#" 318 ,"title": "<xsl:sequence select="$measureTitle"/>" 288 319 ,"attributes": {"class": "Value"} 289 320 ,"sortable": … … 373 404 <xsl:param name="seriesTitle" ibis:doc="series legend title"/> 374 405 <xsl:param name="valueTitle" ibis:doc="y axis title"/> 406 <xsl:param name="measureValueType"/> 375 407 376 408 <xsl:param name="seriesFieldName"/> … … 392 424 <xsl:param name="baseExportFilename" select="'export'"/> 393 425 394 395 426 <!-- 396 427 Did have code to dynamically craft - too complex and error prone. 397 <xsl:when test="boolean($measure/XSLT_FORMAT_PATTERN)">#=kendo.toString(value, '<xsl:value-of select="$measure/XSLT_FORMAT_PATTERN"/>')#</xsl:when> 428 PLUS XSLT format pattern is not 100% with the kendo pattern... 429 Template must be used because axis ticks are dynamically, chart 430 script generated. 398 431 --> 399 432 <xsl:param name="valueAxisTemplate"> 400 433 <xsl:choose> 434 <xsl:when test="$measureValueType/JAVASCRIPT_FORMAT_PATTERN">#=kendo.toString(value, "<xsl:sequence select="$measureValueType/JAVASCRIPT_FORMAT_PATTERN"/>")#</xsl:when> 401 435 <xsl:when test="contains($valueTitle, 'Percent')">#=kendo.toString(value, '0.0')#%</xsl:when> 402 436 <xsl:when test="contains($valueTitle, 'Number') or contains($valueTitle, 'Count')" >#=kendo.toString(value, ',0')#</xsl:when> … … 462 496 { 463 497 <!-- 498 GARTH TODO: CHECK INTO THESE FORMAT PATTERNS??? Maybe we have a js format pattern instead of 499 JAVA_FP. Ticket keeps it generic so could be used with js international FP or kendo's. 464 500 //format: "XXX {0:n00}" //Custom Formatter like '00##' "<xsl:value-of select="$valueTitle"/>" 465 501 // template: kendo.template("Year: #: value #") //Custom Formatter like '00##' "<xsl:value-of select="$valueTitle"/>" -
trunk/ibisph-view/src/main/webapp/xslt/json/LeafletMap.xslt
r23342 r24448 92 92 93 93 <xsl:template name="LeafletMap.choroplethJSON"> 94 <xsl:param name="javascriptRecordArrayVariableName" select="'records'"/> 95 94 <xsl:param name="datasetRecordsJSONJavascriptVariableName"/> 96 95 <xsl:param name="geoDimension"/> 97 96 <xsl:param name="geoDimensionName" select="$geoDimension/NAME"/> 98 97 <xsl:param name="recordDimensionFields"/> 99 <xsl:param name="recordGeoIDFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $geoDimensionName]/ RECORD_FIELD_NAME"/>98 <xsl:param name="recordGeoIDFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $geoDimensionName]/NAME"/> 100 99 101 100 <xsl:param name="mapRecordDimensionFilters" select="NULL" … … 130 129 <xsl:param name="legendTitle" select="'Count'" ibis:doc="Legend's value title - typically the measure title"/> 131 130 131 <!-- GARTH TODO: maybe pass in a measureValueFormatter object 132 measureValueFormatter.toString(number); 133 Then could simply inject a function that uses the kendo.toString or kendo.number etc.??? 134 135 the format is only needed 136 --> 137 132 138 { // Start of Choropleth JSON 133 139 "choroplethControl": … … 136 142 { 137 143 "title": "<xsl:value-of select="$legendTitle"/>" 144 ,"measureFormatter": null 138 145 } 139 146 ,"reverseColors": <xsl:value-of select="$reverseColors"/> … … 168 175 ,"dataObject": 169 176 { 170 "data": <xsl:value-of select="$ javascriptRecordArrayVariableName"/>177 "data": <xsl:value-of select="$datasetRecordsJSONJavascriptVariableName"/> 171 178 ,"fieldName": 172 179 { -
trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/springsecurity/IndicatorAccessVoter.java
r24423 r24448 49 49 throw new IllegalArgumentException("Does not support the presented Object type"); 50 50 } 51 int result = ACCESS_DENIED;52 51 53 52 // Cast the generic object to a FilterInvocation object. Not sure the whys … … 67 66 // Now that we have the user details and a request object, get the 68 67 // indicator or view name from the path and test against the user's list. 69 // NOTE: Still need to test for admin type users if the affirmative based 70 // voter is used. Also, the test for null selected name is needed because 71 // the ind list page doesn't have an indicator name - AND if no names then 72 // they can't access it anyway. 68 // NOTES: Still need to test for admin type users if the affirmative based 69 // voter is used. Also, the test for no selected IP name is needed because 70 // the list pages don't have an indicator name on the request. This mainly 71 // happens upon login where the request is of the form indicator/list - sans 72 // any IP name. So need to test for that special use case and allow if the 73 // user has any IPs. 73 74 String requestedName = this.getRequestFilenameSansExtenstion(request); 74 75 if(allowedIndicatorsUserDetails.isAdmin()) { 75 re sult = ACCESS_GRANTED;76 return(ACCESS_GRANTED); 76 77 } 77 /*78 else if(!org.ibisph.util.StrLib.isSomething(requestedName)) {79 result = ACCESS_ABSTAIN;80 }81 */82 78 else if(allowedIndicatorsUserDetails.getAllowedIndicatorNameSet().contains(requestedName)) { 83 re sult = ACCESS_GRANTED;79 return(ACCESS_GRANTED); 84 80 } 85 81 else if("list".equals(requestedName) && (0 < allowedIndicatorsUserDetails.getAllowedIndicatorNameSet().size())) { 86 result = ACCESS_GRANTED; 87 } 88 else { 89 logger.error(".vote - User {} DOES NOT have access to Indicator {} ", allowedIndicatorsUserDetails.getFullName(), requestedName); 82 return(ACCESS_GRANTED); 90 83 } 91 84 92 return(result); 85 logger.error(".vote - User {} DOES NOT have access to Indicator {} ", allowedIndicatorsUserDetails.getFullName(), requestedName); 86 return(ACCESS_DENIED); 93 87 } //-------------------------- End of Method ------------------------------ 94 88
Note: See TracChangeset
for help on using the changeset viewer.