pre_load_agent.xts 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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, 2015
  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/AGS.xml,messages/portal.xml" includeConfig="true" requiredCapability="canUseEventStudio">
  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"/>
  15. <!--
  16. ===============================================================================================
  17. Render the HTML page
  18. ===============================================================================================
  19. -->
  20. <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init">
  21. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  22. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  23. <xsl:template match="/">
  24. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
  25. <html>
  26. <head>
  27. <script type="text/javascript">
  28. function init()
  29. {
  30. var agent_name = "<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='selected_path']))"/>";
  31. if (agent_name.length > 0) {
  32. var cf = parent.getConfigFrame();
  33. // set the message frame in the original - this will give us a clean sheet and we can get the load to clear up other things too
  34. cf.messageFrame_Params['m'] = '/ags/load_agent.xts';
  35. cf.messageFrame_Params['m_path'] = agent_name;
  36. cf.messageFrame_Params['ui.routingServerGroup'] = cf.UI_ROUTING_SERVER_GROUP;
  37. cf.messageFrame_Params['cafcontextid'] = cf.cafContextId;
  38. // also have to make the URL for the metadata IFrame load
  39. cf.metadataFrame_Params['m'] = '/ags/init_model.xts';
  40. cf.metadataFrame_Params['ui.object'] = agent_name;
  41. cf.metadataFrame_Params['ui.action'] = 'edit';
  42. cf.metadataFrame_Params['cafcontextid'] = cf.cafContextId;
  43. // load both message and metadata frames up
  44. cf.getCommandStackManager().getCommandStack().clear();
  45. cf.getCommandStackManager().getCommandStack().push("reloadFunctionsTree()");
  46. cf.getCommandStackManager().getCommandStack().push("reloadMetadataTree()");
  47. cf.getCommandStackManager().getCommandStack().push("loadMessageFrame()");
  48. cf.getCommandStackManager().getCommandStack().push("loadMetadataFrame()");
  49. // want to do these actions
  50. cf.getCommandStackManager().processCommandStack();
  51. }
  52. // nothing more to do here
  53. parent.showDialogFrame(0);
  54. }
  55. </script>
  56. </head>
  57. <!-- just do the redirect -->
  58. <body onload="init();">
  59. </body>
  60. </html>
  61. </xsl:template>
  62. </xsl:stylesheet>
  63. </xts:block>
  64. <!-- Debug -->
  65. <!-- ============================================================================= -->
  66. <xts:block id="debug" condition=".[ /root/session/param[@name='debug'] = '1' ]" dependency="renderPage" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  67. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  68. <!-- debug logic sheet -->
  69. <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">
  70. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  71. <xsl:template match="/">
  72. <dbg:dumpxml select="/root"/>
  73. </xsl:template>
  74. </xsl:stylesheet>
  75. </xts:block>
  76. </xts:morphlet>