source: main/adopters/hi/trunk/src/main/webapps/hhdw-view/xslt/html/query/module/result/Page.xslt @ 25269

Last change on this file since 25269 was 25269, checked in by GarthBraithwaite_STG, 17 months ago

hi - turned off anchor padding. changed triangle direction for expandable content control. Added wider class for QR and possibly IP report pages. QM button flex align for columns and not centered. Text changes for access_denied.jsp.

File size: 20.0 KB
Line 
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="../../../../xml/Interactive.xslt"/>
11        <xsl:import href="../../../user/login/Login.xslt"/>
12        <xsl:import href="../../definition/ApplyCriteria.xslt"/>
13        <xsl:import href="../../definition/QueryDefinition.xslt"/>
14        <xsl:import href="../Page.xslt"/>
15        <xsl:import href="DataViz.xslt"/>
16
17
18        <ibis:doc>
19                <name>html/query/result/Page</name>
20                <summary>Default core code that produces the interactive query result page</summary>
21                <description>
22                        Contains the templates that create the interactive data table, chart 
23                        and map module query results page.  This page differs from the basic
24                        parent query result page code in that it uses the Kendo and Leaflet     
25                        javascript to display interactive charts, data tables, and maps.
26                </description>
27        </ibis:doc>
28
29       
30<xsl:param name="Page.htmlClass" select="QueryResult"/>
31
32        <xsl:param name="Page.pageTitle" ibis:doc="Page's title text which is based on the '/QUERY_MODULE/TITLE' element.">
33                Query Result - <xsl:value-of select="/QUERY_MODULE/TITLE"/> - <xsl:value-of select="$QueryModule.configuration/TITLE"/>
34        </xsl:param>
35        <xsl:param name="Page.contentTitle" ibis:doc="Page's content title text which is based on the '/QUERY_MODULE/TITLE' element.">
36                Query Results for <xsl:value-of select="/QUERY_MODULE/TITLE"/> - <xsl:value-of select="$QueryModule.configuration/TITLE"/>
37        </xsl:param>
38
39
40        <!-- bread crumbs and content options -->
41        <xsl:param name="Page.builderURL" select="concat($Page.queryBaseRequestPath, 'builder/', $QueryModule.request/CONFIGURATION_PATH, '.html')"/>
42        <xsl:param name="Page.resultURL"  select="concat($Page.queryBaseRequestPath, 'result/',  $QueryModule.request/CONFIGURATION_PATH, '.html')"/>
43
44
45        <xsl:param name="Page.requestErrorMessageContent">
46                <div class="Error">
47                        <h2>Error: <xsl:value-of select="$QueryModule.request/ERROR/TITLE"/></h2>
48
49                        <p>
50                        There is a problem getting the specified query data from the
51                        database.  This error could be a temporary issue either with
52                        the servers or the network.  Please wait a few minutes and try
53                        your query again.  If the problem persists, please report this
54                        problem to us (<a href="about/ContactInformation.html">contact information</a>).
55                        The nature of the problem is shown below and will be helpful
56                        when reporting the problem.  We apologize for any inconveniences
57                        and appreciate your patience and help.
58                        </p>
59
60                        <div class="Note" title="{$QueryModule.request/ERROR/TITLE}">
61                                <h3>Error Details:</h3>
62                                <xsl:value-of select="$QueryModule.request/ERROR/DESCRIPTION"/>
63                        </div>
64                </div>
65        </xsl:param>
66
67        <xsl:param name="Page.resultErrorMessageContent">
68                <div class="Error">
69                        <h2>SAS/CGI System Error:</h2>
70                        <p>
71                        There is a problem getting the specified query data from the
72                        database.  Please report this problem to us (<a href="about/ContactInformation.html">contact information</a>).
73                        The nature of the problem is shown below and will be helpful
74                        when reporting the problem.  We apologize for any inconveniences
75                        and appreciate your patience and help.
76                        </p>
77
78                        <div class="Note" title="{$QueryModule.request/ERROR/TITLE}">
79                                <h3>More Error Detail:</h3>
80                                <xsl:value-of select="$QueryModule.request/ERROR"/>
81                        </div>
82                </div>
83        </xsl:param>
84
85        <xsl:param name="Page.pleaseWaitMessageContent">
86                <div class="PleaseWait">
87                        <h2>Please wait.  Processing Dataset Request.</h2>
88                        <p>
89                        The system is processing your data request.  Your browser should
90                        be actively trying to load a page.  This is typically indicated by
91                        your browser showing something spinning the browser tab.  If this
92                        is not the case click on this <a href="{$Page.resultURL}" title="Resubmit query">get
93                        query results</a> link.  Otherwise be patient as your data will be
94                        displayed as soon as they are available.
95                        </p>
96                </div>
97        </xsl:param>
98
99        <xsl:param name="Page.resultNoDataMessageContent">
100                <div class="Note">
101                        <h2>Sorry, no data were returned for your query.</h2>
102                        <p>
103                        The filtering criteria was too specific or no data exists in
104                        the dataset.  If you feel that your query should have worked,
105                        please contact us and let us know about the problem. Otherwise,
106                        please go back and modify your query using less specific
107                        filtering criteria.
108                        </p>
109                </div>
110        </xsl:param>
111
112
113        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
114        <xsl:template name="Page.specificHeadContent"
115                ibis:doc="If no query result element present then this page needs to
116                        issue a query result request which the controller will then build
117                        the query URL, call the Query app, and return to this page again
118                        but with a result which this page will then display.  This function
119                        used to be done with a confirmation page and separate controller but
120                        was combined 1/10/08."
121        >
122                <xsl:if test="not(exists($QueryModule.result)) and not(exists($QueryModule.request/ERROR))">
123                        <!-- 2021 FF has an issue with BASE element with relative URL when
124                                doing the refresh.  Using script works but doesn't show the
125                                wait screen.  Simple solution was to use a full explicit path.
126                                <script>window.location.href = "<xsl:value-of select="$Page.resultURL"/>";</script>
127                                <meta http-equiv="refresh" content="0;URL={$Page.resultURL}"/>
128
129                                This goes away when/if builder and result are combined.
130                        -->
131                        <meta http-equiv="refresh" content="0;url={ibis:getRequestURL($Page.resultURL)}"/>
132                </xsl:if>
133
134                <xsl:call-template name="Page.metaNoCacheControl"/>
135
136                <style>
137                        button, .Button, a.Button:visited
138                        {
139                                min-width: 180px;
140                        }
141
142                        .ContentOptions .Container.Buttons
143                        {
144                                flex-wrap: wrap;
145                        }
146                        .ContentOptions .Container.Buttons button,
147                        .ContentOptions .Container.Buttons .Filler
148                        {
149                                margin: 5px;
150                                max-width: none;
151                                width: 200px;
152                                flex-basis: 200px;
153                                flex-grow: 1;
154                                justify-content: normal;
155                        }
156                        .ContentOptions .Container.Buttons .Filler
157                        {
158                                height: 1px;
159                        }
160
161                        section.WideBox
162                        {
163                                background-color: #333;
164                                width: calc(100vw - 10px);
165                                position: relative;
166                                left: calc(-50vw + 50%);
167                        }
168                        section.WideBox div.Container
169                        {
170                                display: flex;
171                                justify-content: center;
172                        }
173
174                        section.WideBox div.Container div.Left,
175                        section.WideBox div.Container div.Right
176                        {
177                                display: flex;
178                                flex-direction: column;
179                                margin: 2em 0 4em 0;
180                                max-width: 375px;
181                        }
182                        section.WideBox div.Container div.Left
183                        {
184                                margin-left: 2em;
185                        }
186
187                        section.WideBox div.Container div.Center
188                        {
189                                margin: 2em 3em 3em 3em;
190                                border: 1px solid white;
191                        }
192                        section.WideBox div.Container div h4
193                        {
194                                margin: 0;
195                                color: #f8f8f8;
196                                font-size: 2em;
197                                text-transform: none;
198                        }
199                        #content section.WideBox div.Container div p
200                        {
201                                margin: 2em 0 1.5em 0;
202                                color: #d8d8d8;
203                        }
204                        section.WideBox div.Container div button
205                        {
206                                position: absolute;
207                                bottom: 2em;
208                                align-self: center;
209                                width: 200px;
210                                max-width: 200px;
211                        }
212                </style>
213
214        </xsl:template>
215
216
217        <xsl:template name="Page.contentBody" ibis:doc="Main interactive sections content template.">
218
219                <xsl:call-template name="Page.contentOptions"/>
220<!-- can include measure title if wanted
221QueryModule.measure
222-->
223                <h2>Query Criteria</h2>
224                <table id="userCriteria" class="Info"
225                        summary="The first column is a title of that type of selection with
226                                the next column showing a list of selected values.
227                        "
228                        caption="Result table that shows selected dimensions and group by selections."
229                >
230                        <xsl:call-template name="QueryModule.selectedDimensionsCriteriaTableRows">
231                                <xsl:with-param name="selectedDimensions" select="$QueryModule.queryModule//SECTION//SELECTED_DIMENSIONS"/>
232                                <xsl:with-param name="dimensions" select="$QueryModule.dimensions"/>
233                        </xsl:call-template>
234
235                        <xsl:call-template name="QueryModule.dataGroupedByTableRow">
236                                <xsl:with-param name="rowDimensionTitle"   select="ibis:getDimensionTitle($QueryModule.dimensions/DIMENSION[NAME=$QueryModule.request/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME])"/>
237                                <xsl:with-param name="colDimensionTitle"   select="ibis:getDimensionTitle($QueryModule.dimensions/DIMENSION[NAME=$QueryModule.request/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME])"/>
238                                <xsl:with-param name="otherDimensionTitle" select="ibis:getDimensionTitle($QueryModule.dimensions/DIMENSION[NAME=$QueryModule.request/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME])"/>
239                        </xsl:call-template>
240                </table>
241
242<xsl:if test="$ApplyCriteria.isSet">
243                <h2>Current "Apply Query Definition"</h2>
244                <table id="applyCriteria" class="Info"
245                        summary="The first column is a title of that type of selection with
246                                the next column showing a list of selected values.
247                        "
248                        caption="Result table that shows selected dimensions and group by selections."
249                >
250                        <xsl:call-template name="QueryModule.selectedDimensionsCriteriaTableRows">
251                                <xsl:with-param name="selectedDimensions" select="$ApplyCriteria.queryDefinition//SELECTED_DIMENSIONS"/>
252                        </xsl:call-template>
253
254                        <xsl:call-template name="QueryModule.dataGroupedByTableRow">
255                                <xsl:with-param name="rowDimensionTitle"   select="ibis:getDimensionTitle($QueryModule.dimensions/DIMENSION[NAME=$ApplyCriteria.queryDefinition/REQUEST/ACTUAL_GROUP_BY/CATEGORY_DIMENSION_NAME])"/>
256                                <xsl:with-param name="colDimensionTitle"   select="ibis:getDimensionTitle($QueryModule.dimensions/DIMENSION[NAME=$ApplyCriteria.queryDefinition/REQUEST/ACTUAL_GROUP_BY/SERIES_DIMENSION_NAME])"/>
257                                <xsl:with-param name="otherDimensionTitle" select="ibis:getDimensionTitle($QueryModule.dimensions/DIMENSION[NAME=$ApplyCriteria.queryDefinition/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME])"/>
258                        </xsl:call-template>
259                        <xsl:call-template name="QueryModule.selectedVisualizationTableRow">
260                                <xsl:with-param name="request" select="$ApplyCriteria.queryDefinition/REQUEST"/>
261                        </xsl:call-template>
262                </table>
263</xsl:if>
264
265                <xsl:choose>
266                        <xsl:when test="exists($QueryModule.request/ERROR)">
267                                <xsl:copy-of select="$Page.requestErrorMessageContent"/>
268                        </xsl:when>
269
270                        <xsl:when test="exists($QueryModule.result/ERROR)">
271                                <xsl:copy-of select="$Page.resultErrorMessageContent"/>
272                        </xsl:when>
273
274                        <xsl:when test="not(exists($QueryModule.result))">
275                                <xsl:copy-of select="$Page.pleaseWaitMessageContent"/>
276                        </xsl:when>
277
278                        <xsl:when test="count($QueryModule.result/RECORDS/RECORD) = 0">
279                                <xsl:copy-of select="$Page.resultNoDataMessageContent"/>
280                        </xsl:when>
281
282                        <!-- If records, then display the data list table. -->
283                        <xsl:otherwise>
284                                <xsl:call-template name="Page.dataContent"/>
285                        </xsl:otherwise>
286                </xsl:choose>
287
288                <xsl:call-template name="Page.usageAgreementDialog"/>
289
290        </xsl:template>
291
292
293        <xsl:template name="Page.contentOptions">
294                <div class="ContentOptions">
295                        <h3><xsl:value-of select="'Query Result Page Options'"/></h3>
296
297                        <div class="Container Buttons">
298                                <button type="button" accesskey="B" id="modifyButton" 
299                                        onclick="location.href='{$Page.builderURL}'"
300                                >
301                                        Modify Query
302                                        <xsl:call-template name="Help.popup">
303                                                <xsl:with-param name="content" select="$Page.modifyQueryHelpContent"/>
304                                        </xsl:call-template>
305                                </button>
306
307                                <button type="button" accesskey="S" id="saveDefinition" onclick="saveQueryDefinition()">
308                                        Save Query Definition
309                                        <xsl:call-template name="Help.popup">
310                                                <xsl:with-param name="content" select="$Page.saveQueryDefinitionHelpContent"/>
311                                        </xsl:call-template>
312                                </button>
313
314                                <button type="button" accesskey="A" id="applyCriteria" 
315                                        onclick="openApplyCriteriaDialog();"
316                                >
317                                        Apply Query Definition
318                                        <xsl:call-template name="Help.popup">
319                                                <xsl:with-param name="content" select="$Page.applyCriteriaHelpContent"/>
320                                        </xsl:call-template>
321                                </button>
322
323                                <xsl:if test="exists($QueryModule.queryModule/DEVELOPMENT_FLAG)">
324                                        <button type="button" accesskey="L" id="defaultQueryButton" 
325                                                onclick="location.href='{$Page.resultURL}?Reload=x'"
326                                        >
327                                                Run Default Query
328                                                <xsl:call-template name="Help.popup">
329                                                        <xsl:with-param name="content" select="$Page.loadDefaultQueryHelpContent"/>
330                                                </xsl:call-template>
331                                        </button>
332
333                                        <button type="button" accesskey="X" id="viewXMLButton" 
334                                                onclick="location.href='query/configuration/{$QueryModule.request/CONFIGURATION_PATH}.xml'"
335                                        >
336                                                View Module XML
337                                        </button>
338
339                                        <xsl:if test="exists($QueryModule.request/QUERY_APPLICATION_URL) and ('post' != $QueryModule.queryModule/QUERY_APPLICATION_HTTP_REQUEST_TYPE)">
340                                        <button type="button" accesskey="Q" id="viewIBISQButton" 
341                                                onclick="location.href='{$QueryModule.request/QUERY_APPLICATION_URL}'"
342                                        >
343                                                Get IBISQ XML
344                                        </button>
345                                        </xsl:if>
346                                </xsl:if>
347
348                                <button type="button" accesskey="D" id="changeQueryDataset" 
349                                        onclick="location.href='{$QueryModule.queryModule/QUERY_CONFIGURATION_SELECTION/LOCAL_URL}'"
350                                >
351                                        Select New Indicator
352                                        <xsl:call-template name="Help.popup">
353                                                <xsl:with-param name="content" select="$Page.changeDatasetMeasureHelpContent"/>
354                                        </xsl:call-template>
355                                </button>
356
357                                <span class="Filler"/>
358                                <span class="Filler"/>
359                                <span class="Filler"/>
360                        </div>
361                </div>
362
363                <xsl:call-template name="ApplyCriteria.dialog"/>
364
365                <xsl:call-template name="QueryDefintion.editIdentityDialog">
366                        <xsl:with-param name="queryModule" select="$QueryModule.queryModule"/>
367                </xsl:call-template>
368
369                <xsl:call-template name="Login.dialog">
370                        <xsl:with-param name="overviewContent">
371                                <p>
372                                You are not logged in.  To save a query you must be logged in. 
373                                Enter your username / password to proceed.  Once successfully
374                                logged in you will be redirected back to this page where you
375                                can then save the query definition.
376                                </p>
377                        </xsl:with-param>
378                </xsl:call-template>
379
380        </xsl:template>
381
382
383        <xsl:template name="Page.dataContent" 
384                ibis:doc="Standard/basic map, chart, data table, and meta data.  This
385                        allows sub result type pages to Override this standard data content
386                        with different content.
387                "
388        >
389                <xsl:variable name="dataVizContainerIDPrefix" select="ibis:firstLetterLowerCase( replace($QueryModule.request/CONFIGURATION_PATH, '/', '_') )"/>
390                <xsl:variable name="dataVizObjectName"        select="concat($dataVizContainerIDPrefix, 'DataViz')"/>
391
392                <xsl:variable name="showMap"   select="ibis:DataViz.showMap($QueryModule.request/MAP_NAME)"/>
393                <xsl:variable name="showChart" select="ibis:DataViz.showChart($QueryModule.request/CHART_NAME)"/>
394
395                <xsl:if test="$showChart">
396                        <xsl:call-template name="ContentContainer.expandable">
397                                <xsl:with-param name="title" select="if('Line'=$QueryModule.request/CHART_NAME)then 'Trend' else 'Chart'"/>
398                                <xsl:with-param name="content">
399                                        <xsl:call-template name="DataViz.chartContainer">
400                                                <xsl:with-param name="containerID"   select="concat($dataVizContainerIDPrefix, '_chart')"/>
401                                                <xsl:with-param name="footerContent" select="$QueryModule.configuration/CHART_NARRATIVE"/>
402                                        </xsl:call-template>
403                                </xsl:with-param>
404                                <xsl:with-param name="show" select="true()"/>
405                                <xsl:with-param name="addWikiAttribute" select="false()"/>
406                        </xsl:call-template>
407                </xsl:if>
408
409                <xsl:call-template name="ContentContainer.expandable">
410                        <xsl:with-param name="title" select="'Data Table'"/>
411                        <xsl:with-param name="content">
412                                <xsl:call-template name="DataViz.gridContainer">
413                                        <xsl:with-param name="containerID"         select="concat($dataVizContainerIDPrefix, '_grid')"/>
414                                        <xsl:with-param name="valueAttributeNames" select="$QueryModule.valueAttributeNames"/>
415                                        <xsl:with-param name="valueAttributes"     select="$QueryModule.valueAttributes"/>
416                                </xsl:call-template>
417                        </xsl:with-param>
418                        <xsl:with-param name="show" select="true()"/>
419                        <xsl:with-param name="addWikiAttribute" select="false()"/>
420                </xsl:call-template>
421
422                <xsl:if test="$showMap">
423                        <xsl:call-template name="ContentContainer.expandable">
424                                <xsl:with-param name="title" select="'Map'"/>
425                                <xsl:with-param name="content">
426                                        <xsl:call-template name="DataViz.mapContainer">
427                                                <xsl:with-param name="containerID"   select="concat($dataVizContainerIDPrefix, '_map')"/>
428                                                <xsl:with-param name="footerContent" select="$QueryModule.configuration/MAP_NARRATIVE"/>
429                                        </xsl:call-template>
430                                </xsl:with-param>
431                                <xsl:with-param name="show" select="true()"/>
432                                <xsl:with-param name="addWikiAttribute" select="false()"/>
433                                <xsl:with-param name="description" select="'Choropleth/thematic map.'"/>
434                        </xsl:call-template>
435                </xsl:if>
436
437<section class="WideBox">
438        <div class="Container">
439                <div class="Left">
440                        <h4>Explore a different dataset</h4>
441                        <p>
442                                This is one data source available in the Hawai'i Health Data Warehouse.
443                                Click the button below to go to the page with all the data sources.
444                        </p>
445                        <button onclick="location.href='/data-sources'">Go to datasets</button>
446                </div>
447                <div class="Center"></div>
448                <div class="Right">
449                        <h4>Choose a different topic</h4>
450                        <p>
451                                This is one topic the Hawai'i Health Data Warehouse has available
452                                for you. Click the button below to go to the page with all the
453                                health topics.
454                        </p>
455                        <button onclick="location.href='/health-topics'">Select a different topic</button>
456                </div>
457        </div>
458</section>
459
460                <xsl:call-template name="ContentContainer.expandable">
461                        <xsl:with-param name="title" select="'Technical Notes'"/>
462                        <xsl:with-param name="content">
463                                <xsl:call-template name="QueryModule.dataNotes"/>
464                                <xsl:call-template name="QueryModule.dataSources"/>
465                                <xsl:call-template name="QueryModule.dataIssues"/>
466                        </xsl:with-param>
467                        <xsl:with-param name="show" select="true()"/>
468                </xsl:call-template>
469
470                <xsl:if test="$showMap">
471                        <xsl:call-template name="DataViz.choroplethMapJavaScript"/>
472                </xsl:if>
473                <script id="{$dataVizContainerIDPrefix}_script">
474                        <xsl:call-template name="DataViz.queryResultKendoLeafletDataVizObject">
475                                <xsl:with-param name="dataVizObjectName"        select="$dataVizObjectName"/>
476                                <xsl:with-param name="dataVizContainerIDPrefix" select="$dataVizContainerIDPrefix"/>
477
478                                <xsl:with-param name="queryModule"                      select="$QueryModule.queryModule"/>
479                                <xsl:with-param name="queryConfiguration"       select="$QueryModule.configuration"/>
480                                <xsl:with-param name="queryRequest"                     select="$QueryModule.request"/>
481                        </xsl:call-template>
482
483                        $(document).ready(function()
484                        {
485                                <xsl:value-of select="$dataVizObjectName"/>.init();
486                               
487                        });
488
489                        <xsl:if test="$showChart">
490                        $(window).resize(function () {
491                                <xsl:value-of select="$dataVizObjectName"/>.resizeKendoChart();
492                        });
493                        </xsl:if>
494                </script>
495        </xsl:template>
496
497
498        <xsl:template name="Page.contentFooter" ibis:doc="QM Result dates and owning program's contact info.">
499                <xsl:param name="queryModule" select="$QueryModule.queryModule"/>
500                <xsl:param name="orgUnitName" select="if(0 != string-length($queryModule/ORG_UNIT_NAME)) then $queryModule/ORG_UNIT_NAME else 'DEFAULT'"/>
501                <xsl:param name="orgUnit"     select="$Page.orgUnits//ORG_UNIT[NAME=$orgUnitName]"/>
502
503                <xsl:if test="string-length($orgUnit/TITLE) != 0">
504                        <footer>
505                                <div class="DataDates">
506                                        These data were queried on: <xsl:value-of select="$queryModule/REQUEST/FINISHED_DATE"/>
507                                        <xsl:if test="boolean($queryModule/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE)">
508                                                <br/>
509                                                The dataset was last updated on:  <xsl:value-of select="$queryModule/IBISQ_QUERY_RESULT/DATASET/MODIFIED_DATE"/>
510                                        </xsl:if>
511                                </div>
512                                <div class="OrgUnit">
513                                        <xsl:value-of select="$orgUnit/TITLE"/>, <xsl:value-of select="$orgUnit/CONTACT_TEXT"/>
514                                        <xsl:if test="string-length($orgUnit/URL) != 0">
515                                                (<a href="{$orgUnit/URL}"><xsl:value-of select="$orgUnit/URL"/></a>)
516                                        </xsl:if>
517                                </div>
518                        </footer>
519                </xsl:if>
520        </xsl:template>
521
522</xsl:stylesheet>
523<!-- ============================= End of File ============================= -->
Note: See TracBrowser for help on using the repository browser.