123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:pg="http://developer.cognos.com/schemas/xts/pg"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
- xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
- xmlns:out="dummy-uri"
- exclude-result-prefixes="xts xsl cp dp cf cm">
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <!-- This template renders UI for the basic search resultset -->
- <xsl:template match="pg:pager-basicSearch">
-
- <mf:long-description-scripts/>
-
- <cf:main-pager-section virtualPage="true" name="search" width="100%">
- <xsl:if test="@navContent='true'">
- <xsl:attribute name="navContent"><xsl:value-of select="'true'"/></xsl:attribute>
- </xsl:if>
- <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
- <cf:param name="lines-per-page">
- <out:value-of select="key('session-param', 'linesPerPage')"/>
- </cf:param>
- <xsl:choose>
- <xsl:when test="@navContent='true'">
- <cf:param name="item-path">/root/navContent/nav:searchResponse/nav:content/*</cf:param>
- </xsl:when>
- <xsl:otherwise>
- <cf:param name="item-path">$childReply/*[cm:usage != 'subObject']</cf:param>
- </xsl:otherwise>
- </xsl:choose>
- <cf:param name="rows">
- <cp:tableHeader session-name="s_cc">
- <xsl:if test = "not(@noSelection)">
- <cp:columnHeader width="16" toggleName="checkbox_" noLabel="true" id="checkbox_0"/>
- </xsl:if>
- <cp:columnHeader width="20"/>
- <cp:columnHeader width="20">
- <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
- <out:text/><xts:string id="IDS_PATH_INDICATOR"/><out:text></out:text>
- </cp:columnHeader>
- <cp:columnHeader width="100%" sort="n">
- <cp:sortHref>
- <out:value-of select="$back-url"/>&m_s_cc=<out:text/>
- <out:choose>
- <out:when test="key('session-param','s_cc') = 'na'">nd</out:when>
- <out:when test="key('session-param','s_cc') = 'nd'">sa</out:when>
- <out:otherwise>na</out:otherwise>
- </out:choose>
- </cp:sortHref>
-
- <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
- <xts:string id="IDS_NAME"/>
- </cp:columnHeader>
- <cp:columnHeader width="150">
- <xts:string id="IDS_HEADING_ACTIONS"/>
- </cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent>
- <cp:common-render-variables>
- <!-- Common variables used in rendering icons, actions .. etc. -->
- <pm:permissions/>
- <mf:common-entry-varaibles/>
- </cp:common-render-variables>
- <xsl:if test = "not(@noSelection)">
- <cp:columnContent valign="top">
- <out:variable name="checkboxLabel"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><out:value-of select="cm:defaultName"/></xts:param></xts:string></out:variable>
- <input type="checkbox" value="{'{xtsext:urlencode(string(cm:searchPath))}'}" name="checkbox_{'{position()}'}" id="checkbox_{'{position()}'}" aria-label="{'{$checkboxLabel}'}" >
- <out:if test="key('env-param',concat('checkbox_' , position()))">
- <out:attribute name="checked">checked</out:attribute>
- </out:if>
- </input>
- </cp:columnContent>
- </xsl:if>
- <cp:columnContent valign="top" style="padding-top:6px;">
- <xsl:choose>
- <xsl:when test="@navContent='true'">
- <out:call-template name="ccinav-gen-icon">
- <out:with-param name="imgURL" select="nav:imgURL"/>
- <out:with-param name="screenTip" select="nav:screenTip"/>
- <out:with-param name="defaultAction" select="nav:defaultAction/nav:imgURL"/>
- <out:with-param name="hiddenObject" select="nav:hidden"/>
- </out:call-template>
- </xsl:when>
- <xsl:otherwise>
- <out:call-template name="gen-icon">
- <out:with-param name="class" select="$class"/>
- <out:with-param name="userInterfaces" select="$userInterfaces"/>
- <out:with-param name="canRead" select="$canRead"/>
- <out:with-param name="canWrite" select="$canWrite"/>
- <out:with-param name="canExecute" select="$canExecute"/>
- <out:with-param name="canTraverse" select="$canTraverse"/>
- <out:with-param name="isDangling" select="$isDangling"/>
- <out:with-param name="output_format" select="$output_format"/>
- <out:with-param name="action" select="$action"/>
- <out:with-param name="executionFormat" select="$executionFormat"/>
- <out:with-param name="hiddenObject" select="$hiddenObject"/>
- <out:with-param name="effectiveUserCapabilities" select="$effectiveUserCapabilities"/>
- </out:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- <cp:columnContent valign="top" nowrap="true">
- <div tabindex="0">
- <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
- <out:attribute name="alt">
- <xsl:choose>
- <xsl:when test="@navContent='true'">
- <out:call-template name="do-the-path-link-nav">
- <out:with-param name="path" select="nav:fullPath/nav:pathStep/nav:pathStep"></out:with-param>
- <out:with-param name="name" select="nav:name"></out:with-param>
- </out:call-template>
- </xsl:when>
- <xsl:otherwise>
- <out:variable name="object-start-at-path">
- <out:if test="starts-with(cm:searchPath, '~') or starts-with(cm:searchPath,key('session-param', 'e_hp'))">
- <out:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
- </out:if>
- <out:if test="starts-with(cm:searchPath,'/content')">
- <out:value-of select="$defaultContentRoot"/>
- </out:if>
- </out:variable>
- <cf:do-the-path-link>
- <cf:param name="familytree">cm:ancestors</cf:param>
- <cf:param name="familymember">cm:defaultName</cf:param>
- <cf:param name="home"><out:value-of select="$object-start-at-path"/></cf:param>
- <cf:param name="onlyAncestors">true</cf:param>
- </cf:do-the-path-link>
- </xsl:otherwise>
- </xsl:choose>
- </out:attribute>
- </img><xsl:text> </xsl:text>
- </div>
- </cp:columnContent>
-
- <cp:columnContent valign="top" wrap="true" width="100%">
- <div>
- <!-- Logic to figure out if an entry is to be hyperlinked and if it is what the URL should be -->
- <xsl:choose>
- <xsl:when test="@navContent='true'">
- <out:call-template name="ccinav-gen-url"></out:call-template>
- </xsl:when>
- <xsl:otherwise>
- <mf:entry-name mode="search"/>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- <div>
- <out:text/><xts:string id="IDS_SEARCH_LAST_MODIFIED_TEXT"/><out:text/>
- <xsl:choose>
- <xsl:when test="@navContent='true'">
- <out:value-of select="string( nav:lastModifiedDate )"/>
- </xsl:when>
- <xsl:otherwise>
- <out:value-of select="xtsext:formatDateFromUTC( string( cm:modificationTime ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
- </xsl:otherwise>
- </xsl:choose>
- </div>
-
- <mf:long-description/>
- </cp:columnContent>
- <cp:columnContent valign="top">
- <xsl:choose>
- <xsl:when test="@navContent='true'">
- <out:call-template name="ccinav-gen-action-properties"/>
- </xsl:when>
- <xsl:otherwise>
- <out:call-template name="action-properties">
- <out:with-param name="supportRunOptionsAction" select="true()"/>
- <out:with-param name="supportScheduleAction" select="true()"/>
- <out:with-param name="canRead" select="$canRead"/>
- <out:with-param name="canWrite" select="$canWrite"/>
- <out:with-param name="canExecute" select="$canExecute"/>
- <out:with-param name="canTraverse" select="$canTraverse"/>
- <out:with-param name="class" select="$class"/>
- <out:with-param name="userInterfaces" select="$userInterfaces"/>
- <out:with-param name="output_format" select="$output_format"/>
- <out:with-param name="isDangling" select="$isDangling"/>
- <out:with-param name="effectiveUserCapabilities" select="$effectiveUserCapabilities"/>
- </out:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- </cp:tableContent>
- </cf:param>
- </cf:main-pager-section>
- </xsl:template>
- <!-- This template renders UI for the index (Burgundy) search resultset -->
- <xsl:template match="pg:pager-indexSearch">
- <script language="javascript">
- <out:variable name="icon-expand">
- <out:value-of select="xtsext:javascriptencode($skin_images)"/>prompt_option_expand.gif<out:text/>
- </out:variable>
- <out:variable name="icon-collapse">
- <out:value-of select="xtsext:javascriptencode($skin_images)"/>prompt_option_collapse.gif<out:text/>
- </out:variable>
-
- function expandMatch(id) {
- var match = document.getElementById(id + "match");
- if (match != null) {
- match.style.overflow = 'visible';
- match.style.height = 'auto';
- match.style.lineHeight = 'normal';
- match.style.display = "";
- }
-
- var icon = document.getElementById(id + "srcharw");
- if (icon != null) {
- icon.src ="<out:value-of select="$icon-collapse"/>";
- }
- }
- function collapseMatch(id) {
- var match = document.getElementById(id + "match");
- if (match != null) {
- match.style.display = "none";
- }
-
- var icon = document.getElementById(id + "srcharw");
- if (icon != null) {
- icon.src ="<out:value-of select="$icon-expand"/>";
- }
- }
- function toggleMatch(id) {
- var match = document.getElementById(id + "match");
- if (match.style.overflow == 'hidden') {
- expandMatch(id);
- }
- else {
- collapseMatch(id);
- }
- }
- var desc_expanded =
- <out:choose>
- <out:when test="string(/root/env/param[@name='desc_expanded']) = 'false'">
- <out:value-of select="'false'"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="'true'"/>
- </out:otherwise>
- </out:choose>
- ;
- function toggleMatchAll(count) {
- var icon = document.getElementById("srcharwall");
- if (!desc_expanded) {
- icon.title = '<xts:string id="IDS_SEARCH_COLLAPSE_DETAILS" encode="javascript"/>';
- desc_expanded = true;
- icon.src = "<out:value-of select="$icon-collapse"/>";
- if (count > 0) {
- for (i = 1; i <= count; i++) {
- expandMatch ("" + i);
- }
- }
- }
- else {
- icon.title = '<xts:string id="IDS_SEARCH_EXPAND_DETAILS" encode="javascript"/>';
- desc_expanded = false;
- icon.src = "<out:value-of select="$icon-expand"/>";
- if (count > 0) {
- for (i = 1; i <= count; i++) {
- collapseMatch("" + i);
- }
- }
- }
- if (document.frmSearch["desc_expanded"]) {
- document.frmSearch["desc_expanded"].value = desc_expanded;
- }
- }
- </script>
- <cf:main-pager-section virtualPage="true" form="frmSearch" navContent="true" name="search" width="100%">
- <xsl:copy-of select="@*"/>
- <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
- <cf:param name="item-path">/root/navContent/nav:searchResponse/nav:content/*</cf:param>
- <cf:param name="lines-per-page">
- <out:value-of select="key('session-param', 'linesPerPage')"/>
- </cf:param>
- <cf:param name="noGoto">true</cf:param>
- <cf:param name="navContext"><out:value-of select="{'/root/navContent/nav:searchResponse/nav:context'}"/></cf:param>
- <cf:param name="navApproximateMaxEntries"><out:value-of select="{'/root/navContent/nav:searchResponse/nav:content/@estimatedTotal'}"/></cf:param>
- <cf:param name="rows">
- <cp:tableHeader>
- <xsl:if test = "not(@noSelection)">
- <cp:columnHeader width="16" toggleName="checkbox_"/>
- </xsl:if>
- <cp:columnHeader width="20"/>
- <cp:columnHeader width="100%" noSep="T">
- <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
- <out:text/><xts:string id="IDS_PATH_INDICATOR"/><out:text> </out:text>
- <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
- <xts:string id="IDS_NAME"/>
- <out:if test="count(/root/navContent/nav:searchResponse/nav:content/*) > 0">
- <a href="javascript:toggleMatchAll({'{count(/root/navContent/nav:searchResponse/nav:content/*)}'})">
- <img id="srcharwall" hspace="2" border="0">
- <out:choose>
- <out:when test="string(/root/env/param[@name='desc_expanded']) = 'false'">
- <out:attribute name="src"><out:value-of select="$skin_images"/>prompt_option_expand.gif<out:text/></out:attribute>
- <out:attribute name="title"><out:text/><xts:string id="IDS_SEARCH_EXPAND_DETAILS"/></out:attribute>
- <out:attribute name="alt"><out:text/><xts:string id="IDS_SEARCH_EXPAND_DETAILS"/></out:attribute>
- </out:when>
- <out:otherwise>
- <out:attribute name="src"><out:value-of select="$skin_images"/>prompt_option_collapse.gif<out:text/></out:attribute>
- <out:attribute name="title"><out:text/><xts:string id="IDS_SEARCH_COLLAPSE_DETAILS"/></out:attribute>
- <out:attribute name="alt"><out:text/><xts:string id="IDS_SEARCH_COLLAPSE_DETAILS"/></out:attribute>
- </out:otherwise>
- </out:choose>
- </img>
- </a>
- </out:if>
- </cp:columnHeader>
- <cp:columnHeader width="1">
- </cp:columnHeader>
- <cp:columnHeader width="150">
- <xts:string id="IDS_HEADING_ACTIONS"/>
- </cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent>
- <cp:common-render-variables>
- <!-- Common variables used in rendering icons, actions .. etc. -->
- <pm:permissions/>
- <mf:common-entry-varaibles/>
- </cp:common-render-variables>
- <xsl:if test = "not(@noSelection)">
- <cp:columnContent valign="top">
- <out:if test="string(nav:type) != ''">
- <out:variable name="obj-id">
- <out:text/>storeID("<out:value-of select="substring-after(string(nav:id), '_')"/>")<out:text/>
- </out:variable>
- <input type="checkbox" name="checkbox_{'{position()}'}" value="{'{$obj-id}'}">
- <out:if test="key('env-param',concat('checkbox_' , position()))">
- <out:attribute name="checked">checked</out:attribute>
- </out:if>
- </input>
- </out:if>
- </cp:columnContent>
- </xsl:if>
- <cp:columnContent valign="top" style="padding-top:6px;">
- <out:call-template name="ccinav-gen-icon">
- <out:with-param name="imgURL" select="nav:imgURL"/>
- <out:with-param name="screenTip" select="nav:screenTip"/>
- <out:with-param name="defaultAction" select="nav:defaultAction/nav:imgURL"/>
- <out:with-param name="hiddenObject" select="nav:hidden"/>
- </out:call-template>
- </cp:columnContent>
- <cp:columnContent valign="top">
- <div>
- <img width="20" height="16" align="absmiddle" src="{'{$skin_images}'}path.gif">
- <out:attribute name="alt">
- <out:call-template name="do-the-path-link-nav">
- <out:with-param name="path" select="nav:fullPath/nav:pathStep/nav:pathStep"></out:with-param>
- <out:with-param name="name" select="nav:name"></out:with-param>
- </out:call-template>
- </out:attribute>
- </img><xsl:text> </xsl:text>
- <!-- Logic to figure out if an entry is to be hyperlinked and if it is what the URL should be -->
- <out:call-template name="ccinav-gen-url"></out:call-template>
- </div>
- <out:variable name="display">
- <out:choose>
- <out:when test="string(/root/env/param[@name='desc_expanded']) = 'false'">
- <out:value-of select="'none'"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="''"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <div id="{'{position()}'}match">
- <out:attribute name="style">display:<out:value-of select="$display"/></out:attribute>
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td style="padding-left:24px" class="objectOptions">
- <out:if test="nav:matchDescription != ''">
- <out:value-of disable-output-escaping="yes" select="nav:matchDescription"/>
- </out:if>
- </td>
- </tr>
- </table>
- </div>
- </cp:columnContent>
- <cp:columnContent valign="top" align="right">
- <out:if test="nav:score != '' and nav:score != 'null' ">
- <out:value-of select="nav:score"/>%<out:text/>
- <out:text> </out:text>
- <img src="{'{nav:icon[nav:name="score"]/nav:imgURL}'}">
- <out:attribute name="title">
- <xts:string id="IDS_SEARCH_TOOLTIP_RELEVANCE">
- <xts:param name="score"><out:value-of select="nav:score"/></xts:param>
- </xts:string>
- </out:attribute>
- <out:attribute name="alt">
- <xts:string id="IDS_SEARCH_TOOLTIP_RELEVANCE">
- <xts:param name="score"><out:value-of select="nav:score"/></xts:param>
- </xts:string>
- </out:attribute>
- </img>
- </out:if>
- </cp:columnContent>
- <cp:columnContent valign="top">
- <out:call-template name="ccinav-gen-action-properties">
- </out:call-template>
- </cp:columnContent>
- </cp:tableContent>
- </cf:param>
- </cf:main-pager-section>
- </xsl:template>
- <xsl:template match="pg:do-the-path-link-nav">
- <out:template name="do-the-path-link-nav">
- <out:param name="path" select="''"/>
- <out:param name="name" select="''"/>
- <out:value-of select="$path/nav:name"/>
- <out:choose>
- <out:when test="$path/nav:pathStep">
- <out:text/> > <out:text/>
- <out:call-template name="do-the-path-link-nav">
- <out:with-param name="path" select="$path/nav:pathStep"></out:with-param>
- <out:with-param name="name" select="$name"/>
- </out:call-template>
- </out:when>
- <out:otherwise>
- <out:text/> > <out:text/>
- <out:value-of select="$name"/>
- </out:otherwise>
- </out:choose>
- </out:template>
- </xsl:template>
-
- <xsl:template match="pg:store_cs_filter">
- <xts:append>
- <xts:function name="TDSRequest">
- <xts:param name="action">set</xts:param>
- <xts:param name="session-id"><out:value-of select="$passport"/></xts:param>
- <xts:param name="name"><out:value-of select="'index_search_context'"/></xts:param>
- <xts:param name="source">
- <out:value-of select="{./pg:cs_filter}"/>
- </xts:param>
- </xts:function>
- </xts:append>
- </xsl:template>
-
- <xsl:template match="pg:read_cs_filter">
- <!-- consult with the runtime session storage iff we don't already have a filter -->
- <out:if test="not(/root/env/param[@name='cs_filter']) and string(/root/env/param[@name='t_cs_filter_saved']) = 'true'">
- <xts:append>
- <index_search_context>
- <xts:function name="TDSRequest">
- <xts:param name="action">get</xts:param>
- <xts:param name="session-id"><out:value-of select="$passport"/></xts:param>
- <xts:param name="name"><out:value-of select="'index_search_context'"/></xts:param>
- </xts:function>
- </index_search_context>
- </xts:append>
- <xts:append select="/root/env">
- <param name="cs_filter">
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="XMLEncode">
- <xts:queryValue select="/root/*[local-name()= 'index_search_context']"/>
- </xts:transform>
- </param>
- </xts:append>
- <xts:delete select="/root/index_search_context"/>
- </out:if>
- </xsl:template>
- <!-- The main engine -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|