123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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).
- -->
- <!--
- ===============================================================================================
- Deletes an object in CM based on parameters passed in.
- Should delete a CM command like so:
- <delete xmlns="http://developer.cognos.com/schemas/xts-cm/1/" select="/Contents/folder/report"/>
- ===============================================================================================
- -->
- <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/">
- <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:delete/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:delete>
- <cm:objects xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <!-- Determine if doing a version delete, if so then skip the m_obj delete otherwise you'll lose the parent object too -->
- <xsl:variable name="isVersionsDelete" select="form:param[@name = 'vrsn_del']='true'"/>
- <xsl:choose>
- <!-- Single object delete. Execlude requests from the "previous versions" page where both m_obj and checkboxes might exist in the request -->
- <xsl:when test="(form:param[@name = 'm_obj'] and (form:param[@name = 'm_obj'] != ''))and not($isVersionsDelete)">
- <cm:nil>
- <cm:searchPath><xsl:value-of select="form:param[@name = 'm_obj']"/></cm:searchPath>
- </cm:nil>
- </xsl:when>
- <!-- Group delete -->
- <xsl:otherwise>
- <xsl:for-each select="form:param[starts-with(@name, 'checkbox_') and not (starts-with(@name, 'checkbox_dispatcher_')) and not (starts-with(@name, 'checkbox_configurationFolder_true_'))]">
- <cm:nil>
- <cm:searchPath><xsl:value-of select="xtsext:urldecode(string(.))"/></cm:searchPath>
- </cm:nil>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </cm:objects>
- <cm:options recursive="true" force="true"/>
- </cm:delete>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Delete notification that are no longer being used >
- <xts:block id="deleteSchedules" processor="XSLT" type="exec" dependency="doFormCommand">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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: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/schedules">
- <xts:sequence>
- <xts:append>
- <xsl:for-each select=".//cm:schedule">
- <send:request provider="xts">
- <Delete xmlns="http://developer.cognos.com/schemas/upfront/">
- <id><xsl:value-of select="cm:defaultName"/></id>
- </Delete>
- </send:request>
- </xsl:for-each>
- </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:deleteResponse"><xsl:copy-of select="cm:deleteResponse"/></xsl:when>
- <xsl:otherwise><error/></xsl:otherwise>
- </xsl:choose>
- </response>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|