importUserInterfaceProfiles.xslt 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 2014
  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. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:resource-prop="http://developer.cognos.com/admin/properties" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:ns1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" xmlns:admui="http://developer.cognos.com/schemas/xts/admui" xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2" exclude-result-prefixes="wsrf-rp resource-prop admui xtsext xsl ns1 uic SOAP-ENV muws2 xts">
  13. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  14. <admui:variables/>
  15. <xsl:template match="/root" priority="2">
  16. <xsl:variable name="profiles" select="/root/profiles"/>
  17. <uic:fragment>
  18. <xsl:variable name="resultsMsg">
  19. <xsl:choose>
  20. <xsl:when test="$profiles/profile/importFault">
  21. <xsl:text><xts:string id="IDS_UIP_IMPORT_FAILED"/></xsl:text>
  22. </xsl:when>
  23. <xsl:otherwise>
  24. <xsl:text><xts:string id="IDS_UIP_IMPORT_SUCCEEDED"/></xsl:text>
  25. </xsl:otherwise>
  26. </xsl:choose>
  27. </xsl:variable>
  28. <div class="cogstyle-dialog-content">
  29. <div class="dialogHeaderText">
  30. <xsl:value-of select="$resultsMsg"/>
  31. </div>
  32. </div>
  33. <uic:table>
  34. <uic:header>
  35. <uic:row>
  36. <uic:column role="presentation"/>
  37. <uic:column width="20%" scope="col">
  38. <uic:text>
  39. <xts:string id="IDS_ADM_ACT_TABLE_HEADER_NAME"/>
  40. </uic:text>
  41. </uic:column>
  42. <uic:column width="20%" scope="col">
  43. <uic:text>
  44. <xts:string id="IDS_UIP_TABLE_HEADER_IMPORT_NAME"/>
  45. </uic:text>
  46. </uic:column>
  47. <uic:column width="80%" scope="col">
  48. <uic:text>
  49. <xts:string id="IDS_ADM_ACT_TABLE_HEADER_MESSAGE"/>
  50. </uic:text>
  51. </uic:column>
  52. </uic:row>
  53. </uic:header>
  54. <uic:body>
  55. <xsl:for-each select="$profiles/profile">
  56. <uic:row>
  57. <uic:column nowrap="nowrap">
  58. <uic:icon width="16" height="16">
  59. <uic:src>
  60. <admui:imageURL>
  61. <admui:image>
  62. <xsl:choose>
  63. <xsl:when test="importFault">
  64. <xsl:text>ps/cogadmin/images/msg_error.gif</xsl:text>
  65. </xsl:when>
  66. <xsl:otherwise>
  67. <xsl:text>ps/portal/images/checkmark.gif</xsl:text>
  68. </xsl:otherwise>
  69. </xsl:choose>
  70. </admui:image>
  71. </admui:imageURL>
  72. </uic:src>
  73. </uic:icon>
  74. </uic:column>
  75. <uic:column nowrap="nowrap">
  76. <uic:text>
  77. <xsl:value-of select="@name"/>
  78. </uic:text>
  79. </uic:column>
  80. <uic:column nowrap="nowrap">
  81. <uic:text>
  82. <xsl:value-of select="@targetName"/>
  83. </uic:text>
  84. </uic:column>
  85. <uic:column nowrap="nowrap">
  86. <uic:text>
  87. <xsl:choose>
  88. <xsl:when test="importFault">
  89. <xsl:value-of select="importFault/*[local-name()='exception'][2]/*[local-name()='exceptionMsg']"/>
  90. </xsl:when>
  91. <xsl:otherwise>
  92. <xts:string id="IDS_UIP_IMPORT_VALIDATED"/>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </uic:text>
  96. </uic:column>
  97. </uic:row>
  98. </xsl:for-each>
  99. </uic:body>
  100. </uic:table>
  101. <xsl:if test="not($profiles/profile/importFault)">
  102. <table class="cogstyle-dialog-content">
  103. <tr>
  104. <td>
  105. <uic:icon>
  106. <uic:src>
  107. <admui:imageURL>
  108. <admui:image>
  109. <xsl:text>ps/cogadmin/images/msg_warning.gif</xsl:text>
  110. </admui:image>
  111. </admui:imageURL>
  112. </uic:src>
  113. </uic:icon>
  114. </td>
  115. <td>
  116. <xsl:choose>
  117. <xsl:when test="/root/advancedSettings/configuration/property[@name='COGADMIN.UIPROFILES.DELETE_LEGACY_UIPROFILES_PAGE_AFTER_IMPORT']='false'">
  118. <xts:string id="IDS_UIP_IMPORT_REDIRECT_ALERT"/>
  119. </xsl:when>
  120. <xsl:otherwise>
  121. <xts:string id="IDS_UIP_IMPORT_REDIRECT_AND_DELETE_ALERT"/>
  122. </xsl:otherwise>
  123. </xsl:choose>
  124. </td>
  125. </tr>
  126. </table>
  127. </xsl:if>
  128. <script>
  129. var title='<xts:string id="IDS_UIP_IMPORT_UIPROFILES" encode="javascript"></xts:string>';
  130. var uiDialog = showModalDialog(ui_dialog.button.OK,_THIS_.div, title, 180, 810);
  131. uiDialog.processCommand = function (btnType){
  132. <xsl:if test="not($profiles/profile/importFault)">
  133. var bookletTabs = window.adminconsole_xmlbooklettabs;
  134. if(bookletTabs) {
  135. securityHTab = bookletTabs.getTab(1);
  136. securityHTab.refresh(true);
  137. libraryHTab = bookletTabs.getTab(3);
  138. if (libraryHTab.isLoaded()) {
  139. libraryHTab.refresh(true);
  140. var libraryVTabs = libraryHTab.getVTabs();
  141. libraryVTabs.activeTabID = ""; //This will cause the 1st vTab to be selected
  142. }
  143. libraryHTab.onclick();
  144. } else if (adminconsole_xmlbookletheaderrefreshAll) {
  145. adminconsole_xmlbookletheaderrefreshAll();
  146. } else {
  147. window.location.reload();
  148. }
  149. </xsl:if>
  150. uiDialog.destroy();
  151. return true;
  152. };
  153. </script>
  154. </uic:fragment>
  155. </xsl:template>
  156. <xsl:template match="node()" priority="-1">
  157. <xsl:copy>
  158. <xsl:copy-of select="@*"/>
  159. <xsl:apply-templates/>
  160. </xsl:copy>
  161. </xsl:template>
  162. <xsl:template match="text()" priority="-1">
  163. <xsl:value-of select="."/>
  164. </xsl:template>
  165. </xsl:stylesheet>