12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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">
- <xsl:import href="../../common/render-outputs.xslt"/>
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="/">
- <xsl:apply-templates select="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='preview']/*[local-name()='tsePreview']/*[local-name()='agentPreview']"/>
- </xsl:template>
- <xsl:template match="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='preview']/*[local-name()='tsePreview']/*[local-name()='agentPreview']">
- <xsl:variable name="ackText">
- <xsl:choose>
- <xsl:when test="/root/input[@name='dep']/*[local-name()='queryResponse']/*[local-name()='manualTask']/*[local-name()='acknowledgeText']">
- <xsl:value-of select="/root/input[@name='dep']/*[local-name()='queryResponse']/*[local-name()='manualTask']/*[local-name()='acknowledgeText']"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_FRAG_DEFAULT_ACKNOWLEDGE_TEXT"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <script type="text/javascript">
- _THIS_.addEventListener("fragment.load", "_THIS_init",false);
- _THIS_.addEventListener('fragment.unload','_THIS_unload', false);
- function _THIS_init(evt) {
- dojo.require("dijit.form.Button");
- //check if we have the button
- var btn = dijit.byId('_THIS_button');
- //create a new one, destroy the old one first
- if (btn) {
- btn.destroy();
- }
- var acknowledge = function(){
- _THIS_acknowledge(this);
- }
- //create a dojo button
- btn = hts_createButton('<xsl:value-of select="xtsext:javascriptencode(string($ackText))"/>',acknowledge,'_THIS_button');
- //Distribute to children
- var _THIS_distList = new Array();
- var _THIS_children = _THIS_.getChildren();
- var i, l = _THIS_children.length;
- for (i = 0; i < l; i++) {
- _THIS_distList[i] = _THIS_children[i].id;
- }
- _F_Event.distribute(_THIS_distList,evt);
- }
- function _THIS_acknowledge(btn) {
- var theButton = dijit.byId('_THIS_button');
- if (theButton) {
- theButton.attr("disabled",true);
- }
- var params="action=completeNotification";
- _THIS_.retrieve(params,null,true);
- //update the viewer
- _THIS_.transientUpdate('cognosTaskChanged',new Date().toUTCString());
- }
- /**
- * Just pass it on to children. This may not be necessary, When destory is called
- * on the parent. However it may be need in other cases if they exist. The event
- * is then passed back to the parent as well.
- */
- function _THIS_unload(evt) {
- //Distribute to children
- var _THIS_distList = new Array();
- var _THIS_children = _THIS_.getChildren();
- var i, l = _THIS_children.length;
- for (i = 0; i < l; i++) {
- _THIS_distList[i] = _THIS_children[i].id;
- }
- //do not bubble.
- evt.bubbles = false;
- _F_Event.distribute(_THIS_distList,evt);
- }
- </script>
- <xsl:call-template name="renderUI">
- <xsl:with-param name="path" select="."/>
- </xsl:call-template>
- <div>
- <div id="_THIS_button"/>
- </div>
- <!--div class="viewer" id="_THIS_viewercontent">_THIS?frag-subfragment=viewer/THIS_</div-->
- </xsl:template>
- </xsl:stylesheet>
|