render-task.xslt 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: HTS
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:hts="http://developer.cognos.com/myinbox/common/hts_ui" exclude-result-prefixes="xts xtsext hts">
  9. <xsl:import href="../../common/set-priority.xslt"/>
  10. <xsl:import href="../../common/json-converter.xslt"/>
  11. <xsl:import href="../../common/task-info.xslt"/>
  12. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
  13. <xsl:template match="/">
  14. <xsl:apply-templates select="/" mode="common"/>
  15. <hts:script language="javascript">
  16. dojo.require("dijit.layout.ContentPane");
  17. _THIS_.addEventListener("fragment.load", "_THIS_init");
  18. _THIS_.addEventListener("fragment.retrieve.after", "_THIS_retrieveAfter");
  19. // enable logging?
  20. _F_config.enableLog = false;
  21. function _THIS_init(evt) {
  22. //write the task description
  23. _THIS_renderDescription();
  24. }
  25. function _THIS_renderDescription() {
  26. var description = '<xsl:value-of select="xtsext:javascriptencode(/root/input[@name='dep']/queryResponse/*[local-name()='presentationDescription']/*[local-name()='description'])"/>';
  27. if (description) {
  28. dojo.addOnLoad(function() {
  29. if (dijit.byId("_THIS_task_email_container")) {
  30. //if it there detroy it. Should really update, but for some reason
  31. //dijit.byId("_THIS_task_email_container").attr('content', 'test')
  32. //does not work.
  33. dijit.byId("_THIS_task_email_container").destroy();
  34. }
  35. new dijit.layout.ContentPane({content: description},"_THIS_task_email_container");
  36. });
  37. }
  38. }
  39. function _THIS_retrieveAfter(evt) {
  40. if (evt.target.id == "_THIS_") {
  41. //get the selected task, JSONify it and raise the event
  42. _THIS_raiseTaskInfo();
  43. }
  44. }
  45. </hts:script>
  46. <xsl:call-template name="Display_Single_Task">
  47. <xsl:with-param name="tasks" select="/root/input[@name='dep']/queryResponse/*[local-name()='getTaskInfoResponse']/*"/>
  48. <xsl:with-param name="desc" select="/root/input[@name='dep']/queryResponse/*[local-name()='presentationDescription']"/>
  49. </xsl:call-template>
  50. </xsl:template>
  51. <xsl:template name="Display_Single_Task">
  52. <xsl:param name="tasks"/>
  53. <xsl:param name="desc"/>
  54. <!-- should only be one for now -->
  55. <xsl:for-each select="$tasks">
  56. <xsl:variable name="ttype" select="*[local-name()='taskType']"/>
  57. <xsl:variable name="priority_tooltip">
  58. <xts:string id="IDS_FRAG_TASKVIEWER_TOOLTIP_EDIT_PRIORITY"/>
  59. </xsl:variable>
  60. <xsl:variable name="showAdvancedPropertiesTooltip">
  61. <xts:string id="IDS_FRAG_TASKVIEWER_TOOLTIP_SHOW_ADVANCED_PROPERTIES"/>
  62. </xsl:variable>
  63. <xsl:variable name="hideAdvancedPropertiesTooltip">
  64. <xts:string id="IDS_FRAG_TASKVIEWER_TOOLTIP_HIDE_ADVANCED_PROPERTIES"/>
  65. </xsl:variable>
  66. <xsl:variable name="showAdvancedPropertiesButtonAltMessage">
  67. <xts:string id="IDS_FRAG_TASKVIEWER_SHOW_ADVANCED_PROPERTIES_BUTTON_ALT"/>
  68. </xsl:variable>
  69. <xsl:variable name="hideAdvancedPropertiesButtonAltMessage">
  70. <xts:string id="IDS_FRAG_TASKVIEWER_HIDE_ADVANCED_PROPERTIES_BUTTON_ALT"/>
  71. </xsl:variable>
  72. <hts:section format="select-dialog" style="width:100%">
  73. <hts:rowset width="100%">
  74. <hts:row>
  75. <hts:action>
  76. <hts:div id="_THIS_task_email_container" dojoType="dijit.layout.ContentPane" style="width:100%;height:100%;overflow-y:auto"></hts:div>
  77. </hts:action>
  78. </hts:row>
  79. </hts:rowset>
  80. </hts:section>
  81. </xsl:for-each>
  82. </xsl:template>
  83. </xsl:stylesheet>