123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: Viewer
- (C) Copyright IBM Corp. 2001, 2011
- US Government Users Restricted Rights - Use, duplication or
- disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/viewer.xml, messages/portal.xml, messages/portalRL.xml" includeConfig="true" requiredCapability="canUseCognosViewer">
- <!-- Reads session-sensitive info from CM -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="refreshSession"
- path="portal/cc/read_session.xml"
- condition=".[
- string(/root/cookies/cookie[@name = 'cc_session']) = ''
- or /root/env/param[@name='m_reload']
- or /root/env/param[@name='m_root'] ]">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <!-- Update the <session> element for this request. -->
- <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession" processor="XSLT" type="exec"
- condition=".[
- /root/newSession
- or /root/env/param[@name='ui']
- or /root/env/param[@name='d']
- or /root/env/param[starts-with(@name,'m_s_')]
- or /root/env/param[@name = 'resetSort'] ]"
- mandatory="false"/>
- <!-- Save changes to the state info in a cookie -->
- <xts:block mode="interpret" processor="XSLT" type="exec"
- id="setSession"
- path="portal/set_session.xml"
- dependency="buildSession"
- condition=".[/root/updateSession]"
- mandatory="false"/>
- <xts:block id="initialize" processor="XSLT" type="exec" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='controller_state']">
- <controllerState>
- <xsl:attribute name="controllerState">
- <xsl:value-of select="/root/env/param[@name='controller_state']"/>
- </xsl:attribute>
- </controllerState>
- </xsl:when>
- <xsl:otherwise>
- <!-- if this is the first pass through the morphlet, get the gateway URI -->
- <gateway>
- <xts:function name="getConfiguration">
- <xts:param name="gateway"/>
- </xts:function>
- </gateway>
- </xsl:otherwise>
- </xsl:choose>
- </xts:append>
- <xts:append select="/root/env">
- <param name="CAMNamespaceOnEmailLink">
- <xts:function name="getConfiguration">
- <xts:param name="CAMNamespaceOnEmailLink"/>
- </xts:function>
- </param>
- </xts:append>
- <!--add an m_name env variable so the email dialog defaults the subject properly-->
- <xts:append select="/root/env">
- <param name="m_name"><xsl:value-of select="/root/env/param[@name='ui.name']"/></param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- generateDefaultEmailOptions - If no delivery options where save on the object and it's the
- first time we hit this page then generate defaults
- ===============================================================================================
- -->
- <xts:block id="generateDefaultEmailOptions" dependency="initialize setSession" path="/portal/emailOptions/logicsheets/generate_defaults.xslt" processor="XSLT" type="exec" condition=".[not(/root/controllerState) and not(string(/root/env/param[@name='executeEmail'])='true')]" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- </xts:block>
- <!--
- ===============================================================================================
- processDefaultEmailOptions - If no delivery options where save on the object and it's the
- first time we hit then process the default delivery options.
- ===============================================================================================
- -->
- <xts:block id="processDefaultEmailOptions" path="/portal/emailOptions/logicsheets/process_email_options.xslt" processor="XSLT" dependency="generateDefaultEmailOptions" type="exec" condition=".[not(/root/controllerState) and not(string(/root/env/param[@name='executeEmail'])='true')]" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <xts:block id="generateEmailParams" processor="XSLT" type="exec" dependency="processDefaultEmailOptions" condition=".[not(/root/controllerState) and not(string(/root/env/param[@name='executeEmail'])='true')]" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/env">
- <param name="controller_state">email|markup</param>
- <xsl:variable name="linkToReport">
- <xsl:value-of select="/root/*[local-name()='gateway']"/>
- <xsl:text>?b_action=cognosViewer</xsl:text>
- <xsl:if test="/root/env/param[@name='CAMNamespaceOnEmailLink']='true' or /root/env/param[@name='CAMNamespaceOnEmailLink']='TRUE'">
- <xsl:variable name="camNamespace">
- <xsl:value-of select="substring-before(substring-after(/root/session/param[@name = 'e_hp'], 'CAMID("' ), ':')"/>
- </xsl:variable>
- <xsl:if test="$camNamespace!= ''" >
- <xsl:text>&CAMNamespace=</xsl:text>
- <xsl:value-of select="$camNamespace"/>
- </xsl:if>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="key('env-param','ui.action')='view'">&ui.action=view</xsl:when>
- <xsl:otherwise>&ui.action=run</xsl:otherwise>
- </xsl:choose>
- <xsl:text>&ui.object=</xsl:text>
- <xsl:value-of select="xtsext:protect(xtsext:urlencode(string(key('env-param','ui.object'))),'url','url','getdata')"/>
- <xsl:text>&run.outputFormat=</xsl:text>
- <xsl:value-of select="key('env-param','run.outputFormat')"/>
- <xsl:text>&run.outputLocale=</xsl:text>
- <xsl:value-of select="key('env-param','run.outputLocale')"/>
- <xsl:if test="key('env-param','lang')!=''">
- <xsl:text>&lang=</xsl:text>
- <xsl:value-of select="key('env-param','lang')"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="html-markup">
- <xsl:text><A href="</xsl:text>
- <xsl:value-of select="$linkToReport"/>
- <xsl:text>"></xsl:text>
- <xsl:choose>
- <xsl:when test="contains(string(key('env-param','run.outputFormat')), 'HTML')">HTML</xsl:when>
- <xsl:otherwise><xsl:value-of select="key('env-param', 'run.outputFormat')"/></xsl:otherwise>
- </xsl:choose>
- <xsl:text></A></xsl:text>
- </xsl:variable>
- <param name="linkToReport"><xsl:value-of select="$html-markup"/></param>
- <param name="hideEmailAsAttachment">
- <xsl:choose>
- <xsl:when test="key('env-param', 'hideEmailAsAttachment')!=''"><xsl:value-of select="key('env-param', 'hideEmailAsAttachment')"/></xsl:when>
- <xsl:when test="key('env-param','ui.action')='view'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </param>
- <param name="hideLinkToReport">
- <xsl:choose>
- <xsl:when test="key('env-param', 'hideLinkToReport')!=''"><xsl:value-of select="key('env-param', 'hideLinkToReport')"/></xsl:when>
- <xsl:when test="key('env-param','run.continueConversation') = 'true'">false</xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </param>
- </xts:append>
- <xts:delete select="/root/*[local-name()='morphletResponse']"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- callMorphlet - Calls the appropriate morphlet using the passed in params which will return
- markup to be displayed or the expected results
- ===============================================================================================
- -->
- <xts:block id="callMorphlet" processor="XSLT" dependency="generateEmailParams" type="exec" condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl dlgctrl xtsext req-params pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <pf:variables/>
-
- <xsl:template match="/">
- <xts:sequence>
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/emailOptions/email_options.xts</dlgctrl:target>
- <dlgctrl:stackName>viewer-email</dlgctrl:stackName>
- <req-params:param name="options"><xsl:value-of select="key('env-param','deliveryOptions')"/></req-params:param>
- <req-params:param name="titlePrefix"><xts:string id="IDS_EMAIL_OPTIONS_TITLE_PREFIX"/></req-params:param>
- <req-params:param name="titlePostfix"><xsl:value-of select="xtsext:enforceBTD(key('env-param','ui.name'),$baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></req-params:param>
- <req-params:param name="defaultTarget">/portal/viewer-email.xts</req-params:param>
- <req-params:param name="hideEmailAsAttachment"><xsl:value-of select="key('env-param','hideEmailAsAttachment')"/></req-params:param>
- <req-params:param name="linkToReport"><xsl:value-of select="key('env-param','linkToReport')"/></req-params:param>
- <req-params:param name="reportViewer">true</req-params:param>
- <!--
- If we don't want to continue the conversation, then we're being called from the wait page so we
- should hide the 'Include a link to the report' link.
- -->
- <req-params:param name="hideLinkToReport"><xsl:value-of select="key('env-param','hideLinkToReport')"/></req-params:param>
- <!-- Fix for COGCQ00225444 - only if we want to hide attachment, otherwise, we want to check attachment as default -->
- <req-params:param name="m_ro_emailAsAttachment">
- <xsl:choose>
- <xsl:when test="key('env-param','hideEmailAsAttachment') = 'true'">false</xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </req-params:param>
- </dlgctrl:XTS2Request>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- processReponse - Process the response from the callMorphlet block and either displays
- the markup or processes the results
- ===============================================================================================
- -->
- <xts:block id="processResponse" path="/portal/emailOptions/logicsheets/process_email_options.xslt" processor="XSLT" dependency="callMorphlet" type="exec" condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <xts:block id="sendRequest" processor="XSLT" type="exec" mode="output" dependency="processResponse" mimeType="text/html" contentId="callEmail" partId="1" condition=".[/root/controllerState[@controllerState='email|finished' or @controllerState='email|canceled']]" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl dlgctrl xtsext req-params">
- <xsl:output method="html" encoding="utf-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <pf:variables/>
- <xsl:template match="/">
- <xsl:variable name="method">
- <xsl:choose>
- <xsl:when test="/root/*[local-name()='morphletResponse']/*[local-name()='options']/*/*[local-name()='item'][*[local-name()='name']='emailAsAttachment']/*[local-name()='value']='true'">email</xsl:when>
- <xsl:otherwise>run</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="emailOptions">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set">
- <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]">
- <xsl:copy-of select="/root/*[local-name()='morphletResponse']/*[local-name()='options']/*/*"/>
- <xsl:if test="$method != 'run'">
- <item xsi:type="bus:runOptionBoolean">
- <name xsi:type="bus:runOptionEnum">continueConversation</name>
- <value xsi:type="xsd:boolean"><xsl:value-of select="key('env-param', 'run.continueConversation')"/></value>
- </item>
- </xsl:if>
- </options>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="web64encodedEmailOptions">
- <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($emailOptions), true()))"/>
- </xsl:variable>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="{$skin_root}/portal/default.css"/>
- <link rel="stylesheet" type="text/css" href="{$skin_root}/qs/RVReport.css"/>
- <script language="javascript">
- function finish()
- {
- var form = document.getElementById("executeEmail");
- if (typeof form != "undefined" && form != null)
- {
- if (typeof form.pageVisited != "undefined" && form.pageVisited != null && form.pageVisited.value.length > 0)
- {
- window.history.go(+1);
- return;
- }
- else if (typeof form.pageVisited != "undefined" && form.pageVisited != null)
- {
- <!-- set the page visited value so if the user hits the back button in the browser it'll have a value -->
- form.pageVisited.value = "true";
- }
- }
- <xsl:choose>
- <xsl:when test="/root/controllerState[@controllerState='email|canceled']">
- if(typeof parent.destroyCModal == "function")
- {
- parent.destroyCModal();
- }
- else if (window.opener)
- {
- window.close();
- }
- var oCognosViewerObject = parent.oCV<xsl:value-of select="key('env-param', 'cv.id')"/>;
- if (oCognosViewerObject)
- {
- if(oCognosViewerObject.getStatus() == "working" || oCognosViewerObject.getStatus() == "stillWorking")
- {
- oCognosViewerObject.getWorkingDialog().show();
- }
- }
- </xsl:when>
- <xsl:otherwise>
- var oCognosViewerObject = parent.oCV<xsl:value-of select="key('env-param', 'cv.id')"/>;
- if (oCognosViewerObject)
- {
- oCognosViewerObject.closeActiveHTTPConnection();
- oCognosViewerObject.removeTransparentBackgroundLayer();
- <xsl:if test="$method='email' and key('env-param','run.continueConversation')='false'">
- <!--so the viewer framework doesn't cancel the request when we exit, set it to keep the session alive-->
- oCognosViewerObject.setKeepSessionAlive(true);
- </xsl:if>
- }
- form.submit();
- setTimeout('document.progress.src="<xsl:value-of select="xtsext:javascriptencode($brand_images)"/>progress.gif"',1);
- </xsl:otherwise>
- </xsl:choose>
- }
- </script>
- </head>
- <body onload="finish();">
- <form action="{/root/http/param[@name='SCRIPT_NAME']}" name="executeEmail" id="executeEmail" method="post" style="display:none;height:100%;margin:0px">
- <input type="hidden" name="pageVisited" value=""/>
- <input type="hidden" name="b_action" value="cognosViewer"/>
- <input type="hidden" name="cv.id" value="{key('env-param','cv.id')}"/>
- <input type="hidden" name="email.options">
- <xsl:attribute name="value">
- <xsl:value-of select="$web64encodedEmailOptions"/>
- </xsl:attribute>
- </input>
- <input type="hidden" name="email.method" value="{$method}"/>
- <input type="hidden" name="cv.header" value="false"/>
- <input type="hidden" name="ui.action" value="email"/>
- <input type="hidden" name="cv.responseFormat" value="closeDialog"/>
- <input type="hidden" name="m_tracking" value="{key('env-param', 'm_tracking')}"/>
- <input type="hidden" name="ui.conversation" value="{key('env-param','ui.conversation')}"/>
- <input type="hidden" name="ui.routingServerGroup" value="{key('env-param','ui.routingServerGroup')}"/>
- <input type="hidden" name="run.continueConversation" value="{key('env-param','run.continueConversation')}"/>
- <input type="hidden" name="ui.backURL">
- <xsl:attribute name="value">
- <xsl:choose>
- <xsl:when test="string(key('env-param','ui.backURL')) != ''">
- <xsl:value-of select="key('env-param','ui.backURL')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','backURL')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </input>
- </form>
- <table id="workingStatus" cellspacing="0" height="100%" width="100%" cellpadding="0" align="center" valign="middle">
- <tr>
- <td width="100%" height="100%" align="center" valign="middle">
- <table align="center" cellspacing="0" cellpadding="0" style="vertical-align:middle; border:1px outset;" class="busyBody">
- <tr>
- <td rowspan="2">
- <img src="{$brand_images}progress.gif" style="margin:5px;" width="48" height="48" name="progress"/>
- </td>
- <td nowrap="nowrap">
- <span class="busyUpdatingStr">
- <xts:string id="GOTO_WORKING"/>
- </span>
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap">
- <span class="busyUpdatingStr">
- <xts:string id="RV_PLEASE_WAIT"/>
- </span>
- </td>
- </tr>
- <tr>
- <td style="height:7px;" colspan="2"/>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
- </xsl:template>
- <pf:serialize-xml/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug - display debug information
- ===============================================================================================
- -->
- <xts:block id="debug" dependency="sendRequest" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <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">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|