1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | |
---|
3 | <xsl:stylesheet version="3.0" |
---|
4 | xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" |
---|
5 | xmlns:xs ="http://www.w3.org/2001/XMLSchema" |
---|
6 | xmlns:ibis="http://www.ibisph.org" |
---|
7 | |
---|
8 | exclude-result-prefixes="ibis xs xsl" |
---|
9 | > |
---|
10 | <xsl:import href="../../../ibis.xslt"/> |
---|
11 | <xsl:import href="../../../xml/Interactive.xslt"/> |
---|
12 | <xsl:import href="../../../json/Dataset.xslt"/> |
---|
13 | <xsl:import href="../../../json/Kendo.xslt"/> |
---|
14 | <xsl:import href="../../../json/LeafletMap.xslt"/> |
---|
15 | <xsl:import href="../../DataViz.xslt"/> |
---|
16 | <xsl:import href="../../ContentContainer.xslt"/> |
---|
17 | <xsl:import href="Indicator.xslt"/> |
---|
18 | |
---|
19 | <ibis:doc> |
---|
20 | <name>html/indicator/profile/ContentBlocks</name> |
---|
21 | <summary>Provides AJAX IP and IPV data fields and interactive script blocks</summary> |
---|
22 | <description> |
---|
23 | Provides access to IP/IPV scripts and data fields. |
---|
24 | |
---|
25 | Note: the calling page MUST provide all applicable script includes etc. |
---|
26 | </description> |
---|
27 | </ibis:doc> |
---|
28 | |
---|
29 | <xsl:param name="VariableNamePreifx" select="ibis:firstLetterLowerCase( replace($indicatorView/NAME, '\.', '_') )"/> |
---|
30 | <xsl:param name="RecordsJavascriptVarName" select="concat($VariableNamePreifx, '_records')"/> |
---|
31 | <xsl:param name="DataSourceJavascriptVarName" select="concat($VariableNamePreifx, '_dataSource')"/> |
---|
32 | <xsl:param name="MapJavascriptVarName" select="concat($VariableNamePreifx, '_map')"/> |
---|
33 | <xsl:param name="ChartJavascriptVarName" select="concat($VariableNamePreifx, '_chart')"/> |
---|
34 | <xsl:param name="GridJavascriptVarName" select="concat($VariableNamePreifx, '_grid')"/> |
---|
35 | |
---|
36 | <xsl:param name="UseExistingRecordsFlag"/> |
---|
37 | <xsl:param name="UseExistingDataSourceFlag"/> |
---|
38 | |
---|
39 | <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! NOT SURE IF ABLE TO TURN OFF ??????? --> |
---|
40 | <xsl:param name="ShowMapFlag" select="ibis:DataViz.showMap( |
---|
41 | $indicatorView/MAP_NAME, |
---|
42 | $indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[USAGE='category']/NAME, |
---|
43 | $indicatorView/DIMENSION_USAGES/DIMENSION_USAGE[USAGE='series']/NAME, |
---|
44 | $Indicator.dimensions |
---|
45 | )" |
---|
46 | /> |
---|
47 | <xsl:param name="ShowChartFlag" select="ibis:DataViz.showChart($indicatorView/CHART_NAME)"/> |
---|
48 | <xsl:param name="ShowGridFlag"/> |
---|
49 | |
---|
50 | <xsl:param name="MapName" select="$indicatorView/MAP_NAME"/> |
---|
51 | <xsl:param name="ChartName" select="$indicatorView/CHART_NAME"/> |
---|
52 | <xsl:param name="GridName" select="$indicatorView/GRID_NAME"/> |
---|
53 | |
---|
54 | <xsl:param name="BlockIDPrefix" select="replace($indicatorView/NAME, '\.', '_')"/> |
---|
55 | <xsl:param name="MapContainerID" select="concat($BlockIDPrefix, '_map')"/> |
---|
56 | <xsl:param name="ChartContainerID" select="concat($BlockIDPrefix, '_chart')"/> |
---|
57 | <xsl:param name="GridContainerID" select="concat($BlockIDPrefix, '_grid')"/> |
---|
58 | |
---|
59 | <xsl:param name="ComparisonDimensionName" select="'GeoState'"/> |
---|
60 | <xsl:param name="ComparisonDimensionValue" select="'35'"/> |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | <xsl:output method="html" version="5.0" html-version="5" encoding="ISO-8859-1" indent="no"/> |
---|
65 | |
---|
66 | |
---|
67 | <xsl:template match="/" ibis:doc="Main root element processing template."> |
---|
68 | <!-- global error catcher... --> |
---|
69 | <xsl:fallback> |
---|
70 | <xsl:message terminate="yes"> |
---|
71 | The XSLT has a problem processing and is now terminating... |
---|
72 | </xsl:message> |
---|
73 | </xsl:fallback> |
---|
74 | |
---|
75 | <xsl:variable name="measure" select="$Indicator.measure"/> |
---|
76 | <xsl:variable name="recordDimensionFields"> |
---|
77 | <xsl:call-template name="Interactive.getRecordDimensionFields"> |
---|
78 | <xsl:with-param name="dimensions" select="$Indicator.dimensions"/> |
---|
79 | <xsl:with-param name="dimensionUsages" select="$indicatorView/DIMENSION_USAGES"/> |
---|
80 | </xsl:call-template> |
---|
81 | </xsl:variable> |
---|
82 | <xsl:variable name="datasetRecords" select="$indicator/DATASETS/DATASET[NAME = $indicatorView/DATASET_NAMES/DATASET_NAME]/RECORDS"/> |
---|
83 | <xsl:variable name="indicatorViewDatasetRecords"> |
---|
84 | <xsl:call-template name="Interactive.getIndicatorViewDatasetRecords"> |
---|
85 | <xsl:with-param name="datasetRecords" select="$datasetRecords"/> |
---|
86 | <xsl:with-param name="dimensionUsages" select="$indicatorView/DIMENSION_USAGES"/> |
---|
87 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
88 | </xsl:call-template> |
---|
89 | </xsl:variable> |
---|
90 | <xsl:variable name="valueAttributeNames" select="distinct-values($indicatorViewDatasetRecords//VALUE_ATTRIBUTE_NAME)"/> |
---|
91 | |
---|
92 | <span id="whyImportant" wiki="true"> |
---|
93 | <xsl:copy-of select="$indicator/WHY_IMPORTANT"/> |
---|
94 | </span> |
---|
95 | |
---|
96 | <span id="{$indicatorView/NAME}.mapNarrative" wiki="true"> |
---|
97 | <xsl:copy-of select="$indicatorView/MAP_NARRATIVE"/> |
---|
98 | </span> |
---|
99 | |
---|
100 | <span id="{$indicatorView/NAME}.chartNarrative" wiki="true"> |
---|
101 | <xsl:copy-of select="$indicatorView/CHART_NARRATIVE/text()"/> |
---|
102 | </span> |
---|
103 | |
---|
104 | <span id="{$indicatorView/NAME}.dataNotes" wiki="true"> |
---|
105 | <xsl:call-template name="Indicator.dataNotes"> |
---|
106 | <xsl:with-param name="title" select="''"/> |
---|
107 | <xsl:with-param name="measure" select="$measure"/> |
---|
108 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
109 | </xsl:call-template> |
---|
110 | </span> |
---|
111 | |
---|
112 | <span id="definition" wiki="true"> |
---|
113 | <xsl:call-template name="Indicator.definition"/> |
---|
114 | </span> |
---|
115 | |
---|
116 | <span id="howCalculated" wiki="true"> |
---|
117 | <xsl:call-template name="Indicator.howCalculated"/> |
---|
118 | </span> |
---|
119 | |
---|
120 | <span id="dataSources" wiki="true"> |
---|
121 | <xsl:call-template name="Indicator.dataSources"/> |
---|
122 | </span> |
---|
123 | |
---|
124 | <span id="initiatives" wiki="true"> |
---|
125 | <xsl:call-template name="Indicator.initiatives"> |
---|
126 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
127 | </xsl:call-template> |
---|
128 | </span> |
---|
129 | |
---|
130 | <span id="otherObjectives" wiki="true"> |
---|
131 | <xsl:call-template name="Indicator.otherObjectives"/> |
---|
132 | </span> |
---|
133 | |
---|
134 | <span id="howDoing" wiki="true"> |
---|
135 | <xsl:call-template name="Indicator.howDoing"/> |
---|
136 | </span> |
---|
137 | |
---|
138 | <span id="howCompare" wiki="true"> |
---|
139 | <xsl:call-template name="Indicator.howCompare"/> |
---|
140 | </span> |
---|
141 | |
---|
142 | <span id="whatDoing" wiki="true"> |
---|
143 | <xsl:call-template name="Indicator.whatDoing"/> |
---|
144 | </span> |
---|
145 | |
---|
146 | <span id="evidenceBasedPractices" wiki="true"> |
---|
147 | <xsl:call-template name="Indicator.evidenceBasedPractices"/> |
---|
148 | </span> |
---|
149 | |
---|
150 | <span id="availableServices" wiki="true"> |
---|
151 | <xsl:call-template name="Indicator.availableServices"/> |
---|
152 | </span> |
---|
153 | |
---|
154 | <span id="moreResources" wiki="true"> |
---|
155 | <xsl:call-template name="Indicator.moreResources"/> |
---|
156 | </span> |
---|
157 | |
---|
158 | <span id="otherInformation" wiki="true"> |
---|
159 | <xsl:call-template name="Indicator.otherInformation"/> |
---|
160 | </span> |
---|
161 | |
---|
162 | <span id="footnoteReferences" wiki="true"> |
---|
163 | <xsl:call-template name="Indicator.footnoteReferences"/> |
---|
164 | </span> |
---|
165 | |
---|
166 | <span id="allDates" wiki="true"> |
---|
167 | <xsl:call-template name="Indicator.allDates"/> |
---|
168 | </span> |
---|
169 | |
---|
170 | <span id="klScript"> |
---|
171 | <xsl:variable name="ancillaryValueNames" select="distinct-values($indicator/DATASETS/DATASET[NAME = $indicatorView/DATASET_NAMES/DATASET_NAME]/ANCILLARY_VALUE_USAGES/ANCILLARY_VALUE_USAGE/NAME)"/> |
---|
172 | <xsl:variable name="measureValueFormatPattern" select="($Indicator.valueTypes/VALUE_TYPE[NAME = $measure/VALUE_TYPE_NAME]/XSLT_FORMAT_PATTERN)[1]"/> |
---|
173 | <xsl:call-template name="DataViz.leafletKendoScript"> |
---|
174 | <xsl:with-param name="dimensions" select="$Indicator.dimensions"/> |
---|
175 | <xsl:with-param name="datasetRecords" select="$indicatorViewDatasetRecords"/> |
---|
176 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
177 | <xsl:with-param name="recordAncillaryValueFields"> |
---|
178 | <xsl:call-template name="Interactive.getIndicatorRecordAncillaryValueFields"> |
---|
179 | <xsl:with-param name="indicator" select="$indicator"/> |
---|
180 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
181 | <xsl:with-param name="ancillaryValueNames" select="$ancillaryValueNames"/> |
---|
182 | <xsl:with-param name="ancillaryValues" select="$Indicator.ancillaryValues"/> |
---|
183 | <xsl:with-param name="valueTypes" select="$Indicator.valueTypes"/> |
---|
184 | <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> |
---|
185 | </xsl:call-template> |
---|
186 | </xsl:with-param> |
---|
187 | |
---|
188 | <xsl:with-param name="recordsJavascriptVariableName" select="$RecordsJavascriptVarName"/> |
---|
189 | <xsl:with-param name="leafletMapJavascriptVariableName" select="$MapJavascriptVarName"/> |
---|
190 | <xsl:with-param name="kendoDataSourceJavascriptVariableName" select="$DataSourceJavascriptVarName"/> |
---|
191 | <xsl:with-param name="kendoGridJavascriptVariableName" select="$GridJavascriptVarName"/> |
---|
192 | <xsl:with-param name="kendoChartJavascriptVariableName" select="$ChartJavascriptVarName"/> |
---|
193 | |
---|
194 | <xsl:with-param name="measure" select="$measure"/> |
---|
195 | <xsl:with-param name="measureValueFormatPattern" select="$measureValueFormatPattern"/> |
---|
196 | |
---|
197 | <xsl:with-param name="showMap" select="$ShowMapFlag"/> |
---|
198 | <xsl:with-param name="mapContainerID" select="$MapContainerID"/> |
---|
199 | <xsl:with-param name="mapName" select="$MapName"/> |
---|
200 | <xsl:with-param name="geoJSONName" select="$indicatorView/MAP_DIMENSION_NAME"/> |
---|
201 | <xsl:with-param name="geoIDFieldName" select="$recordDimensionFields/RECORD_DIMENSION_FIELD[DIMENSION_NAMES/DIMENSION_NAME = $indicatorView/MAP_DIMENSION_NAME]/NAME"/> |
---|
202 | <xsl:with-param name="geoIDFieldValuePrefixToRemove" select="concat($indicatorView/MAP_DIMENSION_NAME, '.')"/> |
---|
203 | <xsl:with-param name="geoTypeTitle" select="ibis:getDimensionTitle($indicator//DIMENSIONS/DIMENSION[NAME = $indicatorView/MAP_DIMENSION_NAME])"/> |
---|
204 | <xsl:with-param name="mapComparisonValue" select="$indicatorViewDatasetRecords/RECORD[ DIMENSIONS[ (2 = count(DIMENSION)) and DIMENSION[(NAME = $ComparisonDimensionName) and (VALUE = $ComparisonDimensionValue)]]]/MEASURE/VALUE"/> |
---|
205 | |
---|
206 | <xsl:with-param name="showGrid" select="ibis:isFirstLetter_T_or_Y_or_X($ShowGridFlag)"/> |
---|
207 | <xsl:with-param name="gridContainerID" select="$GridContainerID"/> |
---|
208 | <xsl:with-param name="gridName" select="$GridName"/> |
---|
209 | <xsl:with-param name="showValueAttributeColumn" select="0 != count($valueAttributeNames)"/> |
---|
210 | <xsl:with-param name="showLabelColumn" select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/> |
---|
211 | <xsl:with-param name="showNoteColumn" select="false()"/> |
---|
212 | |
---|
213 | <xsl:with-param name="showChart" select="$ShowChartFlag"/> |
---|
214 | <xsl:with-param name="chartContainerID" select="$ChartContainerID"/> |
---|
215 | <xsl:with-param name="chartName" select="$ChartName"/> |
---|
216 | <xsl:with-param name="chartTitle" select="ibis:getIndicatorViewChartTitle($indicator, $indicatorView, $Indicator.dimensions)"/> |
---|
217 | |
---|
218 | <xsl:with-param name="baseExportFilename" select="ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView, $Indicator.dimensions)"/> |
---|
219 | </xsl:call-template> |
---|
220 | </span> |
---|
221 | |
---|
222 | </xsl:template> |
---|
223 | |
---|
224 | </xsl:stylesheet> |
---|
225 | <!-- ============================= End of File ============================= --> |
---|