123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2011
- 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).
- -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:block id="build-search-request"
- condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]"
- type="exec" mode="interpret" processor="XSLT">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- exclude-result-prefixes="xts xos bus nav SOAP-ENV">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:include href="/fragments/mvc/includes/common-include.xslt"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <xsl:variable name="path">
- <xsl:variable name="mvc-sfolder" select="string($params[@name='mvc-sfolder'])"/>
- <xsl:choose>
- <xsl:when test="$mvc-sfolder != ''">
- <xsl:choose>
- <xsl:when test="starts-with($mvc-sfolder, '_')">
- <xsl:text/>storeID('<xsl:value-of select="substring-after($mvc-sfolder, '_')"/>')<xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$mvc-sfolder"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/>systemDefault<xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <nav-search-query>
- <xsl:if test="string($params[@name='stext']) != ''">
- <nav:string><xsl:value-of select="$params[@name='stext']"/></nav:string>
- </xsl:if>
- <nav:searchType>normal</nav:searchType>
- <!-- scope -->
- <xsl:variable name="sscope" select="$params[@name='sscope']"/>
- <nav:scope>
- <xsl:choose>
- <xsl:when test="$sscope = 'p'">
- <xsl:value-of select="'systemDefault'"/>
- </xsl:when>
- <xsl:when test="$sscope = 'm'">
- <xsl:value-of select="'userDefault'"/>
- </xsl:when>
- <xsl:when test="$sscope = 'fo'">
- <xsl:value-of select="$path"/>
- </xsl:when>
- <xsl:when test="$sscope = 'fb'">
- <xsl:value-of select="$path"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'systemDefault'"/>
- </xsl:otherwise>
- </xsl:choose>
- </nav:scope>
-
- <!-- recursive scope: whether to search subfolders -->
- <nav:recursive>
- <xsl:choose>
- <xsl:when test="string($params[@name='sscope']) = 'fo'">
- <xsl:value-of select="'false'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'true'"/>
- </xsl:otherwise>
- </xsl:choose>
- </nav:recursive>
- <!-- field -->
- <nav:fields>
- <xsl:choose>
- <xsl:when test="$params[@name = 'sfield'] = 'n'">
- <xsl:value-of select="'nf'"/>
- </xsl:when>
- <xsl:when test="$params[@name = 'sfield'] = 'd'">
- <xsl:value-of select="'df'"/>
- </xsl:when>
- <xsl:when test="$params[@name = 'sfield'] = 'nd'">
- <xsl:value-of select="'ndf'"/>
- </xsl:when>
- </xsl:choose>
- </nav:fields>
- <!-- match criteria -->
- <xsl:variable name="smethod" select="$params[@name='smethod']"/>
- <nav:match>
- <xsl:choose>
- <xsl:when test="$smethod = '1'">
- <xsl:value-of select="'contains'"/>
- </xsl:when>
- <xsl:when test="$smethod = '2'">
- <xsl:value-of select="'starts'"/>
- </xsl:when>
- <xsl:when test="$smethod = '3'">
- <xsl:value-of select="'exact'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'contains'"/>
- </xsl:otherwise>
- </xsl:choose>
- </nav:match>
- <!-- modified since -->
- <xsl:variable name="smodified" select="$params[@name='smodified']"/>
- <xsl:if test="$smodified != 'any'">
- <nav:itemModified>
- <xsl:choose>
- <xsl:when test="$smodified = 't'">0</xsl:when>
- <xsl:when test="$smodified = 'l3d'">259200</xsl:when>
- <xsl:when test="$smodified = 'lw'">604800</xsl:when>
- <xsl:when test="$smodified = 'lm'">2629743</xsl:when>
- <xsl:when test="$smodified = 'l3m'">7889231</xsl:when>
- <xsl:when test="$smodified = 'l6m'">15778463</xsl:when>
- <xsl:when test="$smodified = 'ly'">31556926</xsl:when>
- <xsl:when test="$smodified = 'l3y'">94670777</xsl:when>
- </xsl:choose>
- </nav:itemModified>
- </xsl:if>
- <!-- item type(s) to restrict search to -->
- <xsl:variable name="stype" select="string($params[@name='stype'])"/>
- <xsl:if test="$stype != ''">
- <nav:itemType><xsl:value-of select="$stype"/></nav:itemType>
- </xsl:if>
- </nav-search-query>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <xts:block id="getContent"
- condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]"
- dependency="build-search-request" type="exec" mode="interpret" processor="XSLT">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- exclude-result-prefixes="xts xos bus nav SOAP-ENV">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:include href="/fragments/mvc/includes/common-include.xslt"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <xos:part>
- <xos:entityHeader>
- <xos:param name="Content-Type">text/xml; charset=UTF-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <response>
- <logic>
- <configured-gateway><xts:function name="getConfiguration"><xts:param name="gateway"/></xts:function></configured-gateway>
- <xsl:copy-of select="/root/state"/>
- <xts:request name="NAV" faultBlock="requestFault">
- <SOAP-ENV:Envelope>
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/bus:biBusHeader"/>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <nav:search>
- <!-- nav options -->
- <nav:validateTag fault="true"/>
- <xsl:copy-of select="/root/nav-search-query/*"/>
-
- <xsl:call-template name="build-pagination-params"/>
-
- <nav:param name="postUrl"/>
- <nav:param name="backUrl">rewrite</nav:param>
- <nav:param name="browserAgent"><xsl:value-of select="$browser"/></nav:param>
-
- <!-- properties -->
- <xsl:call-template name="build-navQuery-properties"/>
- </nav:search>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </logic>
- </response>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="requestFault" type="fault" processor="XSLT">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xts">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:include href="/fragments/mvc/includes/common-include.xslt"/>
-
- <xsl:template match="/">
- <xsl:call-template name="handleException"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|