123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: Viewer
- (C) Copyright IBM Corp. 2001, 2019
- 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">
- <xts:block id="drillTargets" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='drillTargets'] != '']" mandatory="false">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <!-- Convert drill specification from XML string to document form -->
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <drillTargets>
- <xsl:value-of select="/root/env/param[@name='drillTargets']" disable-output-escaping="yes"/>
- </drillTargets>
- <drillSpecs>
- <xsl:value-of select="/root/env/param[@name='drillSpecs']" disable-output-escaping="yes"/>
- </drillSpecs>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="drillSpecs" dependency="drillTargets" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='drillSpecs']!='']" mandatory="false">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:template match="/root">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="count(/root/*[local-name()='drillTargets']/*) > 1">
- <xts:replace select="/root/*[local-name()='drillTargets']">
- <drillTargets>
- <xts:transform src="portal/drillthrough.xslt" processor="XSLT">
- <appendDrillSpecs>
- <xsl:copy-of select="/root/*[local-name()='drillTargets']"/>
- <xsl:copy-of select="/root/*[local-name()='drillSpecs']"/>
- </appendDrillSpecs>
- </xts:transform>
- </drillTargets>
- </xts:replace>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="sourceContextIdx">
- <xsl:value-of select="/root/*[local-name()='drillTargets']/*[local-name()='drillTarget']/@drillIdx"/>
- </xsl:variable>
- <xts:append select="/root">
- <sourceContext>
- <xsl:copy-of select="/root/*[local-name()='drillSpecs']/*/DRILL[(position()-1)=$sourceContextIdx]/*[local-name()='parameters']"/>
- </sourceContext>
- <objectPaths>
- <xsl:copy-of select="/root/*[local-name()='drillSpecs']/*/DRILL[(position()-1)=$sourceContextIdx]/*[local-name()='objectPaths']"/>
- </objectPaths>
- <sendFilterContext>
- <xsl:value-of select="/root/*[local-name()='drillSpecs']/*/DRILL[(position()-1)=$sourceContextIdx]/@sendFilterContext"/>
- </sendFilterContext>
- </xts:append>
- <xts:replace select="/root/*[local-name()='drillTargets']/*[local-name()='drillTarget']">
- <drillTarget>
- <xsl:for-each select="/root/*[local-name()='drillSpecs']/*/DRILL[(position()-1)=$sourceContextIdx]/@*">
- <xsl:attribute name="{name()}">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:for-each>
- <xsl:copy-of select="/root/*[local-name()='drillTargets']/*[local-name()='drillTarget']/*"/>
- </drillTarget>
- </xts:replace>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- drill_from_pdf
- ===============================================================================================
- -->
- <xts:block id="drill_from_pdf" type="exec" mode="output" processor="XSLT" mimeType="text/html; charset=utf-8" dependency="drillSpecs">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="rv/logicsheets/rvlogic.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:rvl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/rv/rvlogic/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf">
- <xsl:output method="html" indent="no" encoding="UTF-8"/>
- <pf:variables/>
- <xsl:template match="/root">
- <html>
- <head>
- <meta name="Copyright" content="(C) Copyright IBM Corporation and its licensors 2001, 2011."/>
- <meta name="Trademark" content="IBM, the IBM logo, and Cognos are trademarks of IBM Corp., registered in many jurisdictions worldwide."/>
- <script language="javascript">
- <!--
- taken from CDrillThroughTarget.js
- Need to inline this script since if the user drills from a PDF file, a temp .htm file will
- get generated in the users temp directory, so trying to bring is a js file using the webRoot will not
- always work.
- -->
- function CDrillThroughTarget(label, outputFormat, outputLocale, showInNewWindow, method, path, bookmark, parameters, objectPaths, sPrompt, dynamicDrillThrough, parameterProperties)
- {
- this.m_label = label;
- this.m_outputFormat = outputFormat;
- this.m_outputLocale = outputLocale;
- this.m_showInNewWindow = showInNewWindow;
- this.m_method = method;
- this.m_path = path;
- this.m_bookmark = bookmark;
- this.m_parameters = parameters;
- this.m_objectPaths = objectPaths;
- this.m_prompt = "false";
- this.m_parameterProperties = parameterProperties;
- if (typeof sPrompt != 'undefined' && sPrompt != null)
- {
- if (sPrompt == 'yes')
- {
- this.m_prompt = "true";
- }
- else if (sPrompt == 'target')
- {
- this.m_prompt = '';
- }
- }
- if(typeof dynamicDrillThrough != 'undefined' && dynamicDrillThrough != null)
- {
- this.m_dynamicDrillThrough = dynamicDrillThrough;
- }
- }
- function CDrillThroughTarget_getParameterProperties()
- {
- return this.m_parameterProperties;
- }
- function CDrillThroughTarget_getLabel()
- {
- return this.m_label;
- }
- function CDrillThroughTarget_getOutputFormat()
- {
- return this.m_outputFormat;
- }
- function CDrillThroughTarget_getOutputLocale()
- {
- return this.m_outputLocale;
- }
- function CDrillThroughTarget_getShowInNewWindow()
- {
- return this.m_showInNewWindow;
- }
- function CDrillThroughTarget_getMethod()
- {
- return this.m_method;
- }
- function CDrillThroughTarget_getPath()
- {
- return this.m_path;
- }
- function CDrillThroughTarget_getBookmark()
- {
- return this.m_bookmark;
- }
- function CDrillThroughTarget_getParameters()
- {
- return this.m_parameters;
- }
- function CDrillThroughTarget_getObjectPaths()
- {
- return this.m_objectPaths;
- }
- function CDrillThroughTarget_getPrompt()
- {
- return this.m_prompt;
- }
- function CDrillThroughTarget_isDynamicDrillThrough()
- {
- return this.m_dynamicDrillThrough;
- }
- CDrillThroughTarget.prototype.getLabel = CDrillThroughTarget_getLabel;
- CDrillThroughTarget.prototype.getOutputFormat = CDrillThroughTarget_getOutputFormat;
- CDrillThroughTarget.prototype.getOutputLocale = CDrillThroughTarget_getOutputLocale;
- CDrillThroughTarget.prototype.getShowInNewWindow = CDrillThroughTarget_getShowInNewWindow;
- CDrillThroughTarget.prototype.getMethod = CDrillThroughTarget_getMethod;
- CDrillThroughTarget.prototype.getPath = CDrillThroughTarget_getPath;
- CDrillThroughTarget.prototype.getBookmark = CDrillThroughTarget_getBookmark;
- CDrillThroughTarget.prototype.getParameters = CDrillThroughTarget_getParameters;
- CDrillThroughTarget.prototype.getObjectPaths = CDrillThroughTarget_getObjectPaths;
- CDrillThroughTarget.prototype.getPrompt = CDrillThroughTarget_getPrompt;
- CDrillThroughTarget.prototype.isDynamicDrillThrough = CDrillThroughTarget_isDynamicDrillThrough;
- CDrillThroughTarget.prototype.getParameterProperties = CDrillThroughTarget_getParameterProperties;
- <!-- end of CDrillThroughTarget.js -->
- function getCvId()
- {
- var cvId = "";
- // temp function until RSVP passes in the cvid to this morphlet
- try
- {
- if(typeof parent.oCV_NS_ != "undefined")
- {
- cvId = "_NS_";
- }
- else if(typeof parent.oCV_THIS_ != "undefined")
- {
- cvId = "_THIS_";
- }
- else if(typeof parent.oCVRS != "undefined")
- {
- cvId = "RS";
- }
- else if (typeof this.frameElement != "undefined" && this.frameElement != null)
- {
- if (typeof this.frameElement.id != "undefined" && this.frameElement.id.indexOf("CVIFrame") == 0)
- {
- cvId = this.frameElement.id.substring(8);
- }
- }
- }
- catch(e)
- {
- cvId = "";
- }
- return cvId;
- }
- function pdfDrill()
- {
- <xsl:choose>
- <xsl:when test="count(drillTargets/*) > 1">
- try
- {
- <xsl:variable name="drillTargets">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/*[local-name()='drillTargets']/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text disable-output-escaping="yes">if (parent != this && typeof parent.doMultipleDrills == "function") {</xsl:text>
- <xsl:text>parent.doMultipleDrills("<rvDrillTargets></xsl:text>
- <xsl:value-of select="xtsext:javascriptencode(string($drillTargets))" disable-output-escaping="yes"/>
- <xsl:text></rvDrillTargets>", getCvId());</xsl:text>
- <xsl:text>}
- else {
- </xsl:text>
- <xsl:call-template name="genMultiDrill"/>
- <xsl:text>
- }</xsl:text>
- }
- catch (e)
- {
- <xsl:call-template name="genMultiDrill"/>
- }
- </xsl:when>
- <xsl:otherwise>
- try
- {
- <!-- Let parent handle drill if it can otherwise
- - process it localy by opening a new window -->
- <xsl:text disable-output-escaping="yes">if (parent != this && typeof parent.doSingleDrill == "function") {
- parent.doSingleDrill(</xsl:text>
- <xsl:apply-templates select="drillTargets/drillTarget"/>
- <xsl:text>);</xsl:text>
- <xsl:if test="drillTargets/drillTarget/@outputFormat='XLS' or
- drillTargets/drillTarget/@outputFormat='CSV' or
- drillTargets/drillTarget/@outputFormat='XLWA' or
- drillTargets/drillTarget/@outputFormat='singleXLS' or
- drillTargets/drillTarget/@outputFormat='spreadsheetML' or
- drillTargets/drillTarget/@showInNewWindow = 'true'">
- <xsl:call-template name="returnToPDF"/>
- </xsl:if>
- <xsl:text disable-output-escaping="yes">} else if (parent != this && parent.Application && typeof parent.Application.LaunchDrillTargetFromPdf =="function") {
- //Handle drill-through in authoring perspective
- parent.Application.LaunchDrillTargetFromPdf(</xsl:text>
- <xsl:apply-templates select="drillTargets/drillTarget"/>
- <xsl:text>);} else { </xsl:text>
- <xsl:for-each select="drillTargets/drillTarget[position()=1]">
- <xsl:call-template name="genSingleDrill"/>
- </xsl:for-each>
- <xsl:text>
- }</xsl:text>
- }
- catch(e)
- {
- <xsl:for-each select="drillTargets/drillTarget[position()=1]">
- <xsl:call-template name="genSingleDrill"/>
- </xsl:for-each>
- }
- </xsl:otherwise>
- </xsl:choose>
- }
- </script>
- </head>
- <body onload="javascript:pdfDrill()">
- <xsl:variable name="formAction">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='gateway']) != ''">
- <xsl:value-of select="/root/env/param[@name='gateway']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/env/param[@name='ui.gateway']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="count(drillTargets/*) > 1">
- <form name="multiDrillForm" id="multiDrillForm" method="post" action="{$formAction}" style="height:100%;margin:0px">
- <input type="hidden" name="b_action" value="xts.run"/>
- <input type="hidden" name="m" value="portal/drillthrough.xts"/>
- <input type="hidden" name="drillTargets"/>
- <input type="hidden" name="ui.errURL" value="javascript:window.close()"/>
- <input type="hidden" name="ui.backURL" value="javascript:window.close()"/>
- <input type="hidden" name="dfextpdf" value="1"/>
- <input type="hidden" name="invokeGotoPage" value="true"/>
- </form>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="sourceContext">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/*[local-name()='sourceContext']/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="objectPaths">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/*[local-name()='objectPaths']/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="sendFilterContext">
- <xsl:value-of select="/root/*[local-name()='sendFilterContext']"/>
- </xsl:variable>
- <form name="multiDrillForm" id="multiDrillForm" method="post" action="{$formAction}" style="height:100%;margin:0px">
- <input type="hidden" name="b_action" value="xts.run"/>
- <input type="hidden" name="m" value="portal/drillthrough.xts"/>
- <input type="hidden" name="ui.errURL" value="javascript:window.close()"/>
- <input type="hidden" name="ui.backURL" value="javascript:window.close()"/>
- <input type="hidden" name="ui.action" value=""/>
- <input type="hidden" name="ui.object" value=""/>
- <input type="hidden" name="run.outputFormat" value=""/>
- <input type="hidden" name="run.outputLocale" value=""/>
- <input type="hidden" name="run.prompt" value="false"/>
- <input type="hidden" name="sourceContext" value="{string($sourceContext)}"/>
- <input type="hidden" name="objectPaths" value="{string($objectPaths)}"/>
- <input type="hidden" name="dynamicDrill" value="{string($sendFilterContext)}"/>
- </form>
- </xsl:otherwise>
- </xsl:choose>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="drillTarget">
- <!-- Generate parameters for doSingleDrill call -->
- <xsl:variable name="sourceContext">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/*[local-name()='sourceContext']/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="objectPaths">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/*[local-name()='objectPaths']/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="sendFilterContext">
- <xsl:value-of select="/root/*[local-name()='sendFilterContext']"/>
- </xsl:variable>
- <xsl:text>"</xsl:text>
- <xsl:if test="@showInNewWindow = 'true'">_blank</xsl:if>
- <xsl:text>",new Array( new Array( "ui.object", "</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(@path))"/><xsl:text>")</xsl:text>
- <xsl:for-each select="drillParameter">
- <xsl:variable name="selectChoices">
- <rvl:selectChoices/>
- </xsl:variable>
- <xsl:text>, new Array("</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(concat('p_', @name)))"/><xsl:text>", "</xsl:text><xsl:value-of select="xtsext:javascriptencode(string($selectChoices))"/><xsl:text>")</xsl:text>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@method = ''">
- <xsl:text>),"execute"</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>),"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(@method))"/><xsl:text>"</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text disable-output-escaping="yes">,"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(@outputFormat))"/><xsl:text disable-output-escaping="yes">"</xsl:text>
- <xsl:text disable-output-escaping="yes">,"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(@outputLocale))"/><xsl:text disable-output-escaping="yes">"</xsl:text>
- <!-- Do not urlencode bookmark since RSVP has already done it when the PDF is generated -->
- <xsl:text disable-output-escaping="yes">,"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(@bookmark))"/><xsl:text disable-output-escaping="yes">"</xsl:text>
- <xsl:text disable-output-escaping="yes">,"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string($sourceContext))" disable-output-escaping="yes"/><xsl:text disable-output-escaping="yes">"</xsl:text>
- <xsl:text disable-output-escaping="yes">,"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string($objectPaths))" disable-output-escaping="yes"/><xsl:text disable-output-escaping="yes">"</xsl:text>
- <xsl:text>,getCvId()</xsl:text>
- <xsl:variable name="promptOption">
- <xsl:choose>
- <xsl:when test="string(@prompt)='yes'">true</xsl:when>
- <xsl:when test="string(@prompt)='target'"></xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text disable-output-escaping="yes">,"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string($promptOption))"/><xsl:text disable-output-escaping="yes">"</xsl:text>
- <xsl:text disable-output-escaping="yes">,"</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(@sendFilterContext))"/><xsl:text disable-output-escaping="yes">"</xsl:text>
- </xsl:template>
- <xsl:template name="genSingleDrill">
- <!-- Generate code to perform drill in a new window and then
- do a 'back' to restore the PDF that this document replaced. -->
- var f = document.multiDrillForm;
- <xsl:choose>
- <xsl:when test="@method = 'view'">
- f["ui.action"].value = "view";
- f["ui.object"].value = "defaultOutput(<xsl:value-of select="xtsext:javascriptencode(string(@path))"/>,\"<xsl:value-of select="xtsext:javascriptencode(string(@outputFormat))"/>\",\"\")";
- </xsl:when>
- <xsl:otherwise>
- <!-- Do an execute -->
- f["ui.action"].value = "execute";
- <xsl:choose>
- <xsl:when test="/root/system/param[@name='pdfDrilBaltic']='true'">
- f["ui.object"].value = "<xsl:value-of select="xtsext:javascriptencode(xtsext:urldecode(string(@path)))"/>";
- </xsl:when>
- <xsl:otherwise>
- f["ui.object"].value = "<xsl:value-of select="xtsext:javascriptencode(string(@path))"/>";
- </xsl:otherwise>
- </xsl:choose>
- f["run.outputFormat"].value = "<xsl:value-of select="xtsext:javascriptencode(string(@outputFormat))"/>"
- f["run.outputLocale"].value = "<xsl:value-of select="xtsext:javascriptencode(string(@outputLocale))"/>"
- <xsl:if test="string(@prompt)='yes'">
- f["run.prompt"].value = "true";
- </xsl:if>
- var formField;
- <xsl:for-each select="drillParameter">
- <xsl:choose>
- <xsl:when test="./@value!=''">
- formField = document.createElement("input");
- formField.setAttribute("type", "hidden");
- formField.setAttribute("name", "<xsl:value-of select="xtsext:javascriptencode(string(concat('p_', @name)))"/>");
- <xsl:variable name="selectChoices">
- <rvl:selectChoices/>
- </xsl:variable>
- formField.setAttribute("value", "<xsl:value-of select="xtsext:javascriptencode(string($selectChoices))"/>");
- f.appendChild(formField);
- </xsl:when>
- <xsl:otherwise>
- formField = document.createElement("input");
- formField.setAttribute("type", "hidden");
- formField.setAttribute("name", "<xsl:value-of select="xtsext:javascriptencode(string(concat('p_', @name)))"/>");
- <xsl:variable name="selectChoices">
- <rvl:selectChoicesNil/>
- </xsl:variable>
- formField.setAttribute("value", "<xsl:value-of select="xtsext:javascriptencode(string($selectChoices))"/>");
- f.appendChild(formField);
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@bookmark != ''">
- <!-- Do not urlencode bookmark since RSVP has already done it when the PDF is generated -->
- var bookMarkFormField = document.createElement("input");
- bookMarkFormField.setAttribute("type", "hidden");
- bookMarkFormField.setAttribute("name", "bookmark");
- bookMarkFormField.setAttribute("value", "<xsl:value-of select="xtsext:javascriptencode(string(@bookmark))"/>");
- </xsl:if>
- <xsl:text>if (getCvId() != "") {</xsl:text>
- <xsl:call-template name="launchDrillTargetInNewWindow"/>
- <xsl:text>} else {f.submit();}</xsl:text>
- </xsl:template>
- <xsl:template name="genMultiDrill">
- <!-- Generate code to perform multiple drills in a new window and then
- do a 'back' to restore the PDF that this document replaced. -->
- <xsl:variable name="drillTargets">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/*[local-name()='drillTargets']/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>var f = document.multiDrillForm;</xsl:text>
- <xsl:text>f.drillTargets.value = "<rvDrillTargets>" + "</xsl:text><xsl:value-of select="xtsext:javascriptencode(string($drillTargets))" disable-output-escaping="yes"/><xsl:text>" + "</rvDrillTargets>";</xsl:text>
- <xsl:text>if (getCvId() != "") {</xsl:text>
- <xsl:call-template name="launchDrillTargetInNewWindow"/>
- <xsl:text>} else {f.submit();}</xsl:text>
- </xsl:template>
- <xsl:template name="launchDrillTargetInNewWindow">
- <xsl:call-template name="launchClassicViewerPerspective"/>
- </xsl:template>
- <xsl:template name="launchClassicViewerPerspective">
- // window.location.href would look similar to the following
- // http://localhost/ibmcognos/bidev/v1/disp/repository/sid/cm/oid/id68a0f47a5a24cfd98a120bdba15882b/content
- // we want to get everything from the beginning of the string to /v1
- var sPath = window.location.href.substring(0,window.location.href.indexOf("/v1"));
- // sPath now equals
- // http://localhost/ibmcognos/bidev
- // tack on the classic viewer perspective
- sPath += "/?perspective=classicviewer";
- // we want to use the alternative drill path
- sPath += "&altDrillFlag=true";
- // add the format (really for PDF so the perspective can react accordingly)
- sPath += "&format=" + document.multiDrillForm["run.outputFormat"].value;
- // add search path so that we can get the rest of the CM info for the perspective
- sPath += "&searchPath=" + document.multiDrillForm["ui.object"].value;
- // Give the form a unique name
- var v_sLabel = document.multiDrillForm.getAttribute("name") + Date.now().toString();
- document.multiDrillForm.setAttribute("name", v_sLabel);
- // store the form (in string form) into the browser storage
- if (typeof(Storage) !== "undefined") {
- localStorage.setItem(v_sLabel, document.multiDrillForm.outerHTML);
- // put this unique identifer into the parameters to pass
- sPath += "&drillFormLabel=" + v_sLabel;
- }
- else
- {
- console.log("Sorry! No Web Storage support...");
- }
- var parentWindow = window.parent ? window.parent : window;
- var __goto_win = parentWindow.open(sPath, "_blank");
- </xsl:template>
- <xsl:template name="returnToPDF">
- // Only do this for legacy portal. Otherwise, let the viewer content view do the restore.
- if (parent == this || typeof parent.f_restorePDF != "function") {
- var historyStackIdx = 0;
- var oCV = null;
- try
- {
- oCV = eval("parent.oCV" + getCvId());
- }
- catch(exception)
- {
- oCV = null;
- }
- if(oCV != null && typeof oCV.rvMainWnd != "undefined" && typeof oCV.m_viewerFragment == "undefined")
- {
- historyStackIdx -= (parent.history.length - oCV.rvMainWnd.m_browserHistoryIndex);
- }
- else
- {
- historyStackIdx -= 1;
- }
- setTimeout('history.go(' + historyStackIdx + ')',1);
- }
- </xsl:template>
- <pf:serialize-xml/>
- </xsl:stylesheet>
- </xts:block>
- <!-- Debug -->
- <!-- ============================================================================= -->
- <xts:block id="debug" dependency="drill_from_pdf" condition=".[ /root/session/param[@name='debug'] = '1' or /root/env/param[@name='ui.debug'] = 'true' ]"
- type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
- <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="xsl dbg">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <dbg:templates/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|