123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: HTS
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <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">
- <xsl:import href="../../common/set-priority.xslt"/>
- <xsl:import href="../../common/json-converter.xslt"/>
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="/">
- <xsl:apply-templates select="/" mode="common"/>
- <script language="javascript">
- dojo.require("dijit.layout.ContentPane");
- _THIS_.addEventListener("fragment.load", "_THIS_init");
- _THIS_.addEventListener("fragment.retrieve.after", "_THIS_retrieveAfter");
- _THIS_.parent.addEventListener("fragment.unload", "_THIS_unload");
- var oTaskInfo;
-
- function _THIS_unload(evt) {
- _THIS_.raiseEvent('cognos.hts.showNotificationTaskViewer');
- }
-
- function _THIS_init() {
- //get the task info as a JSON string and fire the event
- <xsl:variable name="jsonTaskInfo">
- <xsl:call-template name="convertToJSON">
- <xsl:with-param name="taskInfo" select="/root/input[@name='dep']/queryResponse/*[local-name()='getTaskInfoResponse']"/>
- </xsl:call-template>
- </xsl:variable>
- //encode the JSON task info object
- <xsl:if test="$jsonTaskInfo != ''">
- try {
- oTaskInfo = eval("({<xsl:value-of select="xtsext:javascriptencode(string($jsonTaskInfo))"/>})");
- oTaskInfo = oTaskInfo.task;
- } catch (ex) {
- alert('<xts:string id="IDS_FRAG_ERROR_MESSAGE" encode="javascript"/>' + ex);
- }
- </xsl:if>
- var desc = '<xsl:value-of select="xtsext:javascriptencode(/root/*[local-name()='input']/*[local-name()='queryResponse']/*[local-name()='presentationDescription']/*[local-name()='description'][1])"/>';
- var description = _F_Strings.htmlDecode(desc);
-
- if (description) {
- dojo.addOnLoad(function() {
- if (dijit.byId("_THIS_notification_email_container")) {
- //if it there detroy it. Should really update, but for some reason
- //dijit.byId("_THIS_notification_email_container").attr('content', 'test')
- //does not work.
- dijit.byId("_THIS_notification_email_container").destroy();
- }
- new dijit.layout.ContentPane({content: description},"_THIS_notification_email_container");
- });
- }
- }
- function _THIS_retrieveAfter(evt) {
- if (evt.target.id == "_THIS_") {
- if(oTaskInfo) {
- //pass the task details to those fragments interested
- _THIS_.raiseEvent('cognos.hts.notification_info',oTaskInfo);
- }
- }
- }
- </script>
-
- <hts:action>
- <hts:div id="_THIS_notification_email_container" dojoType="dijit.layout.ContentPane" style="width:100%;height:100%;overflow-y:auto"></hts:div>
- </hts:action>
- </xsl:template>
- </xsl:stylesheet>
|