<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright 2009-2014 European Molecular Biology Laboratory
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fn="http://www.w3.org/2005/xpath-functions"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:ae="http://www.ebi.ac.uk/arrayexpress/XSLT/Extension"
                xmlns:search="http://www.ebi.ac.uk/arrayexpress/XSLT/SearchExtension"
                xmlns:html="http://www.w3.org/1999/xhtml"
                extension-element-prefixes="ae search"
                exclude-result-prefixes="ae search html fn xs"
                version="2.0">

    <xsl:param name="queryid"/>
    <xsl:param name="accession"/>
    <xsl:param name="sourcename"/>

    <xsl:param name="grouping"/>
    <xsl:param name="full"/>

    <!-- TODO: fix grouping when we're ready -->
    <xsl:variable name="vGrouping" as="xs:boolean" select="fn:false()"/>
    <xsl:variable name="vFull" as="xs:boolean" select="fn:not(fn:not($full) or $vIsAnonymousReview)"/>

    <xsl:param name="s_page"/>
    <xsl:param name="s_pagesize"/>
    <xsl:param name="s_sortby"/>
    <xsl:param name="s_sortorder"/>

    <xsl:variable name="vSortBy" select="if ($s_sortby) then fn:replace($s_sortby, 'col_(\d+)', '$1') cast as xs:integer else 1" as="xs:integer"/>
    <xsl:variable name="vSortOrder" select="if (fn:starts-with($s_sortorder, 'd')) then 'd' else 'a'" as="xs:string"/>

    <xsl:variable name="vPage" select="if ($s_page and $s_page castable as xs:integer) then $s_page cast as xs:integer else 1" as="xs:integer"/>
    <xsl:variable name="vPageSize" select="if ($s_pagesize and $s_pagesize castable as xs:integer) then $s_pagesize cast as xs:integer else 25"  as="xs:integer"/>

    <xsl:variable name="vPermittedColType" select="('sourcename','sample_description','sample_source_name','characteristics','factorvalue','unit','links')"/>
    <xsl:variable name="vLinksColName" select="('arraydatafile','derivedarraydatafile','arraydatamatrixfile','derivedarraydatamatrixfile','ena_run','fastq_uri')"/>

    <xsl:variable name="vAccession" select="fn:upper-case($accession)"/>
    <xsl:variable name="vData" select="search:queryIndex('files', fn:concat('accession:', $vAccession))"/>
    <xsl:variable name="vSampleFiles" select="$vData[@kind = 'sdrf' and @extension = 'txt']"/>
    <xsl:variable name="vMetaData" select="search:queryIndex('experiments', fn:concat('accession:', $vAccession, if ($userid) then fn:concat(' userid:(', $userid, ')') else ''))[accession = $vAccession]" />

    <xsl:variable name="vIsAnonymousReview" select="fn:not($vMetaData/user/@id = '1') and ($isreviewer = 'true') and $vMetaData/source/@anonymousreview"/>

    <xsl:include href="ae-html-page.xsl"/>
    <xsl:include href="ae-highlight.xsl"/>

    <xsl:template match="/">
        <xsl:call-template name="ae-page">
            <xsl:with-param name="pIsSearchVisible" select="fn:true()"/>
            <xsl:with-param name="pSearchInputValue"/>
            <xsl:with-param name="pExtraSearchFields"/>
            <xsl:with-param name="pTitleTrail">
                <xsl:text>Samples and Data &lt; </xsl:text>
                <xsl:value-of select="$vAccession"/>
                <xsl:text> &lt; Browse</xsl:text>
            </xsl:with-param>
            <xsl:with-param name="pExtraCSS">
                <link rel="stylesheet" href="{$context-path}/assets/stylesheets/ae-experiment-samples-1.0.130704.css" type="text/css"/>
            </xsl:with-param>
            <xsl:with-param name="pBreadcrumbTrail">
                <a href="{$context-path}/browse.html">Browse</a>
                <xsl:text> > </xsl:text>
                <a href="{$context-path}/experiments/{$vAccession}/">
                    <xsl:value-of select="$vAccession"/>
                </a>
                <xsl:text> > Samples and Data</xsl:text>
                <xsl:if test="not($vFull)">
                    <sup><a href="{$context-path}/experiments/{$vAccession}/samples/?full=true" title="Some columns were omitted; please click here to get a full view of samples and data">*</a></sup>
                </xsl:if>
            </xsl:with-param>
            <xsl:with-param name="pExtraJS">
                <script src="{$context-path}/assets/scripts/jquery.query-2.1.7m-ebi.js" type="text/javascript"/>
                <script src="{$context-path}/assets/scripts/jquery.ae-samples-view-1.0.130402.js" type="text/javascript"/>
            </xsl:with-param>
            <xsl:with-param name="pExtraBodyClasses"/>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="ae-content-section">
        <section>
            <div id="ae-content">
                <xsl:choose><commit_msg>- removed link to "full" SDRF view for Anonymous Review<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright 2009-2014 European Molecular Biology Laboratory
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fn="http://www.w3.org/2005/xpath-functions"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:ae="http://www.ebi.ac.uk/arrayexpress/XSLT/Extension"
                xmlns:search="http://www.ebi.ac.uk/arrayexpress/XSLT/SearchExtension"
                xmlns:html="http://www.w3.org/1999/xhtml"
                extension-element-prefixes="ae search"
                exclude-result-prefixes="ae search html fn xs"
                version="2.0">

    <xsl:param name="queryid"/>
    <xsl:param name="accession"/>
    <xsl:param name="sourcename"/>

    <xsl:param name="grouping"/>
    <xsl:param name="full"/>

    <!-- TODO: fix grouping when we're ready -->
    <xsl:variable name="vGrouping" as="xs:boolean" select="fn:false()"/>
    <xsl:variable name="vFull" as="xs:boolean" select="fn:not(fn:not($full) or $vIsAnonymousReview)"/>

    <xsl:param name="s_page"/>
    <xsl:param name="s_pagesize"/>
    <xsl:param name="s_sortby"/>
    <xsl:param name="s_sortorder"/>

    <xsl:variable name="vSortBy" select="if ($s_sortby) then fn:replace($s_sortby, 'col_(\d+)', '$1') cast as xs:integer else 1" as="xs:integer"/>
    <xsl:variable name="vSortOrder" select="if (fn:starts-with($s_sortorder, 'd')) then 'd' else 'a'" as="xs:string"/>

    <xsl:variable name="vPage" select="if ($s_page and $s_page castable as xs:integer) then $s_page cast as xs:integer else 1" as="xs:integer"/>
    <xsl:variable name="vPageSize" select="if ($s_pagesize and $s_pagesize castable as xs:integer) then $s_pagesize cast as xs:integer else 25"  as="xs:integer"/>

    <xsl:variable name="vPermittedColType" select="('sourcename','sample_description','sample_source_name','characteristics','factorvalue','unit','links')"/>
    <xsl:variable name="vLinksColName" select="('arraydatafile','derivedarraydatafile','arraydatamatrixfile','derivedarraydatamatrixfile','ena_run','fastq_uri')"/>

    <xsl:variable name="vAccession" select="fn:upper-case($accession)"/>
    <xsl:variable name="vData" select="search:queryIndex('files', fn:concat('accession:', $vAccession))"/>
    <xsl:variable name="vSampleFiles" select="$vData[@kind = 'sdrf' and @extension = 'txt']"/>
    <xsl:variable name="vMetaData" select="search:queryIndex('experiments', fn:concat('accession:', $vAccession, if ($userid) then fn:concat(' userid:(', $userid, ')') else ''))[accession = $vAccession]" />

    <xsl:variable name="vIsAnonymousReview" select="fn:not($vMetaData/user/@id = '1') and ($isreviewer = 'true') and $vMetaData/source/@anonymousreview"/>

    <xsl:include href="ae-html-page.xsl"/>
    <xsl:include href="ae-highlight.xsl"/>

    <xsl:template match="/">
        <xsl:call-template name="ae-page">
            <xsl:with-param name="pIsSearchVisible" select="fn:true()"/>
            <xsl:with-param name="pSearchInputValue"/>
            <xsl:with-param name="pExtraSearchFields"/>
            <xsl:with-param name="pTitleTrail">
                <xsl:text>Samples and Data &lt; </xsl:text>
                <xsl:value-of select="$vAccession"/>
                <xsl:text> &lt; Browse</xsl:text>
            </xsl:with-param>
            <xsl:with-param name="pExtraCSS">
                <link rel="stylesheet" href="{$context-path}/assets/stylesheets/ae-experiment-samples-1.0.130704.css" type="text/css"/>
            </xsl:with-param>
            <xsl:with-param name="pBreadcrumbTrail">
                <a href="{$context-path}/browse.html">Browse</a>
                <xsl:text> > </xsl:text>
                <a href="{$context-path}/experiments/{$vAccession}/">
                    <xsl:value-of select="$vAccession"/>
                </a>
                <xsl:text> > Samples and Data</xsl:text>
                <xsl:if test="fn:not($vFull) and fn:not($vIsAnonymousReview)">
                    <sup><a href="{$context-path}/experiments/{$vAccession}/samples/?full=true" title="Some columns were omitted; please click here to get a full view of samples and data">*</a></sup>
                </xsl:if>
            </xsl:with-param>
            <xsl:with-param name="pExtraJS">
                <script src="{$context-path}/assets/scripts/jquery.query-2.1.7m-ebi.js" type="text/javascript"/>
                <script src="{$context-path}/assets/scripts/jquery.ae-samples-view-1.0.130402.js" type="text/javascript"/>
            </xsl:with-param>
            <xsl:with-param name="pExtraBodyClasses"/>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="ae-content-section">
        <section>
            <div id="ae-content">
                <xsl:choose>
{'fraction_non_alphanumeric': 0.17069303236638372, 'fraction_numerical': 0.011566085253241301, 'mean_word_length': 3.2162799842705465, 'pattern_counts': {'":': 0, '<': 145, '<?xml version=': 2, '>': 149, 'https://': 0, 'lorem ipsum': 0, 'www.': 14, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4631394', 'n_tokens_mistral': 3599, 'n_tokens_neox': 3283, 'n_words': 668}