seq_agent_tasks.xts 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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, 2017
  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/AGS.xml,messages/portalRL.xml" requiredCapability="canUseEventStudio">
  9. <!--
  10. ================================================================================
  11. decode the agent items
  12. ===============================================================================================
  13. -->
  14. <xts:block id="decode_agent_definition" processor="XSLT" type="exec" nodelist="env">
  15. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
  16. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  17. <xsl:template match="/">
  18. <xts:sequence>
  19. <xsl:if test="/root/env/param[@name = 'agent_definition_blob']">
  20. <xts:append select="/root">
  21. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_seqagenttasks001',string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
  22. </xts:append>
  23. </xsl:if>
  24. </xts:sequence>
  25. </xsl:template>
  26. </xsl:stylesheet>
  27. </xts:block>
  28. <!--
  29. =================================================================================================
  30. createDefaultSequencingValue - If the SeqTasks parameter does not exist then create it with the default value from the agent definition
  31. =================================================================================================
  32. -->
  33. <xts:block id="createDefaultSequencingValue" dependency="decode_agent_definition" processor="XSLT" type="exec" nodelist="env,agent_definition" condition=".[not (/root/env/param[@name='SeqTasks']) or /root/env/param[@name='SeqTasks']='']" mandatory="false">
  34. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
  35. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  36. <xsl:template match="/">
  37. <xts:sequence>
  38. <xts:append select="/root/env">
  39. <param name="SeqTasks">
  40. <xsl:value-of select="/root/agent_definition/sequencing"/>
  41. </param>
  42. </xts:append>
  43. </xts:sequence>
  44. </xsl:template>
  45. </xsl:stylesheet>
  46. </xts:block>
  47. <!--
  48. ==============================================================================================
  49. render_page
  50. Render the HTML page
  51. ===============================================================================================
  52. -->
  53. <xts:block id="render_page" dependency="createDefaultSequencingValue" mode="output" processor="XSLT" type="exec" mimeType="text/html" nodelist="system,env,session,user,actions,tabs,configProps,http,credential,cookies,setCookies,agent_definition">
  54. <!-- portal specific information -->
  55. <xts:logicsheet path="logicsheets/portal.xsl"/>
  56. <!-- Get the new theme framework. -->
  57. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  58. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  59. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  60. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  61. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  62. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  63. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  64. <!-- apply the form logic -->
  65. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  66. <!-- Prevent the href from appearing in the status bar. -->
  67. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  68. <xsl:stylesheet version="1.0"
  69. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  70. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  71. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  72. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  73. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  74. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  75. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  76. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  77. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  78. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  79. exclude-result-prefixes="ut pf lyt dp df utml xtsext xts">
  80. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  81. <!-- add any theme variables -->
  82. <pf:variables/>
  83. <!-- start the output -->
  84. <xsl:template match="root">
  85. <xsl:variable name="script_name">
  86. <xsl:value-of select="/root/http/param[@name='SCRIPT_NAME']"/>
  87. </xsl:variable>
  88. <!-- Page and title -->
  89. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page>
  90. <!-- specify the style sheet(used to render the active/inactive hint text)
  91. todo move this into its own xslt file. Do not put it into the dp stuff because that is relevant to the whole portal
  92. -->
  93. <link href="{$skin_root}/ags/ags.css" type="text/css" rel="stylesheet"/>
  94. <dp:meta/>
  95. <utml:form name="pform" method="post" action="{$gateway}">
  96. <utml:input type="hidden" name="hid" id="hid" utml:update="false" value="ug_cr_as_ag_spfy_ordr"/>
  97. <utml:input type="hidden" name="item2move" utml:update="true" id="item2move"/>
  98. <dp:header>
  99. <dp:title>
  100. <!--xsl:value-of select="$dialogTitle"/-->
  101. <xts:string id="DIALOG_TASK_SEQ_TITLE"/>
  102. </dp:title>
  103. <dp:description>
  104. <xts:string id="DIALOG_TASK_SEQ_DESC"/>
  105. </dp:description>
  106. <dp:close>
  107. <a href="#" onclick="doCancel(event);"><dp:closeMarker/></a>
  108. </dp:close>
  109. </dp:header>
  110. <lyt:layout style="1">
  111. <lyt:section>
  112. <dp:list>
  113. <dp:section>
  114. <dp:label>
  115. <xts:string id="DIALOG_SEQ_TASK_LABEL"/>
  116. </dp:label>
  117. </dp:section>
  118. <dp:section>
  119. <dp:description>
  120. <xts:string id="DIALOG_SEQ_TASK_DESC"/>
  121. </dp:description>
  122. </dp:section>
  123. <dp:section>
  124. <utml:radio-group name="SeqTasks">
  125. <utml:default-value>
  126. <xsl:text>AllAtOnce</xsl:text>
  127. </utml:default-value>
  128. <dp:list>
  129. <!-- values for the radio boxes are the values in CM - for sequencing tasks. Can put them
  130. in directly -->
  131. <dp:section>
  132. <utml:input type="radio" name="SeqTasks" value="parallel" onClick="onSequenceChange()"/>
  133. <xts:string id="ALL_AT_ONCE_LABEL"/>
  134. </dp:section>
  135. <dp:section>
  136. <utml:input type="radio" name="SeqTasks" value="sequential" onClick="onSequenceChange()"/>
  137. <xts:string id="IN_SEQUENCE_LABEL"/>
  138. </dp:section>
  139. </dp:list>
  140. </utml:radio-group>
  141. </dp:section>
  142. </dp:list>
  143. </lyt:section>
  144. </lyt:layout>
  145. <lyt:layout style="1">
  146. <lyt:section>
  147. <dp:textarea>
  148. <dp:section1>
  149. <xts:string id="DIALOG_TASK_LABEL"/>
  150. </dp:section1>
  151. <dp:section2>
  152. <div id="item2moveDiv" style="width:550px;height:120px;border:2;border-style: inset; overflow:auto; "/>
  153. <!--
  154. <utml:select size="8" style="width:350" name="item2move">
  155. <utml:default-value>
  156. <xsl:text>none</xsl:text>
  157. </utml:default-value>
  158. <xsl:for-each select="/root/agent_definition/items/item">
  159. <utml:option>
  160. <xsl:call-template name="setText">
  161. <xsl:with-param name="theText">
  162. <xsl:value-of select="./name"/>
  163. </xsl:with-param>
  164. </xsl:call-template>
  165. <utml:value>
  166. <xsl:value-of select="./id"/>
  167. </utml:value>
  168. </utml:option>
  169. </xsl:for-each>
  170. </utml:select>
  171. -->
  172. </dp:section2>
  173. <dp:section3>
  174. <dp:actions>
  175. <dp:action>
  176. <a href="#" onclick="onReorder('move_up');"><xts:string id="MOVE_UP_LABEL"/></a>
  177. </dp:action>
  178. <dp:action>
  179. <a href="#" onclick="onReorder('move_down');"><xts:string id="MOVE_DOWN_LABEL"/></a>
  180. </dp:action>
  181. <dp:action>
  182. <a href="#" onclick="onReorder('move_way_up');"><xts:string id="TO_TOP_LABEL"/></a>
  183. </dp:action>
  184. <dp:action>
  185. <a href="#" onclick="onReorder('move_way_down');"><xts:string id="TO_BOT_LABEL"/></a>
  186. </dp:action>
  187. </dp:actions>
  188. </dp:section3>
  189. </dp:textarea>
  190. </lyt:section>
  191. </lyt:layout>
  192. <cf:dynamicDiv name="enabledApply" visible="true" initialize="false">
  193. <dp:footer>
  194. <df:button df:id="IDS_OK" utml:validate="true" df:style="href" df:href="#" onclick="doOk();"/>
  195. <df:button df:id="IDS_CANCEL" df:style="href" df:href="#" onclick="doCancel(event);"/>
  196. <df:button df:id="IDS_APPLY" df:style="href" df:href="#" onclick="doApply();"/>
  197. </dp:footer>
  198. </cf:dynamicDiv>
  199. <cf:dynamicDiv name="disabledApply" visible="false" initialize="false">
  200. <dp:footer>
  201. <df:button df:id="IDS_OK" utml:validate="true" df:style="href" df:href="#" onclick="doOk();"/>
  202. <df:button df:id="IDS_CANCEL" df:style="href" df:href="#" onclick="doCancel(event);"/>
  203. <dp:button state="inactive"><dp:buttonText><xts:string id="IDS_APPLY"/></dp:buttonText></dp:button>
  204. </dp:footer>
  205. </cf:dynamicDiv>
  206. <cf:dynamicDiv name="disableAll" visible="false" initialize="false">
  207. <dp:footer>
  208. <dp:button state="inactive"><dp:buttonText><xts:string id="IDS_OK"/></dp:buttonText></dp:button>
  209. <dp:button state="inactive"><dp:buttonText><xts:string id="IDS_CANCEL"/></dp:buttonText></dp:button>
  210. <dp:button state="inactive"><dp:buttonText><xts:string id="IDS_APPLY"/></dp:buttonText></dp:button>
  211. </dp:footer>
  212. </cf:dynamicDiv>
  213. </utml:form>
  214. <script type="text/javascript" src="../common/framework/ui/CUIStyle.js">//</script>
  215. <script type="text/javascript" src="../ags/CList.js"/>
  216. <dp:script>
  217. <pf:help context="ug_cr_as_ag_spfy_ordr" eventStudio="true"/>
  218. <script type="text/javascript" src="../ags/help.js"/>
  219. <script type="text/javascript">
  220. var cf = parent.cf;
  221. var m_sAction = null;
  222. var clistTask;
  223. function init() {
  224. disableApplyButton();
  225. cf.showDialogFrame('100%');
  226. var uiStyle = new CUIStyle("SelValCList_li", "SelValCList_over", "SelValCList_selected", "", null);
  227. clistTask = new CList("myCListLeft",false, "CList_ul",uiStyle);
  228. var divTask = document.getElementById('item2moveDiv');
  229. divTask.className = "CList_hintText_inactive";
  230. // add the clistLeft on the page
  231. divTask.appendChild(clistTask.getListElement());
  232. // get rid of the previous contents of the select
  233. clistTask.removeAllNodes();
  234. var use_list = new Array(<xsl:value-of select="count(/root/agent_definition/items/item)"/>) ;
  235. var disp_list = new Array(<xsl:value-of select="count(/root/agent_definition/items/item)"/>) ;
  236. <xsl:for-each select="/root/agent_definition/items/item">
  237. use_list[<xsl:value-of select = "position()"/>-1] = '<xsl:value-of select="./id"/>' ;
  238. <xsl:variable name="taskDispName">
  239. <xsl:call-template name="setText">
  240. <xsl:with-param name="theText">
  241. <xsl:value-of select="./name"/>
  242. </xsl:with-param>
  243. </xsl:call-template>
  244. </xsl:variable>
  245. disp_list[<xsl:value-of select = "position()"/>-1] = '<xsl:value-of select="xtsext:javascriptencode(string($taskDispName))"/>' ;
  246. </xsl:for-each>
  247. for(var k = use_list.length-1; k&gt;=0; k-- ) {
  248. var node1 = document.createElement("div");
  249. // set some stuff into it - the value that we're going to see
  250. node1.setAttribute('useValue', use_list[k] );
  251. var dispVal = document.createTextNode( disp_list[k] );
  252. node1.appendChild( dispVal );
  253. // add it to the selection
  254. clistTask.add(node1);
  255. }
  256. }
  257. function someThingGood() {
  258. var msgFrame = cf.getMessageIFrame();
  259. var doc = cf.getFrameDocument(msgFrame);
  260. var dialogFrame = cf.getDialogFrame();
  261. var dialogFrameDoc = cf.getFrameDocument(dialogFrame);
  262. var holder = new Object();
  263. //set the task sequence value, which will be parallel or sequence, this value is taken from the
  264. //dialog frame
  265. for (i=0;i &lt; dialogFrameDoc.pform.SeqTasks.length;i++) {
  266. if (dialogFrameDoc.pform.SeqTasks[i].checked) {
  267. holder['SeqTasks'] = dialogFrameDoc.pform.SeqTasks[i].value;
  268. }
  269. }
  270. holder['item2move'] = buildItemXML();
  271. holder['tabSelectedID'] = doc.getElementById('tabSelectedID').value;
  272. holder['prevTabID'] = doc.getElementById('prevTabID').value;
  273. holder['itemSelected'] = doc.getElementById('itemSelected').value;
  274. holder['itemNewLocation'] = doc.getElementById("itemNewLocation").value;
  275. holder['agent_definition_blob'] = '<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='agent_definition_blob']))"/>';
  276. holder['m'] = "/ags/summaryBarUpdate.xts";
  277. // force a SOAP fault for a passport expire - rather than a logon page.
  278. holder['forceSOAPFault']='false';
  279. var dispatcher = new cf.XHTTPDispatcher(updateSummaryBar, holder);
  280. cf.applicationActionManager.httpStart();
  281. try {
  282. setDialogFrameCursor('wait');
  283. dispatcher.dispatch();
  284. }catch(ex){
  285. cf.applicationActionManager.httpStop();
  286. setDialogFrameCursor('default');
  287. }
  288. }
  289. function updateSummaryBar(responseArray)
  290. {
  291. try {
  292. var responseXML = responseArray[0];
  293. var responseText = responseArray[1];
  294. cf.applicationActionManager.httpStop();
  295. var markupNode = responseXML.getElementsByTagName("markup");
  296. var markup = parent.getTextNodeValue(markupNode[0]);
  297. //IE needs responseText, so it needs to be passed in
  298. var parsedResponse = cf.parseResponse(responseXML, responseText);
  299. // decide what we're going to do
  300. if (parsedResponse.isLogonFault()) {
  301. cf.doPassportExpire(responseXML.childNodes[1],resendUpdateRequest,parsedResponse);
  302. //probably should not proceed to hideDialogFrame
  303. return;
  304. } else if (parsedResponse.isSoapFault()) {
  305. // we have a fault which is a genuine fault fault
  306. cf.doSOAPFault(responseXML.childNodes[1],null,parsedResponse);
  307. //probably should not proceed to hideDialogFrame
  308. return;
  309. } else if (markup &amp;&amp; markup != '') {
  310. // do the HTML injection - should be interesting
  311. updateSummaryBarHTML(markup);
  312. var blobbyNode = responseXML.getElementsByTagName("blobby");
  313. updateAgentDefinition(blobbyNode);
  314. } else {
  315. // send the alert
  316. //maybe should do something here...
  317. //do not hide. This will at least stop you from navigating
  318. //back to dialogAdapter rather than slipping undetected.
  319. return;
  320. }
  321. if (m_sAction == 'ok') {
  322. cf.getConfigFrame().hideDialogFrame();
  323. }
  324. //update the agent changed state
  325. if (m_sAction == 'ok' || m_sAction == 'apply') {
  326. cf.agentHasChanged(true);
  327. }
  328. }
  329. finally {
  330. setDialogFrameCursor('default');
  331. }
  332. }
  333. function resendUpdateRequest() {
  334. cf.getCommandStackManager().getCommandStack().push("getDialogFrame().someThingGood()");
  335. }
  336. function updateSummaryBarHTML(markup)
  337. {
  338. // do the HTML injection - should be interesting
  339. var messageIFrame = cf.getMessageIFrame();
  340. var messageIFrame_doc = cf.getFrameDocument(messageIFrame);
  341. // get the insertion location - and inject the HTML
  342. var summaryBarDiv = messageIFrame_doc.getElementById("d1");
  343. // markup is html from agent structure
  344. summaryBarDiv.innerHTML= markup ;
  345. messageIFrame.initSummaryMenu();
  346. }
  347. function doSubmit()
  348. {
  349. document.pform.submit();
  350. }
  351. function buildItemXML() {
  352. var xml="&lt;items&gt;";
  353. var itemsList = clistTask.getAllItems();
  354. for (var i=0;i&lt;itemsList.length;i++) {
  355. var item = itemsList[i];
  356. var taskId = item.getAttribute('useValue') ;
  357. xml+="&lt;item id=&apos;"+taskId+"&apos;/&gt;";
  358. }
  359. xml +="&lt;/items&gt;";
  360. return xml;
  361. }
  362. function addItems(selectElemRef){
  363. // loop over all the selected items
  364. for (var i=selectElemRef.length-1; i &gt;-1 ; i--) {
  365. // move item i from select to selected
  366. if(!clistRight.containsItem(selectElemRef[i])) {
  367. var node1 = document.createElement("div");
  368. node1.setAttribute('useValue', selectElemRef[i].getAttribute('useValue') );
  369. var dispVal = document.createTextNode(selectElemRef[i].firstChild.nodeValue);
  370. node1.appendChild(dispVal);
  371. clistRight.add(node1);
  372. }
  373. }
  374. }
  375. function process(sAction) {
  376. someThingGood();
  377. //Save the action we are performing
  378. m_sAction = sAction;
  379. }
  380. function doOk()
  381. {
  382. if (document.getElementById('disabledApply').style.display=='none') {
  383. process('ok');
  384. }
  385. //hide the frame if the current settings have already been applied
  386. else {
  387. cf.getConfigFrame().hideDialogFrame();
  388. }
  389. }
  390. function doApply()
  391. {
  392. disableAllButton();
  393. process('apply');
  394. }
  395. function doCancel(evt)
  396. {
  397. cf.hideDialogFrame();
  398. }
  399. function disableAllButton()
  400. {
  401. showDynamicDiv('disableAll');
  402. hideDynamicDiv('disabledApply');
  403. hideDynamicDiv('enabledApply');
  404. }
  405. function enableAllButton()
  406. {
  407. hideDynamicDiv('disableAll');
  408. //The enableAll would be called after Apply or ok.
  409. //in either case we would need to reset to a disabled
  410. //apply button.
  411. disableApplyButton();
  412. }
  413. function enableApplyButton()
  414. {
  415. showDynamicDiv('enabledApply');
  416. hideDynamicDiv('disabledApply');
  417. hideDynamicDiv('disableAll');
  418. }
  419. function disableApplyButton()
  420. {
  421. showDynamicDiv('disabledApply');
  422. hideDynamicDiv('enabledApply');
  423. }
  424. function updateBlobValue(blobValue)
  425. {
  426. var msgFrame = cf.getMessageIFrame();
  427. if (msgFrame != null) {
  428. var msgFrameDoc = cf.getFrameDocument(msgFrame);
  429. var elmnt = cf.agsFormUtils.getElementFromFrame(msgFrame, "agent_definition_blob");
  430. if (elmnt == null || elmnt == undefined) {
  431. elmnt = cf.createHiddenInput(msgFrameDoc, "agent_definition_blob", "");
  432. msgFrameDoc.pform.appendChild(elmnt);
  433. }
  434. elmnt.value = blobValue;
  435. }
  436. }
  437. function updateAgentDefinition(blobby) {
  438. //no blobby found
  439. if (blobby != undefined &amp;&amp; blobby != null) {
  440. //var msgFrame = cf.getMessageIFrame();
  441. var blob = parent.getTextNodeValue(blobby[0]);
  442. //blobby does not contain anything
  443. if (blob &amp;&amp; blob != '') {
  444. updateBlobValue(blob);
  445. }
  446. }
  447. }
  448. function setDialogFrameCursor(cursorStyle) {
  449. var dialogFrame = cf.getDialogFrame();
  450. var dialogFrameDoc = cf.getFrameDocument(dialogFrame);
  451. if (dialogFrameDoc &amp;&amp; dialogFrameDoc != null &amp;&amp; dialogFrameDoc != undefined) {
  452. dialogFrameDoc.body.style.cursor = cursorStyle;
  453. }
  454. //disable the links
  455. var objLinks = dialogFrameDoc.links;
  456. if (cursorStyle=='wait') {
  457. disableAllButton();
  458. } else {
  459. enableAllButton();
  460. }
  461. //do not modify the Ok, cancel and apply, this is because
  462. //in FF at least if you modify the anchor you clicked on
  463. //It seems to redirect the page to cognoe connection.
  464. //I did not investigate further though, but eliminated the
  465. //need to modify the anchor contents.
  466. var regEx = new RegExp("[IDS_APPLY|IDS_CANCEL|IDS_OK]","gim");
  467. var objLinks = dialogFrameDoc.links;
  468. for(i=0;i&lt;objLinks.length;i++) {
  469. var id = objLinks[i].id;
  470. if (!regEx.test(new String(id))) {
  471. disableLink(objLinks[i],cursorStyle=='wait');
  472. }
  473. }
  474. //disable the form inputs
  475. var ele = dialogFrameDoc.pform.elements
  476. for(j=0;j&lt;ele.length;j++){
  477. ele[j].disabled = cursorStyle=='wait';
  478. }
  479. }
  480. function disableLink(anchor, flag){
  481. if(flag){
  482. var href = anchor.getAttribute('href');
  483. if(href &amp;&amp; href != "") {
  484. anchor.setAttribute('ohref', href);
  485. anchor.setAttribute('href',"javascript:void(0);");
  486. if (href.indexOf("help") == -1) {
  487. anchor.style.color='#ACA899';
  488. }
  489. }
  490. var click = anchor.getAttribute('onclick');
  491. if(click &amp;&amp; click != "") {
  492. anchor.setAttribute('oonclick', click);
  493. anchor.setAttribute('onclick',"return false");
  494. }
  495. } else {
  496. var href = anchor.getAttribute('ohref');
  497. if(href &amp;&amp; href != "") {
  498. anchor.setAttribute('href', href);
  499. anchor.removeAttribute('ohref');
  500. if (href.indexOf("help") == -1) {
  501. anchor.style.color='blue';
  502. }
  503. }
  504. var click = anchor.getAttribute('oonclick');
  505. if(click &amp;&amp; click != "") {
  506. anchor.setAttribute('onclick', click);
  507. anchor.removeAttribute('oonclick');
  508. }
  509. }
  510. }
  511. function onSequenceChange() {
  512. enableApplyButton();
  513. }
  514. function onReorder(operation) {
  515. var msgFrame = cf.getMessageIFrame();
  516. var selItemsList = clistTask.getSelectedNodes();
  517. if (selItemsList.length>0) {
  518. var selItem = selItemsList[selItemsList.length-1];
  519. var selItemId = selItem.getAttribute('id') ;
  520. var index = clistTask.indexById(selItemId);
  521. var lastIndex = clistTask.size()-1;
  522. //is the node already at the top of the list?
  523. if (operation=='move_up' &amp;&amp; index &gt; 0) {
  524. clistTask.up(selItemId);
  525. enableApplyButton();
  526. }
  527. //is the node already at the bottom of the list?
  528. else if (operation=='move_down' &amp;&amp; index &lt; lastIndex) {
  529. clistTask.down(selItemId);
  530. enableApplyButton();
  531. }
  532. //is the node already at the top of the list?
  533. else if (operation=='move_way_up' &amp;&amp; index &gt; 0) {
  534. clistTask.toTop(selItemId);
  535. enableApplyButton();
  536. }
  537. //is the node already at the bottom of the list?
  538. else if (operation=='move_way_down' &amp;&amp; index &lt; lastIndex) {
  539. clistTask.toBottom(selItemId);
  540. enableApplyButton();
  541. }
  542. }
  543. }
  544. </script>
  545. </dp:script>
  546. </dp:page>
  547. </xsl:template>
  548. <!-- taken from summarybar xslt -->
  549. <xsl:template name="setText">
  550. <xsl:param name="theText"/>
  551. <xsl:choose>
  552. <xsl:when test="$theText=''"><xts:string id="AGENT_SUMMARY_NONE"/></xsl:when>
  553. <xsl:otherwise>
  554. <xsl:value-of select="$theText"/>
  555. </xsl:otherwise>
  556. </xsl:choose>
  557. </xsl:template>
  558. </xsl:stylesheet>
  559. </xts:block>
  560. <!--
  561. ================================================================================
  562. debug
  563. ================================================================================
  564. -->
  565. <xts:block id="debug" type="exec" mode="output" processor="XSLT" condition=".[/root/session/param[@name = 'debug'] = '1']" mandatory="false" mimeType="text/html" dependency="render_page">
  566. <!-- Get the debug logic sheet -->
  567. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  568. <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">
  569. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  570. <xsl:template match="/">
  571. <dbg:dumpxml select="/root"/>
  572. </xsl:template>
  573. </xsl:stylesheet>
  574. </xts:block>
  575. </xts:morphlet>