Changeset 17416 in main
- Timestamp:
- 11/03/18 23:42:16 (4 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 8 deleted
- 26 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/ibisph-view/src/main/webapp/WEB-INF/config/spring/common.xml
r17155 r17416 226 226 227 227 228 <!-- X M L M O D E L M A P S --> 229 <!-- document bean versions - load once at startup versions --> 228 <!-- S T A T I C / C A C H E D X M L M O D E L M A P S --> 229 <!-- The ModelFromFilePathAndNameService has an option to cache and clear 230 the cache XML docs. As of 11/1/2018 the caching is not set. At some 231 future point this caching can be set to true. This should only be done 232 once a data admin publish request is implemented that clears the cached 233 XML doc object e.g. reloads it. 234 235 Currently, because there is not a reload the cache when published mechanism, 236 this implmentation is not efficienet. Previous versions used the XLST 237 file/document. It is now coded to use java to load the doc for each req 238 simply so that the future configurations and XSLT does not have to be 239 reworked. 240 --> 230 241 <bean id="commonAncillaryValuesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService"> 231 <description>Document version of the published dimensions XML.</description>242 <description>Document version of the published AncillaryValues XML.</description> 232 243 <property name="modelMapKey" value="AncillaryValues"/> 233 244 <property name="getModelService" ref="commonDocumentDAOService"/> … … 235 246 </bean> 236 247 <bean id="commonDataSourcesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService"> 237 <description>Document version of the published dimensions XML.</description>248 <description>Document version of the published DataSources XML.</description> 238 249 <property name="modelMapKey" value="DataSources"/> 239 250 <property name="getModelService" ref="commonDocumentDAOService"/> … … 241 252 </bean> 242 253 <bean id="commonDimensionsModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService"> 243 <description>Document version of the published dimensions XML.</description>254 <description>Document version of the published Dimensions XML.</description> 244 255 <property name="modelMapKey" value="Dimensions"/> 245 256 <property name="getModelService" ref="commonDocumentDAOService"/> … … 247 258 </bean> 248 259 <bean id="commonMeasuresModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService"> 249 <description>Document version of the published dimensions XML.</description>260 <description>Document version of the published Measures XML.</description> 250 261 <property name="modelMapKey" value="Measures"/> 251 262 <property name="getModelService" ref="commonDocumentDAOService"/> … … 253 264 </bean> 254 265 <bean id="commonValueTypesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService"> 255 <description>Document version of the published dimensions XML.</description>266 <description>Document version of the published ValueTypes XML.</description> 256 267 <property name="modelMapKey" value="ValueTypes"/> 257 268 <property name="getModelService" ref="commonDocumentDAOService"/> … … 259 270 </bean> 260 271 <bean id="commonValueAttributesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService"> 261 <description>Document version of the published dimensions XML.</description>272 <description>Document version of the published ValueAttributes XML.</description> 262 273 <property name="modelMapKey" value="ValueAttributes"/> 263 274 <property name="getModelService" ref="commonDocumentDAOService"/> … … 274 285 <property name="filePathAndName" value="org_units.xml"/> 275 286 </bean> 276 277 <!-- file path bean versions - load each request with XSLT opening/processing.278 <bean id="commonAncillaryValuesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService">279 <description>Document version of the published dimensions XML.</description>280 <property name="modelMapKey" value="AncillaryValues"/>281 <property name="getModelService" ref="commonXMLFilePathModelService"/>282 <property name="filePathAndName" value="ancillary_vales.xml"/>283 </bean>284 <bean id="commonDataSourcesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService">285 <description>Document version of the published dimensions XML.</description>286 <property name="modelMapKey" value="DataSources"/>287 <property name="getModelService" ref="commonXMLFilePathModelService"/>288 <property name="filePathAndName" value="data_sources.xml"/>289 </bean>290 <bean id="commonDimensionsModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService">291 <description>Document version of the published dimensions XML.</description>292 <property name="modelMapKey" value="Dimensions"/>293 <property name="getModelService" ref="commonXMLFilePathModelService"/>294 <property name="filePathAndName" value="dimensions.xml"/>295 </bean>296 <bean id="commonMeasuresModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService">297 <description>Document version of the published dimensions XML.</description>298 <property name="modelMapKey" value="Measures"/>299 <property name="getModelService" ref="commonXMLFilePathModelService"/>300 <property name="filePathAndName" value="measures.xml"/>301 </bean>302 <bean id="commonValueTypesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService">303 <description>Document version of the published dimensions XML.</description>304 <property name="modelMapKey" value="ValueTypes"/>305 <property name="getModelService" ref="commonXMLFilePathModelService"/>306 <property name="filePathAndName" value="value_types.xml"/>307 </bean>308 <bean id="commonValueAttributesModelMap" class="org.ibisph.modelmap.ModelFromFilePathAndNameService">309 <description>Document version of the published dimensions XML.</description>310 <property name="modelMapKey" value="ValueAttributes"/>311 <property name="getModelService" ref="commonXMLFilePathModelService"/>312 <property name="filePathAndName" value="value_attributes.xml"/>313 </bean>314 <bean class="org.ibisph.modelmap.ModelFromFilePathAndNameService">315 <description>316 File name and path are passed. The XSLT then must use317 the document() function to load the XML for each and318 every request. Pro of doing this is that a publishing319 event listener is not needed.320 </description>321 <property name="modelMapKey" value="OrgUnitsXMLFilePathAndName"/>322 <property name="getModelService" ref="commonXMLFilePathModelService"/>323 <property name="filePathAndName" value="org_units.xml"/>324 </bean>325 -->326 327 287 328 288 … … 391 351 Injected into the main Page.xslt. 392 352 </description> 393 <property name="modelMapKey" value=" Page.baseContentFilePath"/>353 <property name="modelMapKey" value="BaseContentFilePath"/> 394 354 <property name="model" ref="commonBaseContentPathURL"/> 395 355 </bean> 396 356 397 357 <ref bean="commonOrgUnitsAttributesModelMap"/> 398 399 <!--FILE PATH VERSION:400 <bean class="org.ibisph.modelmap.ModelFromFilePathAndNameService">401 <description>402 File name and path are passed. The XSLT then must use403 the document() function to load the XML for each and404 every request. Pro of doing this is that a publishing405 event listener is not needed.406 </description>407 <property name="modelMapKey" value="OrgUnitsXMLFilePathAndName"/>408 <property name="getModelService" ref="commonXMLFilePathModelService"/>409 <property name="filePathAndName" value="org_units.xml"/>410 </bean>411 -->412 358 413 359 <bean id="commonUserProfileModelMap" class="org.ibisph.user.modelmap.CurrentUserDocument"> -
trunk/ibisph-view/src/main/webapp/WEB-INF/config/spring/community.xml
r17182 r17416 14 14 15 15 <!-- M O D E L S / C O N T R O L L E R R E S O R U C E S --> 16 16 <bean id="communityControlFilePath" class="org.ibisph.model.StringHolder"> 17 17 <constructor-arg value="community"/> 18 18 </bean> -
trunk/ibisph-view/src/main/webapp/WEB-INF/config/spring/security-pre_authenticated.xml
r4508 r17416 6 6 7 7 NOTE: These definitions are specific supplemental Preauth authentication beans. 8 To use the web.xml must include this file as well as the security.xml's filters8 To use, the web.xml must include this file as well as the security.xml's filters 9 9 and managers. As a side note preauth/siteminder should NOT deal with HTTPS. 10 10 This was done because by definition Siteminder is a front end proxy which … … 39 39 <entry key="email" value="garth"/> 40 40 41 <entry key="roles" value="admin^ucrtract^ephtp_bll"/> 41 <entry key="authorities" value="admin^ucrtract^ephtp_bll"/> 42 43 <entry key="admin" value="admin"/> 42 44 <!-- NON Admin Users Test Entries 43 <entry key="admin" value="admin"/>44 45 <entry key="admin" value-ref="securityAuthority.Admin"/> 46 45 47 <entry key="fullname" value="All Mighty"/> 46 48 <entry key="email" value="administrator@ibisph.org"/> -
trunk/ibisph-view/src/main/webapp/WEB-INF/jsp/access_denied.jsp
r12822 r17416 16 16 html 17 17 { 18 background-image: none; 19 } 20 body 21 { 22 width: 700px; 18 background: #ccc; 23 19 } 24 20 25 21 #page 26 22 { 27 padding: 12px 8px 12px 8px; 28 border: 1px solid #cccccc; 23 padding: 1rem; 29 24 } 30 25 26 #content 27 { 28 width: 80%; 29 min-width: 500px; 30 } 31 31 #mainTitle 32 32 { 33 background-color: white; 34 margin-left: 15px; 33 background-color: #003366; 34 color: white; 35 padding: 8px 0 5px 15px; 35 36 } 36 37 div.Note … … 112 113 </div> 113 114 </div> 114 <img src="${pageContext.request.contextPath} image/stop.png" class="Stop"/>115 <img src="${pageContext.request.contextPath}/image/stop.png" class="Stop"/> 115 116 </div> 116 117 -
trunk/ibisph-view/src/main/webapp/css/_community.css
r17021 r17416 67 67 } 68 68 69 .ComparisonContainer > li img 69 .ComparisonContainer .GaugeContainer 70 { 71 padding-left: 1em; 72 } 73 .ComparisonContainer .GaugeContainer h4 74 { 75 font-weight: bold; 76 } 77 .ComparisonContainer .GaugeContainer img 70 78 { 71 79 max-width: 100%; 72 80 min-width: inherit; 81 display: block; 73 82 } 74 83 -
trunk/ibisph-view/src/main/webapp/xslt/html/Graphic.xslt
r17415 r17416 10 10 11 11 <ibis:doc> 12 <name>html/ LeafletMap</name>13 <summary>Templates that create the appropriate HTML code for Leaflet maps</summary>12 <name>html/Graphic</name> 13 <summary>Templates that create the appropriate HTML code for Kendo objects and Leaflet maps</summary> 14 14 <description> 15 15 Provides templates that creates the title, height, and chart URL then … … 26 26 " 27 27 /> 28 29 <xsl:param name="LeafletMap.noneName" select="'None'" ibis:doc="NoMap map name."/> 30 <xsl:param name="LeafletMap.emptyConfigurationName" select="'_empty'" ibis:doc="name to be used for JSON file when no config name"/> 31 32 <xsl:param name="LeafletMap.jsonFilePath" select="concat($Page.baseContentFilePath, 'json/leaflet/')"/> 33 34 <xsl:param name="LeafletMap.ajaxGeoJSONMapLayersFilePath" select="'view/json/geo/'" 35 ibis:doc="Path injected into the ajax call to get map layer geojson files." 36 /> 37 <xsl:param name="LeafletMap.geoJSONIDPropertyName" select="'GeoID'" 38 ibis:doc="Geo ID field name (property name in geojson) for the Choro area 39 that is associated/corresponds to the data's geo dimension value. 40 " 41 /> 42 43 <xsl:param name="LeafletMap.nonMapableMessageContent" ibis:doc="text shown when map is 2d or 3d."> 28 <xsl:param name="ChartName" ibis:doc="Optional user selected and injected param."/> 29 <xsl:param name="GridName" ibis:doc="Optional user selected and injected param."/> 30 31 32 <xsl:param name="Graphic.noneName" select="'None'" ibis:doc="No Chart chart name."/> 33 34 <xsl:param name="xxxxxxxxxxxxxxxxxxxLeafletMap.nonMapableMessageContent" ibis:doc="text shown when map is 2d or 3d."> 44 35 <h3>Map Not Available</h3> 45 36 The data are grouped by 2 or more dimensions. Maps can only be displayed … … 50 41 51 42 52 <xsl:function name="ibis:LeafletMap.getMapName" as="xs:string" 43 <xsl:param name="Graphic.nonChartableMessageContent" ibis:doc="text shown when chart is 3d and not chartable."> 44 <h3>Chart Not Available</h3> 45 The data are grouped by more dimensions than the chart is capable of displaying. 46 If you would like this chart you will need to remove one or more grouping 47 selections on the query definition builder page and then resubmit the 48 query request or choose a different chart that supports multiple dimensions. 49 </xsl:param> 50 <xsl:param name="Graphic.nonMapableMessageContent" ibis:doc="text shown when map is 2d or 3d."> 51 <h3>Map Not Available</h3> 52 The data are grouped by 2 or more dimensions. Maps can only be displayed 53 when the data are grouped by a single geographical dimension. If you would 54 like a map you will need to return to the query definition page and set 55 the primary display by "category" to the "Geographic Area" selection and 56 clear all other group by selections. Then resubmit the query. 57 </xsl:param> 58 59 60 61 <xsl:function name="ibis:Graphic.getMapName" as="xs:string" 53 62 ibis:doc="localizes checking the MapName param. Rules: 54 63 1) page request URL/HTTP request parameter via the request params … … 81 90 </xsl:function> 82 91 83 <xsl:function name="ibis: LeafletMap.showMap" as="xs:boolean"92 <xsl:function name="ibis:Graphic.showMap" as="xs:boolean" 84 93 ibis:doc="localizes checking the supplied mapname against the 'None' value." 85 94 > 86 95 <xsl:param name="mapName" ibis:doc="Map name to test."/> 87 <xsl:variable name="testMapName" select="if(string-length($mapName) != 0) then $mapName else ibis:LeafletMap.getMapName($mapName)"/> 88 <xsl:value-of select="$testMapName != $LeafletMap.noneName"/> 89 </xsl:function> 90 <xsl:function name="ibis:LeafletMap.showMap" as="xs:boolean" 91 ibis:doc="localizes checking the supplied mapname against the 'None' value." 92 > 93 <xsl:value-of select="true()"/> 94 </xsl:function> 95 96 97 98 99 100 101 <xsl:template name="LeafletMap.mapContainer" ibis:doc="Leaflet map container HTML code."> 96 <xsl:variable name="testMapName" select="if(string-length($mapName) != 0) then $mapName else ibis:Graphic.getMapName($mapName)"/> 97 <xsl:value-of select="$testMapName != $Graphic.noneName"/> 98 </xsl:function> 99 100 101 <xsl:function name="ibis:Graphic.getChartName" as="xs:string" 102 ibis:doc="localizes checking the ChartName param. Rules: 103 1) page request URL/HTTP request parameter via the request params 104 model map and the Java servlet transformation. 105 2) Supplied chart name param. 106 3) IP view chart name. 107 4) QM view chart name. 108 5) 'DEFAULT'. 109 " 110 > 111 <xsl:param name="chartName" ibis:doc="Chart name unless param override."/> 112 113 <xsl:choose> 114 <xsl:when test="string-length($ChartName) != 0"> 115 <xsl:value-of select="$ChartName"/> 116 </xsl:when> 117 <xsl:when test="string-length($chartName) != 0"> 118 <xsl:value-of select="$chartName"/> 119 </xsl:when> 120 <!-- 121 <xsl:when test="string-length(/INDICATOR_VIEW/CHART_NAME) != 0"> 122 <xsl:value-of select="/INDICATOR_VIEW/CHART_NAME"/> 123 </xsl:when> 124 <xsl:when test="string-length(/QUERY_MODULE/REQUEST/CHART_NAME) != 0"> 125 <xsl:value-of select="/QUERY_MODULE/REQUEST/CHART_NAME"/> 126 </xsl:when> 127 --> 128 <xsl:otherwise>DEFAULT</xsl:otherwise> 129 </xsl:choose> 130 </xsl:function> 131 132 133 <xsl:function name="ibis:Graphic.showChart" as="xs:boolean" 134 ibis:doc="localizes checking the supplied chartName against the 'None' value." 135 > 136 <xsl:param name="chartName" ibis:doc="Chart name to test."/> 137 <xsl:value-of select="$chartName != $Graphic.noneName"/> 138 </xsl:function> 139 140 141 <xsl:function name="ibis:Graphic.getGridName" as="xs:string" 142 ibis:doc="localizes checking the GridName param. Rules same as chart." 143 > 144 <xsl:param name="gridName" ibis:doc="Chart name unless param override."/> 145 146 <xsl:choose> 147 <xsl:when test="string-length($GridName) != 0"> 148 <xsl:value-of select="$GridName"/> 149 </xsl:when> 150 <xsl:when test="string-length($gridName) != 0"> 151 <xsl:value-of select="$gridName"/> 152 </xsl:when> 153 <!-- 154 <xsl:when test="string-length(/INDICATOR_VIEW/GRID_NAME) != 0"> 155 <xsl:value-of select="/INDICATOR_VIEW/GRID_NAME"/> 156 </xsl:when> 157 <xsl:when test="string-length(/QUERY_MODULE/REQUEST/GRID_NAME) != 0"> 158 <xsl:value-of select="/QUERY_MODULE/REQUEST/GRID_NAME"/> 159 </xsl:when> 160 --> 161 <xsl:otherwise>DEFAULT</xsl:otherwise> 162 </xsl:choose> 163 </xsl:function> 164 165 166 <xsl:template name="Graphic.chartContainer" ibis:doc="Kendo chart container HTML code."> 167 <xsl:param name="containerID" select="'chart'" ibis:doc="Value that is used as an ID for chart. Default = 'chart'."/> 168 <xsl:param name="title"/> 169 <xsl:param name="defaultContent"/> 170 171 <div class="Graphic Chart"> 172 <!-- this is in the chart itself... 173 <xsl:if test="string-length($title) != 0"><h3><xsl:value-of select="$title"/></h3></xsl:if> 174 --> 175 <div id="{$containerID}"><xsl:copy-of select="$defaultContent"/></div> 176 </div> 177 </xsl:template> 178 179 180 <xsl:template name="Graphic.mapContainer" ibis:doc="Leaflet map container HTML code."> 102 181 <xsl:param name="containerID" select="'map'" ibis:doc="Value that is used as an ID for map. Default = 'map'."/> 103 182 <xsl:param name="title"/> … … 110 189 111 190 112 <xsl:template name=" LeafletMap.choroplethJavaScript">191 <xsl:template name="Graphic.choroplethMapJavaScript"> 113 192 <script type="text/javascript" src="{$ibis.urlPrefix}js/leaflet-src.js"/> 114 193 <script type="text/javascript" src="{$ibis.urlPrefix}js/jquery.leaflet.js"/> … … 124 203 </xsl:template> 125 204 126 <xsl:template name=" LeafletMap.selectionJavaScript">205 <xsl:template name="Graphic.selectionMapJavaScript"> 127 206 <script type="text/javascript" src="{$ibis.urlPrefix}js/leaflet-src.js"/> 128 207 <script type="text/javascript" src="{$ibis.urlPrefix}js/jquery.leaflet.js"/> … … 136 215 </xsl:template> 137 216 138 139 140 <xsl:template name="LeafletMap.baseJSON" ibis:doc="Returns the base/core JSON.">141 <xsl:copy-of select="unparsed-text(concat($LeafletMap.jsonFilePath, '_Base.json'))"/>142 </xsl:template>143 144 <xsl:template name="LeafletMap.namedConfigurationJSON" ibis:doc="Gets the named specific JSON options from the file.">145 <xsl:param name="configurationName"/>146 <xsl:variable name="configurationName" select="if(0 = string-length($configurationName)) then $LeafletMap.emptyConfigurationName else $configurationName"/>147 <xsl:copy-of select="unparsed-text(concat($LeafletMap.jsonFilePath, $configurationName, '.json'))"/>148 </xsl:template>149 150 <xsl:template name="LeafletMap.requestJSON">151 <xsl:param name="mapTitle" select="'Request JSON'"/>152 <xsl:param name="webappPrefix" select="$ibis.urlPrefix"/>153 <xsl:param name="mapType" select="'selection'"/>154 <xsl:param name="selectionLayerSetLayerKeys"/>155 <xsl:param name="selectionLayerSetSelectionType" select="'multiple'"/>156 157 { // Start of Request Specific JSON158 title: "<xsl:value-of select="$mapTitle"/>"159 ,localURLWebappPrefix: "<xsl:value-of select="$webappPrefix"/>"160 ,type: "<xsl:value-of select="$mapType"/>"161 <xsl:if test="$selectionLayerSetLayerKeys">162 ,selectionLayerSetLayerKeys: <xsl:value-of select="ibis:textNodesToJSONArray($selectionLayerSetLayerKeys)"/>163 </xsl:if>164 <xsl:if test="$selectionLayerSetSelectionType">165 ,selectionLayerSetSelectionType: "<xsl:value-of select="$selectionLayerSetSelectionType"/>"166 </xsl:if>167 } // End of Request Specific JSON168 </xsl:template>169 170 171 172 <xsl:template name="LeafletMap.choroplethJSON">173 <xsl:param name="javascriptRecordArrayVariableName" select="'records'"/>174 <xsl:param name="geoIDFieldName" ibis:doc="data record's field that contains the geo ID to match against the GeoJSON ID field (typically 'Category' or 'Series')."/>175 <xsl:param name="geoIDFieldValuePrefixToRemove"/>176 177 <xsl:param name="measureValueFieldName" select="'MeasureValue'" ibis:doc="base field name of the js data records array that is the choro value."/>178 <xsl:param name="geoJSONName" select="'GeoCnty'" ibis:doc="choro json layer filename - sans path and .json extension."/>179 <xsl:param name="geoTypeTitle" select="'County'" ibis:doc="Choro layer title - County, Region"/>180 <xsl:param name="legendTitle" select="'Count'" ibis:doc="Legend's value title - typically the measure title"/>181 182 <xsl:param name="dimensionFieldInclusionCriteria" select="NULL"183 ibis:doc="List of field name/field values to filter out/refine the184 approp data value record to use for the choro. These are typically185 the CONSTANT and SERIES dim values to hold constant.186 Example - when doing a map that has 3 total group by dimensions:187 GeoXXX, Year, and MotherAgeGrp. In this example we want the 2011188 year and the 20-29 mothers age group for the county. If hooked189 up to a UI control then code will need to be added that sets the190 inclusion criteria, calls set the data properties, and notifies191 the choro to recalc.192 "193 />194 195 <xsl:param name="reverseColors" select="false()"/>196 <xsl:param name="comparisonValue" select="0"/>197 <xsl:param name="desirableIndexValue" select="0"/>198 199 <xsl:param name="geoTitleFieldName" select="concat($geoIDFieldName, 'Title')"/>200 201 <xsl:message select="'========================= comp value in lm.cjson'"/>202 <xsl:message select="$comparisonValue[1]"/>203 204 { // Start of Choropleth JSON205 choroplethControl:206 {207 legend:208 {209 title: "<xsl:value-of select="$legendTitle"/>"210 }211 ,reverseColors: <xsl:value-of select="$reverseColors"/>212 ,layerSetsKey: "<xsl:value-of select="$geoJSONName"/>"213 ,dataClasses:214 {215 betterWorse:216 {217 comparisonValue: "<xsl:value-of select="$comparisonValue[1]"/>"218 ,desirableIndexValue: <xsl:value-of select="$desirableIndexValue"/>219 }220 }221 }222 ,layerSets:223 {224 sets:225 {226 "choropleth":227 {228 title: "Choropleth" <!-- grouping title -->229 ,layers:230 {231 "<xsl:value-of select="$geoJSONName"/>":232 {233 type: "choropleth"234 ,url: "<xsl:value-of select="concat($LeafletMap.ajaxGeoJSONMapLayersFilePath, $geoJSONName, '.json')"/>"235 ,title: "<xsl:value-of select="$geoTypeTitle"/>" <!-- layer title -->236 ,show: true237 ,options:238 {239 geoIDPropertyName: "<xsl:value-of select="$LeafletMap.geoJSONIDPropertyName"/>"240 ,dataObject:241 {242 data: <xsl:value-of select="$javascriptRecordArrayVariableName"/>243 ,comparisonValue: "<xsl:value-of select="$comparisonValue[1]"/>"244 <xsl:if test="0 != string-length($geoIDFieldValuePrefixToRemove)">245 ,geoIDFieldValuePrefixToRemove: "<xsl:value-of select="$geoIDFieldValuePrefixToRemove"/>"246 </xsl:if>247 ,fieldName:248 {249 <!-- maybe have a constant field name and value - these ARE dynamic and script set250 although the script could set these values and call the map refresh!!!!!!!!!!251 in the l.geojson.int.js the this.options.dataObject.dimensionFieldInclusionCriteria252 handles this...253 maybe have a series field name and value254 what about the new ancillary values and value attribute stuff?????255 256 <xsl:message select="'*************LeafletMapGraphic.requestOptionsJSON - dimensionFieldInclusionCriteria: '"/>257 <xsl:message select="$dimensionFieldInclusionCriteria"/>258 -->259 geoID: "<xsl:value-of select="$geoIDFieldName"/>"260 ,geoTitle: "<xsl:value-of select="$geoTitleFieldName"/>"261 ,"measureValue": "<xsl:value-of select="$measureValueFieldName"/>"262 ,"measureValueTitle": "<xsl:value-of select="$measureValueFieldName"/>Title"263 ,"lowerLimit": "LowerLimit"264 ,"upperLimit": "UpperLimit"265 ,"lowerLimitTitle": "LowerLimitTitle"266 ,"upperLimitTitle": "UpperLimitTitle"267 ,"numeratorTitle": "NumeratorTitle"268 ,"denominatorTitle": "DenominatorTitle"269 ,"note": "Note"270 ,"label": "Label"271 ,"valueAttributeName": "ValueAttributeName"272 }273 <xsl:if test="count($dimensionFieldInclusionCriteria/*) != 0">274 ,dimensionFieldInclusionCriteria:275 [276 <xsl:for-each select="$dimensionFieldInclusionCriteria/DIMENSION">277 <xsl:if test="position() != 1">,</xsl:if>278 {279 fieldName: "<xsl:value-of select="NAME"/>"280 ,fieldTitle: "<xsl:value-of select="TITLE"/>"281 ,value: "<xsl:value-of select="VALUE"/>"282 ,valueTitle: "<xsl:value-of select="VALUE"/>"283 }284 </xsl:for-each>285 ]286 </xsl:if>287 }288 }289 }290 }291 }292 }293 }294 } // End of Choropleth JSON295 </xsl:template>296 297 217 </xsl:stylesheet> 298 218 <!-- ============================= End of File ============================= --> -
trunk/ibisph-view/src/main/webapp/xslt/html/Page.xslt
r17123 r17416 7 7 exclude-result-prefixes="ibis" 8 8 > 9 <xsl:import href=" ibis.xslt"/>9 <xsl:import href="../ibis.xslt"/> 10 10 <xsl:import href="ContentContainer.xslt"/> 11 11 <xsl:import href="Help.xslt"/> … … 162 162 <xsl:param name="Page.htmlClass" ibis:doc="Stub param that provides hook to set the main html css class."/> 163 163 164 165 <xsl:param name="Page.baseContentFilePath" select="'../../ibisph-content'" 166 ibis:doc="Injected via the common alt model map bean def. This allows 167 down stream XSLT to dynamically access the 2ndardy XML files as well 168 as leaflet map and kendo json files. 169 " 170 /> 171 164 <xsl:param name="XMLModifedDate" 165 ibis:doc="Parameter which is set via the Java model code so that the 166 resultant page can display the XML file's modified date/time." 167 /> 168 <xsl:variable name="Page.XMLModifedDate" 169 select="if(string-length($XMLModifedDate) = 0) then //ibis:doc/versions/version[1]/date else $XMLModifedDate" 170 ibis:doc="Variable that wraps the 'XMLModifedDate' parameter so that we 171 know where this variable/parameter is defined. If the parameter 172 value is not specified then the parameter defaults to selecting the 173 XML document's ibis:doc version date." 174 /> 172 175 173 176 <xsl:param name="OrgUnits"/> 174 <xsl:param name="Page.orgUnits" select="$OrgUnits/ORG_UNITS"/> 177 <xsl:param name="Page.orgUnits" select="$OrgUnits/ORG_UNITS" 178 ibis:doc="Convenience variable which holds the ORG_UNIT elements. This 179 could/should be loaded and cached at app startup and injected at some 180 future point for speed. For now, because there is not a reload the 181 cache when published mechanism, it is implemented as a file/document 182 lookup. 183 " 184 /> 175 185 <xsl:param name="Page.orgUnitName" select="'DEFAULT'" 176 186 ibis:doc="Default Org Unit name used for page body content footer. This … … 178 188 Defaults to 'DEFAULT'." 179 189 /> 180 181 190 182 191 -
trunk/ibisph-view/src/main/webapp/xslt/html/SiteSpecific.xslt
r16650 r17416 27 27 28 28 <xsl:param name="SiteSpecific.siteNavigationSelectionsXMLFilePathAndName" 29 select=" concat($Page.baseContentFilePath,'xml/selection/navigation/SiteNavigationSelections.xml')"29 select="ibis:getContentFilePath('xml/selection/navigation/SiteNavigationSelections.xml')" 30 30 /> 31 31 … … 64 64 65 65 <xsl:param name="SiteSpecific.contextNavigationSelectionsXMLFilePathAndName" 66 select=" concat($Page.baseContentFilePath, 'xml/selection/navigation/', $PathSegments[1], 'ContextSelection.xml')"66 select="ibis:getContentFilePath(concat('xml/selection/navigation/', $PathSegments[1], 'ContextSelection.xml'))" 67 67 /> 68 68 <xsl:param name="SiteSpecific.contextNavigationSelections" … … 93 93 94 94 <xsl:param name="SiteSpecific.siteAuthenticatedUserSelectionXMLFilePathAndName" 95 select=" concat($Page.baseContentFilePath,'xml/selection/navigation/AuthenticatedUserSelection.xml')"95 select="ibis:getContentFilePath('xml/selection/navigation/AuthenticatedUserSelection.xml')" 96 96 /> 97 97 <xsl:param name="SiteSpecific.siteNonAuthenticatedUserSelectionXMLFilePathAndName" 98 select=" concat($Page.baseContentFilePath,'xml/selection/navigation/userContextSelection.xml')"98 select="ibis:getContentFilePath('xml/selection/navigation/userContextSelection.xml')" 99 99 /> 100 100 <xsl:param name="SiteSpecific.siteAuthenticatedUserSelections"> … … 119 119 ". 120 120 121 <xsl:if test="string-length($ ibis.XMLModifedDate) != 0">121 <xsl:if test="string-length($Page.XMLModifedDate) != 0"> 122 122 <br/><br/> 123 Content updated: <xsl:value-of select="$ ibis.XMLModifedDate"/>123 Content updated: <xsl:value-of select="$Page.XMLModifedDate"/> 124 124 </xsl:if> 125 125 </xsl:param> … … 400 400 from the Department of Health, Indicator-Based 401 401 Information System for Public Health Web site: http://ibis.health.gov" 402 <xsl:if test="string-length($ ibis.XMLModifedDate) != 0">403 <div class="LastModified">Page Content Updated: <xsl:value-of select="$ ibis.XMLModifedDate"/></div>402 <xsl:if test="string-length($Page.XMLModifedDate) != 0"> 403 <div class="LastModified">Page Content Updated: <xsl:value-of select="$Page.XMLModifedDate"/></div> 404 404 </xsl:if> 405 405 </div> -
trunk/ibisph-view/src/main/webapp/xslt/html/community/builder/Page.xslt
r17182 r17416 183 183 <div id="selectionMapDialog" class="DialogContent"> 184 184 <div class="InnerCanvas"> 185 <xsl:call-template name=" LeafletMap.mapContainer"/>185 <xsl:call-template name="Graphic.mapContainer"/> 186 186 </div> 187 187 <button type="button" title="Sets the selected geographical values." … … 192 192 >Cancel</button> 193 193 </div> 194 <xsl:call-template name=" LeafletMap.selectionJavaScript"/>194 <xsl:call-template name="Graphic.selectionMapJavaScript"/> 195 195 196 196 <script type="text/javascript"> -
trunk/ibisph-view/src/main/webapp/xslt/html/community/indicator/Page.xslt
r17255 r17416 96 96 <xsl:message select="$indicatorComparisonValues/STATE"/> 97 97 --> 98 <img src="{$ibis.urlPrefix}image/gauge/compare/{$indicatorComparisonValues/STATE/VALUE/COMPARISON/GAUGE_NAME}.png" alt="comparison gauge value"/> <br/>98 <img src="{$ibis.urlPrefix}image/gauge/compare/{$indicatorComparisonValues/STATE/VALUE/COMPARISON/GAUGE_NAME}.png" alt="comparison gauge value"/> 99 99 <span class="GaugeFootnote Popup"> 100 100 Description of Dashboard Gauge -
trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/view/Page.xslt
r17255 r17416 8 8 exclude-result-prefixes="ibis xs xsl" 9 9 > 10 <xsl:import href="../../../../xml/Interactive.xslt"/> 11 <xsl:import href="../../../../json/Dataset.xslt"/> 12 <xsl:import href="../../../../json/Kendo.xslt"/> 13 <xsl:import href="../../../../json/LeafletMap.xslt"/> 14 <xsl:import href="../../../Graphic.xslt"/> 15 <xsl:import href="../Indicator.xslt"/> 10 16 <xsl:import href="../Page.xslt"/> 11 <xsl:import href="../../../../xml/Interactive.xslt"/>12 <xsl:import href="../../../../json/indicator/profile/InteractiveJSON.xslt"/>13 <xsl:import href="../../../Kendo.xslt"/>14 <xsl:import href="../../../LeafletMap.xslt"/>15 <xsl:import href="../Indicator.xslt"/>16 17 17 18 … … 33 34 </xsl:param> 34 35 35 36 36 <xsl:param name="Page.comparisonDimensionName" select="'GeoState'"/> 37 37 <xsl:param name="Page.comparisonDimensionValue" select="'35'"/> 38 38 39 40 39 <xsl:param name="Indicator.contentBlockType" select="'fixed'"/> 41 40 <xsl:param name="Indicator.contentBlockTitleLevel" select="3"/> 42 43 44 45 46 <xsl:template name="xxxxxxxxxxxPage.specificScript" ibis:doc="Provides Kendo and Leaflet script code.">47 <xsl:if test="0 = string-length($indicatorView/SURROGATE_VIEW_URL)">48 <xsl:call-template name="Page.interativeContent">49 <xsl:with-param name="indicatorView" select="$indicatorView"/>50 </xsl:call-template>51 </xsl:if>52 </xsl:template>53 41 54 42 … … 70 58 71 59 72 73 60 <xsl:template name="Page.interativeContent" 74 61 ibis:doc="Main interactive sections content template." … … 78 65 <xsl:variable name="measureName" select="$indicatorView/MEASURE_NAME"/> 79 66 <xsl:variable name="measure" select="($indicator//MEASURE[NAME = $measureName])[1]"/> 80 81 67 82 68 <xsl:call-template name="ContentContainer.expandable"> … … 89 75 </xsl:call-template> 90 76 91 <xsl:variable name="showMap" select="ibis: LeafletMap.showMap()"/> <!-- $indicatorView/MAP_NAME -->77 <xsl:variable name="showMap" select="ibis:Graphic.showMap($indicatorView/MAP_NAME)"/> 92 78 <xsl:if test="$showMap"> 93 79 <xsl:call-template name="ContentContainer.expandable"> 94 80 <xsl:with-param name="title" select="'Map'"/> 95 81 <xsl:with-param name="content"> 96 <xsl:call-template name=" LeafletMap.mapContainer">82 <xsl:call-template name="Graphic.mapContainer"> 97 83 <xsl:with-param name="containerID" select="'map'"/> 98 84 <xsl:with-param name="title" select="ibis:getMapTitle($indicator, $indicatorView, $Indicator.dimensions)"/> … … 109 95 </xsl:if> 110 96 111 <xsl:if test="ibis: Kendo.showChart($indicatorView/CHART_NAME)">97 <xsl:if test="ibis:Graphic.showChart($indicatorView/CHART_NAME)"> 112 98 <xsl:call-template name="ContentContainer.expandable"> 113 99 <xsl:with-param name="title" select="if('Line'=$indicatorView/CHART_NAME) then 'Trend' else 'Chart'"/> 114 100 <xsl:with-param name="content"> 115 <xsl:call-template name=" Kendo.chartContainer">101 <xsl:call-template name="Graphic.chartContainer"> 116 102 <xsl:with-param name="containerID" select="'chart'"/> 117 103 <xsl:with-param name="title" select="ibis:getChartTitle($indicator, $indicatorView, $Indicator.dimensions)"/> … … 220 206 <xsl:with-param name="indicatorView" select="$indicatorView"/> 221 207 <xsl:with-param name="measure" select="$Indicator.measure"/> 208 <xsl:with-param name="showMap" select="$showMap"/> 222 209 </xsl:call-template> 223 210 </xsl:template> … … 225 212 226 213 227 <xsl:template name="Page.leafletKendoScript" 228 ibis:doc="Provides the kendo and leaflet javascript." 229 > 214 <xsl:template name="Page.leafletKendoScript" ibis:doc="Provides the kendo and leaflet javascript."> 230 215 <xsl:param name="indicatorView"/> 231 216 <xsl:param name="measure"/> 232 233 <xsl:if test="ibis:LeafletMap.showMap($indicatorView/MAP_NAME)"> 234 <xsl:call-template name="LeafletMap.choroplethJavaScript"/> 217 <xsl:param name="showMap" select="ibis:Graphic.showMap($indicatorView/MAP_NAME)"/> 218 219 <xsl:if test="$showMap"> 220 <xsl:call-template name="Graphic.choroplethMapJavaScript"/> 235 221 </xsl:if> 236 222 <xsl:variable name="measureValueFormatPattern" select="($Indicator.valueTypes/VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/> … … 280 266 var records = 281 267 [<xsl:text> </xsl:text> 282 <xsl:call-template name=" InteractiveJSON.getDatasetRecords">268 <xsl:call-template name="Dataset.getDatasetRecordsJSON"> 283 269 <xsl:with-param name="dimensions" select="$Indicator.dimensions"/> 284 270 <xsl:with-param name="datasetRecords" select="$indicatorViewDatasetRecords"/> … … 308 294 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 309 295 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 296 <!-- GARTH TODO: Total row, note and label, 297 NEED VALUE ATTRIBUTE SUPPORT AS WELL. 298 --> 310 299 <xsl:with-param name="showFooterRow" select="false()"/> 311 300 <xsl:with-param name="showNoteColumn" select="false()"/> … … 368 357 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]])"/> 369 358 <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/> 370 <xsl:message select="concat('Interactive - Show Map: ', $ Interactive.showMap, ', geoDimensionName:', $geoDimensionName)"/>359 <xsl:message select="concat('Interactive - Show Map: ', $showMap, ', geoDimensionName:', $geoDimensionName)"/> 371 360 372 361 <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/> … … 442 431 443 432 444 <xsl:if test=" ibis:LeafletMap.showMap($indicatorView/MAP_NAME)">433 <xsl:if test="$showMap"> 445 434 var leafletMapConstructorJSON = $.extend 446 435 (true, {} … … 469 458 ); 470 459 $leafletMap = $("#map").leaflet(leafletMapConstructorJSON); 471 <!--472 <xsl:call-template name="LeafletMap.mapsJavaScript"/>473 <xsl:call-template name="LeafletMap.namedMapJavaScript"/>474 -->475 460 </xsl:if> 476 461 477 462 }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 478 <!-- 479 <xsl:call-template name="Kendo.chartsJavaScript"/> 480 <xsl:call-template name="Kendo.namedChartJavaScript"/> 481 <xsl:call-template name="Kendo.gridsJavaScript"/> 482 <xsl:call-template name="Kendo.namedGridJavaScript"/> 483 --> 463 484 464 </script> 485 465 </xsl:template> -
trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/view_numbers/Page.xslt
r16188 r17416 45 45 46 46 <!-- Data Sources --> 47 TODO: GARTH 47 48 <xsl:call-template name="Indicator.dataSources"> 48 49 <xsl:with-param name="indicatorDataSources" select="$indicator/DATA_SOURCES"/> -
trunk/ibisph-view/src/main/webapp/xslt/html/query/module/Page.xslt
r17255 r17416 12 12 <ibis:doc> 13 13 <name>html/query/module/Page</name> 14 <summary>Core/common query module html template overrides</summary>14 <summary>Core/common query module params and html template overrides</summary> 15 15 <description> 16 16 Provides core query module templates. … … 27 27 /> 28 28 29 30 <xsl:param name="AncillaryValues"/>31 <xsl:param name="Page.ancillaryValues" select="$AncillaryValues/ANCILLARY_VALUES"/>32 <xsl:param name="DataSources"/>33 <xsl:param name="Page.dataSources" select="$DataSources/DATA_SOURCES"/>34 <xsl:param name="Measures"/>35 <xsl:param name="Page.measure" select="$Measures/MEASURES/MEASURE[NAME=/QUERY_MODULE/MEASURE_NAME]"/>36 <xsl:param name="ValueTypes"/>37 <xsl:param name="Page.valueTypes" select="$ValueTypes/VALUE_TYPES"/>38 <xsl:param name="ValueAttributes"/>39 <xsl:param name="Page.valueAttributes" select="$ValueAttributes/VALUE_ATTRIBUTES"/>40 41 29 <xsl:param name="Page.orgUnitName" select="/QUERY_MODULE/ORG_UNIT_NAME" 42 30 ibis:doc="Provides the associated module organization unit contact … … 46 34 /> 47 35 48 49 <xsl:param name="Page.chartsXMLFilePathAndName" select="concat($Page.baseContentFilePath, 'xml/charts.xml')"/> 50 <xsl:param name="Page.charts" select="document($Page.chartsXMLFilePathAndName)/CHARTS/CHART[not(NOT_SELECTABLE_FLAG) and not(NAME = /QUERY_MODULE/CONFIGURATIONS/CONFIGURATION/CRITERIA/EXCLUDE/CHART_NAMES/CHART_NAME)]" 51 ibis:doc="Convenience variable which holds the CHARTS elements - could be injected." 52 /> 53 54 <xsl:param name="Page.mapsXMLFilePathAndName" select="concat($Page.baseContentFilePath, 'xml/maps.xml')"/> 55 <xsl:param name="Page.maps" select="document($Page.mapsXMLFilePathAndName)/MAPS/MAP[not(NOT_SELECTABLE_FLAG) and not(NAME = /QUERY_MODULE/CONFIGURATIONS/CONFIGURATION/CRITERIA/EXCLUDE/MAP_NAMES/MAP_NAME)]" 56 ibis:doc="Convenience variable which holds the MAPS elements." 57 /> 36 <xsl:param name="Page.charts" select="document(ibis:getContentFilePath('xml/charts.xml'))/CHARTS/CHART[not(NOT_SELECTABLE_FLAG) and not(NAME = /QUERY_MODULE/CONFIGURATIONS/CONFIGURATION/CRITERIA/EXCLUDE/CHART_NAMES/CHART_NAME)]"/> 37 <xsl:param name="Page.maps" select="document(ibis:getContentFilePath('xml/maps.xml'))/MAPS/MAP[not(NOT_SELECTABLE_FLAG) and not(NAME = /QUERY_MODULE/CONFIGURATIONS/CONFIGURATION/CRITERIA/EXCLUDE/MAP_NAMES/MAP_NAME)]"/> 58 38 59 39 </xsl:stylesheet> -
trunk/ibisph-view/src/main/webapp/xslt/html/query/module/builder/Page.xslt
r17255 r17416 8 8 > 9 9 <xsl:import href="../Page.xslt"/> 10 <xsl:import href="../../../LeafletMap.xslt"/> 10 <xsl:import href="../../../Graphic.xslt"/> 11 <xsl:import href="../../../../json/LeafletMap.xslt"/> 11 12 <xsl:import href="SectionSelections.xslt"/> 12 13 <xsl:import href="Builder.xslt"/> -
trunk/ibisph-view/src/main/webapp/xslt/html/query/module/builder/SectionSelections.xslt
r17255 r17416 655 655 <div id="selectionMapDialog" class="DialogContent"> 656 656 <div class="InnerCanvas"> 657 <xsl:call-template name=" LeafletMap.mapContainer">657 <xsl:call-template name="Graphic.mapContainer"> 658 658 <xsl:with-param name="containerID" select="'map'"/> 659 659 </xsl:call-template> … … 662 662 <button type="button" onclick="selectionMapDialog.close()" title="Closes map selection without updating selections.">Cancel</button> 663 663 </div> 664 <xsl:call-template name="LeafletMap.selectionJavaScript"/> 665 664 665 <xsl:call-template name="Graphic.selectionMapJavaScript"/> 666 666 <script type="text/javascript"> 667 667 var selectionMapDialog; -
trunk/ibisph-view/src/main/webapp/xslt/html/query/module/builder/SiteSpecific.xslt
r16074 r17416 44 44 <HELP> 45 45 <TEXT> 46 After defining any data filtering criteria and data 47 grouping, click this button. Once clicked your query 48 definition will be submitted and a result page will 49 be presented. 46 This submits your query definition. Once submitted 47 the data will be processed and the result page will 48 be presented. From the result page you can return 49 to this page and refineany data filtering criteria 50 and data grouping selections. 50 51 </TEXT> 51 52 </HELP> … … 55 56 <DESCRIPTION>Choose different query dataset/measure.</DESCRIPTION> 56 57 <TITLE>Select Different Measure</TITLE> 58 <HELP> 59 <TEXT> 60 Allows you to change the measure to be queried. 61 </TEXT> 62 </HELP> 57 63 </SELECTION> 58 64 <SELECTION> 59 65 <URL><xsl:value-of select="concat($ibis.urlPrefix, 'query/builder/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html?Reload=x')"/></URL> 60 66 <DESCRIPTION>Reloads the query definition.</DESCRIPTION> 61 <TITLE>Load Default Query Definition</TITLE> 67 <TITLE>Reset to Default Selections</TITLE> 68 <HELP> 69 <TEXT> 70 Resets your query definition to the default selections 71 and settings. This is different from the [Reset] button 72 located at the bottom of the page. The [Reset] restores 73 immediate page selections made. This option actually 74 reloads the query definition to it's default state. 75 </TEXT> 76 </HELP> 62 77 </SELECTION> 63 78 </SELECTIONS> … … 73 88 <DESCRIPTION>Click this button to save the selections as a saved criteria definition.</DESCRIPTION> 74 89 <TITLE>Save Query Definition</TITLE> 90 <HELP> 91 <TEXT> 92 Allows you to save your current filtering criteria and 93 display selections. These saved query definitions can 94 then be ran later and can even be shared with others. 95 </TEXT> 96 </HELP> 75 97 </SELECTION> 76 98 </xsl:if> … … 79 101 <DESCRIPTION>Click this button to access all query definitions.</DESCRIPTION> 80 102 <TITLE>My Saved Query Definitions</TITLE> 103 <HELP> 104 <TEXT> 105 Takes you to a page that shows a list of all of your 106 saved query defintions. You can then choose several 107 options to run the definition, refine it, or delete it. 108 109 NOTE: you will need to be logged in to be able to see 110 your definitions. 111 </TEXT> 112 </HELP> 81 113 </SELECTION> 82 114 </SELECTIONS> -
trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/Page.xslt
r17255 r17416 11 11 12 12 <xsl:import href="../../../../xml/Interactive.xslt"/> 13 <xsl:import href="../../../../json/ indicator/profile/InteractiveJSON.xslt"/>14 15 <xsl:import href="../../../ Kendo.xslt"/>16 <xsl:import href="../../../LeafletMap.xslt"/> 17 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 18 <xsl:import href="UserSelections.xslt"/> 19 19 <xsl:import href="Result.xslt"/> 20 21 20 22 21 <ibis:doc> … … 32 31 33 32 34 35 <xsl:param name="Page.pageTitle" ibis:doc="Page's title text which is based on the ' $Result.queryModule/TITLE' element.">36 Query Result - <xsl:value-of select=" $Result.queryModule/TITLE"/> - <xsl:value-of select="$Result.configuration/TITLE"/>33 <xsl:param name="Page.configurationTitle" select="/QUERY_MODULE/CONFIGURATIONS/CONFIGURATION[NAME=/QUERY_MODULE/REQUEST/CONFIGURATION_NAME]/TITLE"/> 34 <xsl:param name="Page.pageTitle" ibis:doc="Page's title text which is based on the '/QUERY_MODULE/TITLE' element."> 35 Query Result - <xsl:value-of select="/QUERY_MODULE/TITLE"/> - <xsl:value-of select="$Page.configurationTitle"/> 37 36 </xsl:param> 38 <xsl:param name="Page.sectionsTitle" ibis:doc="Page's content title text which is based on the ' $Result.queryModule/TITLE' element.">39 Query Results for <xsl:value-of select=" $Result.queryModule/TITLE"/> - <xsl:value-of select="$Result.configuration/TITLE"/>37 <xsl:param name="Page.sectionsTitle" ibis:doc="Page's content title text which is based on the '/QUERY_MODULE/TITLE' element."> 38 Query Results for <xsl:value-of select="/QUERY_MODULE/TITLE"/> - <xsl:value-of select="$Page.configurationTitle"/> 40 39 </xsl:param> 41 40 … … 44 43 /> 45 44 46 47 <xsl:param name="Page.comparisonDimensionName" select="'GeoState'"/> 48 <xsl:param name="Page.comparisonDimensionValue" select="'35'"/> 49 50 51 <xsl:param name="Page.nonChartableMessageContent" ibis:doc="text shown when chart is 3d and not chartable."> 52 <h3>Chart Not Available</h3> 53 The data are grouped by more dimensions than the chart is capable of displaying. 54 If you would like this chart you will need to remove one or more grouping 55 selections on the query definition builder page and then resubmit the 56 query request or choose a different chart that supports multiple dimensions. 57 </xsl:param> 58 <xsl:param name="Page.nonMapableMessageContent" ibis:doc="text shown when map is 2d or 3d."> 59 <h3>Map Not Available</h3> 60 The data are grouped by 2 or more dimensions. Maps can only be displayed 61 when the data are grouped by a single geographical dimension. If you would 62 like a map you will need to return to the query definition page and set 63 the primary display by "category" to the "Geographic Area" selection and 64 clear all other group by selections. Then resubmit the query. 65 </xsl:param> 45 <xsl:param name="Page.resultURL" select="concat($ibis.urlPrefix, 'query/result/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html')"/> 46 47 48 <xsl:param name="DataSources"/> 49 50 <xsl:param name="Measures"/> 51 <xsl:param name="Page.dimensions" select="Page.queryModule/DIMENSIONS"/> 66 52 67 53 … … 75 61 was combined 1/10/08." 76 62 > 77 <xsl:if test="not(exists( $Result.queryResult)) and not(exists($Result.queryModule/REQUEST/ERROR))">78 <meta http-equiv="refresh" content="0;URL={$ Result.resultURL}"/>63 <xsl:if test="not(exists(/QUERY_MODULE/IBISQ_QUERY_RESULT)) and not(exists(/QUERY_MODULE/REQUEST/ERROR))"> 64 <meta http-equiv="refresh" content="0;URL={$Page.resultURL}"/> 79 65 </xsl:if> 80 66 … … 85 71 86 72 <xsl:template name="Page.sectionsContent" ibis:doc="Main interactive sections content template."> 87 88 <xsl:param name="rowDimensionName" select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME"/> 89 <xsl:param name="colDimensionName" select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME"/> 90 <xsl:param name="otherDimensionName" select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME"/> 91 <xsl:param name="rowDimensionTitle" select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/> 92 <xsl:param name="colDimensionTitle" select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/> 93 <xsl:param name="otherDimensionTitle" select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$otherDimensionName]/TITLE"/> 94 <xsl:param name="recordCount" select="count($Result.queryResult/RECORDS/RECORD)"/> 95 73 <xsl:param name="queryModule" select="/QUERY_MODULE"/> 74 75 <xsl:param name="rowDimensionName" select="$queryModule/REQUEST/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME"/> 76 <xsl:param name="colDimensionName" select="$queryModule/REQUEST/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME"/> 77 <xsl:param name="otherDimensionName" select="$queryModule/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME"/> 78 <xsl:param name="rowDimensionTitle" select="$queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/> 79 <xsl:param name="colDimensionTitle" select="$queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/> 80 <xsl:param name="otherDimensionTitle" select="$queryModule/DIMENSIONS/DIMENSION[NAME=$otherDimensionName]/TITLE"/> 81 <xsl:param name="recordCount" select="count($queryModule/IBISQ_QUERY_RESULT/RECORDS/RECORD)"/> 82 83 <xsl:param name="configuration" select="$queryModule/CONFIGURATIONS/CONFIGURATION[NAME=/QUERY_MODULE/REQUEST/CONFIGURATION_NAME]"/> 96 84 97 85 <a id="top"></a> 98 86 <xsl:call-template name="UserSelections.criteria"> 99 <xsl:with-param name="queryModule" select="$ Result.queryModule"/>100 <xsl:with-param name="criteriaTitle" select="concat('Query Criteria for the ', $ Result.configuration/TITLE, ' Measure')"/>87 <xsl:with-param name="queryModule" select="$queryModule"/> 88 <xsl:with-param name="criteriaTitle" select="concat('Query Criteria for the ', $configuration/TITLE, ' Measure')"/> 101 89 <xsl:with-param name="criteriaDescription" 102 select="if(exists($ Result.configuration/DESCRIPTION))103 then $ Result.configuration/DESCRIPTION90 select="if(exists($configuration/DESCRIPTION)) 91 then $configuration/DESCRIPTION 104 92 else 'User query criteria includes filtering and how the data are grouped' 105 93 " … … 112 100 113 101 <xsl:choose> 114 <xsl:when test="exists($ Result.queryModule/REQUEST/ERROR)">102 <xsl:when test="exists($queryModule/REQUEST/ERROR)"> 115 103 <xsl:copy-of select="$Result.requestErrorMessageContent"/> 116 104 </xsl:when> 117 105 118 <xsl:when test="exists($ Result.queryResult/ERROR)">106 <xsl:when test="exists($queryModule/IBISQ_QUERY_RESULT/ERROR)"> 119 107 <xsl:copy-of select="$Result.resultErrorMessageContent"/> 120 108 </xsl:when> 121 109 122 <xsl:when test="not(exists($ Result.queryResult))">110 <xsl:when test="not(exists($queryModule/IBISQ_QUERY_RESULT))"> 123 111 <xsl:copy-of select="$Result.pleaseWaitMessageContent"/> 124 112 </xsl:when> … … 131 119 <xsl:otherwise> 132 120 <xsl:call-template name="Page.dataContent"> 121 <xsl:with-param name="queryModule" select="$queryModule"/> 133 122 </xsl:call-template> 134 123 </xsl:otherwise> … … 136 125 137 126 <h3>Query Date Time Stamp</h3> 138 These data were queried on: <xsl:value-of select=" /QUERY_MODULE/REQUEST/FINISHED_DATE"/>139 <xsl:if test="boolean( /QUERY_MODULE/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE)">127 These data were queried on: <xsl:value-of select="$queryModule/REQUEST/FINISHED_DATE"/> 128 <xsl:if test="boolean($queryModule/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE)"> 140 129 <br/> 141 The dataset was last updated on: <xsl:value-of select=" /QUERY_MODULE/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE"/>130 The dataset was last updated on: <xsl:value-of select="$queryModule/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE"/> 142 131 </xsl:if> 143 132 <br/><br/> … … 146 135 <br/><br/> 147 136 </xsl:template> 137 148 138 149 139 … … 154 144 " 155 145 > 156 157 <xsl:variable name="showMap" select="ibis:LeafletMap.showMap()"/> <!-- $indicatorView/MAP_NAME --> 146 <xsl:param name="queryModule" select="/QUERY_MODULE"/> 147 <xsl:param name="configuration" select="$queryModule/CONFIGURATIONS/CONFIGURATION[NAME=$queryModule/REQUEST/CONFIGURATION_NAME]"/> 148 <xsl:param name="request" select="$queryModule/REQUEST"/> 149 150 <xsl:variable name="showMap" select="ibis:Graphic.showMap($request/MAP_NAME)"/> 158 151 <xsl:if test="$showMap"> 159 152 <xsl:call-template name="ContentContainer.expandable"> 160 153 <xsl:with-param name="title" select="'Map'"/> 161 154 <xsl:with-param name="content"> 162 <xsl:call-template name=" LeafletMap.mapContainer">155 <xsl:call-template name="Graphic.mapContainer"> 163 156 <xsl:with-param name="containerID" select="'map'"/> 164 157 <xsl:with-param name="title" select="'ibis:getMapTitle($indicator, $indicatorView, $indicator/dimensions)'"/> … … 175 168 </xsl:if> 176 169 177 <xsl:if test="ibis:Kendo.showChart(CHART_NAME)">170 <xsl:if test="ibis:Graphic.showChart($request/CHART_NAME)"> 178 171 <xsl:call-template name="ContentContainer.expandable"> 179 <xsl:with-param name="title" select="if('Line'=$ Result.request/CHART_NAME)then 'Trend' else 'Chart'"/>172 <xsl:with-param name="title" select="if('Line'=$request/CHART_NAME)then 'Trend' else 'Chart'"/> 180 173 <xsl:with-param name="content"> 181 <xsl:call-template name=" Kendo.chartContainer">174 <xsl:call-template name="Graphic.chartContainer"> 182 175 <xsl:with-param name="containerID" select="'chart'"/> 183 176 <xsl:with-param name="title" select="'ibis:getChartTitle($indicator, $indicatorView, $Indicator.dimensions)'"/> … … 213 206 <xsl:with-param name="content"> 214 207 215 216 208 <!-- Data Notes --> 217 209 <xsl:call-template name="ContentContainer.contentBlockWithDelimitedTitleTextsNodesets"> 218 210 <xsl:with-param name="title" select="'Data Notes'"/> 219 <xsl:with-param name="titleAndTextsNodeset" select="$ Result.configuration/DATA_NOTES/DATA_NOTE"/>211 <xsl:with-param name="titleAndTextsNodeset" select="$configuration/DATA_NOTES/DATA_NOTE"/> 220 212 <xsl:with-param name="addWikiAttribute" select="true()"/> 221 213 </xsl:call-template> … … 226 218 <xsl:with-param name="content"> 227 219 <ul> 228 <xsl:for-each select="$Result.configuration/DATA_SOURCES/DATA_SOURCE"> 220 <xsl:variable name="Page.dataSources" select="$DataSources/DATA_SOURCES"/> 221 <xsl:for-each select="$configuration/DATA_SOURCES/DATA_SOURCE"> 229 222 <xsl:sort select="SORT_ODRER" order="ascending" data-type="number"/> 230 223 <li><xsl:value-of select="TEXT"/></li> … … 237 230 <xsl:call-template name="ContentContainer.contentBlockWithDelimitedTitleTextsNodesets"> 238 231 <xsl:with-param name="title" select="'Data Issues'"/> 239 <xsl:with-param name="titleAndTextsNodeset" select="$ Result.configuration/DATA_ISSUES/DATA_ISSUE"/>232 <xsl:with-param name="titleAndTextsNodeset" select="$configuration/DATA_ISSUES/DATA_ISSUE"/> 240 233 <xsl:with-param name="addWikiAttribute" select="true()"/> 241 234 </xsl:call-template> … … 249 242 <xsl:call-template name="Indicator.dataSources"/> 250 243 --> 244 251 245 </xsl:with-param> 252 246 <xsl:with-param name="show" select="false()"/> … … 257 251 </xsl:call-template> 258 252 259 260 261 <xsl:call-template name="Page.leafletKendoScript"> 262 </xsl:call-template> 263 </xsl:template> 264 265 266 267 268 269 270 271 <xsl:template name="Page.leafletKendoScript" 272 ibis:doc="Provides the kendo and leaflet javascript." 273 > 274 <xsl:if test="ibis:LeafletMap.showMap()"> 275 <xsl:call-template name="LeafletMap.choroplethJavaScript"/> 276 </xsl:if> 277 <xsl:variable name="measureValueFormatPattern" select="($Result.valueTypes/VALUE_TYPE[NAME = $Result.measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/> 278 279 <xsl:variable name="recordDimensionFields"> 280 <xsl:call-template name="Interactive.getRecordDimensionFields"> 281 <xsl:with-param name="dimensions" select="$Result.dimensions"/> 282 <xsl:with-param name="dimensionUsages" select="$Result.dimensionUsages"/> 283 </xsl:call-template> 284 </xsl:variable> 285 286 <xsl:variable name="datasetRecords" select="$Result.queryResult/RECORDS"/> 287 <xsl:variable name="ancillaryValueNames" select="$Result.configuration//ANCILLARY_VALUE/NAME"/> 288 <xsl:variable name="recordAncillaryValueFields"> 289 <xsl:call-template name="Interactive.getQueryRecordAncillaryValueFields"> 290 <xsl:with-param name="ancillaryValueNames" select="$ancillaryValueNames"/> 291 <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> 292 </xsl:call-template> 293 </xsl:variable> 294 295 253 <xsl:call-template name="Result.leafletKendoScript"> 254 <xsl:with-param name="queryModule" select="$queryModule"/> 255 <xsl:with-param name="configuration" select="$configuration"/> 256 <xsl:with-param name="request" select="$request"/> 257 <xsl:with-param name="showMap" select="$showMap"/> 258 </xsl:call-template> 296 259 <!-- 297 <xsl:message select="$datasetRecords"/>298 299 <xsl:message select="concat('~~~~~~~~~~~~~~~~~~~~Page.leafletKendoScript - Records count: ', count($datasetRecords/*), ', recordDimensionFields: ', count($recordDimensionFields/*))"/>300 <xsl:message select="$recordDimensionFields"/>301 302 <xsl:message select="'============= start of IV Interactive.'"/>303 <xsl:message select="$recordDimensionFields"/>304 <xsl:message select="'============= end of IV Interactive.'"/>305 306 <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/>307 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/>308 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/>309 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]])"/>310 <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/>311 <xsl:message select="concat('Interactive - Show Map: ', $Interactive.showMap, ', geoDimensionName:', $geoDimensionName)"/>312 313 <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/>314 <xsl:message select="$Page.comparisonDimensionName"/>315 <xsl:message select="$Page.comparisonDimensionValue"/>316 <xsl:message select="$indicatorViewInteractive./RECORD"/>317 318 <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/>319 <xsl:message select="$indicatorView/MAP_DIMENSION_NAME"/>320 <xsl:message select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/>321 260 --> 322 323 324 <!-- tried doing jsonp tech but callback func must be defined before doing the script jsonp325 so you'd have the variable = null, call back, end of script, include jsonp, then contructor326 script. Very messy - decided just to do simple var and include it.327 -->328 <script type="text/javascript">329 var records =330 [<xsl:text> </xsl:text>331 <xsl:call-template name="InteractiveJSON.getDatasetRecords">332 <xsl:with-param name="dimensions" select="$Result.dimensions"/>333 <xsl:with-param name="datasetRecords" select="$datasetRecords"/>334 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/>335 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/>336 <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/>337 </xsl:call-template>338 ];339 340 var kendoDataSource = new kendo.data.DataSource(341 <xsl:call-template name="Kendo.dataSourceConstructorJSON">342 <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/>343 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/>344 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/>345 </xsl:call-template>346 );347 348 var kendoGridConstructorJSON = $.extend349 (true, {}350 ,<xsl:call-template name="Kendo.baseGridJSON"/>351 ,<xsl:call-template name="Kendo.namedConfigurationJSON">352 <xsl:with-param name="configurationName" select="'IndicatorProfileGrid'"/>353 </xsl:call-template>354 ,<xsl:call-template name="Kendo.requestGridJSON">355 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/>356 <xsl:with-param name="measure" select="$Result.measure"/>357 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/>358 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/>359 <xsl:with-param name="showFooterRow" select="false()"/>360 <xsl:with-param name="showNoteColumn" select="false()"/>361 <xsl:with-param name="showLabelColumn" select="false()"/>362 </xsl:call-template>363 );364 365 var kendoChartConstructorJSON = $.extend366 (true, {}367 ,<xsl:call-template name="Kendo.baseChartJSON"/>368 ,<xsl:call-template name="Kendo.namedConfigurationJSON">369 <xsl:with-param name="configurationName" select="$Result.configuration/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="title" select="'ibis:getChartTitle($indicator, $indicatorView, $Indicator.dimensions)'"/>374 <xsl:with-param name="seriesTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/TITLE"/>375 <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/TITLE"/>376 <xsl:with-param name="valueTitle" select="$Result.measure/TITLE"/>377 378 <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/NAME"/>379 <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/NAME"/>380 381 <xsl:with-param name="includeDatasetSeries" select="1 < $recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/VALUE_COUNT"/>382 <xsl:with-param name="ancillaryValueNames" select="$ancillaryValueNames"/>383 </xsl:call-template>384 );385 //console.debug("%o", kendoChartConstructorJSON);386 //console.log(JSON.stringify(kendoChartConstructorJSON,null,2));387 388 var $kendoGrid;389 var $kendoChart;390 var $leafletMap;391 $(document).ready(function()392 {393 $kendoGrid = $("#grid").kendoGrid (kendoGridConstructorJSON);394 $kendoChart = $("#chart").kendoChart(kendoChartConstructorJSON);395 kendoDataSource.read(); // have to have after grid and chart because .autoBind = false.396 /*397 <xsl:if test="ibis:LeafletMap.showMap($Result.configuration/MAP_NAME)">398 var leafletMapConstructorJSON = $.extend399 (true, {}400 ,<xsl:call-template name="LeafletMap.baseJSON"/>401 ,<xsl:call-template name="LeafletMap.namedConfigurationJSON">402 403 <xsl:with-param name="configurationName" select="$Result.configuration/MAP_NAME"/>404 405 </xsl:call-template>406 ,<xsl:call-template name="LeafletMap.requestJSON">407 <!-- <xsl:with-param name="mapTitle" select="'Choropleth'"/> -->408 <xsl:with-param name="mapType" select="'choropleth'"/>409 </xsl:call-template>410 ,<xsl:call-template name="LeafletMap.choroplethJSON">411 412 <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/>413 <xsl:with-param name="geoJSONName" select="$Result.configuration/MAP_DIMENSION_NAME"/>414 415 <xsl:with-param name="geoIDFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $Result.configuration/MAP_DIMENSION_NAME]/NAME"/>416 <xsl:with-param name="geoIDFieldValuePrefixToRemove" select="concat($Result.configuration/MAP_DIMENSION_NAME, '.')"/>417 <xsl:with-param name="measureValueFieldName" select="'MeasureValue'"/>418 <xsl:with-param name="legendTitle" select="$Result.measure/TITLE"/>419 <xsl:with-param name="geoTypeTitle" select="ibis:getDimensionTitle($Result.queryModule//DIMENSIONS/DIMENSION[NAME = $Result.configuration/MAP_DIMENSION_NAME])"/>420 <xsl:with-param name="reverseColors" select="$Result.measure/DESIRABLE_VALUE = 1"/>421 <xsl:with-param name="desirableIndexValue" select="$Result.measure/DESIRABLE_VALUE"/>422 <xsl:with-param name="comparisonValue" select="$datasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Page.comparisonDimensionName) and (VALUE = $Page.comparisonDimensionValue)]]]/MEASURE/VALUE"/>423 </xsl:call-template>424 );425 $leafletMap = $("#map").leaflet(leafletMapConstructorJSON);426 <!--427 <xsl:call-template name="LeafletMap.mapsJavaScript"/>428 <xsl:call-template name="LeafletMap.namedMapJavaScript"/>429 -->430 </xsl:if>431 */432 433 }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~434 435 <xsl:call-template name="Kendo.chartsJavaScript"/>436 <xsl:call-template name="Kendo.namedChartJavaScript"/>437 <xsl:call-template name="Kendo.gridsJavaScript"/>438 <xsl:call-template name="Kendo.namedGridJavaScript"/>439 </script>440 261 </xsl:template> 441 262 -
trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/Result.xslt
r17255 r17416 16 16 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ PARAMS / VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~ --> 17 17 18 <xsl:param name="Measures"/> 19 <xsl:param name="Result.measures" select="$Measures/MEASURES"/> 20 21 <xsl:param name="AncillaryValues"/> 22 <xsl:param name="Result.ancillaryValues" select="$AncillaryValues/ANCILLARY_VALUES"/> 23 24 <xsl:param name="ValueTypes"/> 25 <xsl:param name="Result.valueTypes" select="$ValueTypes/VALUE_TYPES"/> 26 27 <xsl:param name="ValueAttributes"/> 28 <xsl:param name="Result.valueAttributes" select="$ValueAttributes/VALUE_ATTRIBUTES"/> 29 30 <xsl:param name="Dimensions"/> 31 <xsl:param name="Result.dimensions" select="$Dimensions/DIMENSIONS"/> 32 33 34 <xsl:param name="Result.comparisonDimensionName" select="'GeoState'"/> 35 <xsl:param name="Result.comparisonDimensionValue" select="'35'"/> 36 37 18 38 <xsl:param name="ShowDimensionValues" select="''" 19 39 ibis:doc="if t, y, or x then shows the dim value in a column for sorting." 20 40 /> 21 41 <xsl:param name="Result.showDimensionValueColumn" select="ibis:isFirstLetter_T_or_Y_or_X($ShowDimensionValues)"/> 42 22 43 23 44 <!-- value which contains the character that represents an IBISQ total value or an all value. --> … … 26 47 which is typically the '.' character." 27 48 /> 28 29 30 <xsl:param name="Result.queryModule" select="/QUERY_MODULE" ibis:doc="Internal convinience variable."/>31 32 <!-- used lots in these files: _values, _selections, _results, result, confirmation -->33 <xsl:param name="Result.configuration"34 select="$Result.queryModule/CONFIGURATIONS/CONFIGURATION[NAME=/QUERY_MODULE/REQUEST/CONFIGURATION_NAME]"35 ibis:doc="Provides a convinience variable to the selected36 query module configuration element. This value is also needed37 sometimes when dealing with the current element and its xpath."38 />39 40 <!-- both of the following variables are NOT needed other than for41 site specific navigation - allows turning on/off the graphic menu item.42 -->43 <xsl:param name="Result.queryResult" select="/QUERY_MODULE/IBISQ_QUERY_RESULT"44 ibis:doc="Internal convinience variable."45 />46 <xsl:param name="Result.datasetRecords" select="$Result.queryResult/RECORDS"47 ibis:doc="Internal convinience variable."48 />49 <xsl:param name="Result.request" select="$Result.queryModule/REQUEST"/>50 51 52 <xsl:param name="Result.resultURL" select="concat($ibis.urlPrefix, 'query/result/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html')"53 ibis:doc="Result page URL."54 />55 56 57 <xsl:param name="Result.measure"58 select="$Measures/MEASURES/MEASURE[NAME = $Result.queryModule/REQUEST/MEASURE_NAME]"59 ibis:doc="Internal convinience variable which holds current measure element."60 />61 62 <xsl:param name="Result.queryAncillaryValueNames" select="$Result.configuration/ANCILLARY_VALUE_NAMES/ANCILLARY_VALUE_NAME"/>63 <xsl:param name="Result.ancillaryValues" select="$Page.ancillaryValues/ANCILLARY_VALUE[(NAME = $Result.queryAncillaryValueNames) and (ACTIVE_FLAG = 'x')]"/>64 65 66 <xsl:param name="ValueTypes"/>67 <xsl:param name="Result.queryValueTypeNames" select="$Result.measure/VALUE_TYPE_NAME union $Result.ancillaryValues/VALUE_TYPE_NAME"/>68 <xsl:param name="Result.valueTypes" select="$ValueTypes//VALUE_TYPE[NAME = $Result.queryValueTypeNames]"/>69 70 <xsl:param name="Result.valueAttributes" select="$Page.valueAttributes/VALUE_ATTRIBUITES/VALUE_ATTRIBUITE[NAME = 'x']"/>71 72 73 <xsl:param name="Result.dimensions" select="$Result.queryModule/DIMENSIONS"/>74 49 75 50 … … 83 58 " 84 59 > 85 <xsl:variable name="countEndsWithStar" select="count( $Result.queryResult/RECORDS/RECORD/MEASURES/MEASURE[ends-with(VALUE, '*')])"/>86 <xsl:variable name="countEndsWithStarStar" select="count( $Result.queryResult/RECORDS/RECORD/MEASURES/MEASURE[ends-with(VALUE, '**')])"/>60 <xsl:variable name="countEndsWithStar" select="count(/QUERY_MODULE/IBISQ_QUERY_RESULT/RECORDS/RECORD/MEASURE[ends-with(VALUE, '*')])"/> 61 <xsl:variable name="countEndsWithStarStar" select="count(/QUERY_MODULE/IBISQ_QUERY_RESULT/RECORDS/RECORD/MEASURE[ends-with(VALUE, '**')])"/> 87 62 <xsl:if test="($countEndsWithStar != 0) and ($countEndsWithStar != $countEndsWithStarStar)"> 88 63 *Use caution in interpreting, the estimate has a relative standard … … 105 80 </xsl:param> 106 81 107 108 82 <xsl:param name="Result.requestErrorMessageContent"> 109 83 <div class="Error"> 110 <h2>Error: <xsl:value-of select=" $Result.queryModule/REQUEST/ERROR/TITLE"/></h2>84 <h2>Error: <xsl:value-of select="/QUERY_MODULE/REQUEST/ERROR/TITLE"/></h2> 111 85 112 86 There is a problem getting the specified query data from the … … 120 94 <br/><br/> 121 95 122 <div class="Note" title="{ $Result.queryModule/REQUEST/ERROR/TITLE}">96 <div class="Note" title="{/QUERY_MODULE/REQUEST/ERROR/TITLE}"> 123 97 <h3>More Error Detail:</h3> 124 <xsl:value-of select=" $Result.queryModule/REQUEST/ERROR/DESCRIPTION"/>98 <xsl:value-of select="/QUERY_MODULE/REQUEST/ERROR/DESCRIPTION"/> 125 99 </div> 126 100 </div><br/> … … 137 111 <br/><br/> 138 112 139 <div class="Note" title="{ $Result.queryModule/REQUEST/ERROR/TITLE}">113 <div class="Note" title="{/QUERY_MODULE/REQUEST/ERROR/TITLE}"> 140 114 <h3>More Error Detail:</h3> 141 <xsl:value-of select=" $Result.queryResult/ERROR"/>115 <xsl:value-of select="/QUERY_MODULE/REQUEST/ERROR"/> 142 116 </div> 143 117 </div><br/> … … 150 124 be actively trying to load a page. This is typically indicated by 151 125 your browser showing something spinning the browser tab. If this 152 is not the case click on this <a href="{$ Result.resultURL}" title="Resubmit query">get126 is not the case click on this <a href="{$Page.resultURL}" title="Resubmit query">get 153 127 query results</a> link. Otherwise be patient as your data will be 154 128 displayed as soon as they are available. … … 188 162 189 163 190 164 <xsl:template name="Result.dataTableValuesFootnote-AnotherVersion" 191 165 ibis:doc="template with ability to control text better..." 192 166 > 193 <xsl:if test="exists( $Result.queryResult/RECORDS/RECORD/MEASURES/MEASURE[ends-with(VALUE, '*')])">167 <xsl:if test="exists(//RECORDS/RECORD/MEASURE[ends-with(VALUE, '*')])"> 194 168 <div class="SupressedCellMessage"> 195 169 * Use caution in interpreting, the estimate has a relative standard … … 199 173 <br/><br/> 200 174 201 <xsl:if test="exists( $Result.queryResult/RECORDS/RECORD/MEASURES/MEASURE[VALUE = '**'])">175 <xsl:if test="exists(//RECORDS/RECORD/MEASURE[VALUE = '**'])"> 202 176 ** The estimate has been suppressed because 1) The relative standard error 203 177 is greater than 50% or when the relative standard error can't be determined. … … 223 197 " 224 198 > 199 200 <xsl:param name="queryModule" select="/QUERY_MODULE"/> 225 201 <xsl:param name="dimensionName" ibis:doc="Query result dimension name text to look up"/> 226 202 <xsl:param name="dimensionValue" ibis:doc="Query result dimension value to look up"/> … … 233 209 234 210 <xsl:param name="cleanValue" select="normalize-space($dimensionValue)"/> 235 <xsl:param name="dimensionElement" select="$ Result.queryModule/DIMENSIONS/DIMENSION[NAME=$dimensionName]"/>211 <xsl:param name="dimensionElement" select="$queryModule/DIMENSIONS/DIMENSION[NAME=$dimensionName]"/> 236 212 <xsl:param name="dimensionValueElement" select="$dimensionElement/VALUES/VALUE[normalize-space(text()[1])=$cleanValue]"/> 237 213 <!-- … … 279 255 280 256 281 <xsl:variable name="Result.dimensionUsages" 282 ibis:doc="Builds a dim usages struct like: 283 DIMENSION_USAGES 284 DIMENSION_USAGE 285 USAGE category 286 NAME Year 287 VALUES 288 VALUE 2012 289 VALUE 2011 290 VALUE 2010 257 258 <xsl:template name="Result.leafletKendoScript" 259 ibis:doc="Provides the kendo and leaflet javascript." 260 > 261 <xsl:param name="queryModule"/> 262 <xsl:param name="configuration"/> 263 <xsl:param name="request"/> 264 <xsl:param name="showMap"/> 265 266 <xsl:param name="measure" select="$Result.measures/MEASURE[NAME=$configuration/MEASURE_NAME]"/> 267 <xsl:param name="datasetRecords" select="$queryModule/IBISQ_QUERY_RESULT/RECORDS"/> 268 269 <xsl:param name="ancillaryValueNames" select="$configuration/ANCILLARY_VALUE_NAMES/ANCILLARY_VALUE_NAME"/> 270 <xsl:param name="ancillaryValues" select="$Result.ancillaryValues/ANCILLARY_VALUE[(NAME = $ancillaryValueNames) and (ACTIVE_FLAG = 'x')]"/> 271 272 <xsl:param name="measureValueFormatPattern" select="($Result.valueTypes/VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/> 273 274 <xsl:param name="x" select="$queryModule/DIMENSIONS/DIMENSION[NAME = xxxxxxxxxdimensionName]"/> 275 276 <xsl:param name="dimensions" select="$Result.dimensions"/> 277 278 <xsl:param name="queryValueTypeNames" select="$measure/VALUE_TYPE_NAME union $Result.ancillaryValues/VALUE_TYPE_NAME"/> 279 280 <xsl:param name="valueAttributes" select="$Result.valueAttributes/VALUE_ATTRIBUITES/VALUE_ATTRIBUITE[NAME = 'x']"/> 281 282 283 <xsl:if test="$showMap"> 284 <xsl:call-template name="Graphic.choroplethMapJavaScript"/> 285 </xsl:if> 286 287 <xsl:variable name="dimensionUsages" 288 ibis:doc="Builds a dim usages struct like: 289 DIMENSION_USAGES 290 DIMENSION_USAGE 291 USAGE category 292 NAME Year 293 VALUES 294 VALUE 2012 295 VALUE 2011 296 VALUE 2010 297 ... 298 DIMENSION_USAGE 291 299 ... 292 DIMENSION_USAGE 293 ... 294 " 295 > 300 " 301 > 296 302 <xsl:call-template name="getDimensionUsage"> 297 <xsl:with-param name="datasetRecords" select="$ Result.datasetRecords"/>303 <xsl:with-param name="datasetRecords" select="$datasetRecords"/> 298 304 <xsl:with-param name="usage" select="'category'"/> 299 <xsl:with-param name="dimensionName" select="$ Result.request/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME"/>305 <xsl:with-param name="dimensionName" select="$request/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME"/> 300 306 </xsl:call-template> 301 307 <xsl:call-template name="getDimensionUsage"> 302 <xsl:with-param name="datasetRecords" select="$ Result.datasetRecords"/>308 <xsl:with-param name="datasetRecords" select="$datasetRecords"/> 303 309 <xsl:with-param name="usage" select="'series'"/> 304 <xsl:with-param name="dimensionName" select="$ Result.request/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME"/>310 <xsl:with-param name="dimensionName" select="$request/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME"/> 305 311 </xsl:call-template> 306 312 <xsl:call-template name="getDimensionUsage"> 307 <xsl:with-param name="datasetRecords" select="$ Result.datasetRecords"/>313 <xsl:with-param name="datasetRecords" select="$datasetRecords"/> 308 314 <xsl:with-param name="usage" select="'constant'"/> 309 <xsl:with-param name="dimensionName" select="$ Result.request/ACTUAL_GROUP_BY/CONSTANT_DIMENSION_NAME"/>315 <xsl:with-param name="dimensionName" select="$request/ACTUAL_GROUP_BY/CONSTANT_DIMENSION_NAME"/> 310 316 </xsl:call-template> 311 </xsl:variable> 317 </xsl:variable> 318 319 <xsl:variable name="recordDimensionFields"> 320 <xsl:call-template name="Interactive.getRecordDimensionFields"> 321 <xsl:with-param name="dimensions" select="$dimensions"/> 322 <xsl:with-param name="dimensionUsages" select="$dimensionUsages"/> 323 </xsl:call-template> 324 </xsl:variable> 325 326 <xsl:variable name="recordAncillaryValueFields"> 327 <xsl:call-template name="Interactive.getQueryRecordAncillaryValueFields"> 328 <xsl:with-param name="ancillaryValueNames" select="$ancillaryValueNames"/> 329 <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> 330 </xsl:call-template> 331 </xsl:variable> 332 333 <!-- tried doing jsonp tech but callback func must be defined before doing the script jsonp 334 so you'd have the variable = null, call back, end of script, include jsonp, then contructor 335 script. Very messy - decided just to do simple var and include it. 336 --> 337 <script type="text/javascript"> 338 var records = 339 [<xsl:text> </xsl:text> 340 <xsl:call-template name="Dataset.getDatasetRecordsJSON"> 341 <xsl:with-param name="dimensions" select="$dimensions"/> 342 <xsl:with-param name="datasetRecords" select="$datasetRecords"/> 343 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 344 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 345 <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> 346 </xsl:call-template> 347 ]; 348 349 var kendoDataSource = new kendo.data.DataSource( 350 <xsl:call-template name="Kendo.dataSourceConstructorJSON"> 351 <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/> 352 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 353 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 354 </xsl:call-template> 355 ); 356 <xsl:message select="'Result.measure'"/> 357 <xsl:message select="/QUERY_MODULE/CONFIGURATIONS/CONFIGURATION/MEASURE_NAME"/> 358 <xsl:message select="$Measures//MEASURE[NAME='Pct0_17']/NAME"/> 359 <xsl:message select="$Measures/MEASURES/MEASURE[NAME='Pct0_17']"/> 360 <xsl:message select="$Measures/MEASURES/MEASURE[NAME=$configuration/MEASURE_NAME]"/> 361 <xsl:message select="'========='"/> 362 <xsl:message select="$measure"/> 363 364 var kendoGridConstructorJSON = $.extend 365 (true, {} 366 ,<xsl:call-template name="Kendo.baseGridJSON"/> 367 ,<xsl:call-template name="Kendo.namedConfigurationJSON"> 368 <xsl:with-param name="configurationName" select="'IndicatorProfileGrid'"/> 369 </xsl:call-template> 370 ,<xsl:call-template name="Kendo.requestGridJSON"> 371 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/> 372 <xsl:with-param name="measure" select="$measure"/> 373 <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> 374 <xsl:with-param name="recordAncillaryValueFields" select="$recordAncillaryValueFields"/> 375 <xsl:with-param name="showFooterRow" select="false()"/> 376 <xsl:with-param name="showNoteColumn" select="false()"/> 377 <xsl:with-param name="showLabelColumn" select="false()"/> 378 </xsl:call-template> 379 ); 380 381 var kendoChartConstructorJSON = $.extend 382 (true, {} 383 ,<xsl:call-template name="Kendo.baseChartJSON"/> 384 ,<xsl:call-template name="Kendo.namedConfigurationJSON"> 385 <xsl:with-param name="configurationName" select="$request/CHART_NAME"/> 386 </xsl:call-template> 387 ,<xsl:call-template name="Kendo.requestChartJSON"> 388 <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="'kendoDataSource'"/> 389 <xsl:with-param name="title" select="'ibis:getChartTitle($indicator, $indicatorView, $Indicator.dimensions)'"/> 390 <xsl:with-param name="seriesTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/TITLE"/> 391 <xsl:with-param name="categoryTitle" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/TITLE"/> 392 <xsl:with-param name="valueTitle" select="$measure/TITLE"/> 393 394 <xsl:with-param name="seriesFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/NAME"/> 395 <xsl:with-param name="categoryFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='category']/NAME"/> 396 397 <xsl:with-param name="includeDatasetSeries" select="1 < $recordDimensionFields/RECORD_DIMENSION_FIELD[USAGE='series']/VALUE_COUNT"/> 398 <xsl:with-param name="ancillaryValueNames" select="$ancillaryValueNames"/> 399 </xsl:call-template> 400 ); 401 //console.debug("%o", kendoChartConstructorJSON); 402 //console.log(JSON.stringify(kendoChartConstructorJSON,null,2)); 403 404 var $kendoGrid; 405 var $kendoChart; 406 var $leafletMap; 407 $(document).ready(function() 408 { 409 $kendoGrid = $("#grid").kendoGrid (kendoGridConstructorJSON); 410 $kendoChart = $("#chart").kendoChart(kendoChartConstructorJSON); 411 kendoDataSource.read(); // have to have after grid and chart because .autoBind = false. 412 /* 413 <xsl:if test="$showMap"> 414 var leafletMapConstructorJSON = $.extend 415 (true, {} 416 ,<xsl:call-template name="LeafletMap.baseJSON"/> 417 ,<xsl:call-template name="LeafletMap.namedConfigurationJSON"> 418 <xsl:with-param name="configurationName" select="$configuration/MAP_NAME"/> 419 </xsl:call-template> 420 ,<xsl:call-template name="LeafletMap.requestJSON"> 421 <!-- <xsl:with-param name="mapTitle" select="'Choropleth'"/> --> 422 <xsl:with-param name="mapType" select="'choropleth'"/> 423 </xsl:call-template> 424 ,<xsl:call-template name="LeafletMap.choroplethJSON"> 425 426 <xsl:with-param name="javascriptRecordArrayVariableName" select="'records'"/> 427 <xsl:with-param name="geoJSONName" select="$configuration/MAP_DIMENSION_NAME"/> 428 429 <xsl:with-param name="geoIDFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $configuration/MAP_DIMENSION_NAME]/NAME"/> 430 <xsl:with-param name="geoIDFieldValuePrefixToRemove" select="concat($configuration/MAP_DIMENSION_NAME, '.')"/> 431 <xsl:with-param name="measureValueFieldName" select="'MeasureValue'"/> 432 <xsl:with-param name="legendTitle" select="$measure/TITLE"/> 433 <xsl:with-param name="geoTypeTitle" select="ibis:getDimensionTitle($queryModule//DIMENSIONS/DIMENSION[NAME = $configuration/MAP_DIMENSION_NAME])"/> 434 <xsl:with-param name="reverseColors" select="$measure/DESIRABLE_VALUE = 1"/> 435 <xsl:with-param name="desirableIndexValue" select="$measure/DESIRABLE_VALUE"/> 436 <xsl:with-param name="comparisonValue" select="$datasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $Result.comparisonDimensionName) and (VALUE = $Result.comparisonDimensionValue)]]]/MEASURE/VALUE"/> 437 </xsl:call-template> 438 ); 439 $leafletMap = $("#map").leaflet(leafletMapConstructorJSON); 440 </xsl:if> 441 */ 442 443 }); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 444 </script> 445 </xsl:template> 446 312 447 313 448 <xsl:template name="getDimensionUsage"> … … 315 450 <xsl:param name="usage"/> 316 451 <xsl:param name="dimensionName"/> 317 <!-- 318 <xsl:message select="'************** GARTH'"/> 319 <xsl:message select="distinct-values($datasetRecords/RECORD/DIMENSIONS/DIMENSION[NAME = $dimensionName]/VALUE/text()[1])"/> 320 --> 452 321 453 <xsl:if test="0 != string-length($dimensionName)"> 322 454 <DIMENSION_USAGE> … … 334 466 </xsl:stylesheet> 335 467 <!-- ============================= End of File ============================= --> 336 468 <!-- 469 <xsl:param name="Page.dimensions" select="$Page.queryModule/DIMENSIONS"/> 470 471 472 <xsl:param name="Page.queryAncillaryValueNames" select="$Page.configuration/ANCILLARY_VALUE_NAMES/ANCILLARY_VALUE_NAME"/> 473 <xsl:param name="Page.ancillaryValues" select="$Result.ancillaryValues/ANCILLARY_VALUE[(NAME = $Page.queryAncillaryValueNames) and (ACTIVE_FLAG = 'x')]"/> 474 475 <xsl:param name="Page.queryValueTypeNames" select="$measure/VALUE_TYPE_NAME union $Result.ancillaryValues/VALUE_TYPE_NAME"/> 476 <xsl:param name="Page.valueTypes" select="$ValueTypes//VALUE_TYPE[NAME = $Page.queryValueTypeNames]"/> 477 478 <xsl:param name="Page.valueAttributes" select="$ValueAttributes/VALUE_ATTRIBUTES"/> 479 <xsl:param name="Page.valueAttributes" select="$Page.valueAttributes/VALUE_ATTRIBUITES/VALUE_ATTRIBUITE[NAME = 'x']"/> 480 481 <xsl:param name="Page.queryAncillaryValueNames" select="$Page.configuration/ANCILLARY_VALUE_NAMES/ANCILLARY_VALUE_NAME"/> 482 <xsl:param name="Page.ancillaryValues" select="$Result.ancillaryValues/ANCILLARY_VALUE[(NAME = $Page.queryAncillaryValueNames) and (ACTIVE_FLAG = 'x')]"/> 483 484 <xsl:param name="Page.queryValueTypeNames" select="$measure/VALUE_TYPE_NAME union $Result.ancillaryValues/VALUE_TYPE_NAME"/> 485 486 <xsl:param name="Page.valueAttributes" select="$ValueAttributes/VALUE_ATTRIBUTES"/> 487 <xsl:param name="Page.valueAttributes" select="$Page.valueAttributes/VALUE_ATTRIBUITES/VALUE_ATTRIBUITE[NAME = 'x']"/> 488 489 <xsl:message select="$datasetRecords"/> 490 491 <xsl:message select="concat('~~~~~~~~~~~~~~~~~~~~Page.leafletKendoScript - Records count: ', count($datasetRecords/*), ', recordDimensionFields: ', count($recordDimensionFields/*))"/> 492 <xsl:message select="$recordDimensionFields"/> 493 494 <xsl:message select="'============= start of IV Interactive.'"/> 495 <xsl:message select="$recordDimensionFields"/> 496 <xsl:message select="'============= end of IV Interactive.'"/> 497 498 <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/> 499 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/> 500 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME])"/> 501 <xsl:message select="exists($indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[DIMENSION_NAME = $Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]])"/> 502 <xsl:message select="$Indicator.dimensions/DIMENSION[exists(GEOGRAPHY_FLAG)]/NAME"/> 503 <xsl:message select="concat('Interactive - Show Map: ', $Interactive.showMap, ', geoDimensionName:', $geoDimensionName)"/> 504 505 <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/> 506 <xsl:message select="$Page.comparisonDimensionName"/> 507 <xsl:message select="$Page.comparisonDimensionValue"/> 508 <xsl:message select="$indicatorViewInteractive./RECORD"/> 509 510 <xsl:message select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX interact.xslt'"/> 511 <xsl:message select="$indicatorView/MAP_DIMENSION_NAME"/> 512 <xsl:message select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/> 513 514 --> -
trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/SiteSpecific.xslt
r17255 r17416 19 19 20 20 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ PARAMS / VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~ --> 21 <xsl:param name="SiteSpecific.chartsXMLFilePathAndName" select="concat($Page.baseContentFilePath, 'xml/charts.xml')"/>22 <xsl:param name="SiteSpecific.charts" select="document($SiteSpecific.chartsXMLFilePathAndName)/CHARTS"23 ibis:doc="Convenience variable which holds the CHARTS elements - could be injected."24 />25 26 <xsl:param name="SiteSpecific.mapsXMLFilePathAndName" select="concat($Page.baseContentFilePath, 'xml/maps.xml')"/>27 <xsl:param name="SiteSpecific.maps" select="document($SiteSpecific.mapsXMLFilePathAndName)/MAPS"28 ibis:doc="Convenience variable which holds the MAPS elements - could be injected."29 />30 31 32 21 <xsl:param name="SiteSpecific.builderURL" select="concat($ibis.urlPrefix, 'query/builder/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html')" 33 22 ibis:doc="Builder page URL." … … 99 88 <SELECTION> 100 89 <URL> 101 <xsl:value-of select="concat(replace($ Result.resultURL, '.html', '.xls'), '?PrinterFriendly=x&ShowDimensionValues=', $ShowDimensionValues)"/>90 <xsl:value-of select="concat(replace($Page.resultURL, '.html', '.xls'), '?PrinterFriendly=x&ShowDimensionValues=', $ShowDimensionValues)"/> 102 91 </URL> 103 92 <DESCRIPTION>Click this button to have this page automatically put into Microsoft Excel.</DESCRIPTION> -
trunk/ibisph-view/src/main/webapp/xslt/html/secure/query/module/result/SiteSpecific.xslt
r17255 r17416 18 18 19 19 <!-- ~~~~~~~~~~~~~~~~~~~~~~~ PARAMS / VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~ --> 20 <xsl:param name="Result.resultURL" select="concat($ibis.urlPrefix, 'secure/query/result/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html')" 21 ibis:doc="Result page URL." 22 /> 20 <xsl:param name="Page.resultURL" select="concat($ibis.urlPrefix, 'secure/query/result/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html')"/> 23 21 24 22 <xsl:param name="SiteSpecific.builderURL" select="concat($ibis.urlPrefix, 'secure/query/builder/', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.html')" … … 59 57 </SELECTION> 60 58 61 <xsl:if test="not($Result.configuration/CRITERIA/EXCLUDE/CHART_NAMES/ALL_FLAG)">59 <xsl:if test="not(Result.configuration/CRITERIA/EXCLUDE/CHART_NAMES/ALL_FLAG)"> 62 60 <SELECTION> 63 61 <DESCRIPTION>Display Chart</DESCRIPTION> … … 65 63 <SELECTIONS> 66 64 <xsl:for-each select="$Page.charts/CHART[ 67 (NAME != $Result.queryModule/REQUEST/CHART_NAME) and68 not(NAME = $Result.configuration/CRITERIA/EXCLUDE/CHART_NAMES/CHART_NAME)]"65 (NAME != /QUERY_MODULE/REQUEST/CHART_NAME) and 66 not(NAME = Result.configuration/CRITERIA/EXCLUDE/CHART_NAMES/CHART_NAME)]" 69 67 > 70 68 <xsl:sort select="SORT_ODRER" order="ascending" data-type="number"/> … … 105 103 <SELECTION> 106 104 <URL> 107 <xsl:value-of select="concat(replace($ Result.resultURL, '.html', '.xls'), '?PrinterFriendly=x&ShowDimensionValues=', $ShowDimensionValues)"/>105 <xsl:value-of select="concat(replace($Page.resultURL, '.html', '.xls'), '?PrinterFriendly=x&ShowDimensionValues=', $ShowDimensionValues)"/> 108 106 </URL> 109 107 <DESCRIPTION>Click this button to have this page automatically put into Microsoft Excel.</DESCRIPTION> -
trunk/ibisph-view/src/main/webapp/xslt/html/user/login/Page.xslt
r15958 r17416 212 212 <tr> 213 213 <td colspan="2"> 214 <xsl:if test="0 != string-length($ibis.userProfile/EMAIL_ADDRESS)"> 215 <xsl:call-template name="Help.popup"> 216 <xsl:with-param name="additionalClasses" select="'Right'"/> 217 <xsl:with-param name="title" select="'Already Logged In'"/> 218 <xsl:with-param name="content"> 219 You are currently logged in as: 220 <xsl:value-of select="$ibis.userProfile/FULL_NAME"/>, 221 with an email address of: 222 <xsl:value-of select="$ibis.userProfile/EMAIL_ADDRESS"/>. 223 Press the logout button if you want to logout 224 or simply relogin with different credentials. 225 </xsl:with-param> 226 </xsl:call-template> 227 </xsl:if> 228 214 229 <button type="submit" accesskey="L">Login</button> 215 <xsl:call-template name="Help.popup">216 <xsl:with-param name="additionalClasses" select="'Right'"/>217 <xsl:with-param name="title" select="'Already Logged In'"/>218 <xsl:with-param name="content">219 You are currently logged in as:220 <xsl:value-of select="$ibis.userProfile/FULL_NAME"/>,221 with an email address of:222 <xsl:value-of select="$ibis.userProfile/EMAIL_ADDRESS"/>.223 Press the logout button if you want to logout224 or simply relogin with different credentials.225 </xsl:with-param>226 </xsl:call-template>227 230 <button type="reset">Clear</button> 228 231 </td> -
trunk/ibisph-view/src/main/webapp/xslt/ibis.xslt
r17182 r17416 20 20 </ibis:doc> 21 21 22 <xsl:import href="_ibis-format.xslt"/> 23 <xsl:import href="_ibis-title.xslt"/> 24 <xsl:import href="_ibis-path.xslt"/> 25 <xsl:import href="_ibis-user.xslt"/> 26 <xsl:import href="_ibis-include.xslt"/> 22 27 23 <!-- ========================= P A R A M E T E R S and V A R I A B L E S24 The java servlet controller code adds ALL URL query request parameters25 to the XSLT transformation's parameters. Other special parameters are26 added as well.27 28 28 Many of the global type parameters are defined within this XSLT file. 29 The parameters are passed in via the Java XSLT transformation parameter 30 map (and thus are nameed according to the Java model map key value). 31 For ease of XSLT code maintenance these global XSLT parameters are 32 wrapped within an "ibis." prefix so that it is shown which XSLT file 33 contains the definition. 34 --> 35 <xsl:param name="ibis.adopterTitle" select="'State'" 36 ibis:doc="Value to be used when the XSLT code needs a title usage example 37 is CP reports that compare community, state, and US. This should be 38 overridden in the main ss.xslt with values like 'Utah', 'New Mexico' etc. 29 <!-- ========================= M I S C P A R A M S / F U N C T I O N S --> 30 <xsl:param name="xxxxxxxxxxxxxxxxxxxxxibis.invalidJavaScriptCharsToStrip" select="'.-+%$#@^*()=/'" 31 ibis:doc="Chars to strip from names and/or values when building the JSON 32 structs. 33 WAS IN QM RESULT INTERACTIVE 39 34 " 40 35 /> 41 36 42 <!-- RESOURCE ADDRESSING: The "WebAppURLContextPrefix" parameter is used to43 explicitly build URL addresses to site related resources. The value is44 typically pulled from the servlet context. The resource's path is relative45 to the application's root. The prefix and the relative root address are46 then concatenated together (along with a separator) to build a complete,47 explicit path for the resource. This value can either be hard coded as an48 XSLT variable or in this case is set as a parameter passed in from the49 XML/XSLT transformer.50 51 This full context path value is needed because relative paths do not work52 for sites that have resources under different directory paths. E.g. the53 browser tries to get the resource based on the current resource's path.54 Relative paths work well with sites that deliver dynamic content using a55 servlet call that is located at the root level of the application's context.56 Addressing anything within a site like this using a relative address path57 works since the current resource's path is the root directory.58 59 The resource could also be explicitly coded for a given application context60 (or as the default application - without any context path) but then the code61 is context deployment dependent and would need changing based on the context62 the app was deployed under. So the root "/" can't be used either...63 64 This solution is messier from an XSLT perspective and in making sure that the65 XML/XSLT transformer is passed the correct value and inserts the value in as66 the "WebAppURLContextPrefix" parameter. However, this is a safe way to ensure67 that the resources are found while remaining deployment context independent.68 69 OLDER SOLUTIONS:70 If the apps context is the root then this value should be '/'. If it's71 not then it should be something like: '/ibisph-view/'72 <xsl:variable name="webappURLContextPrefix" select="'/ibisph-view/'"/>73 <xsl:variable name="webappURLContextPrefix" select="concat('/', SystemServlet:System.getWebAppContextName(), '/')" xmlns:SystemServlet="org.ibisph.servlets.view"/>74 75 WORKS - should be a little faster than system properties...76 <xsl:variable name="webappURLContextPrefix" select="concat('/', SystemServlet:System.getWebAppContextName(), '/')" xmlns:SystemServlet="org.ibisph.servlet.view"/>77 78 ALSO WORKS:79 <xsl:variable name="webappURLContext" select="org.ibisph:SystemProperties.getProperty('WebAppContextName')" xmlns:org.ibisph="org.ibisph"/>80 <xsl:variable name="webappURLContextPrefix" select="concat('/', $webappURLContext, '/')"/>81 82 TRIED:83 doesn't blow but doesn't have the correct content path either...84 select="concat(java:org.springframework.web.context.support.StaticWebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, '/')" xmlns:java="http://xml.apache.org/xslt/java"85 86 ONE LINE PROPERTY CALL - WORKS:87 <xsl:variable name="webappURLContextPrefix" select="concat('/', org.ibisph:SystemProperties.getProperty('WebAppContextName'), '/')" xmlns:org.ibisph="org.ibisph"/>88 <xsl:variable name="webappURLContextPrefix" select="org.ibisph:SystemProperties.getProperty('WebAppURLContextPrefix')" xmlns:org.ibisph="org.ibisph"/>89 -->90 <xsl:param name="WebAppContextURLPrefix"91 ibis:doc="Prefix used/needed for referencing resources within the site."92 />93 <xsl:variable name="ibis.urlPrefix" select="$WebAppContextURLPrefix"94 ibis:doc="WebAppContextURLPrefix access variable that all pages should use.95 Has the 'ibis.' prefix to know what XSLT the variable/param is defined in.96 "97 />98 99 <xsl:param name="WebAppRemoteURLPrefix" select="$ibis.urlPrefix"100 ibis:doc="101 Prefix used/needed for referencing this apps resources outside the102 site. This value is primarily used for the site search.103 "104 />105 <xsl:variable name="ibis.remoteURLPrefix" select="$WebAppRemoteURLPrefix"106 ibis:doc="WebAppRemoteURLPrefix access variable that any pages could use.107 Has the 'ibis.' prefix to know what XSLT the variable/param is defined in.108 "109 />110 111 <xsl:param name="UserProfile"112 ibis:doc="User's XML Profile document. Must provide a default node type113 value so that $UserProfile//AUTHORITIES will work when no user profile114 doc is injected. Otherwise the following type of check is needed:115 xsl:with-param name='userAuthorities' select='if(boolean($UserProfile))then $UserProfile//AUTHORITIES else ''116 "117 />118 <xsl:variable name="ibis.userProfile"119 ibis:doc="User Profile XML variable that all pages should use. Has the120 'ibis.' prefix to know what XSLT the variable/param is defined in.121 "122 >123 <xsl:choose>124 <xsl:when test="not($UserProfile)">125 <FULL_NAME>Not Authenticated</FULL_NAME>126 </xsl:when>127 <xsl:when test="exists($UserProfile/USER)">128 <xsl:copy-of select="$UserProfile/USER/*"/>129 </xsl:when>130 <xsl:when test="exists($UserProfile)">131 <xsl:copy-of select="$UserProfile"/>132 </xsl:when>133 <xsl:otherwise>134 <FULL_NAME>Not Authenticated</FULL_NAME>135 </xsl:otherwise>136 </xsl:choose>137 </xsl:variable>138 <xsl:param name="ibis.userAuthorities" select="$ibis.userProfile/AUTHORITIES"139 ibis:doc="Variable used by the ibis:hasAuthority function or can be used directly."140 />141 142 143 <xsl:param name="XMLModifedDate"144 ibis:doc="Parameter which is set via the Java model code so that the145 resultant page can display the XML file's modified date/time."146 />147 <xsl:variable name="ibis.XMLModifedDate"148 select="if(string-length($XMLModifedDate) = 0) then //ibis:doc/versions/version[1]/date else $XMLModifedDate"149 ibis:doc="Variable that wraps the 'XMLModifedDate' parameter so that we150 know where this variable/parameter is defined. If the parameter151 value is not specified then the parameter defaults to selecting the152 XML document's ibis:doc version date."153 />154 155 156 <!-- tried all sorts of patterns for time zone [ZN,*-3] [ZMST], [ZN,MST] etc... -->157 <xsl:param name="ibis.dateTimeFormatPicture" select="'[FNn,*-3], [D01] [MNn] [Y0001] [H]:[m]:[s]'"/>158 <xsl:param name="ibis.dateFormatPicture" select="'[FNn,*-3], [D01] [MNn] [Y0001]'"/>159 <xsl:param name="ibis.timeFormatPicture" select="'[H]:[m]:[s]'"/>160 161 162 <!-- ===================================================== G E N E R A L -->163 37 <xsl:function name="ibis:isFirstLetter_T_or_Y_or_X" as="xs:boolean" 164 38 ibis:doc="Returns 'true' if the text is 'T'rue, 'Y'es, or 'x' - 'false' otherwise (case insensitive)." … … 170 44 </xsl:function> 171 45 172 <xsl:function name="ibis:isAuthenticated" as="xs:boolean" 173 ibis:doc="localizes checking the UserProfile param exists as a node. 174 Note the not not is needed to handle string vs node xslt problem. 175 Exists returns true for any/all defined variables/params. not 176 handles a null or zero len string as false and also handles an 177 empty node set as false. 178 " 46 47 <xsl:param name="PrinterFriendly" ibis:doc="The 'PrinterFriendly' parameter 48 controls which main root processing template is called. This enables the 49 system to easily allow for all pages to be made printer friendly. This 50 parameter is set via the Java controller code and comes from the HTTP 51 request URL." 52 /> 53 <xsl:function name="ibis:isPrinterFriendly" as="xs:boolean" 54 ibis:doc="localizes and hides the 'PrinterFriendly' parameter and isTYZ code." 179 55 > 180 <xsl:value-of select=" not(not($UserProfile))"/>56 <xsl:value-of select="ibis:isFirstLetter_T_or_Y_or_X($PrinterFriendly) or ($PrinterFriendly = 'bw') or ($PrinterFriendly = 'BW')"/> 181 57 </xsl:function> 182 58 183 <xsl:function name="ibis:hasAuthorities" as="xs:boolean" 184 ibis:doc="localizes checking if the user is authenticated and if so if 185 they have an authority (secure type user). 186 " 59 60 <xsl:function name="ibis:getJavaScriptValue" as="xs:string" 61 ibis:doc="If value exists then returns value otherwise null." 187 62 > 188 <xsl:value-of select="if(ibis:isAuthenticated()) then exists($ibis.userAuthorities/AUTHORITY) else false()"/> 189 </xsl:function> 190 191 <xsl:function name="ibis:hasAuthority" as="xs:boolean" 192 ibis:doc="localizes checking the user authorities against the passed in 193 AUTHORITY. If an AUTHORITY's text() matches one of the user's 194 AUTHORITY values then true is returned. Else false is returned. 195 This function is dependent on the global UserAuthorities param 196 which needs to be injected via the java controller/transformer code. 197 " 198 > 199 <xsl:param name="authority" ibis:doc="AUTHORITY value to be tested for."/> 200 <xsl:value-of select="not(exists($authority)) or exists($ibis.userAuthorities[AUTHORITY = $authority])"/> 63 <xsl:param name="value" ibis:doc="Value to be tested."/> 64 <xsl:value-of select="if((string-length($value) != 0) and (string(number($value)) != 'NaN')) then $value else 'null'"/> 201 65 </xsl:function> 202 66 … … 217 81 </xsl:function> 218 82 219 <!-- =========================== F O R M A T T I N G F U N C T I O N S -->220 <xsl:decimal-format name="ibis.defaultDecimalNumberFormat" NaN=" * " zero-digit="0"221 ibis:doc="Default format for the 'ibis:formatNumber function."222 />223 <xsl:param name="ibis.defaultNumericPicture" select="',##0.##'"224 ibis:doc="default number picture format. Done as a variable so that225 site specefic templates can override."226 />227 228 <!-- XSLT 2.0 does NOT provide for any literals inside the picture string that are229 defined as a format character. So to embed a "%" sign without actually multiplying230 the value by 100 a format picture in XSLT 1.0 could simply be "#.#'%'". In XSLT 2231 it shows the #.#'%' with the value multiplied. The way to get around this is to232 change the % character with the decimal numeric format. However some value will233 need to be multiplied so the easiest way to deal with this is to simply replace234 '%' with '' and add the % character to the end of the string.235 See: http://www.w3.org/TR/xslt20/#defining-decimal-format.236 237 Below is an example of how to redefine the % character:238 <xsl:decimal-format name="ibis.percentSuffixDecimalNumberFormat" NaN=" * " zero-digit="0" percent="^"239 ibis:doc="Decimal format that redefines the % character so it doesn't interfere with the240 format picture string."241 />242 -->243 <xsl:param name="ibis.numberFormatQuotedPercentString" ibis:doc="Percentage244 suffix signature to be searched and replaced with null and which signals245 to concat the % sign to the end of the formatted value. This value should246 match the value used by the admin system to signify that a % should be247 added as a numeric suffix. If the % is standalone then the value should248 be of the form 0.xx which will then cause the format number code to mult249 by 100 and add the %. Otherwise the value will be displayed 100x's too250 large (xx00.00%)."251 >'%'</xsl:param>252 253 254 255 <xsl:function name="ibis:getJavaScriptValue" as="xs:string"256 ibis:doc="If value exists then returns value otherwise null."257 >258 <xsl:param name="value" ibis:doc="Value to be tested."/>259 <xsl:value-of select="if((string-length($value) != 0) and (string(number($value)) != 'NaN')) then $value else 'null'"/>260 </xsl:function>261 262 263 <xsl:function name="ibis:getFormattedNumber" as="xs:string"264 ibis:doc="Numeric formatter that localizes the handling of numeric values.265 If a format is not specified then the common.defaultFormat is used."266 >267 <xsl:param name="number" ibis:doc="Value to be formatted. If the value is268 non numeric then that value will be returned. Otherwise the format269 picture will be applied."270 />271 <xsl:param name="picture" ibis:doc="Format to be applied. If '' is specified272 then the ibis.defaultNumericPicture is used. If 'none' is specified then273 the actual value passed in will be used."274 />275 <xsl:value-of select="ibis:getFormattedValue($number, $picture, '')"/>276 </xsl:function>277 278 279 <xsl:function name="ibis:getFormattedValue" as="xs:string"280 ibis:doc="Numeric formatter that localizes the handling of numeric values281 with a default null value. If a format is not specified then the282 common.defaultFormat is used.283 "284 >285 <xsl:param name="number" ibis:doc="Value to be formatted. If the value is286 non numeric then that value will be returned. Otherwise the format287 picture will be applied."288 />289 <xsl:param name="picture" ibis:doc="Format to be applied. If '' is specified290 then the ibis.defaultNumericPicture is used. If 'none' is specified then291 the actual value passed in will be used."292 />293 <xsl:param name="valueIfNull"294 ibis:doc="Value to use if the number param value is not something."295 />296 <xsl:variable name="value">297 <xsl:choose>298 <xsl:when test="(string-length(string($number)) != 0) or not($valueIfNull)">299 <xsl:value-of select="$number"/>300 </xsl:when>301 <xsl:otherwise>302 <xsl:value-of select="$valueIfNull"/>303 </xsl:otherwise>304 </xsl:choose>305 </xsl:variable>306 <xsl:choose>307 <xsl:when test="$picture='none'"><xsl:value-of select="$value"/></xsl:when>308 <xsl:when test="string(number($value))='NaN'"><xsl:value-of select="$value"/></xsl:when>309 310 <!-- put this in because UT had some messed up QM configurations -->311 <xsl:when test="count($picture) > 1">312 <xsl:message select="'***ibis:getFormattedValue - TOO MANY XSLT FORMATS***, picture:'"/>313 <xsl:message select="$picture"/>314 <xsl:value-of select="'CONTENT ERROR - TOO MANY XSLT FORMATS - PLEASE CONTACT US!!!'"/>315 </xsl:when>316 317 <!-- if format string was passed in, then check for the '%' string.318 If found then need to replace with a null and add the % to the319 end. See comments about about how XSLT 2.0 does not allow for320 literals that match one of the defined format control chars321 without effecting formatting.322 323 Else if the string doesn't contain the special percent character324 suffix signature then simply use as is.325 -->326 <xsl:when test="string-length($picture) != 0">327 <xsl:choose>328 <xsl:when test="contains($picture, $ibis.numberFormatQuotedPercentString)">329 <xsl:value-of select="concat(format-number($value, replace($picture,$ibis.numberFormatQuotedPercentString,''), 'ibis.defaultDecimalNumberFormat'), '%')"/>330 </xsl:when>331 <xsl:otherwise>332 <xsl:value-of select="format-number($value, $picture, 'ibis.defaultDecimalNumberFormat')"/>333 </xsl:otherwise>334 </xsl:choose>335 </xsl:when>336 337 <xsl:otherwise>338 <xsl:value-of select="format-number($value, $ibis.defaultNumericPicture, 'ibis.defaultDecimalNumberFormat')"/>339 </xsl:otherwise>340 </xsl:choose>341 </xsl:function>342 343 344 <!-- See: http://stackoverflow.com/questions/16892344/convert-a-string-to-date-format-in-xslt -->345 <xsl:function name="ibis:getFormattedDateTime" as="xs:string"346 ibis:doc="Localizes date and time formatting. Uses the ibis.dateTimeFormatPicture param."347 >348 <xsl:param name="dateTime" ibis:doc="DateTime value to be formatted.349 Call with current-dateTime() to get current system date and time."350 />351 <xsl:value-of select="format-dateTime($dateTime, $ibis.dateTimeFormatPicture)"/>352 </xsl:function>353 <xsl:function name="ibis:getFormattedDate" as="xs:string"354 ibis:doc="Localizes date formatting. Uses the ibis.dateFormatPicture param."355 >356 <xsl:param name="date" ibis:doc="Date value to be formatted. Call with357 current-date() to get current system date."358 />359 <xsl:value-of select="format-date($date, $ibis.dateFormatPicture)"/>360 </xsl:function>361 <xsl:function name="ibis:getFormattedTime" as="xs:string"362 ibis:doc="Localizes time formatting. Uses the ibis.timeFormatPicture param."363 >364 <xsl:param name="time" ibis:doc="Time value to be formatted. Call with365 current-time() to get current system time."366 />367 <xsl:value-of select="format-time($time, $ibis.timeFormatPicture)"/>368 </xsl:function>369 370 371 372 <xsl:function name="ibis:getCompleteURL" as="xs:string"373 ibis:doc="tests the supplied URL and if no http prefix then the webapp374 context is added."375 >376 <xsl:param name="url" ibis:doc="URL to be tested/adjusted. If the value377 begins with http then URL is returned untouched. Else the webapp378 prefix is added and returned."379 />380 <xsl:value-of select="if(starts-with($url,'http')) then $url else concat($ibis.urlPrefix, $url)"/>381 </xsl:function>382 383 384 385 <xsl:function name="ibis:getDimensionTitle" as="xs:string"386 ibis:doc="localizes and hides the if LABEL else TITLE code."387 >388 <xsl:param name="dimension"/>389 <xsl:value-of select="390 if(0 != string-length($dimension/LABEL))391 then $dimension/LABEL392 else $dimension/TITLE393 "/>394 </xsl:function>395 396 <xsl:function name="ibis:getDimensionValueTitle" as="xs:string"397 ibis:doc="localizes and getting the value TITLE."398 >399 <xsl:param name="dimension"/>400 <xsl:param name="dimensionValue"/>401 402 <xsl:value-of select="$dimension/VALUES/VALUE[ normalize-space(text()[1]) = $dimensionValue]/TITLE"/>403 </xsl:function>404 405 <xsl:function name="ibis:getPeriodDimensionValuesTitle" as="xs:string"406 ibis:doc="Builds single or range of period dimension values."407 >408 <xsl:param name="indicatorView" ibis:doc="Indicator Profile View to be used to get the dim values."/>409 <xsl:param name="dimensions" ibis:doc="actual dimensions."/>410 411 <xsl:variable name="periodDimension" select="($dimensions/DIMENSION[NAME = $indicatorView/PERIOD_DIMENSION_NAME])[1]"/>412 <xsl:variable name="indicatorViewDimensionValues" select="$indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[NAME = $indicatorView/PERIOD_DIMENSION_NAME]/VALUES"/>413 <xsl:variable name="firstDimensionValue" select="$indicatorViewDimensionValues/VALUE[1]/text()"/>414 <xsl:variable name="lastDimensionValue" select="$indicatorViewDimensionValues/VALUE[last()]/text()"/>415 416 <xsl:value-of select="if($firstDimensionValue = $lastDimensionValue)417 then ibis:getDimensionValueTitle($periodDimension, $firstDimensionValue)418 else concat(ibis:getDimensionValueTitle($periodDimension, $firstDimensionValue),419 ' to ',420 ibis:getDimensionValueTitle($periodDimension, $lastDimensionValue)421 )"/>422 </xsl:function>423 424 425 <xsl:function name="ibis:getChartTitle" as="xs:string"426 ibis:doc="localizes and hides the if CHART_TITLE_OVERRIDE else built TITLE code."427 >428 <xsl:param name="indicator" ibis:doc="Indicator Profile needed for complete IV title."/>429 <xsl:param name="indicatorView" ibis:doc="Indicator Profile needed for CHART_TITLE_OVERRIDE and complete IV title."/>430 <xsl:param name="dimensions" ibis:doc="actual dimensions."/>431 <xsl:value-of select="432 if(0 != string-length($indicatorView/CHART_TITLE_OVERRIDE))433 then $indicatorView/CHART_TITLE_OVERRIDE434 else ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView, $dimensions)435 "/>436 </xsl:function>437 438 <xsl:function name="ibis:getMapTitle" as="xs:string"439 ibis:doc="localizes and hides the if MAP_TITLE_OVERRIDE else built TITLE code."440 >441 <xsl:param name="indicator" ibis:doc="Indicator Profile needed for complete IV title."/>442 <xsl:param name="indicatorView" ibis:doc="Indicator Profile needed for MAP_TITLE_OVERRIDE and complete IV title."/>443 <xsl:param name="dimensions" ibis:doc="actual dimensions."/>444 <xsl:value-of select="445 if(0 != string-length($indicatorView/MAP_TITLE_OVERRIDE))446 then $indicatorView/MAP_TITLE_OVERRIDE447 else ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView, $dimensions)448 "/>449 </xsl:function>450 451 <xsl:function name="ibis:getIndicatorTitle" as="xs:string"452 ibis:doc="Uses CONCISE_TITLE if present otherwise the main title."453 >454 <xsl:param name="indicator" ibis:doc="Indicator Profile to be used to get the title from."/>455 <xsl:value-of select="456 if(0 != string-length($indicator/CONCISE_TITLE))457 then $indicator/CONCISE_TITLE458 else $indicator/TITLE459 "/>460 </xsl:function>461 462 <xsl:function name="ibis:getCompleteIndicatorViewTitle" as="xs:string"463 ibis:doc="Builds a complete view title."464 >465 <xsl:param name="indicator" ibis:doc="Indicator Profile needed for CONCISE_TITLE."/>466 <xsl:param name="indicatorView" ibis:doc="Indicator Profile View to be used to build the title from."/>467 <xsl:param name="dimensions" ibis:doc="actual dimensions."/>468 <xsl:value-of select="concat(ibis:getIndicatorTitle($indicator), ' ',469 $indicatorView/TITLE, ', ',470 ibis:getPeriodDimensionValuesTitle($indicatorView, $dimensions))"471 />472 </xsl:function>473 474 475 476 <!-- ===================================== M A T C H C O P Y M O D E -->477 <xsl:template match="*" mode="ibis.copy"478 ibis:doc="Provides the ability to do an apply-templates to a copy-of of479 an element (some call this an 'identity transformation'). This480 allows for a deep copy with processing (which also allows ibis.include481 to be processed)."482 >483 <!-- Used the new element and copied the attributes, text, and sub484 elements so that any namespace attributes would not be copied.485 <xsl:apply-templates select="@*" mode="ibis.copy"/>486 <xsl:message>IBIS.COPY</xsl:message>487 -->488 <xsl:element name="{local-name()}">489 <xsl:apply-templates select="current()/@* | current()/text() | current()/*" mode="ibis.copy"/>490 </xsl:element>491 </xsl:template>492 493 494 <xsl:template match="text()" mode="ibis.copy" ibis:doc="copies the text.">495 <!-- trims the text - not really needed for wiki - biggest issue with weird text496 was page indent on and extra line spacing etc.497 <xsl:value-of select="replace(., '^\s+|\s+$', '')"/>498 -->499 <xsl:value-of select="."/>500 </xsl:template>501 502 <!-- Match Copy Mode was lifted from the page.xslt in 4/2007. That code has a note503 about 4-18-06: removed template code and replaced with the mode="ibis.copy"504 templates above because the namespace was being copied into some HTML elements.505 See: http://www.stylusstudio.com/xsllist/200008/post50850.html506 -->507 508 <!-- The following templates are used to help page developers avoid having to509 hard code the deployment specific context into the URL path of IBIS related510 web pages. Example: If the app is deployed into a context called "ibisph-view"511 and your page is "http://localhost/ibisph-view/about/welcome.html" and it512 references an image that is under the "webapps/ibisph-view/image" directory513 it would need a url like "src='/ibisph-view/image/the_image.gif'" to properly514 get the correct resource. A relative path of "src='image/the_image.gif'"515 would cause the browser to request "http://localhost/ibisph-view/about/image/the_image.gif",516 while a path of "src='/image/the_image.gif'" would request this resource517 "http://localhost/image/the_image.gif" both of which are wrong. If the context518 path is coded so that the resource's URL is explicitly defined then a dependency519 exists between the web pages and the context which makes the deployment not520 as portable. Since the web app context path is needed by the XSLTs to build521 the correct HTML code it is implemented here to help static page development.522 Relative links work fine if the resource it within the same directory e.g.523 if the "about/welcome.html" page contains a relative link to the "about/content_usage.html"524 page then all is well. The "about/welcome.html" page can NOT contains a relative525 link to the "indicator/introduction.html" as it will not find the correct526 directory.527 -->528 529 <!-- Local IBIS URL adjustment templates. These templates simply add the web application's530 context path as a prefix to the link reference attribute.531 -->532 <xsl:template match="@ibis:href" mode="ibis.copy" ibis:doc="Inner 'ibis:href' template that adds the 'WebAppURLContextPrefix' to the 'href' attribute.">533 <xsl:attribute name="href" select="concat($ibis.urlPrefix, .)"/>534 </xsl:template>535 <xsl:template match="@ibis:src" mode="ibis.copy" ibis:doc="Inner 'ibis:src' template that adds the 'WebAppURLContextPrefix' to the 'src' attribute.">536 <xsl:attribute name="src" select="concat($ibis.urlPrefix, .)"/>537 </xsl:template>538 <xsl:template match="@ibis:action" mode="ibis.copy" ibis:doc="Inner 'ibis:action' template that adds the 'WebAppURLContextPrefix' to the 'action' attribute.">539 <xsl:attribute name="action" select="concat($ibis.urlPrefix, .)"/>540 </xsl:template>541 542 <xsl:template match="ibis:urlPrefix" mode="ibis.copy" ibis:doc="Mechanism that allows the HTML_CONTENTN PAGE type XML content to get the ibis:urlPrefix value. This is useful for pages that have javascript that need this value.">543 <xsl:value-of select="$ibis.urlPrefix"/>544 </xsl:template>545 546 <xsl:template match="@*" mode="ibis.copy" ibis:doc="Inner '@*' template that copies the non ibis: namespace attributes">547 <xsl:copy-of select="."/>548 </xsl:template>549 550 <xsl:template match="@ibis:doc" mode="ibis.copy" ibis:doc="Eats ibis:doc attribute"/>551 <xsl:template match="ibis:doc" mode="ibis.copy" ibis:doc="Eats ibis:doc element"/>552 553 554 555 <!-- =============================== I B I S I N C L U D E M A T C H -->556 <xsl:template match="ibis:include" mode="#all"557 ibis:doc="558 'ibis:' namespace specific match template which opens559 the document via the 'href' attribute and does an 'apply-template'560 operation on its contents to process sub 'ibis:include' statements561 and to copy its text, attributes, and processing instructions.562 563 Provides the IBISPH system the ability to do simple xinclude564 type operations. As of 6-2004 the xerces parser 2.6.x has xinclude support565 but it must be configured when starting the Java JVM or with Java system566 properties. Since this might not be an option for some deployments (like567 Utah's state wide ITS app server) the system wide property solution is not568 an option. To handle being able to deploy into environments where we don't569 know which XSL engine is being used this two step xinclude processing570 was developed. This option is not nearly as seamless and requires that571 the java controller do 2 transformations - the first being this xinclude572 type transformation with the second being the normal desired page type573 transformation. Another option was to do the xinclude template inside the574 XSLT as a variable then use that variable for all XML nodes. This option575 appears to be somewhat slow but it is seamless.576 577 See: http://www.sagehill.net/docbookxsl/Xinclude.html578 579 This page simply copies the contents of the base document and when it580 hits the ibis:include element it opens the document with an XSLT document581 call based on the href attribute of the xi:include element. These582 elements are then copied into the source document.583 584 NOTE: the included document MUST be a valid XML file e.g. well585 formed with a root/master/parent element.586 587 If a children-only-flag attribute exists in the element then only588 only the sub elements and child text are included and processed.589 This is useful for including an element's text without having to590 include its root element.591 "592 >593 <!-- this only copies child content - skips container element.594 <xsl:copy>595 <xsl:apply-templates select="document(@href, /)" mode="ibis.include"/>596 </xsl:copy>597 <xsl:message select="document(@href, /)"/>598 <xsl:message select="concat('FOUND IBIS INCLUDE: ', @href)"/>599 600 <xsl:message select="@children-only-flag"/>601 <xsl:message select="document(@href, /)602 603 <xsl:choose>604 <xsl:when test="exists(@include-children-only)">605 <xsl:apply-templates select="document(@href, /)/(text() | *)" mode="ibis.copy"/>606 </xsl:when>607 <xsl:otherwise>608 <xsl:apply-templates select="document(@href, /)" mode="ibis.copy"/>609 </xsl:otherwise>610 </xsl:choose>611 612 OLD CODE: then document(@href, /)/(text() | *)613 had an issue seen with topic HTML_CONTENT pages including textual blocks with614 child specified. What happened was that the root container element was copied615 into the doc - not just the children element(s) and text. So it looked okay but616 was wrong HTML as it contained the XML container element.617 -->618 619 <xsl:variable name="url" select="if(0 != string-length(@use-prefix)) then concat($ibis.urlPrefix, @href) else @href"/>620 621 <xsl:apply-templates select=622 "if(exists(@children-only-flag))623 then document($url, /)/(*/text() | */*)624 else document($url, /)625 "626 mode="ibis.copy"627 />628 </xsl:template>629 630 631 <xsl:template match="ibis:include[boolean(@child-name)]" mode="#all"632 ibis:doc="633 Provides the ability to limit includes to a given child element that634 has a NAME that matches the supplied child-name attribute.635 "636 >637 <xsl:variable name="url" select="if(0 != string-length(@use-prefix)) then concat($ibis.urlPrefix, @href) else @href"/>638 <xsl:variable name="childNameElementValue" select="@child-name"/>639 <xsl:message select="concat('********* @child-name: ', $childNameElementValue, ', url: ', $url)"/>640 <xsl:message select="document($url, /)/*/*[NAME=$childNameElementValue]"/>641 <xsl:message select="'*************** END'"/>642 643 <xsl:apply-templates select="document($url, /)/*/*[NAME=$childNameElementValue]" mode="ibis.copy"/>644 </xsl:template>645 646 647 <xsl:template match="ibis:include[boolean(@child-name-list)]" mode="#all"648 ibis:doc="649 Provides the ability to limit includes to a given child element that650 has a NAME that matches the supplied child-name attribute.651 "652 >653 <xsl:variable name="childNames" select="tokenize( normalize-space(replace(@child-name-list, ',', ' ')), '\s+')"/>654 <xsl:variable name="url" select="if(0 != string-length(@use-prefix)) then concat($ibis.urlPrefix, @href) else @href"/>655 <xsl:variable name="doc" select="document($url, /)"/>656 <xsl:message select="concat('********* name: ', name($doc/*), ', url: ', $url)"/>657 658 <xsl:if test="not(@children-only-flag)">659 <xsl:element name="{name($doc/*)}">660 <xsl:apply-templates select="$doc/*/*[NAME=$childNames]" mode="ibis.copy"/>661 </xsl:element>662 </xsl:if>663 <xsl:if test="boolean(@children-only-flag)">664 <xsl:apply-templates select="$doc/*/*[NAME=$childNames]" mode="ibis.copy"/>665 </xsl:if>666 </xsl:template>667 668 83 </xsl:stylesheet> 669 670 671 672 <!-- left here for posterity - a way to totally replace an element...673 <xsl:template match="ibis:a">674 <xsl:element name="a">675 <xsl:attribute name="href"><xsl:value-of select="concat($ibis.urlPrefix, @href)"/></xsl:attribute>676 <xsl:copy-of select="attribute::*[name() != 'href']"/>677 <xsl:apply-templates select="current()/text() | current()/*"/>678 </xsl:element>679 </xsl:template>680 -->681 <!-- img elements do not contain any text or other elements so it doesn't need682 to process/worry about anything other than it's attributes.683 <xsl:template match="ibis:img">684 <img>685 <xsl:attribute name="src"><xsl:value-of select="concat($ibis.urlPrefix, @src)"/></xsl:attribute>686 <xsl:copy-of select="attribute::*[name() != 'src']"/>687 </img>688 </xsl:template>689 -->690 <!-- Since the a element can contain images, divs etc need to process text691 and elements contained within.692 <xsl:template match="ibis:form">693 <xsl:element name="form">694 <xsl:attribute name="action"><xsl:value-of select="concat($ibis.urlPrefix, @action)"/></xsl:attribute>695 <xsl:copy-of select="attribute::*[name() != 'action']"/>696 <xsl:apply-templates select="current()/text() | current()/*"/>697 </xsl:element>698 </xsl:template>699 -->700 84 701 85 <!-- ============================= End of File ============================= --> -
trunk/ibisph-view/src/main/webapp/xslt/xml/Interactive.xslt
r17255 r17416 10 10 11 11 <ibis:doc> 12 <name>xml/ indicator/profile/InteractiveXML</name>12 <name>xml/Interactive</name> 13 13 <summary>Provides XML element creation used by Kendo and Leaflet XSLT.</summary> 14 14 <description> -
trunk/ibisph-view/src/main/webapp/xslt/xml/db/topic.xslt
r15958 r17416 11 11 12 12 <ibis:doc> 13 <name>xml/ </name>13 <name>xml/db/Topic</name> 14 14 <summary>convert topic selection to db insert</summary> 15 15 <description> -
trunk/ibisph/src/main/java/org/ibisph/modelmap/ModelFromFilePathAndNameService.java
r17143 r17416 34 34 protected GetModelService getModelService = null; 35 35 36 protected boolean staticObjectCacheFlag= false;37 protected Object staticCachedModelObject = null;36 protected boolean cacheStaticModelObject = false; 37 protected Object cachedStaticModelObject = null; 38 38 39 39 … … 62 62 } //-------------------------- End of Method ------------------------------ 63 63 64 public void setStaticObjectCacheFlag(boolean isCacheStaticObject) { 65 this.staticObjectCacheFlag = isCacheStaticObject; 64 public void setCacheStaticModelObject(boolean isCacheStaticObject) { 65 this.cacheStaticModelObject = isCacheStaticObject; 66 } //-------------------------- End of Method ------------------------------ 67 68 public void clearCachedStaticModelObject() { 69 this.cachedStaticModelObject = null; 66 70 } //-------------------------- End of Method ------------------------------ 67 71 … … 73 77 */ 74 78 protected Object getModel() throws Exception { 75 Object object = this. staticCachedModelObject;79 Object object = this.cachedStaticModelObject; 76 80 if(null == object) object = this.getModelService.get(this.filePathAndName); 77 if(this. staticObjectCacheFlag) this.staticCachedModelObject = object;81 if(this.cacheStaticModelObject) this.cachedStaticModelObject = object; 78 82 return(object); 79 83 } //-------------------------- End of Method ------------------------------ … … 85 89 */ 86 90 protected Object getReloadedModel() throws Exception { 87 this. staticCachedModelObject = null;91 this.cachedStaticModelObject = null; 88 92 return(getModel()); 89 93 } //-------------------------- End of Method ------------------------------
Note: See TracChangeset
for help on using the changeset viewer.