12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2018
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!-- $Header$ -->
- <!-- $DateTime$ -->
- <!-- $Change$ -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
- xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
- exclude-result-prefixes="wsrp SOAP-ENV xts xtsext ui nav">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:attribute-set name="anchor">
- <xsl:attribute name="class">cognos-anchor</xsl:attribute>
- <xsl:attribute name="onmouseover">window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmouseout">window.status='';return true;</xsl:attribute>
- </xsl:attribute-set>
- <xsl:variable name="portlet-op" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]"/>
- <xsl:variable name="portlet-registration-params" select="$portlet-op/wsrp:registrationContext/wsrp:registrationState/param"/>
- <xsl:variable name="consumerAgent" select="$portlet-registration-params[@name='consumerAgent']"/>
- <xsl:variable name="redirect-url" select="/root/nav:getItemResponse/nav:redirectURL"/>
- <ui:property name="display-id" select="'display_id'"/>
- <ui:property name="display-width" select="'display_width'"/>
- <ui:property name="display-height" select="'display_height'"/>
- <ui:property name="display-action" select="'display_action'"/>
- <ui:property name="view-action" select="'view_action'"/>
- <ui:property name="publish-spec" select="'publish_spec'"/>
- <ui:property name="discussion-spec" select="'discussion_spec'"/>
- <ui:property name="publish-no-prompt" select="'publish_no_prompt'"/>
- <ui:property name="viewer-resize" select="'viewer_resize'"/>
-
- <ui:property name="session-id" select="'session_id'" exclude-session-state="$ui-session-params[@name = 'display_id'] = ''"/>
- <xsl:variable name="session-id-param">
- <xsl:text>_CPSID_</xsl:text>
- <xsl:value-of select="$session-id"/>
- </xsl:variable>
-
- <xsl:variable name="item" select="/root/nav:getItemResponse/nav:item | /root/nav:getItemResponse/nav:shortcut"/>
- <xsl:variable name="run-only" select="$item/nav:action[nav:name = 'run']"/>
- <xsl:variable name="run-options" select="$item/nav:action[nav:name = 'run_options']"/>
- <xsl:variable name="url-item" select="$item/nav:defaultAction/nav:url"/>
- <!-- create browser variable: $ui-browser -->
- <ui:browser/>
- <xsl:variable name="is-powerplay" select="($item/nav:type = 'powerPlayReport') or ($item[self::nav:shortcut] and ($item/*/nav:type = 'powerPlayReport'))"/>
- <xsl:variable name="is-pagelet" select="($item/nav:type = 'pagelet') or ($item[self::nav:shortcut] and ($item/*/nav:type = 'pagelet'))"/>
- <xsl:variable name="is-dashboard" select="($item/nav:type = 'dashboard') or ($item[self::nav:shortcut] and ($item/*/nav:type = 'dashboard'))"/>
- <xsl:variable name="is-document" select="$item/nav:type='document' or ($item[self::nav:shortcut] and $item/*/nav:type='document')"/>
- <xsl:variable name="is-powerplay-8" select="($item/nav:type = 'powerPlay8Report') or ($item[self::nav:shortcut] and ($item/*/nav:type = 'powerPlay8Report')) or ($item/nav:type = 'powerPlay8ReportView') or ($item[self::nav:shortcut] and ($item/*/nav:type = 'powerPlay8ReportView'))"/>
- <xsl:variable name="is-documentContent" select="($item/nav:type = 'documentContent') or ($item[self::nav:shortcut] and ($item/*/nav:type = 'documentContent'))"/>
- <xsl:variable name="canView" select="($item/nav:action/nav:name = 'previous_versions') or ( $url-item/@type = 'external' ) or ( $run-only ) or $is-pagelet or $is-dashboard or $is-documentContent"/>
- <xsl:variable name="show-run-action" select="$display-action='prompt' or ($display-action='view' and not($canView) and $view-action='prompt')"/>
-
- <xsl:variable name="url-view">
-
- <xsl:variable name="url">
- <xsl:choose>
- <xsl:when test="$is-dashboard and ($url-item)">
- <xsl:choose>
- <xsl:when test="contains($url-item,'?')">
- <xsl:value-of select="concat($url-item,'&m_session=', $session-id-param)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($url-item,'?m_session=', $session-id-param)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$url-item"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$redirect-url != '' and not($url-item/@type = 'external')">
- <xsl:value-of select="concat($redirect-url, xtsext:protect( xtsext:urlencode(string($url)), 'url', 'url', 'getdata' ))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$url"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="url-run">
- <xsl:choose>
- <!-- check for "run options" first... -->
- <xsl:when test="$run-options/nav:url != ''">
-
- <xsl:variable name="runurl-with-session-param">
- <xsl:value-of select="concat($run-options/nav:url, '&m_session=', $session-id-param)"/>
- <!-- for sharepoint, we instruct the viewer to save the conversation in the session as well, so subsequent publish would use the same conversation -->
- <xsl:if test="$consumerAgent = 'sharepoint'">
- <xsl:value-of select="concat('&m_sessionConv=', $session-id-param)"/>
- </xsl:if>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($redirect-url != '') and not($run-options/nav:url/@type = 'external')">
- <xsl:value-of select="concat($redirect-url, xtsext:protect( xtsext:urlencode($runurl-with-session-param), 'url', 'url', 'getdata' ))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$runurl-with-session-param"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- ...then check for simple "run" second... -->
- <xsl:when test="$run-only/nav:url != ''">
- <xsl:choose>
- <xsl:when test="($redirect-url != '') and not($run-only/nav:url/@type = 'external')">
- <xsl:value-of select="concat($redirect-url, xtsext:protect( xtsext:urlencode(concat($run-only/nav:url, '&m_session=', $session-id-param)), 'url', 'url', 'getdata' ))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($run-only/nav:url, '&m_session=', $session-id-param)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- ...otherwise nothing to do. -->
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="iFrameSrc">
- <xsl:choose>
- <xsl:when test=" $ui-browser = 'ie' or $ui-browser = 'moz' ">
- <xsl:text>about:blank</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($ui-producer-images, 'space.gif')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:template match="/">
- <!--
- Input conditions:
- ================
- $canView output is available and can be viewed.
- $run-options can run with options?
- $run-only can just run it?
- $ui-browser ie, moz, ns4 or other
- $display-action view, prompt or run
- $view-action prompt or run
- -->
- <xsl:if test="$ui-session-params[@name='display_id'] != ''">
- <div class="portlet-form-field">
- <a href="wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=set:{$ui-state-params[@name = 'channel']}&wsrp-windowState={$ui-window-state}&wsrp-navigationalState=&display_id=/wsrp_rewrite"><xts:string id="IDS_NAV_VEW_BACK_TO_DEFAULT"/></a>
- </div>
- <br/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="/root/recursive-error">
- <xsl:call-template name="render-error-page">
- <xsl:with-param name="type">recursive</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <!--
- If the url type is external and we don't have a run url or if the object type is "document", we default the action to view.
- -->
- <xsl:when test="$display-action = 'view' or ($url-item/@type = 'external' and not($run-options or $run-only)) or $is-document or $is-pagelet or $is-dashboard">
- <xsl:choose>
- <xsl:when test="$canView = 'true'">
- <xsl:choose>
- <xsl:when test="$is-document">
- <xsl:call-template name="render-action-page">
- <xsl:with-param name="type">download</xsl:with-param>
- <xsl:with-param name="url" select="$url-view"/>
- <xsl:with-param name="img-url" select="$item/nav:imgURL"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$ui-browser = 'ns4' or $ui-browser = 'ns6' or $ui-browser = 'ns70' or $ui-browser = 'other'">
- <xsl:call-template name="render-action-page">
- <xsl:with-param name="type">view</xsl:with-param>
- <xsl:with-param name="url" select="$url-view"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-iframe">
- <xsl:with-param name="url" select="$url-view"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$run-options">
- <xsl:choose>
- <xsl:when test="($view-action = 'prompt' ) or ($ui-browser = 'ns4' or $ui-browser = 'ns6' or $ui-browser = 'ns70' or $ui-browser = 'other')">
- <xsl:choose>
- <xsl:when test="$is-powerplay">
- <xsl:call-template name="render-action-page">
- <xsl:with-param name="type">run</xsl:with-param>
- <xsl:with-param name="url" select="$url-view"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-action-page">
- <xsl:with-param name="type">run</xsl:with-param>
- <xsl:with-param name="url" select="$url-run"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$is-powerplay">
- <xsl:call-template name="render-iframe">
- <xsl:with-param name="url" select="$url-view"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-iframe">
- <xsl:with-param name="url" select="$url-run"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-error-page">
- <xsl:with-param name="type">view</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$run-options or $run-only">
- <xsl:choose>
- <xsl:when test="$ui-browser = 'ns4' or $ui-browser = 'ns6' or $ui-browser = 'ns70' or $ui-browser = 'other'">
- <xsl:call-template name="render-action-page">
- <xsl:with-param name="type">run</xsl:with-param>
- <xsl:with-param name="url" select="$url-run"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$display-action = 'prompt'">
- <xsl:choose>
- <xsl:when test="$is-powerplay">
- <xsl:call-template name="render-action-page">
- <xsl:with-param name="type">prompt</xsl:with-param>
- <xsl:with-param name="url" select="$url-view"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-action-page">
- <xsl:with-param name="type">prompt</xsl:with-param>
- <xsl:with-param name="url" select="$url-run"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$is-powerplay">
- <xsl:call-template name="render-iframe">
- <xsl:with-param name="url" select="$url-view"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-iframe">
- <xsl:with-param name="url" select="$url-run"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-error-page">
- <xsl:with-param name="type">run</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <ui:preview/>
- </xsl:template>
- <xsl:template name="render-action-page">
- <xsl:param name="type"/>
- <xsl:param name="url"/>
- <xsl:param name="img-url"/>
- <div id="wsrp_rewrite_run">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="portlet-font" align="center" valign="middle">
- <xsl:attribute name="height">
- <xsl:choose>
- <xsl:when test="$display-height!=''"><xsl:value-of select="$display-height"/></xsl:when>
- <xsl:otherwise>100</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="$type = 'run'">
- <xsl:text/><xts:string id="IDS_NAV_VEW_CLICK_RUN_WITH_OPTIONS"/><br/><br/>
- <a xsl:use-attribute-sets="anchor" href="{ $url }" target="cps_{ $item/nav:id }_run">
- <img width="20" height="20" border="0" src="{ $ui-producer-images }action_run_report_20.gif" alt="{ $run-options/nav:alt }" title="{ $run-options/nav:alt }"/>
- </a>
- </xsl:when>
- <xsl:when test="$type = 'view'">
- <xsl:text/><xts:string id="IDS_NAV_VEW_CLICK_VIEW"/><br/><br/>
- <a xsl:use-attribute-sets="anchor" href="{ $url }" target="cps_view">
- <img width="20" height="20" border="0" src="{ $ui-producer-images }action_view_report_20.gif"/>
- </a>
- </xsl:when>
- <xsl:when test="$type = 'prompt'">
- <script language="javascript">
- function wsrp_rewrite_showreport( e ) {
- var oDiv = document.getElementById("wsrp_rewrite_run");
- var oIFrame = document.getElementById("wsrp_rewrite_iframe");
- oDiv.style.display = "none";
- var busyDiv = document.getElementById("wsrp_rewrite_busydiv");
- busyDiv.style.display="";
- var frameUrl = "<xsl:value-of select="xtsext:javascriptencode($url)"/>";
- if (window.wsrp_rewrite_iframeWrapper){
- wsrp_rewrite_setFrameLocation(wsrp_rewrite_iframeWrapper, frameUrl)
- } else {
- oIFrame.src = frameUrl;
- }
-
- oIFrame.style.display = "block";
-
- // stop event propogation, no one above us needs to know about this.
- if ( e.srcElement ) {
- e.returnValue = false;
- } else {
- e.preventDefault();
- }
- }
- </script>
- <xsl:text/><xts:string id="IDS_NAV_VEW_CLICK_RUN"/><br/><br/>
- <a xsl:use-attribute-sets="anchor" href="#" onclick="wsrp_rewrite_showreport( event );">
- <img width="20" height="20" border="0" src="{ $ui-producer-images }action_run_report_20.gif">
- <xsl:attribute name="alt"><xts:string id="IDS_NAV_VEW_RUN_NOW"/></xsl:attribute>
- <xsl:attribute name="title"><xts:string id="IDS_NAV_VEW_RUN_NOW"/></xsl:attribute>
- </img>
- </a>
- </xsl:when>
- <xsl:when test="$type='download'">
- <xsl:variable name="text"><xts:string id="IDS_NAV_VEW_CLICK_VIEW_DOC"/></xsl:variable>
- <xsl:text/><xsl:value-of select="$text"/><br/><br/>
- <a xsl:use-attribute-sets="anchor" href="{ $url }">
- <img width="16" height="16" border="0" src="{ $img-url }" alt="{ $text }" title="{ $text }"/>
- </a>
- </xsl:when>
- <xsl:otherwise><xts:string id="IDS_NAV_VEW_CONTACT_ADMINISTRATOR"/></xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table>
- </div>
- <xsl:if test="$type = 'prompt'">
- <xsl:call-template name="render-iframe">
- <xsl:with-param name="url">about:blank</xsl:with-param>
- <xsl:with-param name="hidden" select="true()"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="render-error-page">
- <xsl:param name="type"/>
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="portlet-font" align="center" valign="middle" height="100">
- <xsl:choose>
- <xsl:when test="$type = 'view'"><xts:string id="IDS_NAV_VEW_CANNOT_VIEW_ERROR"/></xsl:when>
- <xsl:when test="$type = 'run'"><xts:string id="IDS_NAV_VEW_CANNOT_RUN_ERROR"/></xsl:when>
- <xsl:when test="$type = 'recursive'"><xts:string id="IDS_NAV_VEW_RECURSIVE_CALL_ERROR"/></xsl:when>
- </xsl:choose>
- <br/><xts:string id="IDS_NAV_VEW_CONTACT_ADMINISTRATOR"/><br/>
- </td>
- </tr>
- </table>
- </xsl:template>
- <xsl:template name="render-iframe">
- <xsl:param name="url"/>
- <xsl:param name="hidden" select="false()"/>
-
- <xsl:choose>
- <xsl:when test="$consumerAgent = 'websphere'">
- <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
- <tbody>
- <tr>
- <td>
- <xsl:call-template name="render-iframe-details">
- <xsl:with-param name="url" select="$url"/>
- <xsl:with-param name="hidden" select="$hidden"/>
- </xsl:call-template>
- </td>
- </tr>
- </tbody>
- </table>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-iframe-details">
- <xsl:with-param name="url" select="$url"/>
- <xsl:with-param name="hidden" select="$hidden"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="render-iframe-details">
- <xsl:param name="url"/>
- <xsl:param name="hidden" select="false()"/>
-
- <xsl:variable name="is-external" select="$item/nav:defaultAction/nav:url/@type ='external'"/>
- <xsl:variable name="third-party-portal" select="not ($ui-is-cognos-connection or $ui-is-myportal)"/>
- <xsl:choose>
- <xsl:when test="not($is-external) and $third-party-portal">
- <!-- If the url is not external and we are in 3rd party portals, we will add the code to synchronize iframe requests -->
- <script language="javascript">
- <xsl:choose>
- <xsl:when test="$consumerAgent = 'sap'">
- var wsrp_rewrite_scope;
- if (window.parent)
- wsrp_rewrite_scope = window.parent;
- else
- wsrp_rewrite_scope = window;
- </xsl:when>
- <xsl:otherwise>
- var wsrp_rewrite_scope = window;
- </xsl:otherwise>
- </xsl:choose>
-
- <!--
- Producer registration handle. Used in the cookie that we use to keep track if we already synchronized the viewers or not.
- if this handle is in the cookie, it means that we already synchronized the request and we have a passport cookie.
- -->
- var wsrp_rewrite_reghandle = "<xsl:value-of select="xtsext:javascriptencode($portlet-op/wsrp:registrationContext/wsrp:registrationHandle)"/>";
-
- <!--
- InitCookie session id included in the request as extension. This id is generated when there is an initCookie request.
- It is used to keep track when we have a new initCookie so we can clear the passport
- -->
- var wsrp_rewrite_sessionId = "<xsl:value-of select="$portlet-op/wsrp:markupParams/wsrp:extensions/*[local-name()='applicationState']/*[local-name()='cookieSessionId']"/>";
-
- function wsrp_rewrite_getCookie(name){
- var value = null;
- if (document.cookie.length > 0){
- var search = name + "="
- var index = document.cookie.indexOf(search);
- if (index != -1){
- var start = index + search.length;
- var end = document.cookie.indexOf(";", start);
- if (end == -1)
- end = document.cookie.length;
- value = unescape(document.cookie.substring(start, end))
- }
- }
- return value;
- }
- function wsrp_rewrite_setCookie(name, value){
- document.cookie = name + "=" + value +"; path=/";
- }
-
- <!--
- Check if we already synchronized the viewer and we have the passport cookie set
- -->
- function wsrp_rewrite_isAuthenticated(){
- var authString = wsrp_rewrite_reghandle +"_" + wsrp_rewrite_sessionId;
- var authState = wsrp_rewrite_getCookie("cpsviewer_authstate");
- if (authState != null && authState.indexOf(authString) != -1)
- return true;
-
- return false;
- }
- <!--
- Detect the scenario where we already have a passport cookie, but the cookie might be expired.
- This is done by using the value of the initCookie session id that we get from the consumer.
- If this values changes, it means that initCookie was called and we need to clear the passport cookie.
- -->
- function wsrp_rewrite_isReAuthenticated(){
- var reAuth = false;
- if (!wsrp_rewrite_isAuthenticated()){
- var authState = wsrp_rewrite_getCookie("cpsviewer_authstate");
- if (authState != null){
- var handles = authState.split(",");
- for (var i =0; i < handles.length; i++){
- if (handles[i].indexOf(wsrp_rewrite_reghandle + "_") == 0){
- reAuth = true;
- break;
- }
- }
- }
- }
- return reAuth;
- }
- <!--
- Helper method that will set a cookie that is used to track whether we already have a passport cookie or not
- We will not synchronize the iframes, if this cookie is present.
- -->
- function wsrp_rewrite_setAuthenticated(){
- var authString = wsrp_rewrite_reghandle +"_" + wsrp_rewrite_sessionId;
- var authState = wsrp_rewrite_getCookie("cpsviewer_authstate");
- if (authState == null || authState == "")
- authState = authString;
- else if (authState.indexOf(wsrp_rewrite_reghandle) == -1)
- authState += "," + authString;
-
- wsrp_rewrite_setCookie("cpsviewer_authstate", authState);
- }
-
- <!--
- Helper method that will remove the cookie that is used to track whether we already have a passport cookie or not
- -->
- function wsrp_rewrite_setNotAuthenticated(){
- var authState = wsrp_rewrite_getCookie("cpsviewer_authstate");
- if (authState != null){
- var handles = authState.split(",");
- var newAuthState = "";
- for (var i =0; i < handles.length; i++){
- if (handles[i].indexOf(wsrp_rewrite_reghandle +"_") != 0){
- if (newAuthState != "")
- newAuthState +=",";
- newAuthState += handles[i];
- }
- }
- wsrp_rewrite_setCookie("cpsviewer_authstate", newAuthState);
- }
- }
- <!--
- Build a url that will be used to trigger the login page so we can clear the passport cookie.
- This will be used when the passport has expired and we would like to clear the cookie
- -->
- function wsrp_rewrite_getAuthURL(){
- var url = "<xsl:value-of select="xtsext:javascriptencode($url)"/>";
- var index = url.indexOf("?");
- if (index != -1)
- url = url.substring(0, index);
- url += "?b_action=xts.run&m=/cps4/common/sso.xts"
-
- return url
- }
-
- <!--
- Controller object.
- -->
- function _F_CPSIFrameController(){
- this.iframes = new Array();
- this.started = false;
- this.notified = false;
- this.isClearingCookie = false;
- this.clearCookie = false
- }
-
- <!--
- This method is called when we want to add an iframe to the controller so it can be synchronized.
- This method will do different thing depending on the state of the controller.
-
- If the controller is marked to clear the cookie:
- 1- remove the cookie that tracks whether we are authenticated or not ( call setNotAuthenticated)
- 2- Mark the state of the controller as "clearingCookie"
- 3- Queue the iframe that is being added to the controller so it can be processed later
- 4- create an iframe that will trigger the login page so that the passport cookies is cleared.
-
- If the controller state is "clearingCookie":
- 1- Queue the iframe so it can be processed later
-
- If we are already authenticated:
- 1- Set the location of the iframe. No need to synchronize.
- if the controller hasn't started yet:
- 1- mark the controller as started.
- 2- set the location of the first iframe.
-
- if the controller is already notified:
- 1 - set the location of the iframe
-
- Otherwise:
- 1- Queue the iframe so it can be processed later (once the controller is notified)
- -->
- function wsrp_rewrite_addFrameToController(iframe) {
- if (wsrp_rewrite_controller.clearCookie){
- wsrp_rewrite_setNotAuthenticated();
- wsrp_rewrite_controller.clearCookie = false;
- wsrp_rewrite_controller.isClearingCookie = true;
- wsrp_rewrite_controller.iframes.push(iframe);
- window.wsrp_rewrite_loginIframeWrapper = new _F_CPSIFrame("wsrp_rewrite_clearcookie", wsrp_rewrite_getAuthURL(), document);
- wsrp_rewrite_setFrameLocation(window.wsrp_rewrite_loginIframeWrapper);
- }else if(wsrp_rewrite_controller.isClearingCookie){
- wsrp_rewrite_controller.iframes.push(iframe);
- }else if (wsrp_rewrite_isAuthenticated()){
- wsrp_rewrite_setFrameLocation(iframe);
- }else if (!wsrp_rewrite_controller.started ){
- wsrp_rewrite_controller.started = true;
- wsrp_rewrite_setFrameLocation(iframe);
- } else if (wsrp_rewrite_controller.notified ){
- wsrp_rewrite_setFrameLocation(iframe) ;
- }else{
- wsrp_rewrite_controller.iframes.push(iframe);
- }
- }
-
- <!--
- This method is called when and iframe content is loaded.
- If the controller state is "clearingCookie", we will do the following:
- 1 - The "clearingCookie" state will be cleared
- 2 - We will set the location of the first iframe.
-
- Otherwise, we will do the following:
-
- 1 - Mark the state of the controller as "notified"
- 2 - Set the location of all iframes.
- 3 - Set a cookie so we can tell that we are authenticated (passport cookie is set)
- -->
- function wsrp_rewrite_notifyController(){
- if(wsrp_rewrite_controller.isClearingCookie){
- wsrp_rewrite_controller.isClearingCookie = false;
- // start the first request..
- if (wsrp_rewrite_controller.iframes.length > 0)
- wsrp_rewrite_setFrameLocation(wsrp_rewrite_controller.iframes.pop());
- }else{
- wsrp_rewrite_controller.notified = true;
- while (wsrp_rewrite_controller.iframes.length > 0){
- wsrp_rewrite_setFrameLocation(wsrp_rewrite_controller.iframes.pop());
- }
- wsrp_rewrite_setAuthenticated();
- }
- }
-
- <!--
- An object that will contain referent to the iframe and the href it should be set to
- -->
- function _F_CPSIFrame(iFrameId, url, doc){
- this.iFrameId = iFrameId;
- this.url = url;
- this.isLocationSet = false;
- this.doc=doc;
- }
- <!--
- A global variable used to store the portlet iframe wrapper. This will be used for browser resize action
- -->
- <xsl:if test="$viewer-resize='t'">
- var wsrp_rewrite_cpsFrame;
- </xsl:if>
-
- <!--
- Set the location of the iframe associated the the _F_CPSIFrame object
- -->
- function wsrp_rewrite_setFrameLocation(cpsFrame, overrideUrl){
- if(overrideUrl){
- cpsFrame.url = overrideUrl;
- }
- var iframe = cpsFrame.doc.getElementById(cpsFrame.iFrameId);
-
-
- <xsl:if test="$viewer-resize='t'">
- <!-- get rid off the cache string -->
- var index=cpsFrame.url.indexOf("m_session");
- if (index >-1){
- cpsFrame.url=cpsFrame.url.slice(0,index);
- }
-
- if(cpsFrame.url.indexOf("ui.action%3drun") >-1) {
-
- cpsFrame.url=cpsFrame.url.replace(/ui.action%3drun/,"ui.action%3dmodifyCMReport");
- cpsFrame.url+=wsrp_rewrite_cvReportChartResize(iframe) ;
- }
-
- </xsl:if>
-
- if (iframe != null){
- var _self = cpsFrame;
- setTimeout(function(){_self.isLocationSet = true; iframe.src = _self.url}, 1);
- }
-
- }
-
- <xsl:if test="$viewer-resize='t'">
-
- <!-- User define margin -->
- var wsrp_rewrite_chart_width_margin= 25;
- var wsrp_rewrite_chart_height_margin= 75;
-
- var wsrp_rewrite_chart_width = wsrp_rewrite_chart_width_margin;
- var wsrp_rewrite_chart_height = wsrp_rewrite_chart_height_margin;
- <!-- This function calculates the required size for iframe chart and return the string that needs to be part of the iframe src -->
- function wsrp_rewrite_cvReportChartResize(iframe) {
- wsrp_rewrite_chart_height = wsrp_rewrite_getChartHeight(iframe.offsetHeight, wsrp_rewrite_chart_height_margin);
- wsrp_rewrite_chart_width = wsrp_rewrite_getChartWidth(iframe.offsetWidth, wsrp_rewrite_chart_width_margin);
- return "%26cv.reportWidth=" + wsrp_rewrite_chart_width + "%26cv.reportHeight=" +wsrp_rewrite_chart_height;
- }
-
- function wsrp_rewrite_getChartHeight(iframeHeight, heightMargin) {
- if(iframeHeight > heightMargin ) {
- return iframeHeight - heightMargin;
- } else {
- return iframeHeight;
- }
- }
-
- function wsrp_rewrite_getChartWidth(iframeWidth, widthMargin) {
- if(iframeWidth > widthMargin ) {
- return iframeWidth - widthMargin;
- } else {
- return iframeWidth;
- }
- }
-
- <!--
- Browser resize event listener
- -->
- var wsrp_rewrite_timeoutWait;
- if (wsrp_rewrite_scope.attachEvent) {
- wsrp_rewrite_scope.attachEvent('onresize', function(event){
- clearTimeout(wsrp_rewrite_timeoutWait);
- wsrp_rewrite_timeoutWait = setTimeout('wsrp_rewrite_resizeIframe(wsrp_rewrite_cpsFrame)',1000);
- });;
- } else if (wsrp_rewrite_scope.addEventListener) {
- wsrp_rewrite_scope.addEventListener('resize', function(event){
- clearTimeout(wsrp_rewrite_timeoutWait);
- wsrp_rewrite_timeoutWait = setTimeout('wsrp_rewrite_resizeIframe(wsrp_rewrite_cpsFrame)',1000);
- });;
- }
-
-
- <!--
- Dragging portlet to another column will resize the chart if the iframe size changed
- -->
- Liferay.on('initLayout', function(event) {
- Liferay.once(function() {
- Liferay.Layout.on([ 'drag:end' ], function(event) {
- if(wsrp_rewrite_cpsFrame != null) {
- setTimeout('wsrp_rewrite_resizeIframe(wsrp_rewrite_cpsFrame)',1);
- }
- });
- }, Liferay.Layout, 'bindDragDropListeners');
- });
-
- <!--
- This function resizes the chart in the report if the iframe size is changed
- -->
- function wsrp_rewrite_resizeIframe(cpsFrame) {
- if(cpsFrame != null) {
- var iframe = cpsFrame.doc.getElementById(cpsFrame.iFrameId);
-
- if(cpsFrame.url.indexOf("ui.action%3dmodifyCMReport") >-1) {
- if (wsrp_rewrite_chart_width != wsrp_rewrite_getChartWidth(iframe.offsetWidth, wsrp_rewrite_chart_width_margin) || wsrp_rewrite_chart_height != wsrp_rewrite_getChartHeight(iframe.offsetHeight, wsrp_rewrite_chart_height_margin) ){
- iframe.src=cpsFrame.url.replace(/%26cv.reportWidth=([0-9][0-9]{0,3})%26cv.reportHeight=([0-9][0-9]{0,3})/,wsrp_rewrite_cvReportChartResize(iframe));
- }
- }
- }
- }
- </xsl:if>
-
- <!--
- Called when the iframe is loaded.
- This might be called multiple times because the iframe onLoad event might be triggered when the href is about:blank.
- This method will notify the controller when the content is loaded.
- -->
- function wsrp_rewrite_setReady(iFrameWrapper){
- if (iFrameWrapper && iFrameWrapper.isLocationSet){
-
- <xsl:if test="$consumerAgent = 'sharepoint'">
- <!-- for collaboration, we need to get the session information so we when publish reports, we use the cloned user session -->
- if(!wsrp_rewrite_controller.isClearingCookie && !wsrp_rewrite_controller.sessionInfoRequested){
- wsrp_rewrite_controller.sessionInfoRequested = true;
- document.getElementById("wsrp_rewrite_getsession").src = wsrp_rewrite_getGetSessionUrl();
- }
- </xsl:if>
-
- wsrp_rewrite_notifyController();
- }
- }
-
- <!--
- If the iframe controller is not created, we will create it. The name of the controller will contain the registration id of the producer.
- If we have mulitple viewers on the page with different registration ids, they will use different controllers.
- This is needed to be able to support multiple viewer coming from different versions
- -->
- if (!wsrp_rewrite_scope._F_CPSIFrameControllerDefined_<xsl:value-of select="$portlet-op/wsrp:registrationContext/wsrp:registrationHandle"/>){
- wsrp_rewrite_scope._F_CPSIFrameControllerDefined_<xsl:value-of select="$portlet-op/wsrp:registrationContext/wsrp:registrationHandle"/> = true;
- wsrp_rewrite_scope._F_CPSIFrameControllerInstance_<xsl:value-of select="$portlet-op/wsrp:registrationContext/wsrp:registrationHandle"/> = new _F_CPSIFrameController();
- }
-
- var wsrp_rewrite_controller = wsrp_rewrite_scope._F_CPSIFrameControllerInstance_<xsl:value-of select="$portlet-op/wsrp:registrationContext/wsrp:registrationHandle"/>;
-
- <!--
- If we reAuthenticated, tell the iframe controller to clean the cookie by submitting
- a request that will trigger the loging page causing the passport cookie to reset
- -->
- wsrp_rewrite_controller.clearCookie = wsrp_rewrite_isReAuthenticated();
-
- </script>
-
- <xsl:if test="$consumerAgent = 'sharepoint'">
- <!-- Add sharepoint specific collaboration code -->
- <script language="javascript" src="{$ui-webcontent}cps4/cpsweb/cpsweb.js"/>
- <script language="javascript" src="{$ui-webcontent}cps4/cpsweb/sp/collaboration.js"/>
- <script language="javascript">
- <!--
- ApplicationContent parameters. A list of parameters that are need by the collaboration feature.
- -->
- var wsrp_rewrite_params = {
- publishSpec:"<xsl:value-of select="xtsext:javascriptencode($publish-spec)"/>",
- discussionSpec:"<xsl:value-of select="xtsext:javascriptencode($discussion-spec)"/>",
- objectUrl: "<xsl:value-of select="xtsext:javascriptencode($url-item)"/>",
- publishWithoutPrompt:"<xsl:value-of select="xtsext:javascriptencode($publish-no-prompt)"/>",
- reportStoreId:"<xsl:value-of select="xtsext:javascriptencode($item/nav:internalId)"/>",
- searchPath:"<xsl:value-of select="xtsext:javascriptencode($item/nav:searchPath)"/>",
- sessionId:"<xsl:value-of select="xtsext:javascriptencode($session-id-param)"/>",
- canRun: <xsl:value-of select="boolean($is-dashboard or not($canView) or $display-action='run' or $display-action='prompt')"/>
- };
-
- var wsrp_rewrite_messages = {
- 'IDS_SP_ERROR_LABEL' :'<xts:string id="IDS_SP_ERROR_LABEL" encode="javascript"/>',
- 'IDS_SP_DOCUMENT_NAME_LABEL' :'<xts:string id="IDS_SP_DOCUMENT_NAME_LABEL" encode="javascript"/>',
- 'IDS_SP_DOCUMENT_NAME_TOOLTIP' :'<xts:string id="IDS_SP_DOCUMENT_NAME_TOOLTIP" encode="javascript"/>',
- 'IDS_SP_YES' :'<xts:string id="IDS_SP_YES" encode="javascript"/>',
- 'IDS_SP_NO' :'<xts:string id="IDS_SP_NO" encode="javascript"/>',
- 'IDS_SP_OK' :'<xts:string id="IDS_SP_OK" encode="javascript"/>',
- 'IDS_SP_CANCEL' :'<xts:string id="IDS_SP_CANCEL" encode="javascript"/>',
- 'IDS_SP_OBJECT_TYPE_SITE' :'<xts:string id="IDS_SP_OBJECT_TYPE_SITE" encode="javascript"/>',
- 'IDS_SP_OBJECT_TYPE_FOLDER' :'<xts:string id="IDS_SP_OBJECT_TYPE_FOLDER" encode="javascript"/>',
- 'IDS_SP_OBJECT_TYPE_DOCUMENT_LIBRARY' :'<xts:string id="IDS_SP_OBJECT_TYPE_DOCUMENT_LIBRARY" encode="javascript"/>',
- 'IDS_SP_OBJECT_TYPE_DISCUSSION_LIST' :'<xts:string id="IDS_SP_OBJECT_TYPE_DISCUSSION_LIST" encode="javascript"/>',
- 'IDS_SP_EDT_SELECT_DLG_DISCUSSION_TITLE' :'<xts:string id="IDS_SP_EDT_SELECT_DLG_DISCUSSION_TITLE" encode="javascript"/>',
- 'IDS_SP_EDT_SELECT_DLG_PUBLISH_TITLE' :'<xts:string id="IDS_SP_EDT_SELECT_DLG_PUBLISH_TITLE" encode="javascript"/>',
- 'IDS_SP_EDT_SELECT_DLG_LOCATION_TITLE':'<xts:string id="IDS_SP_EDT_SELECT_DLG_PUBLISH_LOCATION_TITLE" encode="javascript"/>',
- 'IDS_SP_MENU_RUN_PUBLISH' :'<xts:string id="IDS_SP_MENU_RUN_PUBLISH" encode="javascript"/>',
- 'IDS_SP_MENU_VERSIONS' :'<xts:string id="IDS_SP_MENU_VERSIONS" encode="javascript"/>',
- 'IDS_SP_RUNNING_REPORT' :'<xts:string id="IDS_SP_RUNNING_REPORT" encode="javascript"/>',
- 'IDS_SP_CANNOT_RUN_REPORT' :'<xts:string id="IDS_SP_CANNOT_RUN_REPORT" encode="javascript"/>',
- "IDS_SP_DOCUMENT_PUBLISHED": "<xts:string id="IDS_SP_DOCUMENT_PUBLISHED" encode="javascript"><xts:param name="doc">$1</xts:param><xts:param name="doclib">$2</xts:param></xts:string>",
- 'IDS_SP_DISCUSSION_STARTED' :'<xts:string id="IDS_SP_DISCUSSION_STARTED" encode="javascript"/>',
- 'IDS_SP_DISCUSSION_BODY' :'<xts:string id="IDS_SP_DISCUSSION_BODY" encode="javascript"><xts:param name="title">$1</xts:param></xts:string>',
- 'IDS_SP_VIEW_DOCUMENT_ALT' :'<xts:string id="IDS_SP_VIEW_DOCUMENT_ALT" encode="javascript"/>',
- 'IDS_SP_VIEW_DOCUMENT_LIBRARY_ALT' :'<xts:string id="IDS_SP_VIEW_DOCUMENT_LIBRARY_ALT" encode="javascript"/>',
- 'IDS_SP_MENU_DISCUSS_START' :'<xts:string id="IDS_SP_MENU_DISCUSS_START" encode="javascript"/>',
- 'IDS_SP_MENU_DISCUSS_SHOW_RELATED' :'<xts:string id="IDS_SP_MENU_DISCUSS_SHOW_RELATED" encode="javascript"/>',
- 'IDS_SP_DOCUMENT_PUBLISH_EXISTS':'<xts:string id="IDS_SP_DOCUMENT_PUBLISH_EXISTS" encode="javascript"><xts:param name="doc">$1</xts:param></xts:string>',
- 'IDS_SP_DOCUMENT_PUBLISH_EXISTS_HINT':'<xts:string id="IDS_SP_DOCUMENT_PUBLISH_EXISTS_HINT" encode="javascript"><xts:param name="doc">$1</xts:param></xts:string>',
- 'IDS_SP_ERROR_SESSION_EXPIRED':'<xts:string id="IDS_SP_ERROR_SESSION_EXPIRED" encode="javascript"></xts:string>',
- 'IDS_SP_PUBLISH_NO_SESSION':'<xts:string id="IDS_SP_PUBLISH_NO_SESSION" encode="javascript"></xts:string>',
- 'IDS_SP_PUBLISH_MISSING_PROMPTS':'<xts:string id="IDS_SP_PUBLISH_MISSING_PROMPTS" encode="javascript"></xts:string>',
- 'IDS_SP_ERROR_CLEAR':'<xts:string id="IDS_SP_ERROR_CLEAR" encode="javascript"></xts:string>'
- };
-
- var wsrp_rewrite_gateway = "<xsl:value-of select="xtsext:javascriptencode($ui-gateway)"/>";
- var wsrp_rewrite_webcontent = "<xsl:value-of select="xtsext:javascriptencode($ui-webcontent)"/>";
- var wsrp_rewrite_contentLocale = "<xsl:value-of select="xtsext:javascriptencode(/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/*[local-name()='biBusHeader']/*[local-name()='userPreferenceVars']/item[name='contentLocale']/value)"/>";
- var wsrp_rewrite_productLocale = "<xsl:value-of select="xtsext:javascriptencode(/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/*[local-name()='biBusHeader']/*[local-name()='userPreferenceVars']/item[name='productLocale']/value)"/>";
-
- <!-- Create the application context and the colloraboration objects -->
- <![CDATA[
-
- var wsrp_rewrite_app;
-
- var wsrp_rewrite_appContext = new com_ibm_cognos_cps.ApplicationContext({
- proxyTemplate:(new Object().href="wsrp_rewrite?wsrp-urlType=resource&wsrp-requiresRewrite=true&wsrp-url=_cpsresourceurl%3Acpsendmarker_/wsrp_rewrite"),
- renderUrl:(new Object().href="wsrp_rewrite?wsrp-urlType=render/wsrp_rewrite"),
- gateway:wsrp_rewrite_gateway,
- webcontent:wsrp_rewrite_webcontent,
- contentLocale: wsrp_rewrite_contentLocale,
- productLocale:wsrp_rewrite_productLocale,
- parameters: wsrp_rewrite_params,
- sessionController: wsrp_rewrite_controller
- });
-
- function wsrp_rewrite_getGetSessionUrl(){
- var target = wsrp_rewrite_gateway + "?" + "b_action=xts.run&m=cps4/common/getsession.xts&context=wsrp_rewrite_controller";
- return wsrp_rewrite_gateway + "?" + "b_action=xts.run&m=cps4/common/getsession.xts&target=" + encodeURIComponent(wsrp_rewrite_appContext.getProxiedResource(target));
- }
-
- com_ibm_cognos_cps.sp.executeWhenLoaded( function(){
- wsrp_rewrite_app = new com_ibm_cognos_cps.sp.CPSCollaboration (wsrp_rewrite_appContext, "wsrp_rewrite_app", wsrp_rewrite_messages);
- });
-
- ]]>
- </script>
-
- <iframe frameborder="0" scrolling="auto" id="wsrp_rewrite_getsession" style="display:none">
- </iframe>
- </xsl:if>
- <iframe onload="wsrp_rewrite_setReady(window.wsrp_rewrite_loginIframeWrapper)" frameborder="0" scrolling="auto" id="wsrp_rewrite_clearcookie" style="display:none">
- </iframe>
- </xsl:when>
- <xsl:otherwise>
- <script language="javascript">
- var wsrp_rewrite_frameloaded = false;
- function wsrp_rewrite_loadframe(){
- if (!wsrp_rewrite_frameloaded){
- var parentFrame = self;
- while(parentFrame != top){
- try{
- if (parentFrame.name != null){
- if (parentFrame.name.indexOf("<xsl:value-of select="$display-id"/>") != -1){
- var oDiv = document.getElementById("wsrp_rewrite_eholder");
- oDiv.style.display = "block";
- var oIFrame = document.getElementById("wsrp_rewrite_iframe");
- oIFrame.style.display = "none";
-
- wsrp_rewrite_frameloaded=true;
- return;
- }
- }
- }
- catch (e){
- }
- parentFrame= parentFrame.parent;
- }
- var oIFrame = document.getElementById("wsrp_rewrite_iframe");
- oIFrame.src= "<xsl:value-of select="xtsext:javascriptencode($url)"/>";
- wsrp_rewrite_frameloaded=true;
- }
- }
- </script>
- <div id="wsrp_rewrite_eholder" style="display:none;">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="portlet-font" align="center" valign="middle" height="100" id="wsrp_rewrite_error_txt">
- <xts:string id="IDS_NAV_VEW_RECURSIVE_CALL_ERROR"/>
- <br/><xts:string id="IDS_NAV_VEW_CONTACT_ADMINISTRATOR"/><br/>
- </td>
- </tr>
- </table>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="calculated-width">
- <xsl:choose>
- <xsl:when test="$display-width!=''">
- <xsl:value-of select="$display-width"/>
- </xsl:when>
- <xsl:otherwise>100%</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="not($is-external) and not($is-dashboard)">
- <script language="javascript">
- function wsrp_rewrite_showframe(){
- var oDiv = document.getElementById("wsrp_rewrite_busydiv");
- if (oDiv) {
- oDiv.style.display = "none";
- }
- }
- </script>
-
- <xsl:variable name="busydiv-style">
- <xsl:text>position:relative</xsl:text>
- <xsl:if test="$show-run-action">;display:none;</xsl:if>
- </xsl:variable>
- <div style="{$busydiv-style}" id="wsrp_rewrite_busydiv">
- <div style="text-align:center; position:absolute; padding:5px; left:45%">
- <img border="0" src="{ $ui-producer-images }progress.gif"/>
- <br/>
- <xts:string id="IDS_SEARCH_INDEXTREE_LOADING"/>
- </div>
- </div>
- </xsl:if>
- <iframe frameborder="0" scrolling="auto" id="wsrp_rewrite_iframe">
- <xsl:attribute name="width">
- <xsl:value-of select="$calculated-width"/>
- </xsl:attribute>
- <xsl:if test="$display-height!='' and $ui-window-state != 'wsrp:maximized'">
- <xsl:attribute name="height"><xsl:value-of select="$display-height"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$hidden = true()">
- <xsl:attribute name="style">display:none;</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$is-external">
- <xsl:attribute name="name">wsrp_rewrite_<xsl:value-of select="$display-id"/></xsl:attribute>
- <xsl:attribute name="src"><xsl:value-of select="$iFrameSrc"/></xsl:attribute>
- <xsl:attribute name="onload">wsrp_rewrite_loadframe()</xsl:attribute>
- </xsl:when>
- <xsl:when test="$third-party-portal">
- <xsl:attribute name="src">about:blank</xsl:attribute>
- <xsl:attribute name="onload">
- <xsl:text>wsrp_rewrite_setReady(window.wsrp_rewrite_iframeWrapper);</xsl:text>
- <xsl:if test="not($is-dashboard)">
- <xsl:text>if (window.wsrp_rewrite_iframeWrapper && wsrp_rewrite_iframeWrapper.isLocationSet) wsrp_rewrite_showframe();</xsl:text>
- </xsl:if>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="src"><xsl:value-of select="$url"/></xsl:attribute>
- <xsl:if test="not($is-dashboard)">
- <xsl:attribute name="onload">wsrp_rewrite_showframe();</xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </iframe>
- <xsl:if test="$consumerAgent = 'sharepoint'">
- <div id="wsrp_rewrite_app.id.toolbar" style="text-align:left; border-top:1px solid #ebebeb; padding:10px;margin-top:5px; display: none;">
- <a href="#" style="display:none" id="wsrp_rewrite_app.id.publish_menulink" onclick="setTimeout('wsrp_rewrite_app.publishMenuClick()',10);return false;"><xts:string id="IDS_SP_MENU_PUBLISH"/></a>
- <a href="#" style="margin-left:10px; display:none" id="wsrp_rewrite_app.id.discuss_menulink" onclick="setTimeout('wsrp_rewrite_app.discussMenuClick()',10);return false;"><xts:string id="IDS_SP_MENU_DISCUSS"/></a>
- </div>
- </xsl:if>
-
-
- <xsl:if test="not($is-external) and $third-party-portal">
- <script language="javascript">
- // register the iframeWrapper
- var wsrp_rewrite_iframeWrapper = new _F_CPSIFrame("wsrp_rewrite_iframe", "<xsl:value-of select="xtsext:javascriptencode($url)"/>", document);
-
- <!-- we only synchronize the iframe when we don't have the run option is not set to "prompt" -->
- <xsl:if test="not($show-run-action)">
- <xsl:choose>
- <xsl:when test="$viewer-resize='t'">
- <xsl:if test="$viewer-resize='t'">
- wsrp_rewrite_cpsFrame=wsrp_rewrite_iframeWrapper;
- </xsl:if>
- <!-- This may not work if browser is very slow -->
- setTimeout('wsrp_rewrite_addFrameToController(wsrp_rewrite_iframeWrapper)', 1000);
- </xsl:when>
- <xsl:otherwise>
- wsrp_rewrite_addFrameToController(wsrp_rewrite_iframeWrapper);
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </script>
- </xsl:if>
-
- <ui:maximize-scripts ui:objectId="wsrp_rewrite_iframe"/>
- </xsl:template>
- </xsl:stylesheet>
|