sort.xts 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  9. <!--
  10. ===============================================================================================
  11. formlogic_init - standard form logic initialization
  12. ===============================================================================================
  13. -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!--
  16. ===============================================================================================
  17. getObjects - get object class names
  18. ===============================================================================================
  19. -->
  20. <xts:block id="classNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  21. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  22. </xts:block>
  23. <!-- Content Request =========================================================== -->
  24. <xts:block id="getContent" processor="XSLT" type="exec">
  25. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  26. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  27. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  28. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  29. <cml:object-predicates/>
  30. <xsl:template match="root">
  31. <xsl:variable name="m_sort" select="/root/env/param[@name='m_sort']"/>
  32. <xsl:variable name="m_path" select="/root/env/param[@name='m_path']"/>
  33. <xts:sequence>
  34. <xts:append>
  35. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  36. <send:request provider="cm">
  37. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  38. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  39. <cm:requests>
  40. <cm:query>
  41. <cm:search>
  42. <xsl:value-of select="$m_path"/>
  43. </cm:search>
  44. <cm:properties>
  45. <cm:property name="defaultName"/>
  46. <cm:property name="ancestors"/>
  47. </cm:properties>
  48. </cm:query>
  49. <cm:query>
  50. <cm:search>
  51. <xsl:value-of select="$m_path"/>/*<xsl:value-of select="$visibility-predicate"/>
  52. <xsl:text/>
  53. <xsl:choose>
  54. <xsl:when test="/root/env/param[@name = 'stype'] != 'any'">
  55. <xsl:text/>[@objectClass = '<xsl:value-of select="/root/env/param[@name = 'stype']"/>']<xsl:text/>
  56. </xsl:when>
  57. <xsl:otherwise>
  58. <xsl:text/>[@usage != 'subObject' and @objectClass != 'packageConfiguration']<xsl:text/>
  59. </xsl:otherwise>
  60. </xsl:choose>
  61. </cm:search>
  62. <cm:properties>
  63. <cm:property name="defaultName"/>
  64. <cm:property name="searchPath"/>
  65. <cm:property name="displaySequence"/>
  66. <cm:property name="modificationTime"/>
  67. <cm:property name="launchableType"/>
  68. <cm:property name="usage"/>
  69. <cm:property name="hidden"/>
  70. </cm:properties>
  71. <cm:sortBy>
  72. <cm:sort name="usage" order="ascending"/>
  73. <cm:sort name="displaySequence" order="descending"/>
  74. <cm:sort name="defaultName" order="ascending"/>
  75. </cm:sortBy>
  76. <cm:options schemaInfo="true"/>
  77. </cm:query>
  78. </cm:requests>
  79. </cm:query>
  80. </xts:transform>
  81. </send:request>
  82. </xts:transform>
  83. </xts:append>
  84. </xts:sequence>
  85. </xsl:template>
  86. </xsl:stylesheet>
  87. </xts:block>
  88. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getContent classNames">
  89. <xts:logicsheet path="logicsheets/portal.xsl"/>
  90. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  91. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  92. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  93. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  94. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  95. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  96. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  97. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  98. <xsl:stylesheet version="1.0"
  99. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  100. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  101. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  102. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  103. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  104. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  105. xmlns:st="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/specializetabs/"
  106. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  107. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  108. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  109. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  110. xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
  111. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  112. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  113. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  114. exclude-result-prefixes="xsl cm pf lyt dp df st cf cp bus cml dbg utml xtsext xts">
  115. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  116. <!-- current file name -->
  117. <xsl:variable name="mname" select="'sort.xts'"/>
  118. <!-- add any theme variables -->
  119. <pf:variables/>
  120. <xsl:key name="object-class" match="/root/objectClass/class" use="@name"/>
  121. <xsl:variable name="containerCount" select="count(/root/cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'T']/@class = cm:objectClass and cm:displaySequence!=0])"/>
  122. <xsl:variable name="entriesCount" select="count(/root/cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'F']/@class = cm:objectClass and cm:displaySequence!=0])"/>
  123. <!-- start the output -->
  124. <xsl:template match="/root">
  125. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  126. <dp:meta>
  127. <pf:meta/>
  128. <!-- Standard meta tags -->
  129. </dp:meta>
  130. <dp:script>
  131. <pf:help context="HID_SORT"/>
  132. <!-- Help system -->
  133. <script language="javascript">
  134. var containerDefaultList = new Array();
  135. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'T']/@class = cm:objectClass and cm:displaySequence=0]">
  136. <xsl:variable name="containerName">
  137. <xsl:choose>
  138. <xsl:when test="string-length(string(cm:defaultName)) > 61">
  139. <xsl:value-of select="concat(substring(string(cm:defaultName),0,60),'...')"/>
  140. </xsl:when>
  141. <xsl:otherwise>
  142. <xsl:value-of select="cm:defaultName"/>
  143. </xsl:otherwise>
  144. </xsl:choose>
  145. </xsl:variable>
  146. <xsl:variable name="containerNameDisplay">
  147. <xsl:value-of select="xtsext:enforceBTD($containerName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  148. </xsl:variable>
  149. containerDefaultList[<xsl:value-of select="(position() - 1)"/>] = new Array("0", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string($containerNameDisplay)), '&lt;/', '&lt;&quot; + &quot;/')"/>&#160;(<xsl:value-of select="xtsext:javascriptencode(string(key('object-class', cm:objectClass)))"/>)", "<xsl:value-of select="xtsext:replace(xtsext:javascriptencode(string(cm:searchPath)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string(cm:defaultName)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:modificationTime))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:objectClass))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:hidden))"/>");
  150. </xsl:for-each>
  151. var containerOptionList = new Array();
  152. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'T']/@class = cm:objectClass and cm:displaySequence!=0]">
  153. <xsl:variable name="containerName">
  154. <xsl:choose>
  155. <xsl:when test="string-length(string(cm:defaultName)) > 61">
  156. <xsl:value-of select="concat(substring(string(cm:defaultName),0,60),'...')"/>
  157. </xsl:when>
  158. <xsl:otherwise>
  159. <xsl:value-of select="cm:defaultName"/>
  160. </xsl:otherwise>
  161. </xsl:choose>
  162. </xsl:variable>
  163. <xsl:variable name="containerNameDisplay">
  164. <xsl:value-of select="xtsext:enforceBTD($containerName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  165. </xsl:variable>
  166. containerOptionList[<xsl:value-of select="(position() - 1)"/>] = new Array("<xsl:value-of select="$containerCount - (position() - 1)"/>", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string($containerNameDisplay)), '&lt;/', '&lt;&quot; + &quot;/')"/>&#160;(<xsl:value-of select="xtsext:javascriptencode(string(key('object-class', cm:objectClass)))"/>)", "<xsl:value-of select="xtsext:replace(xtsext:javascriptencode(string(cm:searchPath)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string(cm:defaultName)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:modificationTime))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:objectClass))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:hidden))"/>");
  167. </xsl:for-each>
  168. var entriesDefaultList = new Array();
  169. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'F']/@class = cm:objectClass and cm:displaySequence=0]">
  170. <xsl:variable name="entryName">
  171. <xsl:choose>
  172. <xsl:when test="string-length(string(cm:defaultName)) > 61">
  173. <xsl:value-of select="concat(substring(string(cm:defaultName),0,60),'...')"/>
  174. </xsl:when>
  175. <xsl:otherwise>
  176. <xsl:value-of select="cm:defaultName"/>
  177. </xsl:otherwise>
  178. </xsl:choose>
  179. </xsl:variable>
  180. <xsl:variable name="entryNameDisplay">
  181. <xsl:value-of select="xtsext:enforceBTD($entryName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  182. </xsl:variable>
  183. entriesDefaultList[<xsl:value-of select="(position() - 1)"/>] = new Array("0", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string($entryNameDisplay)), '&lt;/', '&lt;&quot; + &quot;/')"/>&#160;(<xsl:value-of select="xtsext:javascriptencode(string(key('object-class', cm:objectClass)))"/>)", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string(cm:searchPath)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string(cm:defaultName)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:modificationTime))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:objectClass))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:hidden))"/>");
  184. </xsl:for-each>
  185. var entriesOptionList = new Array();
  186. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'F']/@class = cm:objectClass and cm:displaySequence!=0]">
  187. <xsl:variable name="entryName">
  188. <xsl:choose>
  189. <xsl:when test="string-length(string(cm:defaultName)) > 61">
  190. <xsl:value-of select="concat(substring(string(cm:defaultName),0,60),'...')"/>
  191. </xsl:when>
  192. <xsl:otherwise>
  193. <xsl:value-of select="cm:defaultName"/>
  194. </xsl:otherwise>
  195. </xsl:choose>
  196. </xsl:variable>
  197. <xsl:variable name="entryNameDisplay">
  198. <xsl:value-of select="xtsext:enforceBTD($entryName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  199. </xsl:variable>
  200. entriesOptionList[<xsl:value-of select="(position() - 1)"/>] = new Array("<xsl:value-of select="$entriesCount - (position() - 1)"/>", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string($entryNameDisplay)), '&lt;/', '&lt;&quot; + &quot;/')"/>&#160;(<xsl:value-of select="xtsext:javascriptencode(string(key('object-class', cm:objectClass)))"/>)", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string(cm:searchPath)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "", "<xsl:value-of select="xtsext:replace( xtsext:javascriptencode(string(cm:defaultName)), '&lt;/', '&lt;&quot; + &quot;/')"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:modificationTime))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:objectClass))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(cm:hidden))"/>");
  201. </xsl:for-each>
  202. //set all the values to zero
  203. function resetToZero(what, sortArray) {
  204. for (var i=0; i &lt; what.options.length; i++){
  205. sortArray[what.options[i].value][0] = 0;
  206. what[i].selected = false;
  207. }
  208. }
  209. function resetList(what,aray,dosel)
  210. {
  211. if (what) {
  212. for (var i=0; i &lt; aray.length; i++){
  213. what[i].value = aray[i][0] + ',' + aray[i][2] + ',' + aray[i][6];
  214. if( dosel==1)
  215. what[i].selected = true;
  216. }
  217. }
  218. }
  219. //this will set the values for both selectbox
  220. function setValues() {
  221. if( containerOptionList.length!=0) {
  222. revalue(containerOptionList);
  223. resetList(document.pform.containerSortOrder,containerOptionList,1);
  224. }
  225. if( containerDefaultList.length!=0){
  226. setList(document.pform.containerDefaultOrder, containerDefaultList);
  227. }
  228. if( entriesOptionList.length != 0) {
  229. revalue(entriesOptionList);
  230. resetList(document.pform.entriesSortOrder, entriesOptionList,1);
  231. }
  232. if( entriesDefaultList.length !=0) {
  233. setList(document.pform.entriesDefaultOrder, entriesDefaultList);
  234. }
  235. //<!-- Innocent hack to get the main page to reset the sort order after visiting this page -->
  236. if (document.pform.backURL &amp;&amp; document.pform.backURL != "")
  237. document.pform.backURL.value = document.pform.backURL.value + "&amp;resetSort=";
  238. }
  239. function resetC(def,idx)
  240. {
  241. if(def=='def')
  242. {
  243. for( ; idx &lt; containerOptionList.length; idx++) {
  244. containerOptionList[idx] = containerOptionList[idx + 1];
  245. }
  246. containerOptionList.length=containerOptionList.length-1;
  247. } else {
  248. for( ; idx &lt; containerDefaultList.length; idx++) {
  249. containerDefaultList[idx] = containerDefaultList[idx + 1];
  250. }
  251. containerDefaultList.length=containerDefaultList.length-1;
  252. }
  253. }
  254. function resetE(def,idx)
  255. {
  256. if(def=='def')
  257. {
  258. for( ; idx &lt; entriesOptionList.length; idx++) {
  259. entriesOptionList[idx] = entriesOptionList[idx + 1];
  260. }
  261. entriesOptionList.length=entriesOptionList.length-1;
  262. } else {
  263. for( ; idx &lt; entriesDefaultList.length; idx++) {
  264. entriesDefaultList[idx] = entriesDefaultList[idx + 1];
  265. }
  266. entriesDefaultList.length=entriesDefaultList.length-1;
  267. }
  268. }
  269. //delete an option
  270. function delOpt(what, index) {
  271. what.options[index] = null;
  272. for(var i=index; i &lt; what.options.length; i++) {
  273. what.options[i].value = i;
  274. }
  275. }
  276. //add an option
  277. function addOpt(what, text, value,isHidden) {
  278. var defaultSelected = false;
  279. var selected = false;
  280. var optionName = new Option(text, value, defaultSelected, selected);
  281. if(isHidden=="true")
  282. optionName.className = "inactiveText";
  283. what.options[what.length] = optionName;
  284. if(what.length &gt; 0)
  285. what.options[what.length-1].selected = false;
  286. }
  287. function processFolder(type, def, whatto,whatfrom)
  288. {
  289. if(type=='ones')
  290. {
  291. var tolen = whatto.length;
  292. var fnd=0;
  293. if( whatfrom.length &gt; 0 ) {
  294. for( var i=0,j=tolen; i &lt; whatfrom.length &amp;&amp; i &gt; -1;)
  295. {
  296. if(whatfrom[i].selected==true) {
  297. if(fnd==0)fnd=1;
  298. if(def=='def') {
  299. addOpt(whatto,containerOptionList[i][1],j,containerOptionList[i][7]);
  300. containerDefaultList[j]=containerOptionList[i];
  301. j++;
  302. } else {
  303. addOpt(whatto,containerDefaultList[i][1],j,containerDefaultList[i][7]);
  304. containerOptionList[j]=containerDefaultList[i];
  305. j++;
  306. }
  307. delOpt(whatfrom,i);
  308. resetC(def,i);
  309. }
  310. if(fnd==1) {
  311. fnd=0;
  312. if(whatfrom.length>0 &amp;&amp; i!=0)
  313. i=i-1;
  314. } else {
  315. i++;
  316. }
  317. }
  318. if(def=='def') {
  319. resetToZero(whatto,containerDefaultList);
  320. } else {
  321. resetToZero(whatfrom,containerDefaultList);
  322. }
  323. }
  324. }
  325. else if(type=='all')
  326. {
  327. var fromlen = whatfrom.length;
  328. if(fromlen!=0) {
  329. var tolen = whatto.length;
  330. for( var i=0, j=tolen; i &lt; fromlen; i++,j++)
  331. {
  332. if( def=='def' ) {
  333. addOpt(whatto,containerOptionList[i][1],j,containerOptionList[i][7]);
  334. containerDefaultList[j]=containerOptionList[i];
  335. }
  336. else {
  337. addOpt(whatto,containerDefaultList[i][1],j,containerDefaultList[i][7]);
  338. containerOptionList[j]=containerDefaultList[i];
  339. }
  340. delOpt(whatfrom,0);
  341. }
  342. if(def=='def') {
  343. resetToZero(whatto,containerDefaultList);
  344. containerOptionList = null;
  345. containerOptionList = new Array();
  346. }
  347. else {
  348. containerDefaultList = null;
  349. containerDefaultList = new Array();
  350. revalue(containerOptionList);
  351. }
  352. }
  353. }
  354. }
  355. function processEntries(type, def, whatto,whatfrom)
  356. {
  357. if(type=='ones')
  358. {
  359. var tolen = whatto.length;
  360. var fnd=0;
  361. if( whatfrom.length &gt; 0 ) {
  362. for( var i=0,j=tolen; i &lt; whatfrom.length &amp;&amp; i &gt; -1;)
  363. {
  364. if(whatfrom[i].selected==true) {
  365. if(fnd==0)fnd=1;
  366. if(def=='def') {
  367. addOpt(whatto,entriesOptionList[i][1],j,entriesOptionList[i][7]);
  368. entriesDefaultList[j]=entriesOptionList[i];
  369. j++;
  370. } else {
  371. addOpt(whatto,entriesDefaultList[i][1],j,entriesDefaultList[i][7]);
  372. entriesOptionList[j]=entriesDefaultList[i];
  373. j++;
  374. }
  375. delOpt(whatfrom,i);
  376. resetE(def,i);
  377. }
  378. if(fnd==1) {
  379. fnd=0;
  380. if(whatfrom.length>0 &amp;&amp; i!=0)
  381. i=i-1;
  382. } else {
  383. i++;
  384. }
  385. }
  386. if(def=='def') {
  387. resetToZero(whatto,entriesDefaultList);
  388. } else {
  389. resetToZero(whatfrom,entriesDefaultList);
  390. }
  391. }
  392. }
  393. else if(type=='all')
  394. {
  395. var fromlen = whatfrom.length;
  396. if(fromlen!=0) {
  397. var tolen = whatto.length;
  398. for( var i=0, j=tolen; i &lt; fromlen; i++,j++)
  399. {
  400. if( def=='def' ) {
  401. addOpt(whatto,entriesOptionList[i][1],j,entriesOptionList[i][7]);
  402. entriesDefaultList[j]=entriesOptionList[i];
  403. }
  404. else {
  405. addOpt(whatto,entriesDefaultList[i][1],j,entriesDefaultList[i][7]);
  406. entriesOptionList[j]=entriesDefaultList[i];
  407. }
  408. delOpt(whatfrom,0);
  409. }
  410. if(def=='def') {
  411. resetToZero(whatto,entriesDefaultList);
  412. entriesOptionList = null;
  413. entriesOptionList = new Array();
  414. }
  415. else {
  416. entriesDefaultList = null;
  417. entriesDefaultList = new Array();
  418. revalue(entriesOptionList);
  419. }
  420. }
  421. }
  422. }
  423. </script>
  424. </dp:script>
  425. <cml:single-object/>
  426. <utml:form name="pform" method="post" action="{$gateway}">
  427. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  428. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  429. <!-- dialog header -->
  430. <dp:header dp:kbA11y="true">
  431. <!-- header titles-->
  432. <dp:title>
  433. <xts:string id="IDS_SORT_ORDER_TITLE">
  434. <xts:param name="sortIn">
  435. <xsl:value-of select="xtsext:enforceBTD(cm:queryResponse/cm:queryReply[1]/*/cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  436. </xts:param>
  437. </xts:string>
  438. </dp:title>
  439. <dp:description>
  440. <xts:string id="IDS_SORT_INTRO"/>
  441. </dp:description>
  442. </dp:header>
  443. <!-- body contents - form item -->
  444. <xsl:variable name="sort_name">
  445. <xts:string id="IDS_NAME"/>
  446. </xsl:variable>
  447. <xsl:variable name="sort_modified">
  448. <xts:string id="IDS_MODIFIED"/>
  449. </xsl:variable>
  450. <xsl:variable name="containerOptCnt">
  451. <xsl:value-of select="count(/root/cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'T']/@class = cm:objectClass and cm:displaySequence!=0])"/>
  452. </xsl:variable>
  453. <xsl:variable name="entriesOptCnt">
  454. <xsl:value-of select="count(/root/cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'F']/@class = cm:objectClass and cm:displaySequence!=0])"/>
  455. </xsl:variable>
  456. <lyt:layout style="1" border="yes" title="IDS_SORT_FOLDERS" lyt:kbA11y="true" id="IDS_SORT_FOLDERS">
  457. <lyt:section>
  458. <dp:list role="presentation">
  459. <dp:section dp:kbA11y="true">
  460. <dp:list title="IDS_SORT_REST" for="containerDefaultOrder_ID" valign="top" role="presentation" parentTitle="IDS_SORT_FOLDERS">
  461. <dp:section width="40%" dp:kbA11y="true">
  462. <dp:text>
  463. <cf:sortList class="sortSelectContent" name="containerDefaultOrder" id="containerDefaultOrder_ID" form="pform" array="containerDefaultList" size="15" action="none">
  464. <cf:initContent>
  465. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'T']/@class = cm:objectClass]">
  466. <xsl:if test="cm:displaySequence=0">
  467. <xsl:variable name="containerNam">
  468. <xsl:choose>
  469. <xsl:when test="string-length(string(cm:defaultName)) > 61">
  470. <xsl:value-of select="concat(substring(string(cm:defaultName),0,60),'...')"/>
  471. </xsl:when>
  472. <xsl:otherwise>
  473. <xsl:value-of select="cm:defaultName"/>
  474. </xsl:otherwise>
  475. </xsl:choose>
  476. </xsl:variable>
  477. <utml:option>
  478. <xsl:attribute name="value"><xsl:value-of select="(position() - number($containerOptCnt) -1)"/></xsl:attribute>
  479. <xsl:if test="string(cm:hidden)='true'">
  480. <xsl:attribute name="class">
  481. <xsl:text/>inactiveText<xsl:text/>
  482. </xsl:attribute>
  483. </xsl:if>
  484. <xsl:value-of select="xtsext:enforceBTD($containerNam, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  485. <xsl:text> (</xsl:text>
  486. <xsl:value-of select="key('object-class', cm:objectClass)"/>
  487. <xsl:text>)</xsl:text>
  488. <xsl:text/>
  489. </utml:option>
  490. </xsl:if>
  491. </xsl:for-each>
  492. </cf:initContent>
  493. </cf:sortList>
  494. </dp:text>
  495. </dp:section>
  496. </dp:list>
  497. <dp:list role="presentation">
  498. <dp:section width="10%" dp:kbA11y="true">
  499. <dp:columnButtonGroup align="center" width="40" label="IDS_SORT_REST" parentLabel = "IDS_SORT_FOLDERS">
  500. <dp:columnButton>
  501. <a href="javascript:processFolder('ones', 'opt', document.pform.containerSortOrder, document.pform.containerDefaultOrder)">
  502. <img height="18" width="18" border="0" class="flippingImages">
  503. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_right.gif<xsl:text/></xsl:attribute>
  504. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_ADD"/></xsl:attribute>
  505. </img>
  506. </a>
  507. </dp:columnButton>
  508. <dp:columnButton>
  509. <a href="javascript:processFolder('ones','def',document.pform.containerDefaultOrder, document.pform.containerSortOrder)">
  510. <img height="18" width="18" border="0" class="flippingImages">
  511. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_left.gif<xsl:text/></xsl:attribute>
  512. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_REMOVE"/></xsl:attribute>
  513. </img>
  514. </a>
  515. </dp:columnButton>
  516. <dp:columnButton>
  517. <a href="javascript:processFolder('all', 'opt', document.pform.containerSortOrder, document.pform.containerDefaultOrder)">
  518. <img height="18" width="18" border="0" class="flippingImages">
  519. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_all_right.gif<xsl:text/></xsl:attribute>
  520. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_ADD_ALL"/></xsl:attribute>
  521. </img>
  522. </a>
  523. </dp:columnButton>
  524. <dp:columnButton>
  525. <a href="javascript:processFolder('all','def',document.pform.containerDefaultOrder, document.pform.containerSortOrder)">
  526. <img height="18" width="18" border="0" class="flippingImages">
  527. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_all_left.gif<xsl:text/></xsl:attribute>
  528. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_REMOVE_ALL"/></xsl:attribute>
  529. </img>
  530. </a>
  531. </dp:columnButton>
  532. </dp:columnButtonGroup>
  533. </dp:section>
  534. </dp:list>
  535. <dp:list title="IDS_SORT_SHOWN_FIRST" for="containerSortOrder_ID" valign="top" role="presentation" parentTitle="IDS_SORT_FOLDERS">
  536. <dp:section width="40%" dp:kbA11y="true">
  537. <dp:text>
  538. <cf:sortList class="sortSelectContent" name="containerSortOrder" id="containerSortOrder_ID" form="pform" array="containerOptionList" size="15" tLabel="IDS_SORT_SHOWN_FIRST_IDS_SORT_ENTRIES" parentLabel="IDS_SORT_ENTRIES">
  539. <cf:initContent>
  540. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'T']/@class = cm:objectClass]">
  541. <xsl:if test="cm:displaySequence!=0">
  542. <xsl:variable name="containerNam">
  543. <xsl:choose>
  544. <xsl:when test="string-length(string(cm:defaultName)) > 61">
  545. <xsl:value-of select="concat(substring(string(cm:defaultName),0,60),'...')"/>
  546. </xsl:when>
  547. <xsl:otherwise>
  548. <xsl:value-of select="cm:defaultName"/>
  549. </xsl:otherwise>
  550. </xsl:choose>
  551. </xsl:variable>
  552. <utml:option>
  553. <xsl:attribute name="value"><xsl:value-of select="(position() - 1)"/></xsl:attribute>
  554. <xsl:if test="string(cm:hidden)='true'">
  555. <xsl:attribute name="class">
  556. <xsl:text/>inactiveText<xsl:text/>
  557. </xsl:attribute>
  558. </xsl:if>
  559. <xsl:value-of select="xtsext:enforceBTD($containerNam, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  560. <xsl:text> (</xsl:text>
  561. <xsl:value-of select="key('object-class', cm:objectClass)"/>
  562. <xsl:text>)</xsl:text>
  563. <xsl:text/>
  564. </utml:option>
  565. </xsl:if>
  566. </xsl:for-each>
  567. </cf:initContent>
  568. </cf:sortList>
  569. </dp:text>
  570. </dp:section>
  571. </dp:list>
  572. </dp:section>
  573. </dp:list>
  574. </lyt:section>
  575. </lyt:layout>
  576. <lyt:layout style="1" border="yes" title="IDS_SORT_ENTRIES" lyt:kbA11y="true" id="IDS_SORT_ENTRIES">
  577. <lyt:section>
  578. <dp:list role="presentation">
  579. <dp:section dp:kbA11y="true">
  580. <dp:list title="IDS_SORT_REST" for="entriesDefaultOrder_ID" valign="top" role="presentation" parentTitle="IDS_SORT_ENTRIES">
  581. <dp:section width="40%" dp:kbA11y="true">
  582. <dp:text>
  583. <cf:sortList class="sortSelectContent" name="entriesDefaultOrder" id="entriesDefaultOrder_ID" form="pform" array="entriesDefaultList" size="15" action="none">
  584. <cf:initContent>
  585. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'F']/@class = cm:objectClass]">
  586. <xsl:if test="cm:displaySequence=0">
  587. <xsl:variable name="entryNam">
  588. <xsl:choose>
  589. <xsl:when test="string-length(string(cm:defaultName)) > 61">
  590. <xsl:value-of select="concat(substring(string(cm:defaultName),0,60),'...')"/>
  591. </xsl:when>
  592. <xsl:otherwise>
  593. <xsl:value-of select="cm:defaultName"/>
  594. </xsl:otherwise>
  595. </xsl:choose>
  596. </xsl:variable>
  597. <xsl:variable name="entryNamDisplay">
  598. <xsl:value-of select="xtsext:enforceBTD($entryNam, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  599. </xsl:variable>
  600. <xsl:variable name="launchableType" select="cm:launchableType"/>
  601. <utml:option>
  602. <xsl:attribute name="value"><xsl:value-of select="(position() - number($entriesOptCnt) -1)"/></xsl:attribute>
  603. <xsl:if test="string(cm:hidden)='true'">
  604. <xsl:attribute name="class">
  605. <xsl:text/>inactiveText<xsl:text/>
  606. </xsl:attribute>
  607. </xsl:if>
  608. <xsl:value-of select="$entryNamDisplay"/>&#160;(<xsl:value-of select="key('object-class', cm:objectClass)[@launchableType=$launchableType or not($launchableType)]"/>)<xsl:text/>
  609. </utml:option>
  610. </xsl:if>
  611. </xsl:for-each>
  612. </cf:initContent>
  613. </cf:sortList>
  614. </dp:text>
  615. </dp:section>
  616. </dp:list>
  617. <dp:list role="presentation">
  618. <dp:section width="10%" dp:kbA11y="true">
  619. <dp:columnButtonGroup align="center" width="40" label="IDS_SORT_REST" parentLabel="IDS_SORT_ENTRIES">
  620. <dp:columnButton>
  621. <a href="javascript:processEntries('ones', 'opt', document.pform.entriesSortOrder, document.pform.entriesDefaultOrder)">
  622. <img height="18" width="18" border="0" class="flippingImages">
  623. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_right.gif<xsl:text/></xsl:attribute>
  624. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_ADD"/></xsl:attribute>
  625. </img>
  626. </a>
  627. </dp:columnButton>
  628. <dp:columnButton>
  629. <a href="javascript:processEntries('ones', 'def', document.pform.entriesDefaultOrder, document.pform.entriesSortOrder)">
  630. <img height="18" width="18" border="0" class="flippingImages">
  631. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_left.gif<xsl:text/></xsl:attribute>
  632. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_REMOVE"/></xsl:attribute>
  633. </img>
  634. </a>
  635. </dp:columnButton>
  636. <dp:columnButton>
  637. <a href="javascript:processEntries('all','opt',document.pform.entriesSortOrder, document.pform.entriesDefaultOrder)">
  638. <img height="18" width="18" border="0" class="flippingImages">
  639. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_all_right.gif<xsl:text/></xsl:attribute>
  640. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_ADD_ALL"/></xsl:attribute>
  641. </img>
  642. </a>
  643. </dp:columnButton>
  644. <dp:columnButton>
  645. <a href="javascript:processEntries('all','def',document.pform.entriesDefaultOrder, document.pform.entriesSortOrder)">
  646. <img height="18" width="18" border="0" class="flippingImages">
  647. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_all_left.gif<xsl:text/></xsl:attribute>
  648. <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_REMOVE_ALL"/></xsl:attribute>
  649. </img>
  650. </a>
  651. </dp:columnButton>
  652. </dp:columnButtonGroup>
  653. </dp:section>
  654. </dp:list>
  655. <dp:list title="IDS_SORT_SHOWN_FIRST" for="entriesSortOrder_ID" valign="top" role="presentation" parentTitle="IDS_SORT_ENTRIES" >
  656. <dp:section width="40%" dp:kbA11y="true">
  657. <dp:text>
  658. <cf:sortList class="sortSelectContent" name="entriesSortOrder" id="entriesSortOrder_ID" form="pform" array="entriesOptionList" size="15" tLabel="IDS_SORT_SHOWN_FIRST_IDS_SORT_FOLDERS" parentLabel="IDS_SORT_FOLDERS">
  659. <cf:initContent>
  660. <xsl:for-each select="cm:queryResponse/cm:queryReply[2]/*[key('system-param', 'ui_objects')/object[@container = 'F']/@class = cm:objectClass]">
  661. <xsl:if test="cm:displaySequence!=0">
  662. <xsl:variable name="entryNam">
  663. <xsl:choose>
  664. <xsl:when test="string-length(string(cm:defaultName)) > 81">
  665. <xsl:value-of select="concat(substring(string(cm:defaultName),0,80),'...')"/>
  666. </xsl:when>
  667. <xsl:otherwise>
  668. <xsl:value-of select="cm:defaultName"/>
  669. </xsl:otherwise>
  670. </xsl:choose>
  671. </xsl:variable>
  672. <xsl:variable name="entryNamDisplay">
  673. <xsl:value-of select="xtsext:enforceBTD($entryNam, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  674. </xsl:variable>
  675. <xsl:variable name="launchableType" select="cm:launchableType"/>
  676. <utml:option>
  677. <xsl:attribute name="value"><xsl:value-of select="(position() - 1)"/></xsl:attribute>
  678. <xsl:if test="string(cm:hidden)='true'">
  679. <xsl:attribute name="class">
  680. <xsl:text/>inactiveText<xsl:text/>
  681. </xsl:attribute>
  682. </xsl:if>
  683. <xsl:value-of select="$entryNamDisplay"/>&#160;(<xsl:value-of select="key('object-class', cm:objectClass)[@launchableType=$launchableType or not($launchableType)]"/>)<xsl:text/>
  684. </utml:option>
  685. </xsl:if>
  686. </xsl:for-each>
  687. </cf:initContent>
  688. </cf:sortList>
  689. </dp:text>
  690. </dp:section>
  691. </dp:list>
  692. </dp:section>
  693. </dp:list>
  694. </lyt:section>
  695. </lyt:layout>
  696. <dp:footer>
  697. <df:button df:id="IDS_OK" utml:validate="false" df:style="submit" onclick="javascript:setValues()"/>
  698. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  699. </dp:footer>
  700. </utml:form>
  701. </dp:page>
  702. </xsl:template>
  703. </xsl:stylesheet>
  704. </xts:block>
  705. <!--
  706. ===============================================================================================
  707. debug - display debug information
  708. ===============================================================================================
  709. -->
  710. <xts:block id="debug" dependency="format" condition=".[/root/session/param[@name='debug'] = '1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  711. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  712. <!-- debug logic sheet -->
  713. <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">
  714. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  715. <dbg:templates/>
  716. <!-- add any debug templates -->
  717. <xsl:template match="/">
  718. <dbg:dumpxml select="/root"/>
  719. </xsl:template>
  720. </xsl:stylesheet>
  721. </xts:block>
  722. </xts:morphlet>