gen_search_page.xslt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!--
  13. Renders the search view.
  14. -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  18. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  19. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  20. xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
  21. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  22. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  23. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  24. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  25. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  26. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  27. xmlns:cs="http://developer.cognos.com/schemas/cs"
  28. xmlns:out="http://www.w3.org/1999/XSL/Transform"
  29. xmlns:pg="http://developer.cognos.com/schemas/xts/pg"
  30. xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
  31. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  32. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  33. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  34. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  35. xmlns:rss="http://developer.cognos.com/schemas/xts/rss/"
  36. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  37. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  38. xmlns:mvc="http://developer.cognos.com/schemas/xts/mvc"
  39. exclude-result-prefixes="xsl cm cml pf mt mf xts xtsext cf cp out bus utml dp lyt pm rss mvc">
  40. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  41. <pm:permissions/>
  42. <pf:documentFormats/>
  43. <pf:variables/>
  44. <mf:variables stateParams="mvc-sfolder m_tab m_ts m_folder m_folder2 m_nbid m_nbid2 search m_searchsection m_searchcontext stext sscope smethod sfield sstatus stype stype_is smodified sshortcuts stime m_section rui backURL" mode="main"/>
  45. <mf:main-variables/>
  46. <rss:variables/>
  47. <xsl:variable name="js-encoded-path" select="xtsext:javascriptencode( string( $m_path ) )"/><!-- Required -->
  48. <xsl:variable name="cmd-form" select="'cform'"/> <!-- Required -->
  49. <xsl:variable name="edit-form" select="'pform'"/><!-- Required -->
  50. <!-- For paths pointing to the personal folder space ONLY, we hide the first part of the path (i.e. /directory/namespace/...). We show My Folders instead. -->
  51. <xsl:variable name="start-at-path">
  52. <xsl:if test="$isMFNav">
  53. <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
  54. </xsl:if>
  55. <xsl:if test="$isPFNav">
  56. <xsl:value-of select="$defaultContentRoot"/>
  57. </xsl:if>
  58. </xsl:variable>
  59. <cp:flyoutControl/>
  60. <mt:common-variables/>
  61. <!-- start the output -->
  62. <xsl:template match="/root">
  63. <!-- Note: DOCTYPE is handled by mt:page -->
  64. <html lang="{$productLocale}" encodeDocType="false">
  65. <head>
  66. <pf:meta/><!-- Standard meta tags -->
  67. <title><xts:string id="IDS_PORTAL"/></title>
  68. <mt:stylesheet/><!-- add the theme style sheet -->
  69. <mf:head/><!-- Common framework logic for Cognos Central main view -->
  70. <pf:help context="HID_SEARCH"/><!-- Help system -->
  71. <pf:launch/><!-- adds functions to launch the studios.... -->
  72. <!-- link for Active Bookmarks (RSS) in FireFox -->
  73. <rss:link/>
  74. </head>
  75. <!-- HTML body -->
  76. <mt:page mode="main" region="IDS_SEARCH_BANNER_TEXT">
  77. <xsl:call-template name="render-header"/><!-- Render the top headers. -->
  78. <xsl:call-template name="search-panel"/><!-- Insert search control panel -->
  79. <form action="{$gateway}" method="post" name="pform" style="margin:0px">
  80. <xsl:choose>
  81. <xsl:when test="$mvc-N-enabled and $mvc-remoteNav">
  82. <!-- MVC - Content Reference -->
  83. <xsl:call-template name="mvcSearchRemoteContent"/>
  84. </xsl:when>
  85. <xsl:otherwise>
  86. <div id="wsrp_rewrite_div_result_busy_container" style="height:0px;display:none;"/>
  87. <pg:busyIndicator/>
  88. <div id="wsrp_rewrite_div_results">
  89. <table border="0" cellpadding="0" cellspacing="0" width="100%" role="presentation" >
  90. <tr>
  91. <!-- result content section -->
  92. <td valign="top" width="100%">
  93. <lyt:layout style="1" joinSection="yes">
  94. <lyt:section width="100%">
  95. <xsl:choose>
  96. <xsl:when test="/root/search/indexSearchNotAllowed">
  97. <mt:errorMessage>
  98. <xts:string id="IDS_SEARCH_NO_INDEX_CAPABILITY"/>
  99. </mt:errorMessage>
  100. </xsl:when>
  101. <xsl:when test="/root/search/emptySearchExpression">
  102. <mt:objectNoneFound id="IDS_EMPTY_QUERY"/>
  103. </xsl:when>
  104. <xsl:when test="/root/search/navSearchSpec or string(/root/search/expression) != ''">
  105. <!-- basic search -->
  106. <pg:pager-basicSearch/>
  107. </xsl:when>
  108. </xsl:choose>
  109. <rss:button/>
  110. </lyt:section>
  111. </lyt:layout>
  112. </td>
  113. </tr>
  114. </table>
  115. </div>
  116. </xsl:otherwise>
  117. </xsl:choose>
  118. <mf:edit-vars/>
  119. </form>
  120. <form name="cform" method="post" action="{$gateway}" style="margin:0px">
  121. <mf:cmd-vars/>
  122. </form>
  123. <!-- End of HTML body -->
  124. </mt:page>
  125. <pg:common-script/>
  126. <pg:common-popup-script/>
  127. </html>
  128. </xsl:template>
  129. <!-- Insert common templates -->
  130. <mt:actions mode="main"/>
  131. <pf:gen-action/>
  132. <pf:gen-icon/>
  133. <pf:gen-url/>
  134. <pf:utilities/>
  135. <!-- MVC - Content Reference -->
  136. <mvc:instance-vars/>
  137. <xsl:template name="mvcSearchRemoteContent">
  138. <xsl:variable name="fragment-params">
  139. <xsl:for-each select="/root/env/param[@name='mvc-sfolder' or @name='sscope' or @name='sfield' or @name='smethod' or @name='smodified' or @name='stext' or @name='stype']">
  140. <xsl:text/>&amp;<xsl:value-of select="@name"/>=<xsl:value-of select="xtsext:urlencode(string(.))"/>
  141. </xsl:for-each>
  142. </xsl:variable>
  143. <mvc:instance id="'search'" fragment-params="$fragment-params"/>
  144. </xsl:template>
  145. <pg:commonSupportTemplates/>
  146. <xsl:template name="render-header">
  147. <mt:h1 mode="mainSearch">
  148. <mt:title><xts:string id="IDS_SEARCH_BANNER_TEXT"/></mt:title>
  149. </mt:h1>
  150. <mt:h4>
  151. <mt:toolbar>
  152. <!-- Show the toolbar when we have data to display -->
  153. <xsl:choose>
  154. <xsl:when test="count(/root/navContent/nav:searchResponse/nav:content/*) > 0 or count($childReply/*) > 0">
  155. <mt:tool-group hideDivider="true">
  156. <mt:tool name="copy" mode="main"/>
  157. <mt:tool name="cut" mode="main"/>
  158. <mt:tool name="delete"/>
  159. </mt:tool-group>
  160. </xsl:when>
  161. <xsl:otherwise>
  162. <mt:tool-group hideDivider="true">
  163. <xsl:choose>
  164. <xsl:when test="contains(string(key('session-param','edit')),'copy')"><mt:tool name="copy" mode="main" /></xsl:when>
  165. <xsl:otherwise><mt:tool name="copy" mode="main" disable="true"/></xsl:otherwise>
  166. </xsl:choose>
  167. <mt:tool name="cut" disable="true"/>
  168. <mt:tool name="delete" disable="true"/>
  169. </mt:tool-group>
  170. </xsl:otherwise>
  171. </xsl:choose>
  172. </mt:toolbar>
  173. </mt:h4>
  174. </xsl:template>
  175. <xsl:template name="search-panel">
  176. <mt:search indexSearch="false">
  177. <mt:scopes>
  178. <mt:scope>fb</mt:scope>
  179. <mt:scope>fo</mt:scope>
  180. <mt:scope customsearch="true">m</mt:scope>
  181. <mt:scope customsearch="true">p</mt:scope>
  182. </mt:scopes>
  183. <mt:stypes>
  184. <!--
  185. ***********************************************************************************************************************************
  186. NOTE: Any changes made to this list of objects should also be made in tools_directory.xts
  187. When adding please keep the value of the string id in alphabetical order, so the name that appears to the user.
  188. ***********************************************************************************************************************************
  189. -->
  190. <mt:stype name="interactiveReport"><xts:string id="IDS_OBJ_INTERACTIVEREPORT"/></mt:stype>
  191. <mt:stype name="analyticsPackage"><xts:string id="IDS_OBJ_AATOCPACKAGE"/></mt:stype>
  192. <mt:stype name="agentDefinition"><xts:string id="IDS_OBJ_AGENT"/></mt:stype>
  193. <mt:stype name="agentDefinitionView"><xts:string id="IDS_OBJ_AGENTVIEW"/></mt:stype>
  194. <mt:stype name="analysis"><xts:string id="IDS_OBJ_ANALYSIS"/></mt:stype>
  195. <mt:stype name="contentReference"><xts:string id="IDS_OBJ_MVC_CONTENT_REFERENCE"/></mt:stype> <!-- Not actual object type, returns Content Reference objects -->
  196. <mt:stype name="dataMovementTask"><xts:string id="IDS_OBJ_DATAMOVEMENTTASK"/></mt:stype>
  197. <mt:stype name="dataMovementTaskAlias"><xts:string id="IDS_OBJ_DATAMOVEMENTTASKALIAS"/></mt:stype>
  198. <mt:stype name="document"><xts:string id="IDS_OBJ_DOCUMENT"/></mt:stype>
  199. <mt:stype name="advisorCanvas"><xts:string id="IDS_OBJ_LAUNCHABLE_ADVISOR_CANVAS"/></mt:stype>
  200. <mt:stype name="advisorView"><xts:string id="IDS_OBJ_LAUNCHABLE_ADVISOR_VIEW"/></mt:stype>
  201. <mt:stype name="folder"><xts:string id="IDS_OBJ_FOLDER"/></mt:stype>
  202. <mt:stype name="cd"><xts:string id="IDS_OBJ_LAUNCHABLE_CD"/></mt:stype> <!-- Not actual object type, returns Cognos Insight objects -->
  203. <mt:stype name="jobDefinition"><xts:string id="IDS_OBJ_JOBDEFINITION"/></mt:stype>
  204. <mt:stype name="metricsExportTask"><xts:string id="IDS_OBJ_METRICSEXPORTTASK"/></mt:stype>
  205. <mt:stype name="metricsDataSourceETLTask"><xts:string id="IDS_OBJ_METRICSDATASOURCEETLTASK"/></mt:stype>
  206. <mt:stype name="metricsFileImportTask"><xts:string id="IDS_OBJ_METRICSFILEIMPORTTASK"/></mt:stype>
  207. <mt:stype name="metricsMaintenanceTask"><xts:string id="IDS_OBJ_METRICSMAINTENANCETASK"/></mt:stype>
  208. <mt:stype name="metricsPackage"><xts:string id="IDS_OBJ_METRICSPACKAGE"/></mt:stype> <!-- Not actual object type, package with userInterfaces for metrics manager-->
  209. <mt:stype name="package"><xts:string id="IDS_OBJ_PACKAGE"/></mt:stype>
  210. <mt:stype name="pagelet"><xts:string id="IDS_OBJ_PAGELET"/></mt:stype>
  211. <mt:stype name="planningPackage"><xts:string id="IDS_OBJ_PLANNING_PACKAGE"/></mt:stype> <!-- Not actual object type, package with userInterfaces for planning package-->
  212. <mt:stype name="planningTask"><xts:string id="IDS_OBJ_PLANNING_TASK"/></mt:stype>
  213. <mt:stype name="powerPlayCube"><xts:string id="IDS_OBJ_POWERPLAYCUBE"/></mt:stype>
  214. <mt:stype name="powerPlayReport"><xts:string id="IDS_OBJ_POWERPLAYREPORT"/></mt:stype>
  215. <mt:stype name="powerPlay8Report"><xts:string id="IDS_OBJ_POWERPLAY8REPORT"/></mt:stype>
  216. <mt:stype name="powerPlay8ReportView"><xts:string id="IDS_OBJ_POWERPLAY8REPORTVIEW"/></mt:stype>
  217. <mt:stype name="query"><xts:string id="IDS_OBJ_QUERY"/></mt:stype>
  218. <mt:stype name="report"><xts:string id="IDS_OBJ_REPORT"/></mt:stype>
  219. <mt:stype name="reportTemplate"><xts:string id="IDS_OBJ_REPORTTEMPLATE"/></mt:stype>
  220. <mt:stype name="reportView"><xts:string id="IDS_OBJ_REPORTVIEW"/></mt:stype>
  221. <mt:stype name="shortcut"><xts:string id="IDS_SHORTCUTS"/></mt:stype>
  222. <mt:stype name="TM1Package"><xts:string id="IDS_OBJ_TM1PACKAGE"/></mt:stype> <!-- Not actual object type, package with userInterfaces for TM1 studio-->
  223. <mt:stype name="URL"><xts:string id="IDS_OBJ_URL"/></mt:stype>
  224. <mt:stype name="dashboard"><xts:string id="IDS_OBJ_DASHBOARD"/></mt:stype>
  225. </mt:stypes>
  226. <mt:close-params>
  227. <param>m_folder2</param>
  228. <param>m_folder</param>
  229. <param>m_section</param>
  230. <param>m_tab</param>
  231. <param>mvc-sfolder</param>
  232. </mt:close-params>
  233. </mt:search>
  234. </xsl:template>
  235. <cp:tabControl/>
  236. </xsl:stylesheet>