Changeset 3511 in main


Ignore:
Timestamp:
02/11/12 11:25:05 (12 years ago)
Author:
Paul Leo
Message:

Fix for trac ticket #163 - output to excel, and view xml now show and work in results page - actually view xml works, output to excel needs to be tested.
Also would like Garth to review method of repair, for accuracy and compliance with how to implement SiteSpecific? mods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • adopters/ma/trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/SiteSpecific.xslt

    r3483 r3511  
    125125                <xsl:apply-templates select="$selections/SELECTIONS" mode="Menu"/>
    126126        </xsl:template>
    127 
     127       
     128        <!--MA 508-->
     129        <xsl:template name="Page.submitControlContainer"
     130                ibis:doc="Provides the submit query control buttons">
     131
     132                <xsl:variable name="excel">
     133                        <xsl:value-of select="concat($ibis.urlPrefix, '/query/result/pop/PopMain/Count.xls?PrinterFriendly=true')"/>
     134                </xsl:variable>
     135        <!--
     136qqqq <xsl:value-of select="$excel"/> -->
     137                <xsl:variable name="xmlview">
     138                        <xsl:value-of select="concat($ibis.urlPrefix, 'query/configuration', /QUERY_MODULE/REQUEST/CONFIGURATION_PATH, '.xml')"/>
     139                </xsl:variable>
     140               
     141                <div id="resultsDisplay" class="SubmitControl">
     142                        <input id="excelButton" type="Button" value="Output to Excel" onclick="window.location='{$excel}'" title="Output to Excel"/>
     143                        <input id="viewButton"  type="Button" value="View XML" onclick="window.location='{$xmlview}'" title="View XML"/>
     144                </div>   
     145        </xsl:template>
     146       
     147<!-- see description and caveats in Page.xslt in this directory for Page.sectionContent template -->
     148<xsl:template name="Page.sectionsContent"
     149                ibis:doc="Main page content template that creates the selections
     150                        section, the optional graphic, optional 2-d table, data list table."
     151        >
     152                <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/ROW_DIMENSION_NAME"/>
     153                <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/COLUMN_DIMENSION_NAME"/>
     154                <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/OTHER_DIMENSION_NAME"/>
     155                <xsl:param name="rowDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/>
     156                <xsl:param name="colDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/>
     157                <xsl:param name="otherDimensionTitle" select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$otherDimensionName]/TITLE"/>
     158                <xsl:param name="graphicName"         select="$Result.queryModule/REQUEST/GRAPHIC_NAME"/>
     159                <xsl:param name="recordCount"         select="count($Result.queryResult/RECORDS/RECORD)"/>
     160               
     161                <!--MA 508-->
     162        <!--     --><xsl:call-template name="Page.submitControlContainer"/>
     163               
     164
     165                <a name="top"></a>
     166                <xsl:call-template name="Selections.userCriteria">
     167                        <xsl:with-param name="queryModule"   select="$Result.queryModule"/>
     168                        <xsl:with-param name="criteriaTitle" select="concat('Query Criteria for the ', $Result.configuration/TITLE, ' Measure')"/>
     169                        <xsl:with-param name="criteriaDescription"
     170                                select="if(exists($Result.configuration/DESCRIPTION))
     171                                        then $Result.configuration/DESCRIPTION
     172                                        else 'User query criteria includes filtering and how the data is grouped'
     173                                "
     174                        />
     175                        <xsl:with-param name="rowDimensionTitle"   select="$rowDimensionTitle"/>
     176                        <xsl:with-param name="colDimensionTitle"   select="$colDimensionTitle"/>
     177                        <xsl:with-param name="otherDimensionTitle" select="$otherDimensionTitle"/>
     178                        <xsl:with-param name="graphTitle"
     179                                select="if($graphicName = 'Map') then 'Map' else $Result.charts/CHART[NAME = $graphicName]/TITLE"
     180                        />
     181                </xsl:call-template>
     182                <br/>
     183
     184
     185                <!-- Display the data.  If no records are available then provide the user
     186                        with a message on what is possibly going on.
     187                -->
     188                <xsl:choose>
     189                        <xsl:when test="exists($Result.queryModule/REQUEST/ERROR)">
     190                                <div class="Error" title="View System Error">
     191                                        <h2>Error: <xsl:value-of select="$Result.queryModule/REQUEST/ERROR/TITLE"/></h2>
     192                                        There is a problem getting the specified query data from the
     193                                        database.  This error could be a temporary issue either with
     194                                        the servers or the network.  Please wait a few minutes and try
     195                                        your query again.  If the problem persists, please report this
     196                                        problem to us (<a href="{$ibis.urlPrefix}home/ContactInformation.html">contact information</a>).
     197                                        The nature of the problem is shown below and will be helpful
     198                                        when reporting the problem.  We apologize for any inconveniences
     199                                        and appreciate your patience and help.
     200                                        <br/><br/>
     201
     202                                        <div class="Note" title="{$Result.queryModule/REQUEST/ERROR/TITLE}">
     203                                                <h3>More Error Detail:</h3>
     204                                                <xsl:value-of select="$Result.queryModule/REQUEST/ERROR/DESCRIPTION"/>
     205                                        </div>
     206                                </div><br/>
     207                        </xsl:when>
     208
     209                        <xsl:when test="exists($Result.queryResult/ERROR)">
     210                                <div class="Error">
     211                                        <h2>SAS/CGI System Error:</h2>
     212                                        There is a problem getting the specified query data from the
     213                                        database.  Please report this problem to us (<a href="{$ibis.urlPrefix}home/ContactInformation.html">contact information</a>).
     214                                        The nature of the problem is shown below and will be helpful
     215                                        when reporting the problem.  We apologize for any inconveniences
     216                                        and appreciate your patience and help.
     217                                        <br/><br/>
     218
     219                                        <div class="Note" title="{$Result.queryModule/REQUEST/ERROR/TITLE}">
     220                                                <h3>More Error Detail:</h3>
     221                                                <xsl:value-of select="$Result.queryResult/ERROR"/>
     222                                        </div>
     223                                </div><br/>
     224                        </xsl:when>
     225
     226                        <xsl:when test="not(exists($Result.queryResult))">
     227                                <div class="PleaseWait">
     228                                        <h2>Please wait.  Processing query.</h2>
     229                                        The system is processing your data request.  Your browser should
     230                                        be actively trying to load a page.  This is typically indicated
     231                                        by your browser showing a spinning/waving something in the upper
     232                                        right corner of the browser's window.  If this is not the case
     233                                        click on this <a href="{$Result.resultURL}" title="Resubmit query">get
     234                                        query results</a> link.  Otherwise be patient as your data will be
     235                                        displayed as soon as they are available.
     236                                </div><br/>
     237                        </xsl:when>
     238
     239                        <xsl:when test="$recordCount = 0">
     240                                <div class="NoDataReturned">
     241                                        <h2>Sorry, no data were returned for your query.</h2>
     242                                        The filtering criteria was too specific or no data exists in
     243                                        the dataset.  If you feel that your query should have worked,
     244                                        please contact us and let us know about the problem. Otherwise,
     245                                        please go back and modify your query using less specific
     246                                        filtering criteria.
     247                                </div><br/>
     248                        </xsl:when>
     249
     250                        <!-- If records, then display the data list table. -->
     251                        <xsl:otherwise>
     252
     253                                <!-- Display the chart/map graphic - if one is selected and it is not none -->
     254                                <xsl:if test="(string-length($graphicName) &gt; 0) and ($graphicName != 'None')">
     255                                        <xsl:call-template name="Graphic.queryResult">
     256                                                <xsl:with-param name="graphicName" select="$graphicName"/>
     257                                                <xsl:with-param name="measure"     select="$Result.measure"/>
     258                                                <xsl:with-param name="rowDimensionTitle" select="$rowDimensionTitle"/>
     259                                                <xsl:with-param name="colDimensionTitle" select="$colDimensionTitle"/>
     260                                                <xsl:with-param name="rowDimensionName"  select="$rowDimensionName"/>
     261                                                <xsl:with-param name="colDimensionName"  select="$colDimensionName"/>
     262                                        </xsl:call-template>
     263                                        <xsl:if test="string-length($otherDimensionName) &gt; 0">
     264                                                <div class="Footnote">
     265                                                        NOTE: The above chart does not show all dataset grouped
     266                                                        by dimensions.
     267                                                </div>
     268                                        </xsl:if>
     269                                        <br/>
     270                                </xsl:if>
     271
     272                                <!-- Display 2d table of query results if there are 2 dimensions specified. -->
     273                                <xsl:if test="(string-length($colDimensionName) &gt; 0) and (string-length($otherDimensionName) = 0)">
     274                                        <xsl:call-template name="Values2d.queryResult2dDataTable">
     275                                                <xsl:with-param name="measure"           select="$Result.measure"/>
     276                                                <xsl:with-param name="rowDimensionName"  select="$rowDimensionName"/>
     277                                                <xsl:with-param name="colDimensionName"  select="$colDimensionName"/>
     278                                                <xsl:with-param name="rowDimensionTitle" select="$rowDimensionTitle"/>
     279                                                <xsl:with-param name="colDimensionTitle" select="$colDimensionTitle"/>
     280                                        </xsl:call-template>
     281                                        <xsl:call-template name="Page.dataTableValuesFootnote"/>
     282                                </xsl:if>
     283
     284                                <!-- lastly, display the standard data list table. -->
     285                                <h2 title="Lists all query values with numerator, denominator, and confidence limit values">Data List</h2>
     286                                <xsl:call-template name="Values.queryResultDataList">
     287                                        <xsl:with-param name="uniqueRecordDimensionNames" select="distinct-values($Result.queryResult/RECORDS/RECORD/DIMENSIONS/DIMENSION/NAME)"/>
     288                                        <xsl:with-param name="displayableMeasures"        select="$Result.displayableMeasures"/>
     289                                </xsl:call-template>
     290                                <div class="RecordCount">Record Count: <xsl:value-of select="$recordCount"/></div>
     291                                <br/>
     292                                <xsl:call-template name="Page.dataTableValuesFootnote"/>
     293                        </xsl:otherwise>
     294                </xsl:choose>
     295
     296
     297                <!-- Data Notes -->
     298                <xsl:if test="exists($Result.configuration/DATA_NOTES)">
     299                        <h2>Data Notes</h2>
     300                        <xsl:for-each select="$Result.configuration/DATA_NOTES/DATA_NOTE">
     301                                <xsl:sort select="SORT_ODRER" order="ascending" data-type="number"/>
     302                                <xsl:call-template name="Page.containedTitleText">
     303                                        <xsl:with-param name="titleTextContainer" select="."/>
     304                                </xsl:call-template>
     305                                <br/>
     306                        </xsl:for-each>
     307                </xsl:if>
     308 
     309                <!-- Data Sources -->
     310                <xsl:if test="count($Result.configuration/DATA_SOURCES/DATA_SOURCE) &gt; 0">
     311                        <h2>Data Sources</h2>
     312                        <xsl:for-each select="$Result.configuration/DATA_SOURCES/DATA_SOURCE">
     313                                <xsl:sort select="SORT_ODRER" order="ascending" data-type="number"/>
     314                                <xsl:if test="position() &gt; 1">;&#160;</xsl:if>
     315                                <xsl:value-of select="TEXT"/>
     316                        </xsl:for-each>
     317                        <br/><br/>
     318                </xsl:if>
     319
     320                <!-- Data Issues -->
     321                <xsl:if test="exists($Result.configuration/DATA_ISSUES)">
     322                        <h2>Data Issues</h2>
     323                        <xsl:for-each select="$Result.configuration/DATA_ISSUES/DATA_ISSUE">
     324                                <xsl:sort select="SORT_ODRER" order="ascending" data-type="number"/>
     325                                <xsl:call-template name="Page.containedTitleText">
     326                                        <xsl:with-param name="titleTextContainer" select="."/>
     327                                </xsl:call-template>
     328                                <br/>
     329                        </xsl:for-each>
     330                </xsl:if>
     331
     332                <h2>Time of Query</h2>
     333                These data were queried on: <xsl:value-of select="/QUERY_MODULE/REQUEST/FINISHED_DATE_TIME_STAMP"/>
     334                <br/><br/>
     335
     336                <a href="#top" class="Top">Top</a>
     337                <br/><br/>
     338        </xsl:template>
     339       
    128340
    129341        <xsl:template name="SiteSpecific.navigationPath"
Note: See TracChangeset for help on using the changeset viewer.