search.xsl 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437
  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, 2015
  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. <xsl:stylesheet version="1.0"
  13. xmlns:out="dummy-uri"
  14. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  15. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  16. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  17. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  18. xmlns:pg="http://developer.cognos.com/schemas/xts/pg"
  19. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  20. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  21. xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="lyt">
  22. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  23. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  24. <!--
  25. This stylesheet (search.xsl) consists of the following templates:
  26. mt:search - generate main search area for page.
  27. mt:directPath - used in lieu of path control in search dialog (only tools).
  28. mt:scopes - generates select element
  29. mt:scope - generate scope list for tools search dialog.
  30. mt:stypes - placeholder.
  31. mt:stype - generate type list for tools search dialog.
  32. -->
  33. <!--
  34. Template - mt:search:
  35. This template defines link elements for skin_style and skin_fonts.
  36. Operation:
  37. Generates javascript:
  38. function doSearch() - apply the search.
  39. function init() - run at page load to set focus.
  40. Renders the search page.
  41. -->
  42. <xsl:template match="mt:common-variables">
  43. <out:variable name="imageRootSpace"><out:value-of select="$webcontent"/><out:text>/images/</out:text></out:variable>
  44. <out:variable name="all_filters">
  45. <out:choose>
  46. <out:when test="string(/root/env/param[@name='all_filters']) != ''">
  47. <out:value-of select="/root/env/param[@name='all_filters']"/>
  48. </out:when>
  49. <out:otherwise>
  50. <out:value-of select="'false'"/>
  51. </out:otherwise>
  52. </out:choose>
  53. </out:variable>
  54. <pg:common-variables caller="cc">
  55. <pg:formLabelStyle>'formLabel'</pg:formLabelStyle>
  56. <pg:tableTextStyle>'tableText'</pg:tableTextStyle>
  57. <pg:tableHeaderStyle>'tableHeader'</pg:tableHeaderStyle>
  58. <pg:tableTitleStyle>'tableTitle'</pg:tableTitleStyle>
  59. <pg:callbackFunction>'doSearch(true)'</pg:callbackFunction>
  60. <pg:gateway>$gateway</pg:gateway>
  61. <pg:imageRoot>$image_root</pg:imageRoot>
  62. <pg:skinImages>$skin_images</pg:skinImages>
  63. <pg:skinSharedImages>$skin_shared_images</pg:skinSharedImages>
  64. <pg:imageRootSpace>$imageRootSpace</pg:imageRootSpace>
  65. <pg:searchTerms>string(/root/env/param[@name = 'stext'])</pg:searchTerms>
  66. <pg:searchForm>'frmSearch'</pg:searchForm>
  67. <pg:isIndexSearch>$isIndexSearch</pg:isIndexSearch>
  68. <pg:selectedCategoryStyle>'indexTreeCategorySelected'</pg:selectedCategoryStyle>
  69. <pg:selectedCategoryHoverStyle>'indexTreeCategoryHoverSelected'</pg:selectedCategoryHoverStyle>
  70. <pg:categoryHoverStyle>'indexTreeCategoryHover'</pg:categoryHoverStyle>
  71. <pg:categoryHighlightStyle>'indexTreeCategoryBlur'</pg:categoryHighlightStyle>
  72. <pg:allFilters>$all_filters</pg:allFilters>
  73. <pg:popupMenu>'flyOutMenu'</pg:popupMenu>
  74. <pg:popupMenuCaption>'ccOptions'</pg:popupMenuCaption>
  75. <pg:popupMenuItem>'tabletext menuItemNormal'</pg:popupMenuItem>
  76. <pg:popupMenuItemHover>'tabletext menuItemOver'</pg:popupMenuItemHover>
  77. <pg:tooltipStyle>'countSummary'</pg:tooltipStyle>
  78. </pg:common-variables>
  79. </xsl:template>
  80. <xsl:template match="mt:search">
  81. <out:variable name="scope" select="string(key('env-param','sscope'))"/>
  82. <out:variable name="type" select="string(key('env-param','stype'))"/>
  83. <out:variable name="type_is" select="string(key('env-param','stype_is'))"/> <!-- index search search type -->
  84. <out:variable name="modified" select="string(key('env-param','smodified'))"/>
  85. <out:variable name="smethod" select="string(key('env-param','smethod'))"/>
  86. <out:variable name="indexSearch" select="'{string(@indexSearch) = 'true'}'"/>
  87. <out:variable name="stext">
  88. <out:choose>
  89. <out:when test="string(key('env-param','sfield')) = 'k' and not($userCanUseIndexSearch)">
  90. <!-- user initiates index search but has no capability - clear the text as it may not apply -->
  91. <out:value-of select="''"/>
  92. </out:when>
  93. <out:otherwise>
  94. <out:value-of select="string(key('env-param','stext'))"/>
  95. </out:otherwise>
  96. </out:choose>
  97. </out:variable>
  98. <out:variable name="singleField">
  99. <xsl:if test="count(mt:fields/*) = 1"><out:value-of select="'{mt:fields/mt:field}'"/></xsl:if>
  100. </out:variable>
  101. <out:variable name="field">
  102. <out:variable name="f" select="xtsext:javascriptencode(string(key('env-param','sfield')))"/>
  103. <out:choose>
  104. <out:when test="$singleField != ''"><out:value-of select="$singleField"/></out:when>
  105. <out:when test="($f = 'k' or $f = '')">
  106. <out:choose>
  107. <out:when test="$indexSearch='true' and $userCanUseIndexSearch">
  108. <out:value-of select="'k'"/>
  109. </out:when>
  110. <out:otherwise>
  111. <out:value-of select="'n'"/>
  112. </out:otherwise>
  113. </out:choose>
  114. </out:when>
  115. <out:otherwise>
  116. <out:value-of select="$f"/>
  117. </out:otherwise>
  118. </out:choose>
  119. </out:variable>
  120. <script language="javascript">
  121. <!-- preload source for search icon animation -->
  122. var imgAnimatedSearch = new Image();
  123. imgAnimatedSearch.src = "<out:value-of select="xtsext:javascriptencode($image_root)"/>action_search_ani.gif";
  124. function doSearch(bTreeFilterSearch)
  125. {
  126. <out:if test="$mvc-N-enabled">
  127. if (typeof clearMVCState == "function")
  128. clearMVCState("search");
  129. </out:if>
  130. if (document.frmSearch.m_searchsection) {
  131. document.frmSearch.m_searchsection.value = "";
  132. }
  133. if (document.frmSearch.m_searchcontext) {
  134. document.frmSearch.m_searchcontext.value = "";
  135. }
  136. if (document.frmSearch.m_pg_esearch) {
  137. document.frmSearch.m_pg_esearch.value = "";
  138. }
  139. if (document.frmSearch.m_section) {
  140. document.frmSearch.m_section.value = "";
  141. }
  142. <!--
  143. // Make sure the base path is not empty. This should rarely be the case!!
  144. // Happens when home is set to "My Folders" and search is invoked immediately after going "home" OR if the url is being tampered with.
  145. -->
  146. if (document.frmSearch.m_path &amp;&amp; document.frmSearch.m_path.value == '')
  147. document.frmSearch.m_path.value = "<out:value-of select="xtsext:javascriptencode(string($m_path))"/>";
  148. <xsl:if test="@type = 'tools'">
  149. if (document.frmSearch.m_newsearch &amp;&amp; document.frmSearch.m_newsearch.value != 'true')
  150. document.frmSearch.m_newsearch.value = "true";
  151. </xsl:if>
  152. document.frmSearch.sfield.value = g_sfield;
  153. var isXSSCheckingOn = <out:value-of select="$isXSSCheckingOn='true'"/>;
  154. if (isXSSCheckingOn
  155. <xsl:if test="string(@indexSearch) = 'true'">
  156. || (g_sfield == 'k' &amp;&amp; document.frmSearch.cs_filter &amp;&amp; document.frmSearch.cs_filter.value != '')
  157. </xsl:if>
  158. ) {
  159. document.frmSearch.method = "post";
  160. <xsl:for-each select="mt:close-params/param">
  161. document.frmSearch["<xsl:value-of select="."/>"].value = document.frmSearch_dummy["unencoded_<xsl:value-of select="."/>"].value;
  162. </xsl:for-each>
  163. } else {
  164. <xsl:if test="string(@indexSearch) = 'true'">
  165. if (!isXSSCheckingOn)
  166. document.frmSearch.method = "get";
  167. if (g_sfield != 'k') {
  168. document.frmSearch.cs_filter.value = "";
  169. document.frmSearch.open_list.value = "";
  170. }
  171. if (wsrp_rewrite_isNewSearchTerms(document.frmSearch.stext.value, m_sLastSearch)) {
  172. //new search terms, clear the filters and open nodes
  173. document.frmSearch.cs_filter.value = "";
  174. document.frmSearch.open_list.value = "";
  175. }
  176. </xsl:if>
  177. }
  178. <!-- set to indicate that we can use cs_filter data that was stored in the runtime session -->
  179. <xsl:if test="string(@indexSearch) = 'true'">
  180. if (g_sfield == 'k' &amp;&amp; document.frmSearch.cs_filter &amp;&amp; document.frmSearch.cs_filter.value != '') {
  181. document.frmSearch.t_cs_filter_saved.value = 'true';
  182. } else {
  183. document.frmSearch.t_cs_filter_saved.value = '';
  184. }
  185. </xsl:if>
  186. <!-- temporarily hide the newSearch div -->
  187. var divNewSearch = document.getElementById("divNewSearch");
  188. if (divNewSearch) {
  189. divNewSearch.style.display = "none";
  190. }
  191. if (document.frmSearch.onsubmit) {
  192. document.frmSearch.onsubmit();
  193. }
  194. document.frmSearch.submit();
  195. if (!bTreeFilterSearch)
  196. document.images["imgSearch"].src = imgAnimatedSearch.src;
  197. }
  198. function onsubmitHandler(bNewSearch)
  199. {
  200. <xsl:if test="string(@indexSearch) = 'true'">
  201. if (document.frmSearch.sfield.value == 'k') {
  202. setTimeout('wsrp_rewrite_showSearchBusy(true)',100);
  203. }
  204. </xsl:if>
  205. }
  206. var m_sLastSearch = '<out:value-of select="xtsext:javascriptencode(string($stext))"/>';
  207. function newSearch()
  208. {
  209. <!-- reset form variable to defaulted values -->
  210. var frmSearch = document.frmSearch;
  211. if (frmSearch.stext)
  212. frmSearch.stext.value = "";
  213. if (frmSearch.cs_filter)
  214. frmSearch.cs_filter.value = "";
  215. if (frmSearch.t_cs_filter_saved)
  216. frmSearch.t_cs_filter_saved.value = "";
  217. if (frmSearch.open_list)
  218. frmSearch.open_list.value = "";
  219. if (frmSearch.stype_is)
  220. setSearchIndexType('any','<xts:string id="IDS_ANY" encode="javascript"/>');
  221. <!-- hide the result div -->
  222. var wsrp_rewrite_div_results = document.getElementById("wsrp_rewrite_div_results");
  223. if (wsrp_rewrite_div_results) {
  224. wsrp_rewrite_div_results.innerHTML = "";
  225. }
  226. <!-- hide the newSearch div -->
  227. var divNewSearch = document.getElementById("divNewSearch");
  228. if (divNewSearch) {
  229. divNewSearch.style.display = "none";
  230. }
  231. clearRelatedReportsHintText();
  232. wsrp_rewrite_hideSearchBusy();
  233. document.frmSearch.stext.focus();
  234. }
  235. function searchKeyHandler(event)
  236. {
  237. var key = -1;
  238. if (event &amp;&amp; event.which)
  239. key = event.which;
  240. else if (window.event)
  241. key = window.event.keyCode;
  242. if (key==13) {
  243. doSearch();
  244. return false;
  245. }
  246. }
  247. function init()
  248. {
  249. <!--
  250. // When returning to the Portal window after launching RS, we do not want to
  251. // give focus to the search field b/c it causes the portal window to jump in front of the RS window.
  252. -->
  253. <out:if test="not(key('env-param','sf'))">
  254. if (document.frmSearch.stext)
  255. document.frmSearch.stext.focus();
  256. </out:if>
  257. }
  258. function setSearchMode(field)
  259. {
  260. <xsl:if test="string(@indexSearch) != 'true'">
  261. return;
  262. </xsl:if>
  263. var userCanUseIndexSearch = <out:value-of select="$userCanUseIndexSearch"/>;
  264. if (!userCanUseIndexSearch) {
  265. document.getElementById('searchOptions_basic').style.display = "";
  266. } else {
  267. var pform = document.frmSearch;
  268. var sfield = "";
  269. //for (var i=0; i &lt; pform.sfield.length; i++) {
  270. // if (pform.sfield[i].selected) {
  271. // sfield = pform.sfield[i].value;
  272. // break;
  273. // }
  274. //}
  275. sfield = (field) ? field : document.frmSearch.sfield.value;
  276. if (sfield == '' || sfield == 'k') {
  277. document.getElementById('searchOptions_index').style.display = "";
  278. document.getElementById('searchOptions_basic').style.display = "none";
  279. }
  280. else
  281. {
  282. document.getElementById('searchOptions_basic').style.display = "";
  283. document.getElementById('searchOptions_index').style.display = "none";
  284. }
  285. }
  286. }
  287. var g_sfield = '<out:value-of select="$field"/>';
  288. function setFindTextIn(selected_value, caption)
  289. {
  290. var findTextInMenu_caption = document.getElementById("findTextInMenu_caption");
  291. if (findTextInMenu_caption) {
  292. findTextInMenu_caption.innerHTML = caption;
  293. }
  294. <!--document.frmSearch.sfield.value = selected_value;-->
  295. g_sfield = selected_value;
  296. setSearchMode(g_sfield);
  297. clearRelatedReportsHintText();
  298. //set focus back to the drop down element
  299. var dropDownEl = document.getElementById("findTextInMenu_drop_down");
  300. if (dropDownEl != null){
  301. dropDownEl.focus();
  302. }
  303. }
  304. function clearRelatedReportsHintText()
  305. {
  306. var hint = document.getElementById('showRelatedReportsDescriptionText');
  307. if (hint) {
  308. hint.style.display = "none";
  309. }
  310. }
  311. <!-- +++++++++++++ Set Flyout Caption Functions ++++++++++++++ -->
  312. function setSearchMethod(selected_value,caption)
  313. {
  314. var searchMethodMenu_caption = document.getElementById("searchMethodMenu_caption");
  315. if( searchMethodMenu_caption )
  316. searchMethodMenu_caption.innerHTML = caption;
  317. if (document.frmSearch.smethod)
  318. document.frmSearch.smethod.value = selected_value;
  319. //set focus back to the drop down element
  320. var dropDownEl = document.getElementById("searchMethodMenu_drop_down");
  321. if (dropDownEl != null){
  322. dropDownEl.focus();
  323. }
  324. }
  325. function setSearchModified(selected_value,caption)
  326. {
  327. var searchModifiedMenu_caption = document.getElementById("searchModifiedMenu_caption");
  328. if( searchModifiedMenu_caption )
  329. searchModifiedMenu_caption.innerHTML = caption;
  330. if (document.frmSearch.smodified)
  331. document.frmSearch.smodified.value = selected_value;
  332. //set focus back to the drop down element
  333. var dropDownEl = document.getElementById("searchModifiedMenu_drop_down");
  334. if (dropDownEl != null){
  335. dropDownEl.focus();
  336. }
  337. }
  338. function setSearchType(selected_value,caption)
  339. {
  340. var searchTypeMenu_caption = document.getElementById("searchTypeMenu_caption");
  341. if( searchTypeMenu_caption )
  342. searchTypeMenu_caption.innerHTML = caption;
  343. if (document.frmSearch.stype)
  344. document.frmSearch.stype.value = selected_value;
  345. //set focus back to the drop down element
  346. var dropDownEl = document.getElementById("searchTypeMenu_drop_down");
  347. if (dropDownEl != null){
  348. dropDownEl.focus();
  349. }
  350. }
  351. function setSearchIndexType(selected_value,caption)
  352. {
  353. var searchTypeMenu_caption = document.getElementById("searchIndexTypeMenu_caption");
  354. if( searchTypeMenu_caption )
  355. searchTypeMenu_caption.innerHTML = caption;
  356. if (document.frmSearch.stype_is)
  357. document.frmSearch.stype_is.value = selected_value;
  358. }
  359. function setSearchScope(selected_value,caption)
  360. {
  361. var searchScopeMenu_caption = document.getElementById("searchScopeMenu_caption");
  362. if( searchScopeMenu_caption )
  363. searchScopeMenu_caption.innerHTML = caption;
  364. if (document.frmSearch.sscope)
  365. document.frmSearch.sscope.value = selected_value;
  366. //need to set the focus back to the drop down element since the menu will
  367. //close
  368. var searchScopeDropDownEl = document.getElementById("searchScopeDropDown");
  369. if (searchScopeDropDownEl != null){
  370. searchScopeDropDownEl.focus();
  371. }
  372. }
  373. </script>
  374. <!-- Ridiculous (but well formed!) hack to prevent the browser from showing a blank line at the top of the page. Ugh !-->
  375. <table cellpadding="0" cellspacing="0">
  376. <out:variable name="submitMethod">
  377. <out:choose>
  378. <out:when test="$isXSSCheckingOn='true'">post</out:when>
  379. <out:otherwise>
  380. <xsl:choose>
  381. <xsl:when test="string(@indexSearch) = 'true'">
  382. <out:choose>
  383. <out:when test="string(/root/env/param[@name='cs_filter']) != ''
  384. or string(/root/env/param[@name='sourceContext']) != ''
  385. ">
  386. <out:value-of select="'post'"/>
  387. </out:when>
  388. <out:otherwise>
  389. <out:value-of select="'get'"/>
  390. </out:otherwise>
  391. </out:choose>
  392. </xsl:when>
  393. <xsl:otherwise>
  394. <out:value-of select="'get'"/>
  395. </xsl:otherwise>
  396. </xsl:choose>
  397. </out:otherwise>
  398. </out:choose>
  399. </out:variable>
  400. <tr>
  401. <td><out:text disable-output-escaping="yes">&lt;</out:text>form name="frmSearch" style="margin:0px" onsubmit="onsubmitHandler();" method="<out:value-of select="$submitMethod"/>" action="<out:value-of select="$gateway"/>"<out:text disable-output-escaping="yes">&gt;</out:text><input type="hidden" name="backURL" ><out:attribute name="value"><out:value-of select="key('env-param', 'backURL')"/></out:attribute></input></td>
  402. </tr>
  403. </table>
  404. <table cellpadding="0" cellspacing="0">
  405. <tr>
  406. <td>
  407. <lyt:layout joinSection="yes" style="1" width="%100">
  408. <lyt:section>
  409. <!-- search mode: render search mode radios - basic | index searches - if user can use index search -->
  410. <!-- text edit box: -->
  411. <dp:list padding="0">
  412. <dp:section>
  413. <!-- Find text in: -->
  414. <dp:label valign="top" width="1%" nospace="true"><xts:string id="IDS_FIND_TXT_IN"/></dp:label>
  415. <dp:link wrap="wrap" valign="top">
  416. <input name="sfield" id="sfield" type="hidden" value="{'{$field}'}"/>
  417. <out:variable name="findTextInMenu">
  418. <flyout id="findTextInMenu" hasCheckbox="true">
  419. <label><xts:string encode="javascript" id="IDS_SEARCH_FINDTEXT_MENU"/></label>
  420. <items>
  421. <itemGroup id="findTextInMenuGroup">
  422. <xsl:if test="not(mt:fields) or mt:fields/mt:field='k'">
  423. <out:if test="$indexSearch='true' and $userCanUseIndexSearch or $singleField = 'k'">
  424. <item id="findTextInMenu_k">
  425. <out:if test="$field = 'k'">
  426. <out:attribute name="itemSelectedState">checked</out:attribute>
  427. </out:if>
  428. <text><xts:string id="IDS_KEYWORD"/></text>
  429. <action>CCPopupMenu.activeMenu.setMenuItemChecked("findTextInMenu_k");setFindTextIn('k','<xts:string id="IDS_KEYWORD" encode="javascript"/>');</action>
  430. </item>
  431. </out:if>
  432. </xsl:if>
  433. <xsl:if test="not(mt:fields) or mt:fields/mt:field='n'">
  434. <item id="findTextInMenu_n">
  435. <out:if test="$field = 'n'">
  436. <out:attribute name="itemSelectedState">checked</out:attribute>
  437. </out:if>
  438. <text><xts:string id="IDS_NAME_FIELD"/></text>
  439. <action>CCPopupMenu.activeMenu.setMenuItemChecked("findTextInMenu_n");setFindTextIn('n','<xts:string id="IDS_NAME_FIELD" encode="javascript"/>');</action>
  440. </item>
  441. </xsl:if>
  442. <xsl:if test="not(mt:fields) or mt:fields/mt:field='d'">
  443. <item id="findTextInMenu_d">
  444. <out:if test="$field = 'd'">
  445. <out:attribute name="itemSelectedState">checked</out:attribute>
  446. </out:if>
  447. <text><xts:string id="IDS_DESC_FIELD"/></text>
  448. <action>CCPopupMenu.activeMenu.setMenuItemChecked("findTextInMenu_d");setFindTextIn('d','<xts:string id="IDS_DESC_FIELD" encode="javascript"/>');</action>
  449. </item>
  450. </xsl:if>
  451. <xsl:if test="not(mt:fields) or mt:fields/mt:field='nd'">
  452. <item id="findTextInMenu_nd">
  453. <out:if test="$field = 'nd'">
  454. <out:attribute name="itemSelectedState">checked</out:attribute>
  455. </out:if>
  456. <text><xts:string id="IDS_NAME_DESC_FIELD"/></text>
  457. <action>CCPopupMenu.activeMenu.setMenuItemChecked("findTextInMenu_nd");setFindTextIn('nd','<xts:string id="IDS_NAME_DESC_FIELD" encode="javascript"/>');</action>
  458. </item>
  459. </xsl:if>
  460. </itemGroup>
  461. </items>
  462. </flyout>
  463. </out:variable>
  464. <div id="findTextInMenu_span" style="margin-left:5px;z-index:10;position: relative;">
  465. <table id="findTextInMenu_drop_down" cellspacing="0" cellpadding="0" style="position:relative; cursor:pointer;" tabindex="0"
  466. onkeypress="return CCPopupMenu.dropDown(event,0,0,'findTextInMenu');"
  467. onclick="return CCPopupMenu.dropDown(event,0,0,'findTextInMenu');" role="button" aria-haspopup="true">
  468. <tr>
  469. <td nowrap="true" valign="top">
  470. <!-- since this anchor is not inside a form and has an event handler must provide a role...in this case -->
  471. <a role="presentation" class="ccOptions" style="text-decoration:underline;" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
  472. <label id="findTextInMenu_caption" for="stext">
  473. <out:choose>
  474. <out:when test="$field = 'k'">
  475. <xts:string id="IDS_KEYWORD"/>
  476. </out:when>
  477. <out:when test="$field = 'n'">
  478. <xts:string id="IDS_NAME_FIELD"/>
  479. </out:when>
  480. <out:when test="$field = 'd'">
  481. <xts:string id="IDS_DESC_FIELD"/>
  482. </out:when>
  483. <out:when test="$field = 'nd'">
  484. <xts:string id="IDS_NAME_DESC_FIELD"/>
  485. </out:when>
  486. </out:choose>
  487. </label>
  488. </a>
  489. </td>
  490. <td nowrap="true" valign="top">
  491. <img name="findTextInMenu_imgFlyControl" src="{'{$skin_shared_images}'}dropdown_arrow.gif" title="" alt=""/>
  492. </td>
  493. </tr>
  494. </table>
  495. </div>
  496. <out:call-template name="renderPopup">
  497. <out:with-param name="flyoutXML">
  498. <out:copy-of select="$findTextInMenu"/>
  499. </out:with-param>
  500. <out:with-param name="controlID">findTextInMenu_span</out:with-param>
  501. </out:call-template>
  502. </dp:link>
  503. </dp:section>
  504. </dp:list>
  505. <dp:list>
  506. <dp:section width="100%">
  507. <table border="0" width="100%" cellpadding="0" cellspacing="0" role="presentation">
  508. <tr>
  509. <td>
  510. <input type="text" size="65" name="stext" id="stext" onkeypress="return searchKeyHandler(event);" style="margin-right:2px;">
  511. <out:attribute name="value"><out:value-of select="$stext"/></out:attribute>
  512. </input>
  513. </td>
  514. <dp:button>
  515. <dp:defaultAct>doSearch();</dp:defaultAct>
  516. <a href="javascript:doSearch()" role="button">
  517. <dp:buttonText><xts:string id="IDS_SEARCH_BUTTON"/></dp:buttonText>
  518. <dp:buttonImage name="imgSearch" dp:tooltip=" ">{$image_root}action_search.gif</dp:buttonImage>
  519. </a>
  520. </dp:button>
  521. <td>
  522. <cf:dynamicExpandingSectionTop indent="no" name="b_search" title="IDS_ADV_SEARCH_OPTIONS" expanding="yes" border="no">
  523. <xsl:if test="string(@indexSearch) = 'true'">
  524. <xsl:attribute name="callback-func">clearRelatedReportsHintText();wsrp_rewrite_resizeHandler();</xsl:attribute>
  525. </xsl:if>
  526. </cf:dynamicExpandingSectionTop>
  527. </td>
  528. <td>
  529. <out:if test="(string($field) = 'k' or string($field) = '') and $userCanUseIndexSearch">
  530. <div id="divNewSearch">
  531. <out:if test="not(/root/search/navSearchSpec or string(/root/search/expression) != '')">
  532. <out:attribute name="style">display:none</out:attribute>
  533. </out:if>
  534. <dp:group>
  535. <dp:groupItem style="padding-left:5px;padding-right:8px;">
  536. <div style="height:18px;" class="ccOptionsDivider"/>
  537. </dp:groupItem>
  538. <dp:groupItem tdClass="formLink">
  539. <dp:link>
  540. <nobr><a href="javascript:newSearch()"><xts:string id="IDS_SEARCH_NEW_SEARCH"/></a></nobr>
  541. </dp:link>
  542. </dp:groupItem>
  543. </dp:group>
  544. </div>
  545. </out:if>
  546. </td>
  547. </tr>
  548. </table>
  549. </dp:section>
  550. </dp:list>
  551. <xsl:if test="string(@indexSearch) = 'true'">
  552. <out:if test="$userCanUseIndexSearch and string(/root/env/param[@name='sourceContext']) != ''">
  553. <div id="showRelatedReportsDescriptionText">
  554. <dp:list>
  555. <dp:section>
  556. <dp:hint wrap="true" nospace="true" width="400px">
  557. <xts:string id="IDS_SHOW_RELATEDREPORTS_TEXT"/>
  558. </dp:hint>
  559. </dp:section>
  560. </dp:list>
  561. </div>
  562. </out:if>
  563. </xsl:if>
  564. </lyt:section>
  565. </lyt:layout>
  566. <!-- Advanced options - body -->
  567. <cf:dynamicExpandingSectionBody name="b_search" title="IDS_ADV_SEARCH_OPTIONS" expanding="yes" border="no">
  568. <dp:group>
  569. <dp:groupItem>
  570. <img height="1" width="10" src="{'{$webcontent}'}/images/space.gif"/>
  571. </dp:groupItem>
  572. <dp:groupItem width="100%" tdClass="sectionBackground">
  573. <!-- Index search options -->
  574. <xsl:if test="string(@indexSearch) = 'true'">
  575. <div id="searchOptions_index">
  576. <out:if test="not($field = 'k')">
  577. <out:attribute name="style">
  578. <out:value-of select="'display:none'"/>
  579. </out:attribute>
  580. </out:if>
  581. <xsl:call-template name="generate-indexSearchFlyouts-block"/>
  582. </div>
  583. </xsl:if>
  584. <!-- Basic search options -->
  585. <div id="searchOptions_basic">
  586. <xsl:if test="string(@indexSearch) = 'true'">
  587. <out:if test="$field = 'k'">
  588. <out:attribute name="style">
  589. <out:value-of select="'display:none'"/>
  590. </out:attribute>
  591. </out:if>
  592. </xsl:if>
  593. <xsl:call-template name="generate-basicSearchFlyouts-block"/>
  594. </div>
  595. </dp:groupItem>
  596. </dp:group>
  597. </cf:dynamicExpandingSectionBody>
  598. </td>
  599. </tr>
  600. </table>
  601. <!-- Standard xts command variables -->
  602. <input type="hidden" name="b_action" value="xts.run"/>
  603. <input type="hidden" name="m" value="{'{$app}/{$mname}'}"/>
  604. <xsl:if test="@type = 'tools'">
  605. <input type="hidden" name="m_newsearch" value="false"/>
  606. </xsl:if>
  607. <!-- Generate hidden inputs that represent the state of the view that called this search page so that it is maintained. -->
  608. <xsl:for-each select="mt:close-params/param">
  609. <input type="hidden" name="{.}">
  610. <xsl:attribute name="value">
  611. <!-- use "xss" to force a XSS-encoding to be carried out on value that is already XSS-encoded -->
  612. <xsl:text/>{xtsext:protect(string(key('env-param','<xsl:value-of select="."/>')), 'xss', concat('NAME','<xsl:value-of select="."/>'),'getdata')}<xsl:text/>
  613. </xsl:attribute>
  614. </input>
  615. </xsl:for-each>
  616. <!-- Search control parameters -->
  617. <input type="hidden" name="search">
  618. <out:attribute name="value"><out:value-of select=" key('env-param','search') "/></out:attribute>
  619. </input>
  620. <xsl:if test="string(@indexSearch) = 'true'">
  621. <!-- extra index search params -->
  622. <input type="hidden" name="cs_filter" value=""/>
  623. <input type="hidden" name="t_cs_filter_saved" value="{'{key(&quot;env-param&quot;,&quot;cs_filter&quot;) != &quot;&quot;}'}"/>
  624. <input type="hidden" name="cs_tree" value="true"/>
  625. <input type="hidden" name="cs_requestversion" value="2"/>
  626. <input id="wsrp_rewrite_allFilters_input" type="hidden" name="all_filters" value="{'{$all_filters}'}"/>
  627. <input type="hidden" name="open_list"/>
  628. <input type="hidden" name="desc_expanded" value="{'{key(&quot;env-param&quot;,&quot;desc_expanded&quot;)}'}"/>
  629. <input name="m_pagerfromsearch" type="hidden" value="{'{key(&quot;env-param&quot;,&quot;m_pagerfromsearch&quot;)}'}"/>
  630. <input name="m_pagertosearch" type="hidden" value="{'{key(&quot;env-param&quot;,&quot;m_pagertosearch&quot;)}'}"/>
  631. <input name="m_pg_esearch" type="hidden" value="{'{key(&quot;env-param&quot;,&quot;m_pg_esearch&quot;)}'}"/>
  632. <input name="m_searchsection" type="hidden" value="{'{key(&quot;env-param&quot;,&quot;m_searchsection&quot;)}'}"/>
  633. <input name="m_searchcontext" type="hidden" value="{'{key(&quot;env-param&quot;,&quot;m_searchcontext&quot;)}'}"/>
  634. <input name="ps_nav_op" type="hidden" value=""/>
  635. </xsl:if>
  636. <!-- Request UI customization parameter -->
  637. <input type="hidden" name="rui">
  638. <out:attribute name="value"><out:value-of select=" key('env-param','rui') "/></out:attribute>
  639. </input>
  640. <!-- Was not painful enough to do this at the top, now we have to make it "well formed" Ugh! Ugh! -->
  641. <table cellpadding="0" cellspacing="0">
  642. <tr><td><out:text disable-output-escaping="yes">&lt;</out:text>/form<out:text disable-output-escaping="yes">&gt;</out:text></td></tr>
  643. </table>
  644. <form name="frmSearch_dummy" style="margin:0px">
  645. <xsl:for-each select="mt:close-params/param">
  646. <!-- POST parameters -->
  647. <input type="hidden" name="unencoded_{.}">
  648. <xsl:attribute name="value">
  649. <xsl:text/>{string(key('env-param','<xsl:value-of select="."/>'))}<xsl:text/>
  650. </xsl:attribute>
  651. </input>
  652. </xsl:for-each>
  653. </form>
  654. </xsl:template>
  655. <!--
  656. Template - mt:directPath:
  657. Used in lieu of path control in search dialog (tools_service_monitor currently
  658. only file to use)
  659. Operation:
  660. Generates either the search button or the close button for the search.
  661. -->
  662. <xsl:template match="mt:directPath">
  663. <a>
  664. <xsl:attribute name="href">
  665. <xsl:text/>{$gateway}?b_action=xts.run&amp;m={$app}/{$mname}<xsl:text/>
  666. <xsl:for-each select="mt:close-params/param">
  667. <xsl:text/>&amp;<xsl:value-of select="."/>={xtsext:protect(xtsext:urlencode(string(key('env-param','<xsl:value-of select="."/>'))),'url',concat('NAME','<xsl:value-of select="."/>'),'getdata')}<xsl:text/>
  668. </xsl:for-each>
  669. </xsl:attribute>
  670. <xsl:choose>
  671. <xsl:when test="mt:searchLabel">
  672. <xsl:variable name="lab">
  673. <xsl:value-of select="mt:searchLabel"/>
  674. </xsl:variable>
  675. <xts:string id="{$lab}"/>
  676. </xsl:when>
  677. <xsl:otherwise>
  678. <xts:string id="IDS_CLOSE"/>
  679. </xsl:otherwise>
  680. </xsl:choose>
  681. </a>&#160;
  682. </xsl:template>
  683. <xsl:template name="generate-basicSearchFlyouts-block">
  684. <dp:list width="100%">
  685. <dp:section width="100%">
  686. <dp:list width="50%">
  687. <dp:section>
  688. <dp:label valign="top" width="1%" nospace="true">
  689. <div> <xts:string id="IDS_SEARCH_METHOD"/></div></dp:label>
  690. <dp:link wrap="wrap" valign="top">
  691. <out:variable name="smethodDefault">
  692. <out:choose>
  693. <out:when test="/root/env/param[@name='queryNamespaceSearchDefaultMethodOptionSetting'] = 'true'">
  694. <out:variable name="option" select="/root/configProps/param[@name='cc']/property[@name='portal.namespaceSearchDefaultMethodOption']"/>
  695. <out:choose>
  696. <out:when test="$option = 'contains'">1</out:when>
  697. <out:when test="$option = 'starts'">2</out:when>
  698. <out:when test="$option = 'equals'">3</out:when>
  699. <out:otherwise>1</out:otherwise>
  700. </out:choose>
  701. </out:when>
  702. <out:otherwise>1</out:otherwise>
  703. </out:choose>
  704. </out:variable>
  705. <input name="smethod" id="smethod" type="hidden">
  706. <out:attribute name="value">
  707. <out:choose>
  708. <out:when test="$smethod = ''"><out:value-of select="$smethodDefault"/></out:when>
  709. <out:otherwise><out:value-of select="$smethod"/></out:otherwise>
  710. </out:choose>
  711. </out:attribute>
  712. </input>
  713. <out:variable name="searchMethodMenu">
  714. <flyout id="searchMethodMenu" hasCheckbox="true">
  715. <label><xts:string encode="javascript" id="IDS_SEARCH_METHOD_MENU"/></label>
  716. <items>
  717. <itemGroup id="searchMethodGroup">
  718. <item id="searchMethod_1">
  719. <out:if test="$smethod = '1' or ($smethod = '' and $smethodDefault = '1')">
  720. <out:attribute name="itemSelectedState">checked</out:attribute>
  721. </out:if>
  722. <text><xts:string id="IDS_CONTAINS"/></text>
  723. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchMethod_1");setSearchMethod('1','<xts:string id="IDS_CONTAINS" encode="javascript"/>');</action>
  724. </item>
  725. <item id="searchMethod_2">
  726. <out:if test="$smethod = '2' or ($smethod = '' and $smethodDefault = '2')">
  727. <out:attribute name="itemSelectedState">checked</out:attribute>
  728. </out:if>
  729. <text><xts:string id="IDS_STARTS_WITH"/></text>
  730. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchMethod_2");setSearchMethod('2','<xts:string id="IDS_STARTS_WITH" encode="javascript"/>');</action>
  731. </item>
  732. <item id="searchMethod_3">
  733. <out:if test="$smethod = '3' or ($smethod = '' and $smethodDefault = '3')">
  734. <out:attribute name="itemSelectedState">checked</out:attribute>
  735. </out:if>
  736. <text><xts:string id="IDS_EQUALS"/></text>
  737. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchMethod_3");setSearchMethod('3','<xts:string id="IDS_EQUALS" encode="javascript"/>');</action>
  738. </item>
  739. </itemGroup>
  740. </items>
  741. </flyout>
  742. </out:variable>
  743. <div id="searchMethodMenu_span" style="margin-left:5px;z-index:9;position: relative;">
  744. <table cellspacing="0" id="searchMethodMenu_drop_down" cellpadding="0" style="cursor:pointer;" tabindex="0"
  745. onkeypress="return CCPopupMenu.dropDown(event,0,0,'searchMethodMenu');"
  746. onclick="return CCPopupMenu.dropDown(event,0,0,'searchMethodMenu');" role="button" aria-haspopup="true">
  747. <tr>
  748. <td nowrap="true" valign="top">
  749. <div class="ccOptions" style="text-decoration:underline" role="presentation" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
  750. <span id="searchMethodMenu_caption">
  751. <out:choose>
  752. <out:when test="$smethod = '1' or ($smethod = '' and $smethodDefault = '1')">
  753. <xts:string id="IDS_CONTAINS"/>
  754. </out:when>
  755. <out:when test="$smethod = '2' or ($smethod = '' and $smethodDefault = '2')">
  756. <xts:string id="IDS_STARTS_WITH"/>
  757. </out:when>
  758. <out:when test="$smethod = '3' or ($smethod = '' and $smethodDefault = '3')">
  759. <xts:string id="IDS_EQUALS"/>
  760. </out:when>
  761. </out:choose>
  762. </span>
  763. </div>
  764. </td>
  765. <td nowrap="true" valign="top">
  766. <img name="searchMethodMenu_imgFlyControl" src="{'{$skin_shared_images}'}dropdown_arrow.gif" title="" alt=""/>
  767. </td>
  768. </tr>
  769. </table>
  770. </div>
  771. <out:call-template name="renderPopup">
  772. <out:with-param name="flyoutXML">
  773. <out:copy-of select="$searchMethodMenu"/>
  774. </out:with-param>
  775. <out:with-param name="controlID">searchMethodMenu_span</out:with-param>
  776. </out:call-template>
  777. </dp:link>
  778. </dp:section>
  779. <xsl:choose>
  780. <xsl:when test="not(@modified) or @modified != 'no' ">
  781. <dp:section>
  782. <dp:label valign="top" width="1%" nospace="true">
  783. <div>
  784. <xts:string id="IDS_SEARCH_MODIFIED"/>
  785. </div>
  786. </dp:label>
  787. <dp:link wrap="wrap" valign="top">
  788. <input name="smodified" id="smodified" type="hidden">
  789. <out:attribute name="value">
  790. <out:choose>
  791. <out:when test="$modified = ''">any</out:when>
  792. <out:otherwise><out:value-of select="$modified"/></out:otherwise>
  793. </out:choose>
  794. </out:attribute>
  795. </input>
  796. <out:variable name="searchModifiedMenu">
  797. <flyout id="searchModifiedMenu" hasCheckbox="true">
  798. <label><xts:string encode="javascript" id="IDS_SEARCH_MODIFIED_MENU"/></label>
  799. <items>
  800. <itemGroup id="searchModifiedGroup">
  801. <item id="searchModified_a">
  802. <out:if test="$modified = 'any' or $modified = ''">
  803. <out:attribute name="itemSelectedState">checked</out:attribute>
  804. </out:if>
  805. <text><xts:string id="IDS_ANY_DATE"/></text>
  806. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_a");setSearchModified('any','<xts:string id="IDS_ANY_DATE" encode="javascript"/>');</action>
  807. </item>
  808. <item id="searchModified_t">
  809. <out:if test="$modified = '2'">
  810. <out:attribute name="itemSelectedState">checked</out:attribute>
  811. </out:if>
  812. <text><xts:string id="IDS_MODIFIED_TODAY"/></text>
  813. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_t");setSearchModified('t','<xts:string id="IDS_MODIFIED_TODAY" encode="javascript"/>');</action>
  814. </item>
  815. <item id="searchModified_l3d">
  816. <out:if test="$modified = 'l3d'">
  817. <out:attribute name="itemSelectedState">checked</out:attribute>
  818. </out:if>
  819. <text><xts:string id="IDS_MODIFIED_LAST3DAYS"/></text>
  820. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_l3d");setSearchModified('l3d','<xts:string id="IDS_MODIFIED_LAST3DAYS" encode="javascript"/>');</action>
  821. </item>
  822. <item id="searchModified_lw">
  823. <out:if test="$modified = 'lw'">
  824. <out:attribute name="itemSelectedState">checked</out:attribute>
  825. </out:if>
  826. <text><xts:string id="IDS_MODIFIED_LASTWEEK"/></text>
  827. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_lw");setSearchModified('lw','<xts:string id="IDS_MODIFIED_LASTWEEK" encode="javascript"/>');</action>
  828. </item>
  829. <item id="searchModified_lm">
  830. <out:if test="$modified = 'lm'">
  831. <out:attribute name="itemSelectedState">checked</out:attribute>
  832. </out:if>
  833. <text><xts:string id="IDS_MODIFIED_LASTMONTH"/></text>
  834. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_lm");setSearchModified('lm','<xts:string id="IDS_MODIFIED_LASTMONTH" encode="javascript"/>');</action>
  835. </item>
  836. <item id="searchModified_l3m">
  837. <out:if test="$modified = 'l3m'">
  838. <out:attribute name="itemSelectedState">checked</out:attribute>
  839. </out:if>
  840. <text><xts:string id="IDS_MODIFIED_LAST3MONTH"/></text>
  841. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_l3m");setSearchModified('l3m','<xts:string id="IDS_MODIFIED_LAST3MONTH" encode="javascript"/>');</action>
  842. </item>
  843. <item id="searchModified_l6m">
  844. <out:if test="$modified = 'l6m'">
  845. <out:attribute name="itemSelectedState">checked</out:attribute>
  846. </out:if>
  847. <text><xts:string id="IDS_MODIFIED_LAST6MONTH"/></text>
  848. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_l6m");setSearchModified('l6m','<xts:string id="IDS_MODIFIED_LAST6MONTH" encode="javascript"/>');</action>
  849. </item>
  850. <item id="searchModified_ly">
  851. <out:if test="$modified = 'ly'">
  852. <out:attribute name="itemSelectedState">checked</out:attribute>
  853. </out:if>
  854. <text><xts:string id="IDS_MODIFIED_LASTYEAR"/></text>
  855. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_ly");setSearchModified('ly','<xts:string id="IDS_MODIFIED_LASTYEAR" encode="javascript"/>');</action>
  856. </item>
  857. <item id="searchModified_l3y">
  858. <out:if test="$modified = 'l3y'">
  859. <out:attribute name="itemSelectedState">checked</out:attribute>
  860. </out:if>
  861. <text><xts:string id="IDS_MODIFIED_LAST3YEARS"/></text>
  862. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchModified_l3y");setSearchModified('l3y','<xts:string id="IDS_MODIFIED_LAST3YEARS" encode="javascript"/>');</action>
  863. </item>
  864. </itemGroup>
  865. </items>
  866. </flyout>
  867. </out:variable>
  868. <div id="searchModifiedMenu_span" style="margin-left:5px;z-index:8;position: relative;">
  869. <table id="searchModifiedMenu_drop_down" cellspacing="0" cellpadding="0" style="cursor:pointer;" tabindex="0"
  870. onkeypress="return CCPopupMenu.dropDown(event,0,0,'searchModifiedMenu');"
  871. onclick="return CCPopupMenu.dropDown(event,0,0,'searchModifiedMenu');" role="button" aria-haspopup="true">
  872. <tr>
  873. <td nowrap="true" valign="top">
  874. <div role="presentation" class="ccOptions" style="text-decoration:underline" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
  875. <span id="searchModifiedMenu_caption">
  876. <out:choose>
  877. <out:when test=" $modified = 'any' or $modified = ''">
  878. <xts:string id="IDS_ANY_DATE"/>
  879. </out:when>
  880. <out:when test=" $modified = 't' ">
  881. <xts:string id="IDS_MODIFIED_TODAY"/>
  882. </out:when>
  883. <out:when test=" $modified = 'l3d' ">
  884. <xts:string id="IDS_MODIFIED_LAST3DAYS"/>
  885. </out:when>
  886. <out:when test=" $modified = 'lw' ">
  887. <xts:string id="IDS_MODIFIED_LASTWEEK"/>
  888. </out:when>
  889. <out:when test=" $modified = 'lm' ">
  890. <xts:string id="IDS_MODIFIED_LASTMONTH"/>
  891. </out:when>
  892. <out:when test=" $modified = 'l3m' ">
  893. <xts:string id="IDS_MODIFIED_LAST3MONTH"/>
  894. </out:when>
  895. <out:when test=" $modified = 'l6m' ">
  896. <xts:string id="IDS_MODIFIED_LAST6MONTH"/>
  897. </out:when>
  898. <out:when test=" $modified = 'ly' ">
  899. <xts:string id="IDS_MODIFIED_LASTYEAR"/>
  900. </out:when>
  901. <out:when test=" $modified = 'l3y' ">
  902. <xts:string id="IDS_MODIFIED_LAST3YEARS"/>
  903. </out:when>
  904. </out:choose>
  905. </span>
  906. </div>
  907. </td>
  908. <td nowrap="true" valign="top">
  909. <img name="searchModifiedMenu_imgFlyControl" src="{'{$skin_shared_images}'}dropdown_arrow.gif" title="" alt=""/>
  910. </td>
  911. </tr>
  912. </table>
  913. </div>
  914. <out:call-template name="renderPopup">
  915. <out:with-param name="flyoutXML">
  916. <out:copy-of select="$searchModifiedMenu"/>
  917. </out:with-param>
  918. <out:with-param name="controlID">searchModifiedMenu_span</out:with-param>
  919. </out:call-template>
  920. </dp:link>
  921. </dp:section>
  922. </xsl:when>
  923. <xsl:otherwise>
  924. <dp:section>
  925. <table cellpadding="0" cellspacing="0">
  926. <tr>
  927. <td>&#160;</td>
  928. </tr>
  929. </table>
  930. </dp:section>
  931. </xsl:otherwise>
  932. </xsl:choose>
  933. </dp:list>
  934. <dp:list width="50%">
  935. <xsl:if test="mt:stypes[not(@indexSearch)]">
  936. <out:if test="not(/root/env/param[@name='tool_tab']) or /root/env/param[@name='tool_tab']!='p'">
  937. <dp:section>
  938. <dp:label valign="top" width="1%" nospace="true">
  939. <div>
  940. <xts:string id="IDS_ENTRY_TYPE"/>
  941. </div>
  942. </dp:label>
  943. <dp:link wrap="wrap" valign="top">
  944. <!-- Create flyout for type -->
  945. <out:variable name="searchTypeItems">
  946. <xsl:apply-templates select="./mt:stypes[not(@indexSearch)]" mode="ddTypes">
  947. <xsl:with-param name="isIdx" select="'false'"/>
  948. </xsl:apply-templates>
  949. </out:variable>
  950. <input name="stype" id="stype" type="hidden">
  951. <out:attribute name="value">
  952. <out:choose>
  953. <out:when test="$type = ''">any</out:when>
  954. <out:otherwise><out:value-of select="$type"/></out:otherwise>
  955. </out:choose>
  956. </out:attribute>
  957. </input>
  958. <out:variable name="searchTypeMenu">
  959. <flyout id="searchTypeMenu" hasCheckbox="true">
  960. <label><xts:string encode="javascript" id="IDS_SEARCH_TYPE_MENU"/></label>
  961. <items>
  962. <itemGroup id="searchTypeGroup">
  963. <out:for-each select="$searchTypeItems/item">
  964. <out:variable name="curVal" select="@value"/>
  965. <out:variable name="ck">
  966. <out:choose>
  967. <out:when test="$type = $curVal">checked</out:when>
  968. <out:when test="($type = 'any' or $type = '') and position()=1">checked</out:when>
  969. </out:choose>
  970. </out:variable>
  971. <item>
  972. <out:if test="$ck!=''">
  973. <out:attribute name="itemSelectedState"><out:value-of select="$ck"/></out:attribute>
  974. </out:if>
  975. <out:copy-of select="@*[name()!='itemSelectedState' and name()!='value']"/>
  976. <out:copy-of select="./*"/>
  977. </item>
  978. </out:for-each>
  979. </itemGroup>
  980. </items>
  981. </flyout>
  982. </out:variable>
  983. <div id="searchTypeMenu_span" style="margin-left:5px;z-index:9;position: relative;">
  984. <table id="searchTypeMenu_drop_down" cellspacing="0" cellpadding="0" style="cursor:pointer;" tabindex="0"
  985. onkeypress="return CCPopupMenu.dropDown(event,0,0,'searchTypeMenu');"
  986. onclick="return CCPopupMenu.dropDown(event,0,0,'searchTypeMenu');" role="button" aria-haspopup="true">
  987. <tr>
  988. <td nowrap="true" valign="top">
  989. <div class="ccOptions" style="text-decoration:underline" role="presentation" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
  990. <span id="searchTypeMenu_caption">
  991. <out:value-of select="$searchTypeMenu//item[string(@itemSelectedState)='checked']/*"/>
  992. </span>
  993. </div>
  994. </td>
  995. <td nowrap="true" valign="top">
  996. <img name="searchTypeMenu_imgFlyControl" src="{'{$skin_shared_images}'}dropdown_arrow.gif" title="" alt=""/>
  997. </td>
  998. </tr>
  999. </table>
  1000. </div>
  1001. <out:call-template name="renderPopup">
  1002. <out:with-param name="flyoutXML">
  1003. <out:copy-of select="$searchTypeMenu"/>
  1004. </out:with-param>
  1005. <out:with-param name="controlID">searchTypeMenu_span</out:with-param>
  1006. </out:call-template>
  1007. </dp:link>
  1008. </dp:section>
  1009. </out:if>
  1010. </xsl:if>
  1011. <!-- Scope: -->
  1012. <xsl:if test="mt:scopes//mt:scope[string() != '']">
  1013. <dp:section>
  1014. <dp:label valign="top" width="1%" nospace="true">
  1015. <div>
  1016. <xts:string id="IDS_SCOPE"/>
  1017. </div>
  1018. </dp:label>
  1019. <dp:link wrap="wrap" valign="top">
  1020. <!-- Create flyout for scope -->
  1021. <out:variable name="searchScopeItems">
  1022. <xsl:apply-templates select="./mt:scopes" mode="ddScopes"/>
  1023. </out:variable>
  1024. <input name="sscope" id="sscope" type="hidden">
  1025. <out:attribute name="value">
  1026. <out:choose>
  1027. <out:when test="$scope = ''"><out:value-of select="$searchScopeItems/item[1]/@value"/></out:when>
  1028. <out:otherwise><out:value-of select="$scope"/></out:otherwise>
  1029. </out:choose>
  1030. </out:attribute>
  1031. </input>
  1032. <out:variable name="searchScopeMenu">
  1033. <flyout id="searchScopeMenu" hasCheckbox="true">
  1034. <label><xts:string encode="javascript" id="IDS_SEARCH_SCOPE_MENU"/></label>
  1035. <items>
  1036. <itemGroup id="searchScopeGroup">
  1037. <out:for-each select="$searchScopeItems/item">
  1038. <out:variable name="curVal" select="@value"/>
  1039. <out:variable name="ck">
  1040. <out:choose>
  1041. <out:when test="$scope = $curVal">checked</out:when>
  1042. <out:when test="$scope = '' and position()=1">checked</out:when>
  1043. </out:choose>
  1044. </out:variable>
  1045. <item>
  1046. <out:if test="$ck!=''">
  1047. <out:attribute name="itemSelectedState"><out:value-of select="$ck"/></out:attribute>
  1048. </out:if>
  1049. <out:copy-of select="@*[name()!='itemSelectedState' and name()!='value']"/>
  1050. <out:copy-of select="./*"/>
  1051. </item>
  1052. </out:for-each>
  1053. </itemGroup>
  1054. </items>
  1055. </flyout>
  1056. </out:variable>
  1057. <div id="searchScopeMenu_span" style="margin-left:5px;z-index:8;position: relative;">
  1058. <table id="searchScopeDropDown" cellspacing="0" cellpadding="0" style="cursor:pointer;" tabindex="0"
  1059. onkeypress="return CCPopupMenu.dropDown(event,0,0,'searchScopeMenu');"
  1060. onclick="return CCPopupMenu.dropDown(event,0,0,'searchScopeMenu');" role="button" aria-haspopup="true">
  1061. <tr>
  1062. <td nowrap="true" valign="top">
  1063. <div class="ccOptions" role="presentation" style="text-decoration:underline" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
  1064. <span id="searchScopeMenu_caption">
  1065. <out:value-of select="$searchScopeMenu//item[string(@itemSelectedState)='checked']/*"/>
  1066. </span>
  1067. </div>
  1068. </td>
  1069. <td nowrap="true" valign="top">
  1070. <img name="searchScopeMenu_imgFlyControl" src="{'{$skin_shared_images}'}dropdown_arrow.gif" title="" alt=""/>
  1071. </td>
  1072. </tr>
  1073. </table>
  1074. </div>
  1075. <out:call-template name="renderPopup">
  1076. <out:with-param name="flyoutXML">
  1077. <out:copy-of select="$searchScopeMenu"/>
  1078. </out:with-param>
  1079. <out:with-param name="controlID">searchScopeMenu_span</out:with-param>
  1080. </out:call-template>
  1081. </dp:link>
  1082. </dp:section>
  1083. </xsl:if>
  1084. <xsl:if test="not(mt:stypes[not(@indexSearch)])">
  1085. <dp:section>
  1086. <table cellpadding="0" cellspacing="0">
  1087. <tr>
  1088. <td>&#160;</td>
  1089. </tr>
  1090. </table>
  1091. </dp:section>
  1092. </xsl:if>
  1093. </dp:list>
  1094. </dp:section>
  1095. </dp:list>
  1096. <xsl:if test="mt:scopes//mt:hiddenscope">
  1097. <xsl:apply-templates select="mt:scopes//mt:hiddenscope"/>
  1098. </xsl:if>
  1099. </xsl:template>
  1100. <xsl:template name="generate-indexSearchFlyouts-block">
  1101. <dp:list width="100%">
  1102. <dp:section width="100%">
  1103. <!-- Method: -->
  1104. <dp:list width="50%">
  1105. <dp:section><dp:text/></dp:section>
  1106. <dp:section><dp:label><xts:string id="IDS_SEARCH_METHOD"/></dp:label><xts:string id="IDS_SEARCH_METHOD_FULL_KEYWORD_TEXT"/></dp:section>
  1107. <dp:section><dp:text/></dp:section>
  1108. </dp:list>
  1109. <xsl:if test="mt:stypes[@indexSearch]">
  1110. <dp:list width="50%">
  1111. <dp:section>
  1112. <dp:label width="1%" nospace="true"><xts:string id="IDS_ENTRY_TYPE"/></dp:label>
  1113. <dp:link wrap="wrap" valign="top">
  1114. <!-- Create flyout for type -->
  1115. <out:variable name="searchIndexTypeItems">
  1116. <xsl:apply-templates select="./mt:stypes[@indexSearch]" mode="ddTypes">
  1117. <xsl:with-param name="isIdx" select="'true'"/>
  1118. </xsl:apply-templates>
  1119. </out:variable>
  1120. <input id="stype_is" name="stype_is" type="hidden">
  1121. <out:attribute name="value">
  1122. <out:choose>
  1123. <out:when test="$type_is = ''">any</out:when>
  1124. <out:otherwise><out:value-of select="$type_is"/></out:otherwise>
  1125. </out:choose>
  1126. </out:attribute>
  1127. </input>
  1128. <out:variable name="searchIndexTypeMenu">
  1129. <flyout id="searchIndexTypeMenu" hasCheckbox="true">
  1130. <label><xts:string encode="javascript" id="IDS_SEARCH_TYPE_MENU"/></label>
  1131. <items>
  1132. <itemGroup id="searchIndexTypeGroup">
  1133. <out:for-each select="$searchIndexTypeItems/item">
  1134. <out:variable name="curVal" select="@value"/>
  1135. <out:variable name="ck">
  1136. <out:choose>
  1137. <out:when test="$type_is = $curVal">checked</out:when>
  1138. <out:when test="($type_is = 'any' or $type_is = '') and position()=1">checked</out:when>
  1139. </out:choose>
  1140. </out:variable>
  1141. <item>
  1142. <out:if test="$ck!=''">
  1143. <out:attribute name="itemSelectedState"><out:value-of select="$ck"/></out:attribute>
  1144. </out:if>
  1145. <out:copy-of select="@*[name()!='itemSelectedState' and name()!='value']"/>
  1146. <out:copy-of select="./*"/>
  1147. </item>
  1148. </out:for-each>
  1149. </itemGroup>
  1150. </items>
  1151. </flyout>
  1152. </out:variable>
  1153. <div id="searchIndexTypeMenu_span" style="margin-left:5px;z-index:9;position: relative">
  1154. <table cellspacing="0" cellpadding="0" style="cursor:pointer;" tabindex="0"
  1155. onkeypress="return CCPopupMenu.dropDown(event,0,0,'searchIndexTypeMenu');"
  1156. onclick="return CCPopupMenu.dropDown(event,0,0,'searchIndexTypeMenu');" role="button">
  1157. <tr>
  1158. <td nowrap="true" valign="top">
  1159. <div role="presentation" class="ccOptions" style="text-decoration:underline" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
  1160. <span id="searchIndexTypeMenu_caption">
  1161. <out:value-of select="$searchIndexTypeMenu//item[string(@itemSelectedState)='checked']/*"/>
  1162. </span>
  1163. </div>
  1164. </td>
  1165. <td nowrap="true" valign="top">
  1166. <img name="searchIndexTypeMenu_imgFlyControl" src="{'{$skin_shared_images}'}dropdown_arrow.gif" title="" alt=""/>
  1167. </td>
  1168. </tr>
  1169. </table>
  1170. </div>
  1171. <out:call-template name="renderPopup">
  1172. <out:with-param name="flyoutXML">
  1173. <out:copy-of select="$searchIndexTypeMenu"/>
  1174. </out:with-param>
  1175. <out:with-param name="controlID">searchIndexTypeMenu_span</out:with-param>
  1176. </out:call-template>
  1177. </dp:link>
  1178. </dp:section>
  1179. </dp:list>
  1180. </xsl:if>
  1181. </dp:section>
  1182. </dp:list>
  1183. </xsl:template>
  1184. <!--
  1185. Template - mt:scopes: FOR FLYOUT SEARCH
  1186. Placeholder.
  1187. Operation:
  1188. apply all templates.
  1189. -->
  1190. <xsl:template match="mt:scopes" priority="1" mode="ddScopes">
  1191. <out:choose>
  1192. <out:when test="/root/page/type = 'customsearch'">
  1193. <xsl:apply-templates select="./*[@customsearch='true']" mode="ddScope"/>
  1194. </out:when>
  1195. <out:otherwise>
  1196. <xsl:apply-templates mode="ddScope"/>
  1197. </out:otherwise>
  1198. </out:choose>
  1199. </xsl:template>
  1200. <!--
  1201. Template - mt:scope: FOR FLYOUT SEARCH
  1202. Create item tags named searchScope_xxx
  1203. Operation:
  1204. Create item element structure consumed in the generate-basicSearchFlyouts-block.
  1205. -->
  1206. <xsl:template match="mt:scope" priority="1" mode="ddScope">
  1207. <xsl:variable name="curVal" select="string()"/>
  1208. <xsl:if test="$curVal != ''">
  1209. <item id="searchScope_{$curVal}" value="{$curVal}">
  1210. <out:variable name="scopeString">
  1211. <xsl:choose>
  1212. <xsl:when test="$curVal = 'any'">
  1213. <xsl:choose>
  1214. <xsl:when test="@type = 'security'"><xts:string id="IDS_FILTER_CURRENT_NAMESPACE"/></xsl:when>
  1215. <xsl:otherwise><xts:string id="IDS_ANY"/></xsl:otherwise>
  1216. </xsl:choose>
  1217. </xsl:when>
  1218. <xsl:when test="$curVal = 'fb'"><xts:string id="IDS_THIS_FOLDER_BELOW"/></xsl:when>
  1219. <xsl:when test="$curVal = 'fo'"><xts:string id="IDS_THIS_FOLDER_ONLY"/></xsl:when>
  1220. <xsl:when test="$curVal = 'm'">
  1221. <out:choose>
  1222. <out:when test="key('session-param', 'e_mroot') != ''">
  1223. <out:value-of select="key('session-param', 'e_mroot')"/>
  1224. </out:when>
  1225. <out:otherwise>
  1226. <xts:string id="IDS_PERSONAL"/>
  1227. </out:otherwise>
  1228. </out:choose>
  1229. </xsl:when>
  1230. <xsl:when test="$curVal = 'p'">
  1231. <out:choose>
  1232. <out:when test="key('session-param', 'e_proot') != ''">
  1233. <out:value-of select="key('session-param', 'e_proot')"/>
  1234. </out:when>
  1235. <out:otherwise>
  1236. <xts:string id="IDS_PUBLIC"/>
  1237. </out:otherwise>
  1238. </out:choose>
  1239. </xsl:when>
  1240. <xsl:when test="$curVal = 's'"><xts:string id="IDS_MYSUB_MYSUBSCRIPTIONS"/></xsl:when>
  1241. </xsl:choose>
  1242. </out:variable>
  1243. <text><out:value-of select="$scopeString"/></text>
  1244. <action>CCPopupMenu.activeMenu.setMenuItemChecked("searchScope_<xsl:value-of select="xtsext:javascriptencode(string($curVal))"/>");setSearchScope('<xsl:value-of select="xtsext:javascriptencode(string($curVal))"/>','<out:value-of select="xtsext:javascriptencode(string($scopeString))"/>');</action>
  1245. </item>
  1246. </xsl:if>
  1247. </xsl:template>
  1248. <!--
  1249. Template - FOR FLYOUT SEARCH
  1250. Scope Placeholder.
  1251. Operation:
  1252. apply all templates.
  1253. -->
  1254. <xsl:template match="*" mode="ddScope">
  1255. <xsl:copy>
  1256. <xsl:copy-of select="@*"/>
  1257. <xsl:apply-templates mode="ddScope"/>
  1258. </xsl:copy>
  1259. </xsl:template>
  1260. <!--
  1261. Template - mt:stypes: FOR FLYOUT SEARCH
  1262. Placeholder.
  1263. Operation:
  1264. generate the searchType_any item element.
  1265. apply all templates.
  1266. -->
  1267. <xsl:template match="mt:stypes" priority="1" mode="ddTypes">
  1268. <xsl:param name="isIdx" select="''"/>
  1269. <xsl:variable name="idxName">
  1270. <xsl:if test="$isIdx = 'true'">Index</xsl:if>
  1271. </xsl:variable>
  1272. <item id="search{$idxName}Type_any">
  1273. <text><xts:string id="IDS_ANY"/></text>
  1274. <action>CCPopupMenu.activeMenu.setMenuItemChecked("search<xsl:value-of select="xtsext:javascriptencode(string($idxName))"/>Type_any");setSearch<xsl:value-of select="xtsext:javascriptencode(string($idxName))"/>Type('any','<xts:string id="IDS_ANY" encode="javascript"/>');</action>
  1275. </item>
  1276. <xsl:apply-templates mode="ddType">
  1277. <xsl:with-param name="isIdx" select="$isIdx"/>
  1278. </xsl:apply-templates>
  1279. </xsl:template>
  1280. <!--
  1281. Template - mt:stype:
  1282. Create item tags named searchType_xxx
  1283. Operation:
  1284. Create item element structure consumed in the generate-basicSearchFlyouts-block.
  1285. -->
  1286. <xsl:template match="mt:stype" mode="ddType">
  1287. <xsl:param name="isIdx" select="''"/>
  1288. <xsl:variable name="idxName">
  1289. <xsl:if test="$isIdx = 'true'">Index</xsl:if>
  1290. </xsl:variable>
  1291. <xsl:variable name="curVal" select="@name"/>
  1292. <xsl:if test="$curVal != ''">
  1293. <item id="search{$idxName}Type_{$curVal}" value="{$curVal}">
  1294. <out:variable name="txtVal"><xsl:copy-of select="./*"/></out:variable>
  1295. <text><out:value-of select="$txtVal"/></text>
  1296. <action>CCPopupMenu.activeMenu.setMenuItemChecked("search<xsl:value-of select="xtsext:javascriptencode(string($idxName))"/>Type_<xsl:value-of select="xtsext:javascriptencode(string($curVal))"/>");setSearch<xsl:value-of select="xtsext:javascriptencode(string($idxName))"/>Type('<xsl:value-of select="xtsext:javascriptencode(string($curVal))"/>','<out:value-of select="xtsext:javascriptencode(string($txtVal))"/>');</action>
  1297. </item>
  1298. </xsl:if>
  1299. </xsl:template>
  1300. <!--
  1301. Template - FOR FLYOUT SEARCH
  1302. Type Placeholder.
  1303. Operation:
  1304. apply all templates.
  1305. -->
  1306. <xsl:template match="*" mode="ddType">
  1307. <xsl:param name="isIdx" select="''"/>
  1308. <xsl:copy>
  1309. <xsl:copy-of select="@*"/>
  1310. <xsl:apply-templates select="./*" mode="ddType">
  1311. <xsl:with-param name="isIdx" select="$isIdx"/>
  1312. </xsl:apply-templates>
  1313. </xsl:copy>
  1314. </xsl:template>
  1315. <xsl:template match="mt:hiddenscope" priority="1">
  1316. <xsl:if test="string(.) != ''">
  1317. <input type="hidden" name="sscope" id="sscope">
  1318. <xsl:attribute name="value"><xsl:value-of select="string(.)"/></xsl:attribute>
  1319. </input>
  1320. </xsl:if>
  1321. </xsl:template>
  1322. <xsl:template match="*">
  1323. <xsl:copy>
  1324. <xsl:copy-of select="@*"/>
  1325. <xsl:apply-templates/>
  1326. </xsl:copy>
  1327. </xsl:template>
  1328. </xsl:stylesheet>