123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- <?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/" messageBase="messages/cogadminuimsgs.xml" resolverBase="cogadmin" requiredCapability="canUseSchedulingPriority">
- <!--
- clickedOk to update schedules - executed once the user hit the OK button on the Set the priority popup dialog to update the schedules
- -->
- <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"/>
-
- <xts:block id="clickedOkUpdateSchedules" dependency="frag_init" type="exec" nodelist="env, header, user, system" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='userClickedOk']='true' and /root/env/param[@name='setPriorityMode']='updateSchedules']">
- <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
- <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
- <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-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:es="http://developer.cognos.com/schemas/eventManagementService/1"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
- exclude-result-prefixes="xsl ui SOAP-ENC SOAP-ENV xos send xsd cm es xtsext xsi uic">
-
- <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="/">
- <!-- update the schedules with the selected priority (from Schedules) -->
- <xts:sequence>
- <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:update>
- <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:for-each select="/root/env/param[contains(@name, '_checkbox_')]">
- <cm:schedule>
- <cm:searchPath>
- <xsl:value-of select="string(.)"/>
- </cm:searchPath>
- <cm:priority><xsl:value-of select="key('env-param', 'priority')"/></cm:priority>
- </cm:schedule>
- </xsl:for-each>
- </cm:objects>
- </cm:update>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- clickedOk to update current background activities - executed once the user hit the OK button on the Set the priority popup dialog to update the current background activities
- -->
- <xts:block id="clickedOkUpdateCurrentActivities" dependency="frag_init" type="exec" nodelist="env, header, user, system" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='userClickedOk']='true' and /root/env/param[@name='setPriorityMode']='updateCurrentActivities']">
- <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
- <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
- <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-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:es="http://developer.cognos.com/schemas/eventManagementService/1"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
- exclude-result-prefixes="xsl ui SOAP-ENC SOAP-ENV xos send xsd cm es xtsext xsi uic">
-
- <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="/">
- <!-- update the upcoming_activities with the slected priority (from upcoming_activities) -->
- <xts:sequence>
- <xts:append>
- <result>
- <send:request provider="eventManagementService" faultBlock="faultHandler">
- <updateEvents>
- <events xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:eventRecord[{count(/root/env/param[contains(@name, '_checkbox_')])}]" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:for-each select="/root/env/param[contains(@name, '_checkbox_')]">
- <item type="tns:eventRecord">
- <eventID xsi:type="xsd:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:value-of select="xtsext:urldecode(string(.))"/>
- </eventID>
- <priority xsi:type="xsd:int" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:value-of select="key('env-param', 'priority')"/>
- </priority>
- </item>
- </xsl:for-each>
- </events>
- </updateEvents>
- </send:request>
- </result>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- checkResult - check result of request
- -->
- <xts:block id="checkResult" type="exec" dependency="frag_init clickedOkUpdateCurrentActivities clickedOkUpdateSchedules" nodelist="env, header, user, system, result" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='userClickedOk']='true' ]">
- <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
- <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
- <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-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:es="http://developer.cognos.com/schemas/eventManagementService/1"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
- exclude-result-prefixes="xsl ui SOAP-ENC SOAP-ENV xos send xsd cm es xtsext xsi uic">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <!-- create an empty fragment to run javascript -->
- <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>
- <fragment>
- <markup>
- <mimeType>text/html</mimeType>
- <markupXml>
- <script>
- <!-- Display alert when a fault was returned -->
- <xsl:if test="/root/result/actionFault">
- alert('<xts:string id="IDS_SPD_PRIORITY_INFO" encode="javascript"/>');
- </xsl:if>
- _THIS_.uiDialog.destroy();
- raiseReloadEvent(_THIS_);
- </script>
- </markupXml>
- </markup>
- </fragment>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env" processor="XSLT" condition=".[not(/root/env/param[@name='userClickedOk']='true')]">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- exclude-result-prefixes="xsl xts xos 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>
- <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>
- <fragment>
- <info>
- <title>IDS_SPD_TITLE</title>
- </info>
- <globalValidator>
- <parameter>
- <name>userClickedOk</name>
- <ruleRef id="fragment-cogadmin:boolean"/>
- </parameter>
- <parameter>
- <name>setPriorityMode</name>
- <ruleRef id="fragment-cogadmin:priorityMode"/>
- </parameter>
- </globalValidator>
- <meta/>
- </fragment>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- render - renders the Set the priority popup dialog
- -->
- <xts:block id="renderMarkup" type="exec" dependency="frag_init getMeta clickedOkUpdateSchedules checkResult" nodelist="env, header, user, system" processor="XSLT" mandatory="false" condition=".[not(/root/env/param[@name='userClickedOk'])]">
- <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
- <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:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
- xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
- 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 uic">
-
- <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/*[local-name()='part']/*[local-name()='entityBody']/fragment">
- <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>
- <uic:fragment>
- <uic:header modal="false">
- <uic:width>500</uic:width>
- <uic:height>100</uic:height>
- <uic:title><xts:string id="IDS_SPD_TITLE"/></uic:title>
- <uic:description><xts:string id="IDS_SPD_DESCRIPTION"/></uic:description>
- </uic:header>
- <!-- body -->
- <uic:body>
- <!-- priority filter -->
- <flt:priorityFilter prefix="_SP" showAny="false"/>
- </uic:body>
- <!-- add the selected checkboxes to a variable for passing into the retrieve() function-->
- <xsl:variable name="selectedItems">
- <xsl:for-each select="/root/env/param[contains(@name, '_checkbox_')]">
- <xsl:value-of select="concat(@name,'=',xtsext:urlencode(.),'&')"/>
- </xsl:for-each>
- </xsl:variable>
- <!-- show ourselves -->
- <script>
- _THIS_.unload = function(evt) {
- _THIS_.removeEventListener("cognos.ui.dialog.ok", "_THIS_.onDialogOK");
- _THIS_.removeEventListener("fragment.unload", _THIS_.unload);
- }
- _THIS_.onDialogOK = function(evt) {
- //round trip all the values of the checkboxes after checking that a priority has been selected
- if(document.getElementById('_SPfilter_priority').value=='') {
- alert('<xts:string id="IDS_SPD_NO_PRIORITY_WARNING" encode="javascript"/>');
- evt.preventDefault();
- return false;
- };
- _THIS_.retrieve('<xsl:value-of select="xtsext:javascriptencode(string($selectedItems))"/>' + 'userClickedOk=true&priority=' + document.getElementById('_SPfilter_priority').value + '&setPriorityMode=<xsl:value-of select="key('env-param','setPriorityMode')"/>');
- return true;
- }
- _THIS_.addEventListener("cognos.ui.dialog.ok", "_THIS_.onDialogOK");
- _THIS_.addEventListener("fragment.unload", _THIS_.unload);
- </script>
-
- </uic:fragment>
- <xts:queryNode select="/root/system | /root/session"/>
-
- </root>
- </xts:transform>
- </markupXml>
- </markup>
- </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" 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:copy-of select="."/>
- </actionFault>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|