<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2011 HPCC Systems.

    All rights reserved. This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:variable name="owner" select="/DFUQueryResponse/Owner"/>
    <xsl:variable name="cluster" select="/DFUQueryResponse/Prefix"/>
    <xsl:variable name="clustername" select="/DFUQueryResponse/ClusterName"/>
    
    <xsl:variable name="logicalname" select="/DFUQueryResponse/LogicalName"/>
    <xsl:variable name="descriptionfilter" select="/DFUQueryResponse/Description"/>
    <xsl:variable name="startdate" select="/DFUQueryResponse/StartDate"/>
    <xsl:variable name="enddate" select="/DFUQueryResponse/EndDate"/>
    <xsl:variable name="filetype" select="/DFUQueryResponse/FileType"/>
    <xsl:variable name="filesizefrom" select="/DFUQueryResponse/FileSizeFrom"/>
    <xsl:variable name="filesizeto" select="/DFUQueryResponse/FileSizeTo"/>
    <xsl:variable name="firstn" select="/DFUQueryResponse/FirstN"/>
    <xsl:variable name="firstntype" select="/DFUQueryResponse/FirstNType"/>

    <xsl:variable name="num" select="/DFUQueryResponse/NumFiles"/>
    <xsl:variable name="pagesize" select="/DFUQueryResponse/PageSize"/>
    <xsl:variable name="lastpagefrom" select="/DFUQueryResponse/LastPageFrom"/>
    <xsl:variable name="prevpagefrom" select="/DFUQueryResponse/PrevPageFrom"/>
    <xsl:variable name="nextpagefrom" select="/DFUQueryResponse/NextPageFrom"/>
    <xsl:variable name="sortby" select="/DFUQueryResponse/Sortby"/>
    <xsl:variable name="descending" select="/DFUQueryResponse/Descending"/>
    <xsl:variable name="filters" select="/DFUQueryResponse/Filters"/>
    <xsl:variable name="parametersforpaging" select="/DFUQueryResponse/ParametersForPaging"/>
    <xsl:variable name="basicquery" select="/DFUQueryResponse/BasicQuery"/>

    <xsl:template match="/DFUQueryResponse">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
            <head>
        <xsl:text disable-output-escaping="yes"><![CDATA[
          <link rel="stylesheet" type="text/css" href="/esp/files/yui/build/fonts/fonts-min.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/yui/build/menu/assets/skins/sam/menu.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/yui/build/button/assets/skins/sam/button.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/css/espdefault.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/css/eclwatch.css" />
                    <link type="text/css" rel="styleSheet" href="/esp/files/css/sortabletable.css"/>
           <script type="text/javascript" src="/esp/files/scripts/espdefault.js"></script>
          <script type="text/javascript" src="/esp/files/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
          <script type="text/javascript" src="/esp/files/yui/build/container/container_core-min.js"></script>
          <script type="text/javascript" src="/esp/files/yui/build/menu/menu-min.js"></script>
          <script language="JavaScript1.2" src="/esp/files/scripts/multiselect.js"></script>
        ]]></xsl:text>

          <script language="JavaScript1.2" id="menuhandlers">
                    var owner = '<xsl:value-of select="$owner"/>';;
                    var cluster = '<xsl:value-of select="$cluster"/>';;
                    var clusterName = '<xsl:value-of select="$clustername"/>';;
                    var logicalName = '<xsl:value-of select="$logicalname"/>';;
                    var descriptionFilter = '<xsl:value-of select="$descriptionfilter"/>';;
                    var startDate = '<xsl:value-of select="$startdate"/>';;
                    var endDate = '<xsl:value-of select="$enddate"/>';;
                    var fileType = '<xsl:value-of select="$filetype"/>';;
                    var fileSizeFrom = '<xsl:value-of select="$filesizefrom"/>';;
                    var fileSizeTo = '<xsl:value-of select="$filesizeto"/>';;
                    var pageSize = '<xsl:value-of select="$pagesize"/>';;
                    var sortBy = '<xsl:value-of select="$sortby"/>';;
                    var descending = '<xsl:value-of select="$descending"/>';;
                    //var firstN = '<xsl:value-of select="$firstn"/>';;
                    //var firstNType = '<xsl:value-of select="$firstntype"/>';;

            var oMenu;

            <xsl:text disable-output-escaping="yes"><![CDATA[
          function DFUFilePopup(query, filename, cluster, replicate, roxiecluster, browsedata, PosId) {
            function detailsDFUFile() {
              document.location.href='/WsDfu/DFUInfo?Name='+ escape(filename) + '&Cluster=' + cluster;
                      }
                        function browseDFUData() {
                          document.location.href='/WsDfu/DFUGetDataColumns?OpenLogicalName='+filename;
                        }
                        function searchDFUData() {
                          if (roxiecluster != "0") {
                                  document.location.href='/WsDfu/DFUSearchData?OpenLogicalName='+filename+ '&ClusterType=roxie&Cluster=' + cluster;
                            } else {
                                  document.location.href='/WsDfu/DFUSearchData?OpenLogicalName='+filename+ '&ClusterType=thor&Cluster=' + cluster + '&RoxieSelections=0';
              }
            }
            function replicateDFUFile() {
              document.location.href='/FileSpray/Replicate?sourceLogicalName='+filename;
            }
            function copyDFUFile() {
              document.location.href='/FileSpray/CopyInput?sourceLogicalName='+filename;
            }
            function renameDFUFile() {
              document.location.href='/FileSpray/RenameInput?sourceLogicalName='+filename;
            }
            function desprayDFUFile()
            {
              document.location.href='/FileSpray/DesprayInput?sourceLogicalName='+filename;
            }
            function showRoxieQueries()
            {
              document.location.href='/WsRoxieQuery/QueriesAction?Type=ListQueries&Cluster='+cluster+'&LogicalName='+filename;
            }
            var xypos = YAHOO.util.Dom.getXY('mn' + PosId);
            if (oMenu) {
              oMenu.destroy();
            }              
            oMenu = new YAHOO.widget.Menu("logicalfilecontextmenu", {position: "dynamic", xy: xypos} );
            oMenu.clearContent();

            oMenu.addItems([
            { text: "Details", onclick: { fn: detailsDFUFile } },
            { text: "Copy", onclick: { fn: copyDFUFile } },
            { text: "Rename", onclick: { fn: renameDFUFile } }
            ]);

            if (browsedata != 0) {
            oMenu.addItems([
            { text: "View Data File", onclick: { fn: searchDFUData } }
            ]);
            }

            if (replicate != 0) {
            oMenu.addItems([
            { text: "Replicate", onclick: { fn: replicateDFUFile } }
            ]);
            }<commit_msg>Fix gh-907 Page Not Found error when ShowQuery for a file<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2011 HPCC Systems.

    All rights reserved. This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:variable name="owner" select="/DFUQueryResponse/Owner"/>
    <xsl:variable name="cluster" select="/DFUQueryResponse/Prefix"/>
    <xsl:variable name="clustername" select="/DFUQueryResponse/ClusterName"/>
    
    <xsl:variable name="logicalname" select="/DFUQueryResponse/LogicalName"/>
    <xsl:variable name="descriptionfilter" select="/DFUQueryResponse/Description"/>
    <xsl:variable name="startdate" select="/DFUQueryResponse/StartDate"/>
    <xsl:variable name="enddate" select="/DFUQueryResponse/EndDate"/>
    <xsl:variable name="filetype" select="/DFUQueryResponse/FileType"/>
    <xsl:variable name="filesizefrom" select="/DFUQueryResponse/FileSizeFrom"/>
    <xsl:variable name="filesizeto" select="/DFUQueryResponse/FileSizeTo"/>
    <xsl:variable name="firstn" select="/DFUQueryResponse/FirstN"/>
    <xsl:variable name="firstntype" select="/DFUQueryResponse/FirstNType"/>

    <xsl:variable name="num" select="/DFUQueryResponse/NumFiles"/>
    <xsl:variable name="pagesize" select="/DFUQueryResponse/PageSize"/>
    <xsl:variable name="lastpagefrom" select="/DFUQueryResponse/LastPageFrom"/>
    <xsl:variable name="prevpagefrom" select="/DFUQueryResponse/PrevPageFrom"/>
    <xsl:variable name="nextpagefrom" select="/DFUQueryResponse/NextPageFrom"/>
    <xsl:variable name="sortby" select="/DFUQueryResponse/Sortby"/>
    <xsl:variable name="descending" select="/DFUQueryResponse/Descending"/>
    <xsl:variable name="filters" select="/DFUQueryResponse/Filters"/>
    <xsl:variable name="parametersforpaging" select="/DFUQueryResponse/ParametersForPaging"/>
    <xsl:variable name="basicquery" select="/DFUQueryResponse/BasicQuery"/>

    <xsl:template match="/DFUQueryResponse">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
            <head>
        <xsl:text disable-output-escaping="yes"><![CDATA[
          <link rel="stylesheet" type="text/css" href="/esp/files/yui/build/fonts/fonts-min.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/yui/build/menu/assets/skins/sam/menu.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/yui/build/button/assets/skins/sam/button.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/css/espdefault.css" />
          <link rel="stylesheet" type="text/css" href="/esp/files/css/eclwatch.css" />
                    <link type="text/css" rel="styleSheet" href="/esp/files/css/sortabletable.css"/>
           <script type="text/javascript" src="/esp/files/scripts/espdefault.js"></script>
          <script type="text/javascript" src="/esp/files/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
          <script type="text/javascript" src="/esp/files/yui/build/container/container_core-min.js"></script>
          <script type="text/javascript" src="/esp/files/yui/build/menu/menu-min.js"></script>
          <script language="JavaScript1.2" src="/esp/files/scripts/multiselect.js"></script>
        ]]></xsl:text>

          <script language="JavaScript1.2" id="menuhandlers">
                    var owner = '<xsl:value-of select="$owner"/>';;
                    var cluster = '<xsl:value-of select="$cluster"/>';;
                    var clusterName = '<xsl:value-of select="$clustername"/>';;
                    var logicalName = '<xsl:value-of select="$logicalname"/>';;
                    var descriptionFilter = '<xsl:value-of select="$descriptionfilter"/>';;
                    var startDate = '<xsl:value-of select="$startdate"/>';;
                    var endDate = '<xsl:value-of select="$enddate"/>';;
                    var fileType = '<xsl:value-of select="$filetype"/>';;
                    var fileSizeFrom = '<xsl:value-of select="$filesizefrom"/>';;
                    var fileSizeTo = '<xsl:value-of select="$filesizeto"/>';;
                    var pageSize = '<xsl:value-of select="$pagesize"/>';;
                    var sortBy = '<xsl:value-of select="$sortby"/>';;
                    var descending = '<xsl:value-of select="$descending"/>';;
                    //var firstN = '<xsl:value-of select="$firstn"/>';;
                    //var firstNType = '<xsl:value-of select="$firstntype"/>';;

            var oMenu;

            <xsl:text disable-output-escaping="yes"><![CDATA[
          function DFUFilePopup(query, filename, cluster, replicate, roxiecluster, browsedata, PosId) {
            function detailsDFUFile() {
              document.location.href='/WsDfu/DFUInfo?Name='+ escape(filename) + '&Cluster=' + cluster;
                      }
                        function browseDFUData() {
                          document.location.href='/WsDfu/DFUGetDataColumns?OpenLogicalName='+filename;
                        }
                        function searchDFUData() {
                          if (roxiecluster != "0") {
                                  document.location.href='/WsDfu/DFUSearchData?OpenLogicalName='+filename+ '&ClusterType=roxie&Cluster=' + cluster;
                            } else {
                                  document.location.href='/WsDfu/DFUSearchData?OpenLogicalName='+filename+ '&ClusterType=thor&Cluster=' + cluster + '&RoxieSelections=0';
              }
            }
            function replicateDFUFile() {
              document.location.href='/FileSpray/Replicate?sourceLogicalName='+filename;
            }
            function copyDFUFile() {
              document.location.href='/FileSpray/CopyInput?sourceLogicalName='+filename;
            }
            function renameDFUFile() {
              document.location.href='/FileSpray/RenameInput?sourceLogicalName='+filename;
            }
            function desprayDFUFile()
            {
              document.location.href='/FileSpray/DesprayInput?sourceLogicalName='+filename;
            }
            function showRoxieQueries()
            {
              //document.location.href='/WsRoxieQuery/QueriesAction?Type=ListQueries&Cluster='+cluster+'&LogicalName='+filename;
              document.location.href='/WsSMC/DisabledInThisVersion?form_';
            }
            var xypos = YAHOO.util.Dom.getXY('mn' + PosId);
            if (oMenu) {
              oMenu.destroy();
            }              
            oMenu = new YAHOO.widget.Menu("logicalfilecontextmenu", {position: "dynamic", xy: xypos} );
            oMenu.clearContent();

            oMenu.addItems([
            { text: "Details", onclick: { fn: detailsDFUFile } },
            { text: "Copy", onclick: { fn: copyDFUFile } },
            { text: "Rename", onclick: { fn: renameDFUFile } }
            ]);

            if (browsedata != 0) {
            oMenu.addItems([
            { text: "View Data File", onclick: { fn: searchDFUData } }
            ]);
            }

            if (replicate != 0) {
            oMenu.addItems([
            { text: "Replicate", onclick: { fn: replicateDFUFile } }
            ]);
            }
{'fraction_non_alphanumeric': 0.14718835769451713, 'fraction_numerical': 0.0037658773217591115, 'mean_word_length': 2.524859392575928, 'pattern_counts': {'":': 0, '<': 137, '<?xml version=': 2, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4797093', 'n_tokens_mistral': 4594, 'n_tokens_neox': 4334, 'n_words': 803}