123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569 |
- <?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 xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml" requiredCapability="canUseEventStudio">
- <!--
- ===================================================================================
- Get the information about the agent datasource
- ===================================================================================
- -->
- <xts:block id="getAgentModel" mode="interpret" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name='ui.action'] = 'edit']">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" exclude-result-prefixes="send">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- get the agent condition - which defines the model spec for the agent -->
- <!-- If ui.cacheContext is empty then retrieve data from CM. RTC:30774-->
- <xsl:choose>
- <xsl:when test="not(/root/env/param[@name='ui.cacheContext']) or /root/env/param[@name='ui.cacheContext']=''">
- <xts:append>
- <agentDataSource>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:int_model">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:value-of select="concat(string(/root/env/param[@name = 'ui.object']) , '/report')"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="metadataModelPackage"/>
- <cm:property name="searchPath"/>
- <cm:property name="metadataModel"/>
- <cm:property name="specification"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </agentDataSource>
- </xts:append>
- </xsl:when>
- <xsl:otherwise>
- <!-- If ui.cacheContext is not empty then call Content Manager Cache Service. -->
- <!--xsl:if test="/root/env/param[@name='ui.cacheContext']!=''">
- <xsl:if test="/root/env/param[@name='ui.object']!=''"-->
- <xts:append>
- <cm:queryResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
- <xts:request target="bus://dispatcher" name="BUS">
- <xts:param name="soapAction">contentManagerCacheService</xts:param>
- <xts:param name="responseEnvelope">false</xts:param>
- <xts:param name="outputHeader">false</xts:param>
- <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <xts:transform src="ags/transforms/transportRequester.xslt" processor="XSLT">
- <root>
- <requester>init_model</requester>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- </root>
- </xts:transform>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <cmCache:queryCache xmlns:cmCache="http://developer.cognos.com/schemas/contentManagerCacheService/1">
- <bus:objectPath xsi:type="bus:searchPathSingleObject">
- <xsl:value-of select="concat(string(/root/env/param[@name = 'ui.object']) , '/report')"/>
- </bus:objectPath>
- <bus:searchType xsi:type="bus:classEnum">report</bus:searchType>
- <bus:entries xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:classEnum[2]">
- <item xsi:type="bus:classEnum">package</item>
- <item xsi:type="bus:classEnum">report</item>
- </bus:entries>
- <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[1]">
- <item xsi:type="bus:genericOptionXMLEncodedXML">
- <bus:name xsi:type="xsd:string">http://developer.cognos.com/ceba/constants/contentManagerCacheOptionEnum#context</bus:name>
- <bus:value xsi:type="bus:xmlEncodedXML">
- <xsl:value-of select="/root/env/param[@name='ui.cacheContext']"/>
- </bus:value>
- </item>
- </bus:options>
- </cmCache:queryCache>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </cm:queryResponse>
- </xts:append>
- <xts:append>
- <agentDataSource>
- <queryResponse>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <xts:queryNode select="/root/*[local-name() = 'queryResponse']/*[local-name() = 'queryCacheResult']/result/objects"/>
- </xts:transform>
- </queryResponse>
- </agentDataSource>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===================================================================================
- Get information about the latest model from Content Manager
- ===================================================================================
- -->
- <xts:block id="getLatestModel" mode="interpret" processor="XSLT" type="exec" mandatory="false" dependency="getAgentModel" condition=".[/root/*[local-name()='agentDataSource']/*[local-name()='queryResponse']!='' or /root/env/param[@name='ui.action'] = 'new']">
- <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:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cm bus xtsext">
- <xsl:template match="/">
- <!--
- define the search path for the model, if the model package does not exist(which will be the case if the package has been removed and republished)
- then use the search path defined in the report specification
- -->
- <xsl:variable name="model_search">
- <xsl:choose>
- <xsl:when test="not(/root/agentDataSource/*[local-name()='queryResponse']/*[local-name()='report']/*[local-name()='metadataModelPackage']/*/*[local-name()='searchPath'])">
- <xsl:value-of select="/root/agentDataSource/*[local-name()='queryResponse']/*[local-name()='report']/*[local-name()='specification']/*[local-name()='report']/*[local-name()='modelPath']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(/root/agentDataSource/*[local-name()='queryResponse']/*[local-name()='report']/*[local-name()='metadataModelPackage']/*/*[local-name()='searchPath'], '/model[last()]')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$model_search='' and /root/env/param[@name='ui.action']='edit'">
-
- <xts:append>
- <agentDataSource>
- <modelFound>false</modelFound>
- </agentDataSource>
- </xts:append>
- </xsl:when>
- <xsl:otherwise>
-
- <xts:sequence>
-
- <!-- get the agent condition - which defines the model spec for the agent -->
- <!-- If ui.cacheContext is empty then retrieve data from CM. RTC:30774-->
- <xsl:choose>
- <xsl:when test="not(/root/env/param[@name='ui.cacheContext']) or /root/env/param[@name='ui.cacheContext']=''">
- <xts:append>
- <cmLastModel action="{/root/env/param[@name='ui.action']}">
- <!--
- we need responseEnvelope="true" otherwise, when we receive a fault, XTS doesn't render default error page.
- -->
- <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="false" soapAction="http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201505/" outputHeader="true">
- <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <bus:query>
- <search xsi:type="xsd:string">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.action'] = 'edit'">
- <xsl:value-of select="$model_search"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/env/param[@name='ui.object']"/>
- <xsl:text>/model[last()]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </search>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[3]">
- <item xsi:type="bus:propEnum">ancestors</item>
- <item xsi:type="bus:propEnum">defaultName</item>
- <item xsi:type="bus:propEnum">searchPath</item>
- </properties>
- <options xsi:type="cm:queryOptions">
- <refProps xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:refProp[1]">
- <item xsi:type="cm:refProp">
- <refPropName xsi:type="cm:propEnum">parent</refPropName>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:propEnum[1]">
- <item xsi:type="cm:propEnum">effectiveUserCapabilities</item>
- </properties>
- </item>
- </refProps>
- </options>
- </bus:query>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </cmLastModel>
- </xts:append>
- </xsl:when>
- <xsl:otherwise>
- <xts:append>
- <cm:queryModelResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
- <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="false" soapAction="contentManagerCacheService" outputHeader="true">
- <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:cmCache="http://developer.cognos.com/schemas/contentManagerCacheService/1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <xts:transform src="ags/transforms/transportRequester.xslt" processor="XSLT">
- <root>
- <requester>init_model</requester>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- </root>
- </xts:transform>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <cmCache:queryCache xmlns:cmCache="http://developer.cognos.com/schemas/contentManagerCacheService/1">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.action']='edit'">
- <bus:objectPath xsi:type="bus:searchPathSingleObject">
- <xsl:value-of select="$model_search"/>
- </bus:objectPath>
- </xsl:when>
- <xsl:otherwise>
- <bus:objectPath xsi:type="bus:searchPathSingleObject">
- <xsl:value-of select="/root/env/param[@name='ui.object']"/>
- <xsl:text>/model[last()]</xsl:text>
- </bus:objectPath>
- </xsl:otherwise>
- </xsl:choose>
- <bus:searchType xsi:type="bus:classEnum">model</bus:searchType>
- <bus:entries xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:classEnum[3]">
- <item xsi:type="bus:classEnum">model</item>
- <item xsi:type="bus:classEnum">package</item>
- <item xsi:type="bus:classEnum">packageConfiguration</item>
- </bus:entries>
- <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[1]">
- <item xsi:type="bus:genericOptionXMLEncodedXML">
- <bus:name xsi:type="xsd:string">http://developer.cognos.com/ceba/constants/contentManagerCacheOptionEnum#context</bus:name>
- <bus:value xsi:type="bus:xmlEncodedXML">
- <xsl:value-of select="/root/env/param[@name='ui.cacheContext']"/>
- </bus:value>
- </item>
- </bus:options>
- </cmCache:queryCache>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </cm:queryModelResponse>
- </xts:append>
- <xts:append>
- <cmLastModel action="{/root/env/param[@name='ui.action']}">
- <queryResponse>
- <queryResult>
- <xts:queryNode select="/root/*[local-name() = 'queryModelResponse']//*[local-name() = 'queryCacheResult']/result/objects/item"/>
- </queryResult>
- </queryResponse>
- </cmLastModel>
- </xts:append>
- <xts:delete select="/root/*[local-name()='queryModelResponse']" mandatory="false"/>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===================================================================================
- Get the package configuration from the package associated with the model
- ===================================================================================
- -->
- <xts:block id="getPackageConfiguration" mode="interpret" processor="XSLT" type="exec" mandatory="false" dependency="getLatestModel" condition=".[/root/*[local-name()='agentDataSource']/*[local-name()='queryResponse']!='' or /root/env/param[@name='ui.action'] = 'new']">
- <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:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cm bus xtsext">
- <xsl:template match="/">
- <!-- cache path would be *not required
- -->
- <xsl:choose>
- <xsl:when test="not(/root/env/param[@name='ui.cacheContext']) or /root/env/param[@name='ui.cacheContext']=''">
- <xsl:variable name="package_searchPath">
- <xsl:value-of select="/root/cmLastModel//*[local-name()='queryResponse']/*[local-name()='queryResult']/*[local-name()='item']/*[local-name()='ancestors']/*[local-name()='value']/*[local-name()='item'][last()]/*[local-name()='searchPath']"/>
- </xsl:variable>
- <xts:sequence>
- <xts:append>
- <cmPackage action="{/root/env/param[@name='ui.action']}" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
- <!--
- we need responseEnvelope="true" otherwise, when we receive a fault, XTS doesn't render default error page.
- -->
- <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" soapAction="http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201505/" outputHeader="true">
- <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <bus:query>
- <search xsi:type="xsd:string">
- <xsl:value-of select="concat($package_searchPath, '/packageConfiguration')"/>
- </search>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[2]">
- <item xsi:type="bus:propEnum">memberDisplayCountDefault</item>
- <item xsi:type="bus:propEnum">memberDisplayCountLimit</item>
- </properties>
- </bus:query>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </cmPackage>
- </xts:append>
- </xts:sequence>
- </xsl:when>
- <xsl:otherwise>
- <!-- queryCache has already got package configuration needs to be copied in seperate block -->
- <xts:sequence>
- <xts:append>
- <cmPackage>
- <cm:queryResponse xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <queryResult>
- <xsl:copy-of select="/root/cmLastModel//*[local-name()='queryResponse']/*[local-name()='queryResult']/*[local-name()='item'][last()]"/>
- </queryResult>
- </cm:queryResponse>
- </cmPackage>
- </xts:append>
- </xts:sequence>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===================================================================================
- Remove that block when you remove responseEnvelope="true" from the xts:request
- ===================================================================================
- -->
- <xts:block id="getLastModelFromCM" mode="interpret" processor="XSLT" type="exec" dependency="getPackageConfiguration" mandatory="false" condition=".[/root/*[local-name()='agentDataSource']/*[local-name()='queryResponse']!='' or /root/env/param[@name='ui.action'] = 'new']">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <xsl:template match="/">
- <xsl:variable name="latest_model_ref">
- <xsl:choose>
- <xsl:when test="not(/root/env/param[@name='ui.cacheContext']) or /root/env/param[@name='ui.cacheContext']=''">
- <xsl:value-of select="/root/cmLastModel//*[local-name()='queryResponse']/*[local-name()='queryResult']/*[local-name()='item']/*[local-name()='searchPath']/*[local-name()='value']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/cmLastModel//*[local-name()='queryResponse']/*[local-name()='queryResult']/*[local-name()='item'][./objectClass/value='model']/*[local-name()='searchPath']/*[local-name()='value']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="agent_model_ref">
- <xsl:value-of select="/root/agentDataSource/*[local-name()='queryResponse']/*[local-name()='report']/*[local-name()='metadataModel']/*[local-name()='model']/*[local-name()='searchPath']"/>
- </xsl:variable>
- <xts:sequence>
- <xts:replace select="/root/cmLastModel">
- <cmLastModel action="{/root/env/param[@name='ui.action']}">
- <xsl:copy-of select="/root/cmLastModel/*"/>
- <xsl:if test="not($agent_model_ref = $latest_model_ref) or $agent_model_ref = ''">
- <updateFrom>
- <xsl:value-of select="$agent_model_ref "/>
- </updateFrom>
- </xsl:if>
- </cmLastModel>
- </xts:replace>
- <xsl:if test="not(/root/env/param[@name='ui.cacheContext']) or /root/env/param[@name='ui.cacheContext']=''">
- <xts:replace select="/root/cmPackage">
- <cmPackage>
- <xsl:copy-of select="/root/cmPackage/SOAP-ENV:Envelope/SOAP-ENV:Body/*"/>
- </cmPackage>
- </xts:replace>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===================================================================================
- Get the global capabilities that we are interested in
- ===================================================================================
- -->
- <xts:block id="getCapabilities" mode="interpret" processor="XSLT" type="exec" dependency="getLastModelFromCM" mandatory="false" condition=".[/root/*[local-name()='agentDataSource']/*[local-name()='queryResponse']!='' or /root/env/param[@name='ui.action'] = 'new']">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <xts:transform src="ags/transforms/get_capabilities.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/header/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']/*[local-name()='userCapabilities']"/>
- <effectiveCapabilities>
- <xsl:copy-of select="/root/cmLastModel/*[local-name()='queryResponse']//*[local-name()='effectiveUserCapabilities']/value/item"/>
- </effectiveCapabilities>
- <!-- These capabilities are global and relevant to us so they are added to the capability list-->
- <globalCapabilities>
- <item>canUseContentStoreTool</item>
- <item>canUseIndexSearch</item>
- <item>canUseScheduling</item>
- </globalCapabilities>
- </root>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===================================================================================
- Do the output script - which sets up the properties pane and the metadata tree
- ===================================================================================
- -->
- <xts:block id="doScript" type="exec" mode="output" processor="XSLT" mimeType="text/html; charset=utf-8" dependency="getCapabilities" mandatory="false" condition=".[/root/*[local-name()='agentDataSource']/*[local-name()='queryResponse']!='' or /root/env/param[@name='ui.action'] = 'new']">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <!-- current file name -->
- <xsl:variable name="mname" select="'/conv.xts'"/>
- <xsl:variable name="packageRoot">
- <xsl:choose>
- <xsl:when test="not(/root/env/param[@name='ui.cacheContext']) or /root/env/param[@name='ui.cacheContext']=''">
- <xsl:value-of select="/root/cmLastModel/*[local-name()='queryResponse']/queryResult/item/ancestors/value/item[objectClass='package']/searchPath"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/cmLastModel/*[local-name()='queryResponse']/queryResult/item[objectClass/value='package']/searchPath/value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/root">
- <html lang="{/root/user/param[@name='productLocale']}">
- <head>
- <title><xts:string id="METADATA_FRAME"/></title>
- <script type="text/javascript">
- <!-- this section sets the values that we need for the metadata model -->
- function setModelInfo() {
- var cf= (this.getConfigFrame?this.getConfigFrame():(parent.getConfigFrame?parent.getConfigFrame():null));
- if (cf==null||!cf.cfgGet||!cf.cfgGet("SCRIPT_ENGINE")) setTimeout(this.setModelInfo,250);
- else {
- // lets set the values for the locals in here too
- cf.cfgSet("productLocale", "<xsl:value-of select="/root/user/param[@name='productLocale']"/>");
- cf.cfgSet("contentLocale", "<xsl:value-of select="/root/user/param[@name='contentLocale']"/>");
- <!-- set the expression locale from the report on the agent -->
- var lastExpressionLocale = cf.cfgGet("expressionLocale");
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.action'] = 'edit' ">
- var loadedExpressionLocale = "<xsl:value-of select="xtsext:javascriptencode(string(/root/agentDataSource/*[local-name()='queryResponse']/*[local-name()='report']/*[local-name()='specification']/*[local-name()='report']/@expressionLocale))"/>";
- </xsl:when>
- <xsl:otherwise>
- // we can't load an expression locale from a package
- var loadedExpressionLocale = cf.cfgGet("contentLocale");
- </xsl:otherwise>
- </xsl:choose>
- var lastModel = cf.cfgGet("cmLastModel");
- var loadedModel = "<xsl:value-of select="xtsext:javascriptencode(string(/root/cmLastModel/*[local-name()='queryResponse']/queryResult/item/searchPath/value))"/>";
-
- // at this point we can decide if we need to blat the trees
- if (lastModel != loadedModel || lastExpressionLocale != loadedExpressionLocale) {
- // have to signal via flags - eek
- cf.cfgSet("reloadMetadataTree",1);
- cf.cfgSet("reloadFunctionsTree",1);
- }
-
- cf.cfgSet("expressionLocale", loadedExpressionLocale);
- cf.cfgSet("cmLastModel",loadedModel);
- <xsl:choose>
- <xsl:when test="$packageRoot!=''">
- cf.cfgSet("PackageRoot","<xsl:value-of select="xtsext:javascriptencode(xtsext:urlencode(string($packageRoot)))"/>");
- </xsl:when>
- <xsl:when test="key('env-param','ui.object')!=''">
- cf.cfgSet("PackageRoot","<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','ui.object')))"/>");
- </xsl:when>
- </xsl:choose>
- <!-- save the package configuration information that we've asked for -->
- <xsl:variable name="t1">
- <xsl:choose>
- <xsl:when test="xtsext:javascriptencode(string(/root/cmPackage//*[local-name()='queryResponse']/queryResult/item/memberDisplayCountDefault/value))!=''">
- <xsl:value-of select="xtsext:javascriptencode(string(/root/cmPackage//*[local-name()='queryResponse']/queryResult/item/memberDisplayCountDefault/value))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="20"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- cf.cfgSet("memberDisplayCountDefault","<xsl:value-of select="$t1"/>");
-
- <xsl:variable name="t2">
- <xsl:choose>
- <xsl:when test="xtsext:javascriptencode(string(/root/cmPackage//*[local-name()='queryResponse']/queryResult/item/memberDisplayCountLimit/value))!=''">
- <xsl:value-of select="xtsext:javascriptencode(string(/root/cmPackage//*[local-name()='queryResponse']/queryResult/item/memberDisplayCountLimit/value))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="50"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- cf.cfgSet("memberDisplayCountLimit","<xsl:value-of select="$t2"/>");
-
- <!-- default report name should always be persent (for agent name - new) -->
- cf.cfgSet("DefaultReportName","<xts:string id="NEW_AGENT_NAME" encode="javascript"/>");
- <!-- if we're making a new agent - then we set the name of the agent here - cause we load up add_condition in
- the other thread - which does nothing. If editting an agent - we call load_agent - and that does the work -->
- <xsl:if test="/root/env/param[@name='ui.action'] = 'new'">
-
- cf.cfgSet("ReportName","<xts:string id="NEW_AGENT_NAME" encode="javascript"/>");
- cf.setWindowTitle();
- <xsl:if test="/root/env/param[@name = 'ui.folder']">
- cf.cfgSet("ReportFolder", "<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='ui.folder']))"/>");
- </xsl:if>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="/root/cmLastModel/updateFrom">
- cf.cfgSet('updatedModel', 'oldModel:<xsl:value-of select="xtsext:javascriptencode(string(/root/cmLastModel/updateFrom))"/>');
- </xsl:when>
- <xsl:otherwise>
- cf.cfgRemove('updatedModel');
- </xsl:otherwise>
- </xsl:choose>
- <!-- Trakker bug 593870.0 - The 'Schedule the agent...' link is missing from the 'I want to...' area
- We need to check if we have the 'canUseScheduling' capability. There will never be an effective capability for 'userCanUseSched'
- because it not a package capability. The check needs to be made against the users global capabilities cache
-
- Trakker bug 593901.0 - Some tasks are missing in Event Studio
- Missing import, export and content management
- -->
- var capabilities = "<xsl:value-of select="/root/capabilities"/>";
- cf.cfgSet("userCapabilities",capabilities);
- cf.resetMenus();
- cf.getCommandStackManager().processCommandStack();
- }
- }
-
- <!-- do both the modelling info and the properties info -->
- function doOnLoad()
- {
- setModelInfo();
- }
-
- </script>
- </head>
- <body onload="doOnLoad();">
-  
- <!--dbg:dumpxml select="/"/-->
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- the agent model could not be found(maybe this user does not have permissions to view it)
- ===============================================================================================
- -->
- <xts:block id="doScriptNoModel" type="exec" mode="output" processor="XSLT" mimeType="text/html; charset=utf-8" dependency="getLastModelFromCM" mandatory="false" condition=".[/root/*[local-name()='agentDataSource']/*[local-name()='queryResponse']='' and /root/env/param[@name='ui.action'] = 'edit']">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:variable name="mname" select="'/conv.xts'"/>
- <xsl:template match="/root">
- <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
- <html>
- <head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title><xts:string id="METADATA_FRAME"/></title>
- <script type="text/javascript">
- function doOnLoad() {
- var cf= (this.getConfigFrame?this.getConfigFrame():(parent.getConfigFrame?parent.getConfigFrame():null));
- cf.getCommandStackManager().initiateCommandStack("leaveAGS()","alert(\'<xts:string id="METADATA_NOT_FOUND" encode="javascript"/>\');window.onbeforeunload=null;window.close()");
- }
- </script>
- </head>
- <body onload="doOnLoad();">
-  
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|