renderPackagesProperties.xslt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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. 2013, 2016
  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:out="http://www.w3.org/1999/XSL/Transform"
  11. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  12. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  13. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  14. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  15. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  16. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  17. xmlns:ctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/controls/"
  18. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  19. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  20. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  21. xmlns:bus="http://developer.cognos.com/schemas/bibus/1/"
  22. xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
  23. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  24. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  25. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  26. xmlns:dpl="http://developer.cognos.com/schemas/xts/logicsheets/deployment/"
  27. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  28. xmlns:x="x"
  29. exclude-result-prefixes="xsl cm cf cp df dp lyt ctrl cml bus utml xtsext dpl">
  30. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  31. <!-- current file name -->
  32. <xsl:variable name="mname" select="'properties_deployment.xts'"/>
  33. <!-- add any theme variables -->
  34. <pf:variables/>
  35. <pf:serialize-xml/>
  36. <!-- deployment variables -->
  37. <dpl:variables/>
  38. <mf:variables/>
  39. <xsl:key name="deploymentOption" match="/root/cm:deploymentOptionsUI/cm:deploymentOption" use="@name"/>
  40. <!-- start the output -->
  41. <xsl:template match="/root">
  42. <!-- get passed in parameters -->
  43. <xsl:variable name="parm_id" select="/root/env/param[@name = 'id']"/>
  44. <cml:single-object/>
  45. <xsl:variable name="has_write_permission" select="contains(concat(' ', $the-object/cm:permissions, ' '), ' write ')"/>
  46. <xsl:variable name="has_policy_permission" select="contains(concat(' ', $the-object/cm:permissions, ' '), ' setPolicy ')"/>
  47. <xsl:variable name="showOKCancel" select="$has_write_permission or $has_policy_permission"/>
  48. <xsl:variable name="browserTitle">
  49. <xts:string id="IDS_PROPERTIES_TITLE">
  50. <xts:param name="objectName">
  51. <span lang="{$contentLocale}"><xsl:value-of select="/root/env/param[@name = 'm_name']"/></span>
  52. </xts:param>
  53. </xts:string>
  54. </xsl:variable>
  55. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  56. <dp:meta>
  57. <pf:meta/>
  58. <!-- Standard meta tags -->
  59. </dp:meta>
  60. <dp:script>
  61. <pf:help context="HID_DEPLOYMENT_INFO"/>
  62. <!-- Help system -->
  63. <script language="JavaScript">
  64. function init()
  65. {
  66. <xsl:if test="/root/cm:deploymentOptionsUI/cm:deploymentOption[@name='entireContentStoreSelect']!='true'">
  67. if (window.disablePackageOptions)
  68. disablePackageOptions();
  69. </xsl:if>
  70. if ( document.pform.m_packagesOp != null )
  71. {
  72. document.pform.m_packagesOp.value = "updateProperties";
  73. }
  74. <xsl:if test="$deployment-method='import' and not(/root/*[local-name()='archiveOptions'])">
  75. alert("<xts:string id="IDS_DEPLOYMENT_MISSING_ARCHIVE" encode="javascript"/>" );
  76. </xsl:if>
  77. }
  78. <xsl:variable name="missingArchiveMessage">
  79. <xsl:text/><xts:string id="IDS_DEPLOYMENT_SELECT_ANOTHER_ARCHIVE" encode="javascript"><xts:param name="archiveName"><xsl:value-of select="/root/env/param[@name = 'm_archive']"/></xts:param></xts:string><xsl:text/>
  80. </xsl:variable>
  81. function validate()
  82. {
  83. <xsl:if test="$deployment-method='import' and not(/root/*[local-name()='archiveOptions'])">
  84. alert(&quot;<xsl:value-of select="$missingArchiveMessage"/>&quot;);
  85. return false;
  86. </xsl:if>
  87. var name = new String(document.pform.m_archive.value);
  88. if (name.search(/[\\\/\:\*\?\"&lt;&gt;|!#$%^&amp;]/) != -1)
  89. {
  90. alert("<xts:string id="IDS_DEPLOYMENT_INVALID_FILE_NAME" encode="javascript"/>" );
  91. return false;
  92. }
  93. if ((document.pform.m_dataSourceSignonSelect != null) &amp;&amp; (document.pform.m_dataSourceSignonSelect.checked == true) &amp;&amp; ((document.pform.m_archiveEncryptPword == null) || (document.pform.m_archiveEncryptPword.value =="")))
  94. {
  95. alert("<xts:string id="IDS_DEPLOYMENT_PROPERTIES_PASSWORD_WARNING" encode="javascript"/>" );
  96. return false;
  97. }
  98. <xsl:if test="$deployment-method='export' and key('env-param', 'm_exportMethod')='selectTenants'">
  99. if (!verifyTenantSelection()) {
  100. return false;
  101. }
  102. </xsl:if>
  103. return true;
  104. }
  105. </script>
  106. <dpl:disableDependentOptionsRadio/>
  107. <dpl:disableDependentOptions/>
  108. <dpl:saveLastValueFunction/>
  109. <dpl:saveLastValueFunctionRadio/>
  110. <xsl:if test="key('env-param', 'm_exportMethod')='selectTenants'">
  111. <script language="javascript" src="{$webRoot}/dojo16/dojo/dojo.js"/>
  112. <dpl:tenantSelectionScript/>
  113. </xsl:if>
  114. <dc:confirm-cancel/>
  115. <script language="javascript" src="{$webcontent}/{$app}/js/list.js"></script>
  116. </dp:script>
  117. <utml:form name="pform" method="post" action="{$gateway}">
  118. <utml:excludes>selectedTenants selectedTenantNames</utml:excludes>
  119. <utml:read-only>
  120. <xsl:choose>
  121. <xsl:when test="contains($the-object/cm:permissions, 'write')">false</xsl:when>
  122. <xsl:otherwise>true</xsl:otherwise>
  123. </xsl:choose>
  124. </utml:read-only>
  125. <!-- add a hidden input for the 'ps_nav_op', doing this will define the default behavior when submitting
  126. this form, we don't want the operation set when tabing, so set it to empty here. ideally this would
  127. be done by the tabbing itself, but since it's done in the theme stuff (and can't use utml) we'll just do
  128. it here. -->
  129. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  130. <!-- this defines the form command operation to be performed when all the collected properties are submitted. -->
  131. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  132. <utml:input type="hidden" name="m_packagesOp" utml:update="false" value="updateProperties"/>
  133. <utml:input type="hidden" name="m_propertiesError" utml:update="false" value="false"/>
  134. <utml:input type="hidden" name="m_deploymentWizardPage"/>
  135. <utml:input type="hidden" name="target_rename"/>
  136. <utml:input type="hidden" name="target_guid"/>
  137. <utml:input type="hidden" name="target_location"/>
  138. <utml:input type="hidden" name="target_source_name"/>
  139. <xsl:if test="$deployment-method='import'">
  140. <utml:input type="hidden" name="selectedTenants"/>
  141. </xsl:if>
  142. <utml:input type="hidden" name="m_targetMorphlet">
  143. <utml:value>
  144. <xsl:value-of select="'properties_deployment.xts'"/>
  145. </utml:value>
  146. </utml:input>
  147. <utml:input type="hidden" name="pager_formop"/>
  148. <xsl:if test="not($has_write_permission)">
  149. <utml:input type="hidden" name="read_only_page"/>
  150. <utml:input type="hidden" name="changed_m_p_defaultName" value="0"/>
  151. <utml:input type="hidden" name="changed_m_p_defaultDescription" value="0"/>
  152. <utml:input type="hidden" name="changed_m_p_defaultScreenTip" value="0"/>
  153. </xsl:if>
  154. <utml:input type="hidden" name="m_selectArchivePageVisited" value="" utml:update="false"/>
  155. <utml:input type="hidden" name="m_firstrun" utml:update="false">
  156. <utml:value>
  157. <xsl:choose>
  158. <xsl:when test="key('env-param','m_firstrun')">
  159. <xsl:value-of select="key('env-param','m_firstrun')"/>
  160. </xsl:when>
  161. <xsl:otherwise>
  162. <xsl:value-of select="'true'"/>
  163. </xsl:otherwise>
  164. </xsl:choose>
  165. </utml:value>
  166. </utml:input>
  167. <!-- dialog header -->
  168. <dp:header useBackURL="not($showOKCancel)" div="div">
  169. <dp:title>
  170. <xsl:copy-of select="$browserTitle"/>
  171. </dp:title>
  172. </dp:header>
  173. <!-- property tabs -->
  174. <df:propertiesTabs select="deployment">
  175. <df:hasSetPolicy>
  176. <xsl:value-of select="$has_policy_permission"/>
  177. </df:hasSetPolicy>
  178. </df:propertiesTabs>
  179. <!-- description tabs -->
  180. <dp:description>
  181. <dpl:description dpl:import-id="IDS_DEPLOYMENT_PROPERTIES_IMPORT_DESCR" dpl:export-id="IDS_DEPLOYMENT_PROPERTIES_EXPORT_DESCR"/>
  182. </dp:description>
  183. <!--Deployment folder section -->
  184. <lyt:layout style="1" title="IDS_DEPLOYMENT_DEPLOYMENT_FILE_NAME" border="no">
  185. <lyt:section>
  186. <dp:list>
  187. <dp:section>
  188. <dp:text>
  189. <xsl:value-of select="/root/env/param[@name='m_archive']"/>
  190. </dp:text>
  191. <dp:text>
  192. <dp:link>
  193. <utml:a utml:op="stack-up" utml:hide-when-read-only="true">
  194. <xsl:attribute name="onClick">
  195. <xsl:text/>javascript:document.pform.m_deploymentWizardPage.value = 'select-archive';document.pform.m_firstrun.value = 'false';<xsl:text/>
  196. <xsl:if test="key('env-param', 'm_exportMethod')='selectTenants'">prepareSelectedTenantsForSubmit();</xsl:if>
  197. </xsl:attribute>
  198. <utml:target>
  199. <xsl:value-of select="$app"/>/new_deployment2.xts<xsl:text/>
  200. </utml:target>
  201. <xts:string id="IDS_DEPLOYMENT_PROPERTIES_CHANGE_FOLDER"/>
  202. </utml:a>
  203. </dp:link>
  204. </dp:text>
  205. </dp:section>
  206. </dp:list>
  207. </lyt:section>
  208. </lyt:layout>
  209. <!--
  210. <xsl:call-template name="deployment-folder-section">
  211. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  212. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  213. </xsl:call-template>
  214. -->
  215. <xsl:choose>
  216. <xsl:when test="key('env-param', 'm_exportMethod')='entireContentStore'">
  217. <!-- Entire content store section -->
  218. <xsl:call-template name="deployment-method-section">
  219. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  220. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  221. </xsl:call-template>
  222. </xsl:when>
  223. <xsl:when test="$deployment-method='export' and key('env-param', 'm_exportMethod')='selectTenants'">
  224. <dpl:exportSelectTenantUI>
  225. <dpl:param name="propertyPage">true</dpl:param>
  226. </dpl:exportSelectTenantUI>
  227. </xsl:when>
  228. <xsl:when test="$deployment-method='import' and key('env-param', 'm_exportMethod')='selectTenants'">
  229. <dpl:deploymentMethodOptions>
  230. </dpl:deploymentMethodOptions>
  231. </xsl:when>
  232. <xsl:otherwise>
  233. <!-- Packages section -->
  234. <lyt:layout style="1" title="IDS_DEPLOYMENT_PACKAGES_PACKAGES" border="yes">
  235. <lyt:section>
  236. <xsl:choose>
  237. <xsl:when test="$deployment-method='import' ">
  238. <dpl:importPackagesAvailableUI dpl:track="true">
  239. <dpl:param name="item-path">/root/cm:deploymentOptionsUI/cm:deploymentOption[@name='package']/*</dpl:param>
  240. <dpl:param name="type">importDeployment</dpl:param>
  241. <dpl:param name="propertyPage">true</dpl:param>
  242. </dpl:importPackagesAvailableUI>
  243. </xsl:when>
  244. <xsl:when test="$deployment-method='export' ">
  245. <dpl:exportPackagesAvailableUI dpl:track="true">
  246. <dpl:param name="item-path">/root/cm:deploymentOptionsUI/cm:deploymentOption[@name='package']/*</dpl:param>
  247. <dpl:param name="type">exportDeployment</dpl:param>
  248. <dpl:param name="propertyPage">true</dpl:param>
  249. </dpl:exportPackagesAvailableUI>
  250. </xsl:when>
  251. </xsl:choose>
  252. </lyt:section>
  253. </lyt:layout>
  254. <!--
  255. <xsl:call-template name="packages-section">
  256. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  257. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  258. </xsl:call-template>
  259. -->
  260. <!-- Option section -->
  261. <xsl:call-template name="package-options-section">
  262. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  263. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  264. </xsl:call-template>
  265. <!-- Directory section -->
  266. <xsl:call-template name="directory-options-section">
  267. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  268. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  269. </xsl:call-template>
  270. <!-- Ownership section -->
  271. <xsl:call-template name="general-options-section">
  272. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  273. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  274. </xsl:call-template>
  275. </xsl:otherwise>
  276. </xsl:choose>
  277. <!-- Dialog footer -->
  278. <dp:footer div="div">
  279. <xsl:choose>
  280. <xsl:when test="$showOKCancel">
  281. <df:button df:id="IDS_OK" df:style="submit" utml:validate="true" df:nav_op="stack-down" onClick="javascript:document.pform.m_packagesOp.value='updateProperties';"/>
  282. <xsl:choose>
  283. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  284. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  285. </xsl:when>
  286. <xsl:otherwise>
  287. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  288. </xsl:otherwise>
  289. </xsl:choose>
  290. </xsl:when>
  291. <xsl:otherwise>
  292. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  293. </xsl:otherwise>
  294. </xsl:choose>
  295. </dp:footer>
  296. <table width="100%">
  297. <tr>
  298. <td align="right">
  299. <font face="arial" size="0">
  300. <xsl:value-of select="$parm_id"/>
  301. </font>
  302. </td>
  303. </tr>
  304. </table>
  305. </utml:form>
  306. </dp:page>
  307. </xsl:template>
  308. <xsl:template name="deployment-folder-section">
  309. <xsl:param name="form-read-only"/>
  310. <xsl:param name="utml-form-name"/>
  311. <xsl:copy>
  312. <lyt:layout style="1" title="IDS_DEPLOYMENT_DEPLOYMENT_FILE_NAME" border="no">
  313. <lyt:section>
  314. <dp:list>
  315. <dp:section>
  316. <dp:text>
  317. <xsl:value-of select="/root/env/param[@name='m_archive']"/>
  318. </dp:text>
  319. <dp:text>
  320. <dp:link>
  321. <utml:a utml:op="stack-up" onClick="javascript:document.pform.m_deploymentWizardPage.value = 'select-archive';">
  322. <utml:target>
  323. <xsl:value-of select="$app"/>/new_deployment2.xts<xsl:text/>
  324. </utml:target>
  325. <xts:string id="IDS_DEPLOYMENT_PROPERTIES_CHANGE_FOLDER"/>
  326. </utml:a>
  327. </dp:link>
  328. </dp:text>
  329. </dp:section>
  330. </dp:list>
  331. </lyt:section>
  332. </lyt:layout>
  333. </xsl:copy>
  334. </xsl:template>
  335. <xsl:template name="package-options-section">
  336. <xsl:param name="form-read-only"/>
  337. <xsl:param name="utml-form-name"/>
  338. <xsl:copy>
  339. <dpl:packagesIncludeReportOutput dpl:track="true"/>
  340. </xsl:copy>
  341. </xsl:template>
  342. <xsl:template name="directory-options-section">
  343. <xsl:param name="form-read-only"/>
  344. <xsl:param name="utml-form-name"/>
  345. <xsl:copy>
  346. <dpl:directoryContentOptions dpl:track="true"/>
  347. </xsl:copy>
  348. </xsl:template>
  349. <xsl:template name="general-options-section">
  350. <xsl:param name="form-read-only"/>
  351. <xsl:param name="utml-form-name"/>
  352. <xsl:copy>
  353. <dpl:generalOptions dpl:track="true"/>
  354. </xsl:copy>
  355. </xsl:template>
  356. <xsl:template name="deployment-method-section">
  357. <xsl:param name="form-read-only"/>
  358. <xsl:param name="utml-form-name"/>
  359. <xsl:copy>
  360. <dpl:deploymentMethodOptions dpl:track="true"/>
  361. </xsl:copy>
  362. </xsl:template>
  363. <xsl:template name="packages-section">
  364. <xsl:param name="form-read-only"/>
  365. <xsl:param name="utml-form-name"/>
  366. <xsl:copy>
  367. <lyt:layout style="1" title="IDS_DEPLOYMENT_PACKAGES_PACKAGES" border="yes">
  368. <lyt:section>
  369. <dpl:packagesAvailable dpl:track="true" dpl:propertyPage="true">
  370. <dpl:param name="item-path">/root/cm:deploymentOptionsUI/cm:deploymentOption[@name='package']/*</dpl:param>
  371. <dpl:param name="target">
  372. <xsl:value-of select="concat($app, '/properties_deployment.xts')"/>
  373. </dpl:param>
  374. </dpl:packagesAvailable>
  375. </lyt:section>
  376. </lyt:layout>
  377. </xsl:copy>
  378. </xsl:template>
  379. <pf:gen-icon/>
  380. </xsl:stylesheet>