123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
- <!--
- ===============================================================================================
- formlogic_init - standard form logic initialization
- ===============================================================================================
- -->
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
- <!--
- ===============================================================================================
- getContent -
- ===============================================================================================
- -->
- <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.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>
- <xsl:choose>
- <xsl:when test="key('env-param','m_rp_parameters')!=''">
- <xts:append>
- <xts:transform src="transforms/portal/parameters/group-parameters.xslt" processor="XSLT">
- <xsl:value-of select="xtsext:web64decode(string(key('env-param','m_rp_parameters')), true())" disable-output-escaping="yes"/>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <xsl:when test="key('env-param','defaultParameters')!=''">
- <xts:append>
- <xts:transform src="transforms/portal/parameters/group-parameters.xslt" processor="XSLT">
- <xsl:value-of select="xtsext:web64decode(string(key('env-param','defaultParameters')), true())" disable-output-escaping="yes"/>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <xsl:otherwise>
- <xts:append>
- <xts:transform src="transforms/portal/parameters/group-parameters.xslt" processor="XSLT">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query>
- <cm:search>
- <xsl:value-of select="key('env-param','m_obj')"/>
- <xsl:choose>
- <xsl:when test="key('env-param','m_class')='agentDefinition'">/report</xsl:when>
- <xsl:when test="key('env-param','m_class')='agentDefinitionView'">/reportView</xsl:when>
- </xsl:choose>
- </cm:search>
- <cm:properties>
- <cm:property name="parameters"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:transform>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- queryDataSourcePrompts - Get the parameter data source connection/signon information from CM
- ===============================================================================================
- -->
- <xts:block id="queryDataSourcePrompts"
- nodeList="credentialParameters,runnableParameters"
- path="/portal/iPrompting/logicsheets/query-datasource.xslt"
- processor="XSLT"
- type="exec"
- dependency="getContent"
- condition=".[/root/credentialParameters or /root/runnableParameters/credentialParameters]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <!--
- ===============================================================================================
- format_message -
- ===============================================================================================
- -->
- <xts:block id="format_prompts" dependency="getContent queryDataSourcePrompts" mode="output" processor="XSLT" type="exec" mimeType="text/html">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- <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:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- exclude-result-prefixes="xsl cm pf xtsext lyt dp df cf cp utml">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <xsl:variable name="mname" select="'view_prompts.xts'"/>
- <pf:variables/>
- <!-- global application variables -->
- <xsl:variable name="object-name">
- <xsl:choose>
- <xsl:when test=" key('env-param', 'm_new_class') != '' ">
- <xts:string id="IDS_ADDENTRIES_TITLE_NEW_JOB"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param', 'm_name')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="pageTitle">
- <xsl:choose>
- <!-- if we're viewing saved prompts and the class is a jobDefinition, we must be viewing the prompts from a step -->
- <xsl:when test="key('env-param', 'm_class') = 'jobDefinition'">
- <xts:string id="IDS_OTHERRUN_VIEW_PROMPTS_TITLE_STEPS">
- <xts:param name="objectName"><xsl:value-of select="$object-name"/></xts:param>
- <xts:param name="stepName">
- <xsl:value-of select="key('env-param', 'report_name')"/>
- </xts:param>
- </xts:string>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_OTHERRUN_VIEW_PROMPTS_TITLE">
- <xts:param name="objectName">
- <xsl:value-of select="/root/env/param[@name = 'm_name']"/>
- </xts:param>
- </xts:string>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/root">
- <xsl:variable name="parameters" select="./parameters"/>
- <xsl:variable name="credentials" select="./credentialParameters"/>
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
- <dp:meta>
- <pf:meta/>
- <!-- Standard meta tags -->
- </dp:meta>
- <dp:script>
- <pf:help context=""/>
- <!-- Help system -->
- </dp:script>
- <utml:form name="pform" method="post" action="{$gateway}">
- <!-- dialog header -->
- <dp:header>
- <!-- header titles-->
- <dp:title>
- <xsl:value-of select="$pageTitle"/>
- </dp:title>
- <dp:description>
- <xts:string id="IDS_OTHERRUN_VIEW_PROMPTS_DESCRIPTION"/>
- </dp:description>
- </dp:header>
- <xsl:if test="$parameters">
- <lyt:layout style="1">
- <lyt:section>
- <dp:list>
- <xsl:for-each select="$parameters/*[local-name()='parameterValue']">
- <dp:section>
- <dp:input>
- <dp:section1>
- <xsl:value-of select="*[local-name()='name']"/>
- <xsl:text><xts:string id="IDS_LIST_START"/></xsl:text>
- </dp:section1>
- <dp:section2>
- <xsl:apply-templates mode="render-values"/>
- </dp:section2>
- </dp:input>
- </dp:section>
- </xsl:for-each>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- </xsl:if>
- <xsl:if test="$credentials">
- <lyt:layout title="IDS_VIEW_PROMPTS_DATASOURCES" style="1" border="yes">
- <lyt:section>
- <dp:list>
- <xsl:for-each select="$credentials/credential">
- <xsl:call-template name="render-credential">
- <xsl:with-param name="credential" select="."/>
- <xsl:with-param name="pos" select="position()"/>
- </xsl:call-template>
- </xsl:for-each>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- </xsl:if>
- <!-- =================== F o o t e r ===================== -->
- <dp:footer>
- <xsl:choose>
- <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
- <df:button df:id="IDS_CLOSE" df:style="stack-down"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_CLOSE" df:style="back-url"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- </utml:form>
- </dp:page>
- </xsl:template>
- <xsl:template name="render-credential">
- <xsl:param name="credential" select="."/>
- <xsl:param name="pos"/>
- <xsl:variable name="dsConnections" select="/root/dataSources/cm:queryResponse/cm:queryReply/cm:dataSourceConnection"/>
- <dp:section>
- <dp:input>
- <dp:section1>
- <xts:string id="IDS_VIEW_PROMPTS_DATASOURCE"/>
- </dp:section1>
- <dp:section2>
- <xts:string id="IDS_VIEW_PROMPTS_CONNECTION">
- <xts:param name="datasource_name"><xsl:value-of select="$dsConnections[$pos]/cm:parent/cm:dataSource/cm:defaultName"/></xts:param>
- <xts:param name="connection_name"><xsl:value-of select="$dsConnections[$pos]/cm:defaultName"/></xts:param>
- </xts:string>
- <xsl:choose>
- <xsl:when test="$credential/dataSourceSignon != ''">
- <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
- <xts:param name="signon_name"><xsl:value-of select="$dsConnections[$pos]/../following-sibling::*[1]/cm:dataSourceSignon/cm:defaultName"/></xts:param>
- </xts:string>
- </xsl:when>
- <xsl:when test="$credential/username != '' and $credential/password != ''">
- <xsl:variable name="signon_name">
- <xts:string id="IDS_VIEW_PROMPTS_USERID_PASSWORD"/>
- </xsl:variable>
- <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
- <xts:param name="signon_name"><xsl:value-of select="$signon_name"/></xts:param>
- </xts:string>
- </xsl:when>
- <xsl:when test="$credential/username != ''">
- <xsl:variable name="signon_name">
- <xts:string id="IDS_VIEW_PROMPTS_USERID_ONLY"/>
- </xsl:variable>
- <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
- <xts:param name="signon_name"><xsl:value-of select="$signon_name"/></xts:param>
- </xts:string>
- </xsl:when>
- <xsl:when test="$credential/password != ''">
- <xsl:variable name="signon_name">
- <xts:string id="IDS_VIEW_PROMPTS_PASSWORD_ONLY"/>
- </xsl:variable>
- <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
- <xts:param name="signon_name"><xsl:value-of select="$signon_name"/></xts:param>
- </xts:string>
- </xsl:when>
- </xsl:choose>
- </dp:section2>
- </dp:input>
- </dp:section>
- </xsl:template>
- <xsl:template match="*[local-name()='simpleParmValueItem']" mode="render-values">
- <xsl:choose>
- <xsl:when test="*[local-name()='display'] != ''">
-  '<xsl:value-of select="*[local-name()='display']"/>',
- </xsl:when>
- <xsl:when test="*[local-name()='use'] != ''">
-  '<xsl:value-of select="*[local-name()='use']"/>',
- </xsl:when>
- <xsl:otherwise>
-  <xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/>,
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="*[local-name()='simpleParmValueItem'][last()]" mode="render-values">
- <xsl:choose>
- <xsl:when test="*[local-name()='display'] != ''">
-  '<xsl:value-of select="*[local-name()='display']"/>'<xsl:text/>
- </xsl:when>
- <xsl:when test="*[local-name()='use'] != ''">
-  '<xsl:value-of select="*[local-name()='use']"/>'<xsl:text/>
- </xsl:when>
- <xsl:otherwise>
-  <xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/><xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="not(position() = last())"><xts:string id="IDS_LIST_SEPARATOR"/></xsl:if>
- </xsl:template>
- <xsl:template match="*[local-name()='boundRangeParmValueItem' or local-name()='unboundedEndRangeParmValueItem' or local-name()='unboundedStartRangeParmValueItem']" mode="render-values">
- <xsl:variable name="startDisplay">
- <xsl:choose>
- <xsl:when test="*[local-name()='start']/*[local-name()='display']!=''">
- <xsl:value-of select="*[local-name()='start']/*[local-name()='display']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="*[local-name()='start']/*[local-name()='use']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="endDisplay">
- <xsl:choose>
- <xsl:when test="*[local-name()='end']/*[local-name()='display']!=''">
- <xsl:value-of select="*[local-name()='end']/*[local-name()='display']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="*[local-name()='end']/*[local-name()='use']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$startDisplay != '' and $endDisplay != ''">
- <xsl:choose>
- <xsl:when test="$startDisplay != $endDisplay">
-  '<xts:string id="IDS_OTHERRUN_BOUNDED_RANGE_VALUE">
- <xts:param name="startValue"><xsl:value-of select="$startDisplay"/></xts:param>
- <xts:param name="endValue"><xsl:value-of select="$endDisplay"/></xts:param>
- </xts:string>'<xsl:text/>
- </xsl:when>
- <xsl:otherwise>
-  '<xsl:value-of select="$endDisplay"/>'<xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$startDisplay != ''">
-  '<xts:string id="IDS_OTHERRUN_RANGED_START_PARAM_VALUE">
- <xts:param name="startValue"><xsl:value-of select="$startDisplay"/></xts:param>
- </xts:string>'<xsl:text/>
- </xsl:when>
- <xsl:when test="$endDisplay != ''">
-  '<xts:string id="IDS_OTHERRUN_RANGED_END_PARAM_VALUE">
- <xts:param name="endValue"><xsl:value-of select="$endDisplay"/></xts:param>
- </xts:string>'<xsl:text/>
- </xsl:when>
- <xsl:otherwise>
-  <xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="not(position() = last())"><xts:string id="IDS_LIST_SEPARATOR"/></xsl:if>
- </xsl:template>
- <xsl:template match="*[local-name()='hierarchicalParmValueItem']" mode="render-values">
- <xsl:param name="ancestorText">
- <xsl:choose>
- <xsl:when test="./*[local-name()='value']/*[local-name()='display'] != ''">
- <xsl:value-of select="./*[local-name()='value']/*[local-name()='display']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./*[local-name()='value']/*[local-name()='use']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="position" select="'first'"/>
-
- <xsl:choose>
- <xsl:when test="*[local-name()='hierarchicalParmValueItem']">
- <xsl:for-each select="./*[local-name()='hierarchicalParmValueItem']">
- <xsl:variable name="pos">
- <xsl:choose>
- <xsl:when test="$position = 'first' and position() = '1'">first</xsl:when>
- <xsl:otherwise>not_first</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="displayText">
- <xsl:choose>
- <xsl:when test="*[local-name()='value']/*[local-name()='display'] != ''">
- <xsl:value-of select="concat($ancestorText, ' > ' ,*[local-name()='value']/*[local-name()='display'])"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($ancestorText, ' > ' ,*[local-name()='value']/*[local-name()='use'])"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:apply-templates select="." mode="render-values">
- <xsl:with-param name="ancestorText" select="concat($ancestorText, ' > ' ,$displayText)"/>
- <xsl:with-param name="position" select="$pos"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$position='not_first'">
- <br/>
- </xsl:if>
- <xsl:text>'</xsl:text>
- <xsl:value-of select="$ancestorText"/>
- <xsl:text>'</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text()" mode="render-values"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug - display debug information
- ===============================================================================================
- -->
- <xts:block id="debug" dependency="format_prompts" 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" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|