selectMembersUI.xts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2008
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml,messages/AGS.xml,messages/portalRL.xml" requiredCapability="canUseEventStudio">
  9. <!--
  10. ================================================================================
  11. Page Renderer
  12. ================================================================================
  13. -->
  14. <xts:block id="page" type="exec" mode="output" processor="XSLT" mimeType="text/html">
  15. <!-- get the debug logic sheet -->
  16. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  17. <!-- get the new theme stuff -->
  18. <xts:logicsheet path="logicsheets/portal.xsl"/>
  19. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  20. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  21. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  22. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  23. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  24. <!-- apply the form logic -->
  25. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  26. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xts lyt pf dp df cp cf dbg utml xtsext">
  27. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  28. <!-- Global template variables -->
  29. <pf:variables/>
  30. <!-- start the output -->
  31. <xsl:template match="/root">
  32. <dp:page title="AGENT_STUDIO_WINDOW_TITLE">
  33. <link href="{$skin_root}/ags/ags.css" type="text/css" rel="stylesheet"/>
  34. <dp:script>
  35. <script type="text/javascript" src="../common/framework/ui/CUIStyle.js">//</script>
  36. <script type="text/javascript" src="../prompting/prompting.js">//</script>
  37. <script type="text/javascript" src="../prompting/CTreeIE5NS6.js">//</script>
  38. <script type="text/javascript">
  39. // get access to the configFrame - the parent window
  40. var cf = parent.getConfigFrame();
  41. // keep the items which launched the query - we should be able to run multiple
  42. // items - the items which have been selected in the tree.
  43. var items = null;
  44. // we also have to persist globally the sort/filter/filter type
  45. var g_sSortOrder = null;
  46. var filter = null;
  47. var filter_type = null;
  48. var case_sensitive = null;
  49. var search_descendants = null;
  50. var search_finished = true;
  51. var startAtPath = null;
  52. // List objects
  53. var clistLeft ;
  54. var clistRight ;
  55. // define the callback function - response from worker thread
  56. var callbackFn = function(status)
  57. {
  58. }
  59. function clistEqualityCheck(list, node) {
  60. var result = false;
  61. var items = list.getAllItems();
  62. for (var i=0; items &amp;&amp; i &lt; items.length;i++) {
  63. result = result || items[i].firstChild.nodeValue.localeCompare(node.nodeValue) == 0;
  64. }
  65. return result;
  66. }
  67. // init function - this will initiate the conversation_frame with the information it need to start up
  68. function init()
  69. {
  70. }
  71. function closeDialog()
  72. {
  73. cf.doClosePopUp();
  74. }
  75. // create the URL which starts the conversation
  76. function sendQuery(callbackFn, method, treeObj)
  77. {
  78. // send the query
  79. cf.doSelectValuesRequest(callbackFn, method, treeObj, g_sSortOrder, filter, filter_type, tracking, conversation);
  80. }
  81. function updateValues(displayValues, useValues)
  82. {
  83. }
  84. function doSearch()
  85. {
  86. filter = null;
  87. filter_type = null;
  88. // filter out the filter
  89. if (document.pform.searchValue.value.length > 0) {
  90. filter = document.pform.searchValue.value;
  91. }
  92. // get the filter type
  93. if (document.pform.search_method[0].checked) {
  94. filter_type = document.pform.search_method[0].value;
  95. }
  96. if (document.pform.search_method[1].checked) {
  97. filter_type = document.pform.search_method[1].value;
  98. }
  99. if (document.pform.search_method[2].checked) {
  100. filter_type = document.pform.search_method[2].value;
  101. }
  102. // sort out the case_insensitive and search_descendants values
  103. // UI has case insensitive - but actual function requires case sensitive - so have to reverse the logic
  104. if (document.pform.case_insensitive.checked) {
  105. case_sensitive = null;
  106. } else {
  107. case_sensitive = true;
  108. }
  109. <xsl:choose>
  110. <xsl:when test="/root/env/param[@name='searchDescendantsAllowed'] and /root/env/param[@name='searchDescendantsAllowed']='true'">
  111. if (document.pform.search_descendants.checked) {
  112. search_descendants = true;
  113. } else {
  114. search_descendants = false;
  115. }
  116. </xsl:when>
  117. <xsl:otherwise>
  118. search_descendants = false;
  119. </xsl:otherwise>
  120. </xsl:choose>
  121. // get the path
  122. if (document.pform.startAtPath.value.length > 0) {
  123. startAtPath = document.pform.startAtPath.value;
  124. }
  125. // run the search
  126. cf.doMemberSearch(startAtPath, filter, filter_type, case_sensitive, search_descendants);
  127. }
  128. function addItem(selectElemRef, selectedElemRef, i)
  129. {
  130. }
  131. function generateMultipleInsert(selectedElemRef)
  132. {
  133. }
  134. </script>
  135. </dp:script>
  136. <link href="{$skin_root}/ags/ags.css" type="text/css" rel="stylesheet"/>
  137. <utml:form name="pform" method="post" action="{$gateway}">
  138. <!-- need a hidden input -->
  139. <utml:input type="hidden" name="startAtPath" id="startAtPath">
  140. <utml:value>
  141. <xsl:value-of select="/root/env/param[@name='startAtPath']"/>
  142. </utml:value>
  143. </utml:input>
  144. <!-- hack to specify that we need to build the run options -->
  145. <dp:header help="false">
  146. <dp:title>
  147. <xts:string id="DIALOG_MEMBER_SEARCH_TITLE"/>
  148. </dp:title>
  149. <dp:description>
  150. <xts:string id="DIALOG_MEMBER_SEARCH_DESCRIPTION"/>
  151. </dp:description>
  152. <dp:close>
  153. <a href="#" onclick="closeDialog();">
  154. <dp:closeMarker/>
  155. </a>
  156. </dp:close>
  157. </dp:header>
  158. <lyt:layout style="1">
  159. <lyt:section>
  160. <!-- do the body -->
  161. <dp:list>
  162. <dp:section>
  163. <dp:label>
  164. <xts:string id="DIALOG_SEARCH_HEADER"/>
  165. </dp:label>
  166. </dp:section>
  167. <dp:section>
  168. <dp:text>
  169. <input type="text" size="60" name="searchValue" id="searchValue"/>
  170. </dp:text>
  171. </dp:section>
  172. </dp:list>
  173. <!-- do the advanced search features -->
  174. <dp:box>
  175. <dp:boxSection valign="top" height="100%">
  176. <dp:list>
  177. <dp:section>
  178. <dp:label>
  179. <xts:string id="DIALOG_SEARCH_FILTER"/>
  180. </dp:label>
  181. </dp:section>
  182. <dp:section>
  183. <dp:choice>
  184. <utml:radio-group name="search_method">
  185. <utml:default-value>contains</utml:default-value>
  186. <dp:section1>
  187. <utml:input type="radio">
  188. <utml:value>
  189. <xsl:text>contains</xsl:text>
  190. </utml:value>
  191. </utml:input>
  192. </dp:section1>
  193. <dp:section2>
  194. <span style="cursor:default">
  195. <xts:string id="DIALOG_SEARCH_FILTER_CONTAINS"/>
  196. </span>
  197. </dp:section2>
  198. <dp:section1>
  199. <utml:input type="radio">
  200. <utml:value>
  201. <xsl:text>starts-with</xsl:text>
  202. </utml:value>
  203. </utml:input>
  204. </dp:section1>
  205. <dp:section2>
  206. <span style="cursor:default">
  207. <xts:string id="DIALOG_SEARCH_FILTER_STARTS_WITH"/>
  208. </span>
  209. </dp:section2>
  210. <dp:section1>
  211. <utml:input type="radio">
  212. <utml:value>
  213. <xsl:text>equals</xsl:text>
  214. </utml:value>
  215. </utml:input>
  216. </dp:section1>
  217. <dp:section2>
  218. <span style="cursor:default">
  219. <xts:string id="DIALOG_SEARCH_FILTER_EQUALS"/>
  220. </span>
  221. </dp:section2>
  222. </utml:radio-group>
  223. </dp:choice>
  224. </dp:section>
  225. </dp:list>
  226. </dp:boxSection>
  227. <dp:boxSection valign="top" height="100%">
  228. <dp:list>
  229. <dp:section>
  230. <dp:label>
  231. <xts:string id="DIALOG_SEARCH_OPTIONS_TITLE"/>
  232. </dp:label>
  233. </dp:section>
  234. <dp:section>
  235. <dp:choice>
  236. <dp:section1>
  237. <utml:input type="checkbox" name="case_insensitive" id="case_insensitive" value="true"/>
  238. </dp:section1>
  239. <dp:section2>
  240. <xts:string id="DIALOG_SEARCH_OPTIONS_CASE"/>
  241. </dp:section2>
  242. <dp:section1>
  243. <utml:input type="checkbox" name="search_descendants" id="search_descendants" value="true">
  244. <utml:read-only>
  245. <xsl:choose>
  246. <xsl:when test="/root/env/param[@name='searchDescendantsAllowed'] and /root/env/param[@name='searchDescendantsAllowed']='true'">
  247. <xsl:text>false</xsl:text>
  248. </xsl:when>
  249. <xsl:otherwise>
  250. <xsl:text>true</xsl:text>
  251. </xsl:otherwise>
  252. </xsl:choose>
  253. </utml:read-only>
  254. </utml:input>
  255. </dp:section1>
  256. <dp:section2>
  257. <xts:string id="DIALOG_SEARCH_OPTIONS_DESCENDANTS"/>
  258. </dp:section2>
  259. </dp:choice>
  260. </dp:section>
  261. </dp:list>
  262. </dp:boxSection>
  263. </dp:box>
  264. </lyt:section>
  265. </lyt:layout>
  266. <!-- footer -->
  267. <dp:footer style="width:100%">
  268. <dp:button>
  269. <dp:defaultKey>active</dp:defaultKey>
  270. <dp:defaultAct>doSearch();</dp:defaultAct>
  271. <a href="#" onclick="doSearch();">
  272. <dp:buttonText>
  273. <xts:string id="DIALOG_SEARCH_BUTTON"/>
  274. </dp:buttonText>
  275. <dp:buttonImage name="imgSearch">../ags/images/tree/member_search.gif</dp:buttonImage>
  276. </a>
  277. </dp:button>
  278. <df:button df:id="IDS_CANCEL" df:style="href" df:href="#" onclick="closeDialog();"/>
  279. </dp:footer>
  280. </utml:form>
  281. </dp:page>
  282. </xsl:template>
  283. </xsl:stylesheet>
  284. </xts:block>
  285. <!-- =========================================================================================
  286. D E B U G B L O C K
  287. =========================================================================================
  288. -->
  289. <xts:block id="debug" type="exec" mode="output" processor="XSLT" condition=".[/root/session/param[@name = 'debug'] = '1']" mandatory="false" mimeType="text/html" dependency="page">
  290. <!-- Get the debug logicsheet. -->
  291. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  292. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  293. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  294. <xsl:template match="/">
  295. <dbg:dumpxml select="/root"/>
  296. </xsl:template>
  297. </xsl:stylesheet>
  298. </xts:block>
  299. </xts:morphlet>