123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2017
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet resolverBase="prompting" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml" requiredCapability="canUseEventStudio">
- <!--
- ===============================================================================================
- Pull the report spec out into the DOM
- ===============================================================================================
- -->
- <xts:block id="buildSpecification" processor="XSLT" type="exec">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <specification>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='memberRequest'] and /root/env/param[@name='memberRequest'] = '2'">
- <metadataRequest connection="<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='model']))"/>">
- <Metadata authoringLocale="<xsl:value-of select="/root/env/param[@name='el']"/>" xml:lang="<xsl:value-of select="/root/env/param[@name='pl']"/>" Depth="2" start_atPath="<xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='startAtPath']))"/>" ResultStart="<xsl:value-of select="/root/env/param[@name='start_pos']"/>" ResultCount="21">
- <Properties>
- <Property name="./dimension"/>
- <Property name="./hierarchy"/>
- <Property name="./level"/>
- <Property name="./member"/>
- <Property name="./folder"/>
- <Property name="./@_RootMembers"/>
- <Property name="*/@name"/>
- <Property name="*/@_path"/>
- <Property name="*/@_ref"/>
- <Property name="*/@memberUniqueName"/>
- <Property name="*/@memberCaption"/>
- <Property name="*/@levelUniqueName"/>
- <Property name="*/@levelNumber"/>
- <Property name="*/@levelLabel"/>
- <Property name="*/@parentUniqueName"/>
- <Property name="*/@currencyCode"/>
- </Properties>
- <!-- build the filter if there is one -->
- <xsl:if test="/root/env/param[@name='filter'] and not(/root/env/param[@name='filter'] = '')">
- <Constraints>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='filter_type'] = 'equals' ">
- <Constraint Condition="[@memberCaption='<xsl:value-of select="/root/env/param[@name='filter']"/>']" CaseSensitive="false"/>
- </xsl:when>
- <xsl:otherwise>
- <Constraint Condition="[<xsl:value-of select="/root/env/param[@name='filter_type']"/>(@memberCaption,'<xsl:value-of select="/root/env/param[@name='filter']"/>')]" CaseSensitive="false"/>
- </xsl:otherwise>
- </xsl:choose>
- </Constraints>
- </xsl:if>
- </Metadata>
- </metadataRequest>
- </xsl:when>
- <xsl:otherwise>
- <!-- get the expression locale -->
- <xsl:variable name="el">
- <xsl:value-of select="/root/env/param[@name='el']"/>
- </xsl:variable>
- <xsl:variable name="di1" select="xtsext:xmlencode(string(/root/env/param[@name='queryRef']))"/>
- <xsl:variable name="qi1">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='memberRequest']='1'">
- <xsl:text>caption([</xsl:text>
- <xsl:value-of select="$di1"/>
- <xsl:text>])</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>[</xsl:text>
- <xsl:value-of select="$di1"/>
- <xsl:text>]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <report expressionLocale="<xsl:value-of select="$el"/>" xmlns="http://developer.cognos.com/schemas/report/14.0/">
- <modelPath><xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='model']))"/></modelPath>
- <XMLAttributes>
- <XMLAttribute name='contextItemFormat' value='XMLFormat'/>
- </XMLAttributes>
- <queries>
- <query name="q1">
- <source>
- <model/>
- </source>
- <selection>
- <!-- send in the data items, these have already been encoded-->
- <xsl:if test="/root/env/param[@name='queryItems']">
- <xsl:value-of select="/root/env/param[@name='queryItems']"/>
- </xsl:if>
- </selection>
- <!-- build the filter if there is one -->
- <xsl:if test="/root/env/param[@name='filter'] and not(/root/env/param[@name='filter'] = '')">
- <xsl:variable name="filter">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='filter_type'] = 'contains' ">
- <!-- [di1] CONTAINS 'Jame' -->
- <xsl:value-of select="$qi1"/>
- <xsl:text> CONTAINS '</xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='filter']))"/>
- <xsl:text>'</xsl:text>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='filter_type'] = 'starts-with' ">
- <!-- [di1] STARTS WITH 'Jame' -->
- <xsl:value-of select="$qi1"/>
- <xsl:text> STARTS WITH '</xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='filter']))"/>
- <xsl:text>'</xsl:text>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='filter_type'] = 'equals' ">
- <!-- [di1] = 'Jame' -->
- <xsl:value-of select="$qi1"/>
- <xsl:text> = '</xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='filter']))"/>
- <xsl:text>'</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <detailFilters>
- <detailFilter use="required" postAutoAggregation="false">
- <filterExpression><xsl:value-of select="$filter"/></filterExpression>
- </detailFilter>
- </detailFilters>
- </xsl:if>
- </query>
- </queries>
- <layouts>
- <layout>
- <defaultDataFormats>
- <numberFormat useGrouping="false"/>
- <currencyFormat useGrouping="false" currencySymbol=""/>
- <dateFormat dateSeparator="-" displayOrder="YMD" showEra="false" showYears="showCentury" showMonths="2-digits" showWeekday="false" showDays="2-digits"/>
- <timeFormat timeSeparator=":" showAmPm="false" showTimeZone="false" showHours="2-digits" showMinutes="2-digits" showSeconds="2-digits" showMilliseconds="3-digits" decimalDelimiter="."/>
- <dateTimeFormat dateSeparator="-" displayOrder="YMD" showEra="false" showYears="showCentury" showMonths="2-digits" showWeekday="false" showDays="2-digits" timeSeparator=":" showAmPm="false" showTimeZone="false" showHours="2-digits" showMinutes="2-digits" showSeconds="2-digits" showMilliseconds="3-digits" decimalDelimiter="."/>
- <intervalFormat dateSeparator="-" showYears="false" showMonths="false" showDays="true" timeSeparator=":" showHours="2-digits" showMinutes="2-digits" showSeconds="2-digits" showMilliseconds="3-digits" decimalSize="3" decimalDelimiter="." sign="-" useTrailingSign="false" useGrouping="false" units="time" whenZero="000 00:00:00.000"/>
- </defaultDataFormats>
- <reportPages>
- <page name="p1">
- <style><defaultStyles><defaultStyle refStyle="pg"/></defaultStyles></style>
- <pageBody >
- <style><defaultStyles><defaultStyle refStyle="pb"/></defaultStyles></style>
- <contents>
- <list refQuery="q1" rowsPerPage="23">
- <style><defaultStyles><defaultStyle refStyle="ls"/></defaultStyles></style>
- <listColumns>
- <listColumn>
- <listColumnTitle >
- <style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style>
- <contents/>
- </listColumnTitle>
- <listColumnBody >
- <style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style>
- <contents>
- <textItem>
- <dataSource>
- <dataItemValue refDataItem="<xsl:value-of select="$di1"/>"/>
- </dataSource>
- </textItem>
- </contents>
- </listColumnBody>
- </listColumn>
- </listColumns>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='sort']!='none'">
- <listGroups>
- <listGroup refDataItem="<xsl:value-of select="$di1"/>">
- <sortList>
- <sortItem refDataItem="<xsl:value-of select="$di1"/>" sortOrder="<xsl:value-of select="/root/env/param[@name='sort']"/>"/>
- </sortList>
- </listGroup>
- </listGroups>
- </xsl:when>
- <xsl:otherwise>
- <listGroups>
- <listGroup refDataItem="<xsl:value-of select="$di1"/>"/>
- </listGroups>
- </xsl:otherwise>
- </xsl:choose>
- </list>
- </contents>
- </pageBody>
- </page>
- </reportPages>
- </layout>
- </layouts>
- </report>
- </xsl:otherwise>
- </xsl:choose>
- </specification>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- call the getExternalRequest to see if the request came from the /ext entry point -->
- <xts:block id="getExternalRequest" dependency="buildSpecification" processor="XSLT" type="exec">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="pf">
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <externalRequest>
- <xts:function name="getRequestExternal" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:param name="passport">
- <xsl:value-of select="$passport"/>
- </xts:param>
- <xts:param name="secureState">
- <xsl:value-of select="/root/header/*[local-name()='biBusHeader']/*[local-name()='CAF']/*[local-name()='secureState']"/>
- </xts:param>
- </xts:function>
- </externalRequest>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- depending on the output of the getExternalRequest request - sign the request -->
- <xts:block id="signSpecification" dependency="getExternalRequest" processor="XSLT" type="exec">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <signedSpec>
- <xsl:choose>
- <xsl:when test="/root/getRequestExternalResponse">
- <xts:function name="signReportSpec" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:param name="source">
- <xsl:value-of select="/root/specification"/>
- </xts:param>
- </xts:function>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/specification"/>
- </xsl:otherwise>
- </xsl:choose>
- </signedSpec>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- build the output we want with the signed request -->
- <xts:block id="makeRequest" dependency="signSpecification" mode="output" mimeType="text/xml" processor="XSLT" type="exec">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <!-- build the metadata request -->
- <xsl:template match="/">
- <xsl:call-template name="buildSpec"/>
- </xsl:template>
- <xsl:template name="buildSpec">
- <bus:value xsi:type="bus:specification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:value-of select="/root/signedSpec"/>
- </bus:value>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|