123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?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).
- -->
- <!--
- ===============================================================================================
- Enables a schedule in CM based on parameters passed in.
- ===============================================================================================
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:create="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/" xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/" requiredCapability="canUseScheduling canUseMonitorActivityTool or">
- <xts:block id="doFormCommand" processor="XSLT" type="exec">
- <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/root/command/form:enable/form:env">
- <xts:sequence>
- <xts:append>
- <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/">
- <!-- this is the a single object -->
- <xsl:if test="(form:param[@name = 'm_obj'] and (form:param[@name = 'm_obj'] != ''))">
- <xsl:variable name="searchPath">
- <xsl:choose>
- <xsl:when test="contains(string(form:param[@name = 'm_obj']),'reportDataServiceAgentDefinition')">
- <xsl:value-of select="form:param[@name = 'm_obj']"/>/schedule<xsl:text/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="form:param[@name = 'm_obj']"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <cm:schedule>
- <cm:searchPath><xsl:value-of select="$searchPath"/></cm:searchPath>
- <cm:active>true</cm:active>
- </cm:schedule>
- </xsl:if>
- <!-- Capture if object is reportDataServiceAgentDefinition -->
- <xsl:variable name="isRule">
- <xsl:choose>
- <xsl:when test="form:param[@name = 'm_isRule']">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- this is when a list of items is sent via edit entries -->
- <xsl:for-each select="form:param[starts-with(@name, 'checkbox_')]">
- <cm:schedule>
- <xsl:variable name="searchPath">
- <xsl:choose>
- <xsl:when test="$isRule = 'true'">
- <xsl:value-of select="string(.)"/>/schedule<xsl:text/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="string(.)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <cm:searchPath><xsl:value-of select="$searchPath"/></cm:searchPath>
- <cm:active>true</cm:active>
- </cm:schedule>
- </xsl:for-each>
- </cm:objects>
- </cm:update>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- operation results -->
- <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doFormCommand">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <response xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
- <xsl:choose>
- <xsl:when test="cm:updateResponse"><xsl:copy-of select="cm:updateResponse"/></xsl:when>
- <xsl:otherwise><error/></xsl:otherwise>
- </xsl:choose>
- </response>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|