123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2005, 2012
- 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/" resolverBase="cogadmin">
- <xts:block id="frag_init"
- nodelist="env, credential"
- type="exec" mode="interpret" processor="XSLT"
- path="cogadmin/logicsheets/fragment_init.xslt"
- condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]" mandatory="true"/>
- <!--
- queryRelationshipByType
- For consolidated action we need to perform the actual action on the results of a QRBT request
- -->
- <xts:block id="queryRelationshipByType" dependency="frag_init" nodelist="env, header" type="exec" processor="XSLT" condition=".[/root/env/param[@name='actionQRBT'] != '']" mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- exclude-result-prefixes="xsl xos xtsext SOAP-ENV bus wsrf-rp">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:for-each select="/root/env/param[@name='actionResourceID' or starts-with(@name,'actionResourceID')]">
- <xsl:variable name="resourceParam" select="."/>
- <xts:sequence>
- <xts:replace select="/root/env/param[starts-with(@name,'actionResourceID') and text()='{$resourceParam}']">
- <xts:transform src="/cogadmin/controls/transforms/getQRBTResourceIDs.xslt" processor="XSLT">
- <root>
- <xts:request protocol="QueryRelationshipsByType" responseEnvelope="false">
- <SOAP-ENV:Envelope
- xmlns:nemo="http://developer.cognos.com/nemo"
- xmlns:muws-p2-xs="http://docs.oasis-open.org/wsdm/muws2-2.xsd"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- <nemo:cogadminHeader>
- <nemo:ResourceIdentifier><xsl:value-of select="$resourceParam"/></nemo:ResourceIdentifier>
- </nemo:cogadminHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <muws-p2-xs:QueryRelationshipsByType>
- <muws-p2-xs:RequestedType><xsl:value-of select="/root/env/param[@name='actionQRBT']"/></muws-p2-xs:RequestedType>
- </muws-p2-xs:QueryRelationshipsByType>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </root>
- </xts:transform>
- </xts:replace>
- </xts:sequence>
- </xsl:for-each>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
-
- <xts:block id="renderMarkup" dependency="queryRelationshipByType" type="exec" nodelist="env, header, user, system" processor="XSLT" mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:val="http://developer.cognos.com/schemas/validator/1/"
- xmlns:fragment="urn:cognos:fragments:validator"
- xmlns:fragment-cogadmin="urn:cognos:fragments:validator:cogadmin"
- exclude-result-prefixes="xsl ui xos xtsext SOAP-ENV bus wsrf-rp">
- <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>
- <xts:append select="/root/output">
- <xos:part>
- <xos:entityHeader>
- <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <markup>
- <mimeType>text/html</mimeType>
- <markupXml>
- <!-- render the HTML -->
- <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
- <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
- <root>
- <!-- Generate UI markup -->
- <xts:transform src="/cogadmin/controls/transforms/gen-ui-markup/perform_actions.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
- <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
- <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
- <root>
- <xsl:variable name="action" select="key('env-param','action')"/>
- <xsl:variable name="capability" select="key('env-param','capability')"/>
- <xsl:variable name="argument" select="key('env-param','argument')"/>
- <!--
- TODO: This should be optimized using AJAX requests so we don't have to wait for
- all actions to be completed before showing the popup dialog
- -->
- <xsl:for-each select="/root/env/param[@name='actionResourceID' or starts-with(@name,'actionResourceID')]">
- <response>
- <displayInfo>
- <!-- need to get some display information -->
- <xts:request protocol="GetMultipleResourceProperties">
- <SOAP-ENV:Envelope
- xmlns:nemo="http://developer.cognos.com/nemo"
- xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- <nemo:cogadminHeader>
- <nemo:ResourceIdentifier><xsl:value-of select="."/></nemo:ResourceIdentifier>
- </nemo:cogadminHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <wsrf-rp:GetMultipleResourceProperties>
- <wsrf-rp:ResourceProperty>Caption</wsrf-rp:ResourceProperty>
- <wsrf-rp:ResourceProperty>Icon</wsrf-rp:ResourceProperty>
- <wsrf-rp:ResourceProperty>IconTooltip</wsrf-rp:ResourceProperty>
- <wsrf-rp:ResourceProperty>Ancestors</wsrf-rp:ResourceProperty>
- <wsrf-rp:ResourceProperty>Hidden</wsrf-rp:ResourceProperty>
- </wsrf-rp:GetMultipleResourceProperties>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </displayInfo>
-
- <actionResponse>
- <!-- perform the action -->
- <xts:request protocol="ExecuteResourceAction" faultBlock="faultHandler">
- <SOAP-ENV:Envelope
- xmlns:nemo="http://developer.cognos.com/nemo"
- xmlns:muws-p2-xs="http://docs.oasis-open.org/wsdm/muws2-2.xsd"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- <nemo:cogadminHeader>
- <nemo:ResourceIdentifier><xsl:value-of select="."/></nemo:ResourceIdentifier>
- </nemo:cogadminHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <ns1:ExecuteResourceAction xmlns:ns1="http://developer.cognos.com/admin/properties">
- <ns1:Name><xsl:value-of select="$action"/></ns1:Name>
- <xsl:if test="$capability">
- <ns1:Capability><xsl:value-of select="$capability"/></ns1:Capability>
- </xsl:if>
- <xsl:if test="$argument">
- <ns1:Argument name="metricGroup"><xsl:value-of select="$argument"/></ns1:Argument>
- </xsl:if>
- <xsl:for-each select="/root/env/param[starts-with(@name, 'errDet')]">
- <xsl:variable name="errorDetailName"><xsl:value-of select="concat('errorDetail',position())"/></xsl:variable>
- <ns1:Argument name="{$errorDetailName}"><xsl:value-of select="."/></ns1:Argument>
- </xsl:for-each>
- </ns1:ExecuteResourceAction>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </actionResponse>
- </response>
- </xsl:for-each>
- <xts:queryNode select="/root/env | /root/system"/>
-
- <contentLocale>
- <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
- </contentLocale>
-
- </root>
- </xts:transform>
- <xts:queryNode select="/root/system | /root/session"/>
- </root>
- </xts:transform>
- </markupXml>
- </markup>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- Fault handler: If a fault happens during an action, then we need to catch it and process it.
- -->
- <xts:block id="faultHandler" dependency="frag_init" type="fault" processor="XSLT">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml"/>
- <xsl:template match="/root/fault">
- <actionFault>
- <xsl:if test="//*[local-name()='exception' and @partialSuccess='true']">
- <xsl:attribute name="partialSuccess">true</xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="."/>
- </actionFault>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|