parseContentTaskOptions.xslt 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2013
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!--
  13. This is used to determine the type of content task we're dealing with based on the task's options.
  14. -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  18. xmlns:set="http://exslt.org/sets"
  19. exclude-result-prefixes="xsl cm set">
  20. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  21. <xsl:key name="option-value" match="cm:queryReply/*/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']/*[local-name()='value']" use="../*[local-name()='name']"/>
  22. <xsl:template match="*[local-name()='queryResponse']" priority="1">
  23. <xsl:variable name="isCleanupContentVarient" select="key('option-value','cleanupContent')='true'"/>
  24. <xsl:variable name="willNotWriteToRepository" select="key('option-value','cleanupContentDoNotWriteToRepository')='true'"/>
  25. <xsl:variable name="willUpdateContextObjects" select="key('option-value','cleanupContentUpdateContextObjects') = 'true'"/>
  26. <xsl:variable name="isConsistencyCheck" select="key('option-value','checkSecurityReferences') = 'true' or key('option-value','repairSecurityReferences') = 'true' or key('option-value','checkInternalInconsistencies') = 'true' or key('option-value','repairInternalInconsistencies') = 'true'"/>
  27. <xsl:variable name="contentTaskType">
  28. <xsl:choose>
  29. <xsl:when test="$isConsistencyCheck">consistency</xsl:when>
  30. <xsl:when test="key('option-value', 'upgradeClasses')">reportUpgrade</xsl:when>
  31. <xsl:when test="$isCleanupContentVarient and $willUpdateContextObjects and $willNotWriteToRepository">retentionRuleUpdate</xsl:when>
  32. <xsl:when test="$isCleanupContentVarient and not($willNotWriteToRepository) and not($willUpdateContextObjects)">contentArchival</xsl:when>
  33. <xsl:when test="$isCleanupContentVarient and $willNotWriteToRepository and not($willUpdateContextObjects)">contentRemoval</xsl:when>
  34. <xsl:when test="key('option-value','createContentStoreUtilizationInfo')!=''">createContentUtilizationInfo</xsl:when>
  35. <xsl:otherwise>unknown</xsl:otherwise>
  36. </xsl:choose>
  37. </xsl:variable>
  38. <param name="contentTaskType"><xsl:value-of select="$contentTaskType"/></param>
  39. </xsl:template>
  40. </xsl:stylesheet>