| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 | <?xml version="1.0" encoding="UTF-8"?><!--    Licensed Materials - Property of IBM    IBM Cognos Products: ps    (C) Copyright IBM Corp. 2005, 2015    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).--><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  	xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"	xmlns:xts="http://developer.cognos.com/schemas/xts/"	xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb/"	xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"	xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"	xmlns:out="dummy-uri">		<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>	<xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>		<xsl:template match="rdb:pageTitle">		<out:choose>			<out:when test="key('env-param','from_schedule_tool') = 'true'">				<xts:string id="IDS_OTHERRUN_ONCE_TITLE">					<xts:param name="objectName">						<span lang="{'{$contentLocale}'}"><out:value-of select="xtsext:enforceBTD(key('env-param', 'm_name'), $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>					</xts:param>				</xts:string>							</out:when>			<out:otherwise>				<xsl:choose>					<xsl:when test="@mode='advanced'">						<xts:string id="IDS_OTHERRUN_ADVANCED_TITLE">							<xts:param name="objectName">								<span lang="{'{$contentLocale}'}"><out:value-of select="xtsext:enforceBTD(key('env-param', 'm_name'), $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>							</xts:param>						</xts:string>								</xsl:when>					<xsl:otherwise>						<xts:string id="IDS_OTHERRUN_TITLE">							<xts:param name="objectName">								<span lang="{'{$contentLocale}'}"><out:value-of select="xtsext:enforceBTD(key('env-param', 'm_name'), $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>							</xts:param>						</xts:string>					</xsl:otherwise>				</xsl:choose>			</out:otherwise>		</out:choose>	</xsl:template>		<xsl:template match="rdb:checkCredential">		<out:choose>			<out:when test="$the-credential">				<input type="hidden" name="m_sp_credential">					<out:attribute name="value"><out:value-of select="$the-credential/cm:searchPath"/></out:attribute>				</input>			</out:when>			<out:otherwise>				<input type="hidden" name="h_CAM_action" value=""/>			</out:otherwise>		</out:choose>		</xsl:template>	<xsl:template match="rdb:description">		<out:variable name="shortVersion">			<xsl:copy-of select="shortVersion/node()"/>		</out:variable>		<out:choose>			<out:when test="key('env-param','from_schedule_tool') = 'true'">				<out:choose>					<out:when test="$shortVersion = 'true'">						<xts:string id="IDS_RUN_ONCE_RUNNABLE_INTRO_SHORT"/>					</out:when>					<out:otherwise>						<xts:string id="IDS_RUN_ONCE_RUNNABLE_INTRO"/>					</out:otherwise>				</out:choose>			</out:when>			<out:otherwise>				<out:variable name="className">					<xsl:copy-of select="className/node()"/>				</out:variable>				<xts:string id="IDS_RUN_WITH_OPTIONS_CLASS_INTRO"><xts:param name="className"><out:value-of select="$className"/></xts:param></xts:string>			</out:otherwise>		</out:choose>	</xsl:template>	<xsl:template match="rdb:viewOrBackground">		<!-- Run now or in the background -->		<dp:choice title="IDS_TIME_AND_DELIVERY_RUN_LABEL" id="runType_radioGroup">			<utml:radio-group name="runType">				<utml:default-value>view</utml:default-value>				<dp:section1>					<utml:input type="radio" name="runType" value="view" onclick="updateRunType();updateOptionType();" id="ctrl_runType_view"/>				</dp:section1>				<dp:section2 for="ctrl_runType_view"><xts:string id="IDS_TIME_AND_DELIVERY_VIEW_REPORT"/></dp:section2>				<dp:section1>					<utml:input type="radio" name="runType" value="background" onclick="updateRunType();updateOptionType();" id="ctrl_runType_background">					</utml:input>				</dp:section1>				<dp:section2 for="ctrl_runType_background"><xts:string id="IDS_TIME_AND_DELIVERY_BACKGROUND_RUN"/></dp:section2>				<dp:section3>					<dp:choice>            <xsl:call-template name="rdb:nowOrLaterControls"/>          </dp:choice>				</dp:section3>			</utml:radio-group>		</dp:choice>	</xsl:template>	<xsl:template match="rdb:nowOrLater" name="rdb:nowOrLater">					<!-- Run now or in the background -->		<dp:choice title="IDS_TIME_RUN_LABEL" id="lbl_nowOrLaterRadioGroup">			<xsl:call-template name="rdb:nowOrLaterControls"/>		</dp:choice>	</xsl:template>		<xsl:template name="rdb:nowOrLaterControls">		<out:choose>			<out:when test="$userCanUseSched">				<out:variable name="runDate" select="key('env-param','p_runDate')"/>				<out:variable name="runTime" select="key('env-param','p_runTime')"/>        <utml:radio-group name="backgroundRun">					<utml:default-value>now</utml:default-value>					<dp:section1>						<utml:input id="id_backgroundRun_now" type="radio" name="backgroundRun" value="now"/>					</dp:section1>					<dp:section2 for="id_backgroundRun_now">            <div> <xts:string id="IDS_TIME_AND_DELIVERY_NOW"/>            </div>          </dp:section2>					<dp:section1>						<utml:input id="id_backgroundRun_later" type="radio" name="backgroundRun" value="later"/>					</dp:section1>					<dp:section2 for="id_backgroundRun_later">            <div>              <xts:string id="IDS_TIME_AND_DELIVERY_LATER"/>            </div>          </dp:section2>				</utml:radio-group>          				<dp:section3>					<dp:list>						<dp:section>							<dp:field width="200">								<!-- Render a select date prompt-->								<out:call-template name="getSelectDate">									<out:with-param name="promptLocale" select="$contentLocale"/>									<out:with-param name="promptTimeZone" select="$timeZone"/>									<out:with-param name="promptFormName" select="'pform'"/>									<out:with-param name="promptRequired" select="'false'"/>									<out:with-param name="promptStartOfWeek" select="'Sunday'"/>									<out:with-param name="promptCalendar" select="'Gregorian'"/>									<out:with-param name="promptParameter" select="'runDate'"/>									<out:with-param name="promptSelectDateUI" select="'editBox'"/>									<out:with-param name="promptInputOrder" select="'YMD'"/>									<out:with-param name="promptDefaultDate" select="$runDate"/>									<out:with-param name="promptDateTime" select="'false'"/>									<out:with-param name="promptMultiSelect" select="'false'"/>									<out:with-param name="promptId" select="'dateFrom'"/>									<out:with-param name="promptBrowserMode" select="$promptBrowserMode"/>									<out:with-param name="suppressDisabled" select="'true'"/>									<out:with-param name="promptSelectUI" select="'editBox'"/>								</out:call-template>							</dp:field>						</dp:section>					</dp:list>					<dp:list>						<dp:section>							<dp:field>								<out:call-template name="getSelectTime">									<out:with-param name="promptLocale" select="$contentLocale"/>									<out:with-param name="promptFormName" select="'pform'"/>									<out:with-param name="promptRequired" select="'false'"/>									<out:with-param name="promptDefaultValue" select="$runTime"/>									<out:with-param name="promptParameter" select="'runTime'"/>									<out:with-param name="promptShowSeconds" select="'false'"/>									<out:with-param name="promptInline" select="'false'"/>									<out:with-param name="promptTimeZone" select="$timeZone"/>									<out:with-param name="promptHourFormat" select="'hh'"/>									<out:with-param name="promptMinuteFormat" select="'mm'"/>									<out:with-param name="promptSecondFormat" select="'ss'"/>									<out:with-param name="promptMode" select="@mode"/>									<out:with-param name="promptMultiSelect" select="'false'"/>									<out:with-param name="promptId" select="'timeFrom'"/>									<out:with-param name="suppressDisabled" select="'true'"/>									<out:with-param name="promptBrowserMode" select="$promptBrowserMode"/>									<out:with-param name="promptSelectUI" select="'editBox'"/>								</out:call-template>							</dp:field>						</dp:section>					</dp:list>				</dp:section3>						</out:when>			<out:otherwise>				<utml:input type="hidden" name="backgroundRun" value="now"/>				<dp:section1><xts:string id="IDS_TIME_AND_DELIVERY_NOW"/></dp:section1>			</out:otherwise>		</out:choose>	</xsl:template>		<xsl:template match="rdb:interactiveJavaScript">		function launchPP8Viewer(format)		{  			var locale;			if (document.getElementById('outputLocaleDropDown')) {				locale = document.getElementById('outputLocaleDropDown').value;			}				else {				locale = '<out:value-of select="xtsext:javascriptencode($contentLocale)"/>'			}						var sPromptForValuesChecked;			if (document.pform.m_pp8ro_prompt.checked)				sPromptForValuesChecked = 'true';			else				sPromptForValuesChecked = 'false';			cognosLaunch('ui.gateway', '<out:value-of select="xtsext:javascriptencode(string($gateway))"/>', 'ui.tool', 'PowerplayStudio','ui.object', '<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_obj']))"/>', 'ui.backURL', '<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='backURL']))"/>', 'ui.la', '<out:value-of select="xtsext:javascriptencode($productLocale)"/>', 'ui.lo', locale, 'ui.crnp', sPromptForValuesChecked, 'ui.crnfrm', format, 'ui.action', 'run', 'ui.access', <out:text/>			<out:choose>				<out:when test="$userCanUsePPS or $has_execute_permission">'<out:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string('execute'), true()))"/>'</out:when>				<out:otherwise>'<out:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string('noexec'), true()))"/>'</out:otherwise>			</out:choose>			<out:text/>);		}				function launchViewer(format)		{			var GATEWAYPARAM="ui.gateway";			var frm = document.pform;					var formElement = document.createElement("form");			formElement.setAttribute("name","xtslaunch");			formElement.setAttribute("method","POST");			formElement.setAttribute("target","_self");					formElement.setAttribute("action", '<out:value-of select="$gateway"/>');			createHiddenInput(formElement, 'b_action', 'cognosViewer');						<!-- should the user be promted -->			var sPrompt;			if (frm.m_ro_prompt.checked)				sPrompt = 'true';			else				sPrompt = 'false';							var recordingEnabled;							<xsl:choose>				<xsl:when test="@advanced='true'">					if ( frm.m_ro_recordingEnabled.checked ) 						recordingEnabled = frm.m_ro_recordingEnabled.value;										else						recordingEnabled = 'false';				</xsl:when>				<xsl:otherwise>					recordingEnabled = 'false';				</xsl:otherwise>			</xsl:choose>			var locale = '';			if (document.getElementById('outputLocaleDropDown')) {				locale = document.getElementById('outputLocaleDropDown').value;			}							var a11y = '';			if (document.getElementById('m_go_accessibilityFeatures')) {				a11y = document.getElementById('m_go_accessibilityFeatures').checked;				createHiddenInput(formElement, 'system.<out:value-of select="xtsext:javascriptencode('http://developer.cognos.com/ceba/constants/systemOptionEnum#accessibilityFeatures')"/>',a11y);			}							createHiddenInput(formElement, 'ui.gateway', '<out:value-of select="xtsext:javascriptencode($gateway)"/>');			createHiddenInput(formElement, 'ui.action', 'run');			createHiddenInput(formElement, 'ui.object', '<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_obj']))"/>');			createHiddenInput(formElement, 'run.outputFormat', format);			createHiddenInput(formElement, 'run.outputLocale', locale);			createHiddenInput(formElement, 'run.prompt', sPrompt);			<out:if test="key('system-param', 'useReportLocaleInRVUI') = 'true'">				createHiddenInput(formElement, 'lang', locale);			</out:if>											<!-- this next one is passed to the viewer so that it can call back to this page on "Run again" -->			createHiddenInput(formElement, 'ui.name', '<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_name']))"/>');			createHiddenInput(formElement, 'ui.backURL', '<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='backURL']))"/>');			createHiddenInput(formElement, 'ui.runOptions', 'true');			<!--	this test for recording set to true can be removed once 					report server supports the recordingEnabled run option. -->			if ( recordingEnabled == "true" ) {				createHiddenInput(formElement, 'run.recordingEnabled', recordingEnabled);			}					<!-- For PDF format add page definition selection and page orientation option. -->			<xsl:if test="@advanced='true'">				if (format == "PDF")				{					<!-- page definition -->					if ( frm.m_ro_outputPageDefinition && frm.m_ro_outputPageDefinition.value != "default")					{						createHiddenInput(formElement, 'run.outputPageDefinition', frm.m_ro_outputPageDefinition.value);					}										<!-- page orientation -->					if (frm.m_ro_outputPageOrientation && frm.m_ro_outputPageOrientation.value != 'default')					{						createHiddenInput(formElement, 'run.outputPageOrientation', frm.m_ro_outputPageOrientation.value);					}				}								<!-- For HTML format, add selected No. of rows. -->												if (format == "HTML") {					if (frm.view_verticalElements) {						createHiddenInput(formElement, 'run.verticalElements', frm.view_verticalElements[frm.view_verticalElements.selectedIndex].value);					}										<!-- always need to send the selection based interactivity when HTML is selected (true OR false) -->					if (document.getElementById('view_selectionBasedFeatures')) {						createHiddenInput(formElement, 'run.selectionBasedFeatures', document.getElementById('view_selectionBasedFeatures').checked);					}				}						</xsl:if>			<!-- we need to build an errURL so if an error occurs in the cognos viewer, the user is returned to			the run with options when he hits OK on the error dialog -->			<!-- NOTE: Currently always pointing to the basic run with options dialog because of the limit in URL size -->			<out:variable name="errURL">				<out:value-of select="$gateway"/>?b_action=xts.run&m=<out:value-of select="$app"/>/runWithOptions/report.xts&m_obj=<out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name = 'm_obj'])),'url','url','getdata')"/>&m_class=<out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name = 'm_class'])),'url','url','getdata')"/>&m_name=<out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name = 'm_name'])),'url','url','getdata')"/>&backURL=<out:value-of select="xtsext:protect(xtsext:urlencode(string(/root/env/param[@name = 'backURL'])),'url','url','getdata')"/>			</out:variable>			sErrURL = "<out:value-of select="xtsext:javascriptencode(string($errURL))"/>";			<!-- only append the outputLocale, format and prompt info if the backURL is not javascript -->				<out:if test="not(starts-with(key('env-param','backURL'), 'javascript:'))">				sErrURL = sErrURL + 							'%26m_ro_outputLocale=' + locale + 							'%26format=' + format +							'%26m_ro_prompt=' + sPrompt;			</out:if>			createHiddenInput(formElement, 'errURL', sErrURL);			document.body.appendChild(formElement);			formElement.submit();			document.body.removeChild(formElement);			formElement = null;		}	</xsl:template>		<!-- Engine transform - this just ensures that everything not undeerstood by this logicheet gets copied over -->	<xsl:template match="*|@*|text()|processing-instruction()">		<xsl:copy>			<xsl:apply-templates select="*|@*|text()|processing-instruction()"/>		</xsl:copy>	</xsl:template></xsl:stylesheet>
 |