getShortOptionsSummary.xslt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. 2012, 2013
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0"
  9. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  10. xmlns:dpl="http://developer.cognos.com/schemas/xts/logicsheets/deployment/"
  11. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  12. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  13. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  14. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  15. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  16. exclude-result-prefixes="xsl dpl pf cf cm xts xtsext">
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" />
  18. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*" />
  19. <pf:variables/>
  20. <xsl:variable name="normalized-content-locale" select="translate( $contentLocale, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )" />
  21. <xsl:key name="archive-details" match="/root/*[local-name()='archiveOptions']/*[local-name()='getDeploymentOptionsResponse']/*[local-name()='deploymentOptions']/*[local-name()='deploymentOption' and @name='package']/*[local-name()='packageDeploymentInfo']" use="*[local-name()='archiveSearchPath']" />
  22. <xsl:template match="/">
  23. <xts:sequence>
  24. <xts:append>
  25. <deploymentOptionsSummary>
  26. <xsl:variable name="includesTenants" select="count($the-object/cm:deploymentOptions/*[@name = 'tenants']/*) > 0"/>
  27. <xsl:variable name="isImportDeployment" select="$the-object/cm:objectClass='importDeployment'"/>
  28. <xsl:variable name="isDataSourceSelect" select="$the-object/cm:deploymentOptions/*[@name='dataSourceSelect']='true'"/>
  29. <xsl:variable name="isNamespaceSelect" select="$the-object/cm:deploymentOptions/*[@name='namespaceSelect']='true'"/>
  30. <xsl:variable name="isRecipientsSelect" select="$the-object/cm:deploymentOptions/*[@name='recipientsSelect']='true'"/>
  31. <xsl:variable name="isPersonalDataSelect" select="$the-object/cm:deploymentOptions/*[@name='personalDataSelect']='true'"/>
  32. <xsl:choose>
  33. <xsl:when test="$the-object/cm:deploymentOptions/*[@name = 'entireContentStoreSelect'] = 'true' and not($includesTenants)">
  34. <optionSummaryItem name="entireContentStoreSelect">
  35. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_CONTENT_STORE" />
  36. </optionSummaryItem>
  37. <xsl:if test="$isPersonalDataSelect">
  38. <optionSummaryItem name="personalDataSelect" dent="1">
  39. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_USER_ACCOUNT" />
  40. </optionSummaryItem>
  41. </xsl:if>
  42. <optionSummaryItem name="configuration" dent="1">
  43. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_CONFIGURATION" />
  44. </optionSummaryItem>
  45. <optionSummaryItem name="directory" dent="1">
  46. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_DIRECTORY" />
  47. </optionSummaryItem>
  48. <optionSummaryItem name="publicFolders" dent="1">
  49. <xts:string id="IDS_ALL_FILES" />
  50. </optionSummaryItem>
  51. <optionSummaryItem name="catalog" dent="1">
  52. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_CATALOG" />
  53. </optionSummaryItem>
  54. </xsl:when>
  55. <xsl:when test="$includesTenants">
  56. <optionSummaryItem name="entireContentStoreSelect">
  57. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_CONTENT_STORE" />
  58. </optionSummaryItem>
  59. <xsl:if test="$the-object/cm:deploymentOptions/*[@name = 'tenants']/*[.='']">
  60. <optionSummaryItem name="publicContent" dent="1">
  61. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_PUBLIC_CONTENT" />
  62. </optionSummaryItem>
  63. </xsl:if>
  64. <xsl:if test="$isPersonalDataSelect">
  65. <optionSummaryItem name="personalDataSelect" dent="1">
  66. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_USER_ACCOUNT" />
  67. </optionSummaryItem>
  68. </xsl:if>
  69. <xsl:variable name="includedTenants" select="$the-object/cm:deploymentOptions/*[@name = 'tenants']/*[.!='']"/>
  70. <xsl:if test="count($includedTenants) > 0" >
  71. <optionSummaryItem name="tenantContent" dent="1">
  72. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_TENANTS" />
  73. </optionSummaryItem>
  74. <xsl:for-each select="$includedTenants">
  75. <optionSummaryItem name="selectedTenant" dent="2">
  76. <xsl:value-of select="."/>
  77. </optionSummaryItem>
  78. </xsl:for-each>
  79. </xsl:if>
  80. </xsl:when>
  81. <xsl:when test="$isNamespaceSelect or $isDataSourceSelect or $isRecipientsSelect or $the-object/cm:deploymentOptions/*[@name='package']/*">
  82. <optionSummaryItem name="entireContentStoreSelect">
  83. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_CONTENT_STORE" />
  84. </optionSummaryItem>
  85. <xsl:if test="($isDataSourceSelect or $isNamespaceSelect or $isRecipientsSelect)">
  86. <optionSummaryItem name="directory" dent="1">
  87. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_DIRECTORY" />
  88. </optionSummaryItem>
  89. <optionSummaryItem name="namespaceSelect" dent="2">
  90. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_COGNOS_NAMESPACE" />
  91. </optionSummaryItem>
  92. </xsl:if>
  93. <xsl:if test="$the-object/cm:deploymentOptions/*[@name = 'package']/*">
  94. <xsl:if test="not($isImportDeployment)">
  95. <xsl:if test="not($isDataSourceSelect or $isNamespaceSelect or $isRecipientsSelect)">
  96. <optionSummaryItem name="directory" dent="1">
  97. <xts:string id="IDS_DEPLOYMENT_SHORT_OPTIONS_SUMMARY_DIRECTORY" />
  98. </optionSummaryItem>
  99. </xsl:if>
  100. <xsl:for-each select="/root/exportPackages/cm:queryResponse/cm:queryReply">
  101. <xsl:if test="*/cm:objectClass='account' or */cm:objectClass='namespace' or */cm:objectClass='namespaceFolder'">
  102. <xsl:call-template name="optionsSummary"/>
  103. </xsl:if>
  104. </xsl:for-each>
  105. <optionSummaryItem name="publicFolders" dent="1">
  106. <xts:string id="IDS_ALL_FILES" />
  107. </optionSummaryItem>
  108. </xsl:if>
  109. <xsl:for-each select="/root/exportPackages/cm:queryResponse/cm:queryReply">
  110. <xsl:if test="not(*/cm:objectClass='account' or */cm:objectClass='namespace' or */cm:objectClass='namespaceFolder')">
  111. <xsl:call-template name="optionsSummary"/>
  112. </xsl:if>
  113. </xsl:for-each>
  114. <xsl:if test="/root/cm:queryResponse/cm:queryReply[1]/*[local-name()='importDeployment']">
  115. <xsl:for-each select="$the-object/*[local-name()='deploymentOptions']/*[local-name()='deploymentOption' and @name='package']/*[local-name()='packageDeploymentInfo']">
  116. <xsl:variable name="deploymentNode" select="*[local-name()='archiveSearchPath']" />
  117. <optionSummaryItem name="selectedContainerItem" dent="2" lang="{$contentLocale}">
  118. <xsl:choose>
  119. <xsl:when test="*">
  120. <img height="16" width="20" align="absmiddle" src="{$skin_images}path.gif">
  121. <xsl:attribute name="alt">
  122. <cf:do-the-path-link>
  123. <cf:param name="familytree">key('archive-details',$deploymentNode)/*[local-name()='sourceAncestorsInfo']</cf:param>
  124. <cf:param name="familymember">key('archive-details',$deploymentNode)/*[local-name()='sourceName']</cf:param>
  125. <cf:param name="onlyAncestors">true</cf:param>
  126. </cf:do-the-path-link>
  127. </xsl:attribute>
  128. </img>
  129. <xsl:text>&#160;</xsl:text>
  130. <xsl:value-of select="key('archive-details',$deploymentNode)/*[local-name()='defaultName']" />
  131. <xsl:text>&#160;&#160;</xsl:text>
  132. </xsl:when>
  133. <xsl:otherwise>
  134. <xts:string id="IDS_PROP_ENTRY_NOT_FOUND" />
  135. </xsl:otherwise>
  136. </xsl:choose>
  137. </optionSummaryItem>
  138. </xsl:for-each>
  139. </xsl:if>
  140. </xsl:if>
  141. </xsl:when>
  142. </xsl:choose>
  143. </deploymentOptionsSummary>
  144. </xts:append>
  145. </xts:sequence>
  146. </xsl:template>
  147. <xsl:template name="optionsSummary">
  148. <optionSummaryItem name="selectedContainerItem" dent="2" lang="{$contentLocale}">
  149. <xsl:choose>
  150. <xsl:when test="*">
  151. <img height="16" width="20" align="absmiddle" src="{$skin_images}path.gif">
  152. <xsl:attribute name="alt">
  153. <cf:do-the-path-link>
  154. <cf:param name="familytree">*/*[local-name()='ancestors']</cf:param>
  155. <cf:param name="familymember">*/cm:defaultName</cf:param>
  156. <cf:param name="onlyAncestors">true</cf:param>
  157. </cf:do-the-path-link>
  158. </xsl:attribute>
  159. </img>
  160. <xsl:text>&#160;</xsl:text>
  161. <xsl:value-of select="*/cm:defaultName" />
  162. <xsl:text>&#160;&#160;</xsl:text>
  163. </xsl:when>
  164. <xsl:otherwise>
  165. <xts:string id="IDS_PROP_ENTRY_NOT_FOUND" />
  166. </xsl:otherwise>
  167. </xsl:choose>
  168. </optionSummaryItem>
  169. </xsl:template>
  170. <dpl:getDefaultPackageName />
  171. </xsl:stylesheet>