cm-save.xsl 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  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. ===============================================================================================
  14. Logic sheet for dealing with "special" properties stored in CM.
  15. ===============================================================================================
  16. -->
  17. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:out="dummy-uri" exclude-result-prefixes="cms xtsext">
  18. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  19. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  20. <!-- Apply "special" decoding when saving certain CM poperties -->
  21. <xsl:template match="cms:prop-decode">
  22. <!-- Handle decoding the members property -->
  23. <out:template match="*[local-name() = 'param'][@name = 'm_p_members']" mode="decode">
  24. <xts:append>
  25. <!-- create /root/members/list node -->
  26. <members>
  27. <out:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string( . )), true() )" disable-output-escaping="yes"/>
  28. </members>
  29. </xts:append>
  30. <!-- Delete the member nodes that have the 'deleted' flag underneath them. -->
  31. <xts:delete select="/root/members/list/*[*[local-name() = 'deleted' and namespace-uri()='x']]"/>
  32. <!-- Delete all properties of the member nodes except for searchPath. -->
  33. <xts:delete select="/root/members/list/*/*[not(local-name()='searchPath' and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/')]"/>
  34. </out:template>
  35. <!-- Handle decoding the consumers property -->
  36. <out:template match="*[local-name() = 'param'][@name = 'm_p_consumers']" mode="decode">
  37. <out:if test="not(../*[local-name() = 'param'][@name = 'changed_m_signon_consumers'] = '0')">
  38. <xts:append>
  39. <consumers>
  40. <out:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(.)), true())" disable-output-escaping="yes"/>
  41. </consumers>
  42. </xts:append>
  43. <!-- Delete any extra information not pertaining to consumers. -->
  44. <xts:delete select="/root/consumers/*[local-name()!='list']"/>
  45. <!-- Delete the consumer nodes that have the 'deleted' flag underneath them. -->
  46. <xts:delete select="/root/consumers/list/*[*[local-name()='deleted' and namespace-uri()='x']]"/>
  47. <!-- Delete all properties of the consumer nodes except for searchPath. -->
  48. <xts:delete select="/root/consumers/list/*/*[not(local-name()='searchPath' and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/')]"/>
  49. </out:if>
  50. </out:template>
  51. <out:template match="*[local-name() = 'param'][@name = 'jobSteps']" mode="decode">
  52. <xts:append>
  53. <!-- create /root/steps node -->
  54. <out:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string( . )), true() )" disable-output-escaping="yes"/>
  55. </xts:append>
  56. </out:template>
  57. <out:template match="*[local-name() = 'param'][@name = 'jobOptions']" mode="decode">
  58. <xts:append>
  59. <!-- create /root/jobOptions node -->
  60. <out:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string( . )), true() )" disable-output-escaping="yes"/>
  61. </xts:append>
  62. </out:template>
  63. <out:template match="*[local-name() = 'param'][@name = 'emailToRunOptions']" mode="decode">
  64. <xts:append>
  65. <!-- create /root/emailToRunOptions node -->
  66. <out:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string( . )), true() )" disable-output-escaping="yes"/>
  67. </xts:append>
  68. </out:template>
  69. <out:template match="*[local-name() = 'param'][@name = 'm_rp_parameters']" mode="decode">
  70. <xts:append>
  71. <!-- create /root/parameters node -->
  72. <out:value-of select="xtsext:web64decode( string( . ), true() )" disable-output-escaping="yes"/>
  73. </xts:append>
  74. </out:template>
  75. <!-- Handle decoding the deploymentOptions property -->
  76. <out:template match="*[local-name() = 'param'][@name = 'm_p_deploymentOptions']" mode="decode">
  77. <xts:append>
  78. <!-- create /root/deploymentOptions node -->
  79. <out:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string( . )), true() )" disable-output-escaping="yes"/>
  80. </xts:append>
  81. </out:template>
  82. </xsl:template>
  83. <!-- Apply "special" processing when saving certain CM poperties -->
  84. <xsl:template match="cms:prop-save">
  85. <!-- Handle the members property -->
  86. <out:template match="*[local-name() = 'param'][@name = 'm_p_members']">
  87. <out:if test="../*[local-name() = 'param'][@name = 'changed_m_p_members'] != '0' or not( ../*[local-name() = 'param'][@name = 'changed_m_p_members'] )">
  88. <out:choose>
  89. <out:when test="../*[local-name() = 'param'][@name = 'm_class'] = 'tenant'">
  90. <tenantMembers xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  91. <xts:queryNode select="/root/members/list/*"/>
  92. </tenantMembers>
  93. </out:when>
  94. <out:otherwise>
  95. <members xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  96. <xts:queryNode select="/root/members/list/*"/>
  97. </members>
  98. </out:otherwise>
  99. </out:choose>
  100. </out:if>
  101. </out:template>
  102. <!-- Handle the consumers property -->
  103. <out:template match="*[local-name() = 'param'][@name = 'm_p_consumers']">
  104. <out:if test="not(../*[local-name() = 'param'][@name = 'changed_m_signon_consumers'] = '0')">
  105. <consumers xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  106. <xts:queryNode select="/root/consumers/list/*"/>
  107. </consumers>
  108. </out:if>
  109. </out:template>
  110. <!-- Handle the deploymentOptions property -->
  111. <out:template match="*[local-name() = 'param'][@name = 'm_p_deploymentOptions']">
  112. <out:if test="not(../*[local-name() = 'param'][@name = 'read_only_page'])">
  113. <deploymentOptions xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  114. <xts:queryNode select="/root/*[local-name()='deploymentOptions']/*"/>
  115. </deploymentOptions>
  116. </out:if>
  117. </out:template>
  118. <!-- Handle the format_pref property -->
  119. <out:template match="*[local-name() = 'param'][@name = 'm_p_format_pref']">
  120. <out:if test="../*[local-name() = 'param'][@name = 'changed_m_p_format_pref'] != '0' or not( ../*[local-name() = 'param'][@name = 'changed_m_p_format_pref'] )">
  121. <out:if test=". = 'user'">
  122. <formats/>
  123. </out:if>
  124. <out:if test=". = 'specify'"/>
  125. </out:if>
  126. </out:template>
  127. <!-- Handle the iso_pref property -->
  128. <out:template match="*[local-name() = 'param'][@name = 'm_p_iso_pref']">
  129. <out:if test="(../*[local-name() = 'param'][@name = 'changed_m_p_iso_pref'] != '0' or not( ../*[local-name() = 'param'][@name = 'changed_m_p_iso_pref'] )) and . = 'default'">
  130. <isolationLevel xmlns="http://developer.cognos.com/schemas/xts-cm/1/"/>
  131. </out:if>
  132. </out:template>
  133. <!-- Handle the base property - a reference to a report/query in a reportView. -->
  134. <out:template match="*[local-name() = 'param'][@name = 'm_p_base']">
  135. <cm:base>
  136. <cm:baseClass>
  137. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  138. </cm:baseClass>
  139. </cm:base>
  140. </out:template>
  141. <!-- Target object for a metadataModelPackage -->
  142. <out:template match="*[local-name() = 'param'][@name = 'm_p_metadataModelPackage']">
  143. <cm:metadataModelPackage>
  144. <cm:baseClass>
  145. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  146. </cm:baseClass>
  147. </cm:metadataModelPackage>
  148. </out:template>
  149. <!-- Target object for a metadataModel -->
  150. <out:template match="*[local-name() = 'param'][@name = 'm_p_metadataModel']">
  151. <cm:metadataModel>
  152. <out:if test=". != ''">
  153. <cm:baseClass>
  154. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  155. </cm:baseClass>
  156. </out:if>
  157. </cm:metadataModel>
  158. </out:template>
  159. <!-- Target object for a shortcut -->
  160. <out:template match="*[local-name() = 'param'][@name = 'm_p_target']">
  161. <cm:target>
  162. <cm:baseClass>
  163. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  164. </cm:baseClass>
  165. </cm:target>
  166. </out:template>
  167. <!-- Scope property for Drill through object -->
  168. <out:template match="*[local-name() = 'param'][@name = 'm_p_scope']">
  169. <cm:scope>
  170. <cm:scopeValues>
  171. <out:if test=". != ''">
  172. <cm:scopeValue><out:value-of select="."/></cm:scopeValue>
  173. </out:if>
  174. </cm:scopeValues>
  175. </cm:scope>
  176. </out:template>
  177. <!-- defaultAnalysis property for package configuration object -->
  178. <out:template match="*[local-name() = 'param'][@name = 'm_ppc_defaultAnalysis']">
  179. <out:choose>
  180. <out:when test=". != ''">
  181. <cm:defaultAnalysis>
  182. <cm:baseClass>
  183. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  184. </cm:baseClass>
  185. </cm:defaultAnalysis>
  186. </out:when>
  187. <out:otherwise>
  188. <cm:defaultAnalysis/>
  189. </out:otherwise>
  190. </out:choose>
  191. </out:template>
  192. <!-- bookmarkItem property for Drill through object -->
  193. <out:template match="*[local-name() = 'param'][@name = 'm_p_bookmarkItem']">
  194. <cm:bookmarkItem>
  195. <out:value-of select="."/>
  196. </cm:bookmarkItem>
  197. </out:template>
  198. <!-- handle the contact for an object -->
  199. <out:template match="*[local-name() = 'param'][@name = 'm_p_contact']">
  200. <cm:contact>
  201. <out:if test=". != ''">
  202. <cm:baseClass>
  203. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  204. </cm:baseClass>
  205. </out:if>
  206. </cm:contact>
  207. </out:template>
  208. <!-- handle the dataSourceAccessAccount for a rolapDataSource object -->
  209. <out:template match="*[local-name() = 'param'][@name = 'm_p_dataSourceAccessAccount']">
  210. <cm:dataSourceAccessAccount>
  211. <out:if test=". != ''">
  212. <cm:baseClass>
  213. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  214. </cm:baseClass>
  215. </out:if>
  216. </cm:dataSourceAccessAccount>
  217. </out:template>
  218. <!-- handle the credentialNamespaces for a dataSourceConnection object -->
  219. <out:template match="*[local-name() = 'param'][@name = 'm_p_use_credentialNamespaces']">
  220. <out:choose>
  221. <out:when test="../*[local-name()='param'][@name = 'm_p_use_credentialNamespaces']='false'">
  222. <cm:credentialNamespaces/>
  223. </out:when>
  224. <out:when test="../*[local-name()='param'][@name='credentialNamespaces']">
  225. <cm:credentialNamespaces>
  226. <cm:namespace>
  227. <cm:searchPath><out:value-of select="../*[local-name()='param'][@name='credentialNamespaces']"/></cm:searchPath>
  228. </cm:namespace>
  229. </cm:credentialNamespaces>
  230. </out:when>
  231. </out:choose>
  232. </out:template>
  233. <!-- handle the credentialNamespaces for a dataSourceConnection object -->
  234. <out:template match="*[local-name() = 'param'][@name = 'm_p_credentialNamespaces']">
  235. <cm:credentialNamespaces>
  236. <out:if test=". != ''">
  237. <cm:namespace>
  238. <cm:searchPath><out:value-of select="../*[local-name()='param'][@name='m_p_credentialNamespaces']"/></cm:searchPath>
  239. </cm:namespace>
  240. </out:if>
  241. </cm:credentialNamespaces>
  242. </out:template>
  243. <!-- Handle the owner property - a reference to an Owner. -->
  244. <out:template match="*[local-name() = 'param'][@name = 'm_p_owner']">
  245. <out:if test="not(/root/env/*[local-name()='param'][@name='changed_m_p_owner']=0)">
  246. <cm:owner>
  247. <cm:baseClass>
  248. <cm:searchPath><out:value-of select="."/></cm:searchPath>
  249. </cm:baseClass>
  250. </cm:owner>
  251. </out:if>
  252. </out:template>
  253. <!-- Handle the contentLocale property - for contacts its called locale. -->
  254. <out:template match="*[local-name()='param'][@name='m_p_contentLocale']">
  255. <out:if test="not(../*[local-name()='param'][@name='changed_m_p_contentLocale']) or ../*[local-name()='param'][@name='changed_m_p_contentLocale']='1'">
  256. <out:choose>
  257. <out:when test="../*[local-name()='param'][@name='m_class']='contact'">
  258. <cm:locale>
  259. <out:value-of select="."/>
  260. </cm:locale>
  261. </out:when>
  262. <out:otherwise>
  263. <cm:contentLocale>
  264. <out:value-of select="."/>
  265. </cm:contentLocale>
  266. </out:otherwise>
  267. </out:choose>
  268. </out:if>
  269. </out:template>
  270. <!-- Handle the productLocale property - Needed for CM fix when changing a choosen language to the default browser language-->
  271. <out:template match="*[local-name()='param'][@name='m_p_productLocale']">
  272. <out:if test="not(../*[local-name()='param'][@name='changed_m_p_productLocale']) or ../*[local-name()='param'][@name='changed_m_p_productLocale']='1'">
  273. <cm:productLocale>
  274. <out:value-of select="."/>
  275. </cm:productLocale>
  276. </out:if>
  277. </out:template>
  278. <!-- Handle the productLocale property - Needed for CM fix when changing a choosen language to the default browser language-->
  279. <out:template match="*[local-name()='param'][@name='m_p_useAccessibilityFeatures']">
  280. <cm:useAccessibilityFeatures>
  281. <out:value-of select="."/>
  282. </cm:useAccessibilityFeatures>
  283. </out:template>
  284. <out:template match="*[local-name()='param'][@name='m_p_canCustomize']">
  285. <out:if test=". != ''">
  286. <cm:canCustomize>
  287. <out:value-of select="."/>
  288. </cm:canCustomize>
  289. </out:if>
  290. </out:template>
  291. <!-- Handle the command block properties on a dataSource or dataSourceConnection -->
  292. <out:template match="*[local-name()='param'][starts-with(@name,'m_cbp_')]">
  293. <out:variable name="propertyName" select="substring-after(@name, 'm_cbp_')"/>
  294. <out:variable name="changeName" select="concat('changed_m_cbp_',$propertyName)"/>
  295. <out:variable name="param" select="../*[local-name()='param']"/>
  296. <!-- Only save the property value if it has been changed or the user wants to delete the child entries -->
  297. <out:if test="$param[@name=$changeName]='1' or not($param[@name=$changeName]) or $param[@name=concat('m_cbd_',$propertyName)]='true'">
  298. <!-- create an element for each command block -->
  299. <out:element namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  300. <xsl:attribute name="name"><xsl:value-of select="'{$propertyName}'"/></xsl:attribute>
  301. <!-- if the user has selected to delete the child entries for this property -->
  302. <out:if test="$param[@name=concat('m_cbd_',$propertyName)]='true'">
  303. <out:attribute name="updateAllDescendents">true</out:attribute>
  304. </out:if>
  305. <out:if test="$param[@name=concat('m_acquired_',$propertyName)]='false' or not($param[@name=concat('m_acquired_',$propertyName)])">
  306. <out:value-of select="xtsext:xmlencode(string(.))"/>
  307. </out:if>
  308. </out:element>
  309. </out:if>
  310. </out:template>
  311. <!-- Handle the tenantID property; we should only include this one if it is really being changed or a tenant object is being created. -->
  312. <out:template match="*[local-name() = 'param'][@name = 'm_p_tenantID']">
  313. <out:variable name="isCreateTenant" select="../*[local-name() = 'param'][@name = 'ifrmcmd']='create' and ../*[local-name() = 'param'][@name = 'm_new_class']='tenant'"/>
  314. <out:variable name="tenantIDHasChanged" select="../*[local-name() = 'param'][@name = 'changed_m_p_tenantID'] and ../*[local-name() = 'param'][@name = 'changed_m_p_tenantID'] != '0'"/>
  315. <out:if test="$isCreateTenant or $tenantIDHasChanged">
  316. <cm:tenantID>
  317. <out:value-of select="."/>
  318. </cm:tenantID>
  319. </out:if>
  320. </out:template>
  321. <!-- Handle the hidden property; we should only include this one if its value has been set. -->
  322. <out:template match="*[local-name() = 'param'][@name = 'm_p_hidden']">
  323. <out:if test="../*[local-name() = 'param'][@name = 'm_p_hidden'] != ''">
  324. <cm:hidden>
  325. <out:value-of select="."/>
  326. </cm:hidden>
  327. </out:if>
  328. </out:template>
  329. <!-- Handle unwritable properties -->
  330. <out:template match="*[local-name() = 'param'][@name = 'm_p_path']"/>
  331. <out:template match="*[local-name() = 'param'][@name = 'm_p_searchPath']"/>
  332. <!-- We completely ignore the username and password values because they are explicitely retrieved in the starts-with(@name, 'm_p_') template. -->
  333. <out:template match="*[local-name() = 'param'][@name = 'm_p_username']"/>
  334. <out:template match="*[local-name() = 'param'][@name = 'm_p_password']"/>
  335. <!-- Ignore the password2 field -->
  336. <out:template match="*[local-name() = 'param'][@name = 'm_p_password2']"/>
  337. <out:template name="build_contentTask_runTime_options">
  338. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  339. <root>
  340. <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
  341. <root>
  342. <out:copy-of select="/root/env"/>
  343. <xts:transform name="XML" src="portal/options.xml"/>
  344. <optionType>contentTaskOptions</optionType>
  345. </root>
  346. </xts:transform>
  347. </root>
  348. </xts:transform>
  349. </out:template>
  350. <out:template name="build_indexUpdateTask_runTime_options">
  351. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  352. <root>
  353. <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
  354. <root>
  355. <out:copy-of select="/root/env"/>
  356. <xts:transform name="XML" src="portal/options.xml"/>
  357. <optionType>indexOptions</optionType>
  358. </root>
  359. </xts:transform>
  360. </root>
  361. </xts:transform>
  362. </out:template>
  363. <out:template name="build_deployment_runTime_options">
  364. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  365. <root>
  366. <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
  367. <root>
  368. <xts:transform src="transforms/portal/options/cleanEnv.xslt" processor="XSLT">
  369. <root>
  370. <out:copy-of select="/root/env"/>
  371. </root>
  372. </xts:transform>
  373. <xts:transform name="XML" src="portal/options.xml"/>
  374. <optionType>deploymentOptions</optionType>
  375. </root>
  376. </xts:transform>
  377. </root>
  378. </xts:transform>
  379. </out:template>
  380. <!-- handle building the schedule object ** FOR NEW SCHEDULE DIALOG **-->
  381. <out:template name="build_jsm_schedule">
  382. <out:param name="env"/>
  383. <out:variable name="tenantID" select="string($env/form:param[@name = 'm_p_tenantID'])"/>
  384. <out:if test="$tenantID">
  385. <tenantID xsi:type="bus:stringProp">
  386. <value xsi:type="xsd:string">
  387. <out:value-of select="$tenantID"/>
  388. </value>
  389. </tenantID>
  390. </out:if>
  391. <active xsi:type="bus:booleanProp">
  392. <value xsi:type="xsd:boolean">
  393. <out:choose>
  394. <out:when test="$env/form:param[@name = 'm_sp_active']">false</out:when>
  395. <out:otherwise>true</out:otherwise>
  396. </out:choose>
  397. </value>
  398. </active>
  399. <!-- handle priority property -->
  400. <out:if test="$env/form:param[@name = 'm_sp_priority'] or $env/form:param[@name = 'm_sp_priority']=''">
  401. <priority xsi:type="bus:positiveIntegerProp">
  402. <value xsi:type="xsd:integer">
  403. <out:value-of select="$env/form:param[@name = 'm_sp_priority']"/>
  404. </value>
  405. </priority>
  406. </out:if>
  407. <out:variable name="dfIntra" select="string($env/form:param[@name = 'df_intra'])"/>
  408. <!-- If using the old or new style triggers, set the triggerName on the schedule object to m_sp_triggerName -->
  409. <triggerName xsi:type="bus:stringProp">
  410. <value xsi:type="xsd:string">
  411. <out:if test="$env/form:param[@name = 'm_sp_type'] = 'trigger'">
  412. <out:value-of select="$env/form:param[@name = 'm_sp_triggerName']"/>
  413. </out:if>
  414. </value>
  415. </triggerName>
  416. <out:if test="not($env/form:param[@name = 'm_triggerType']) or $env/form:param[@name = 'm_triggerType'] = 'schedule'">
  417. <startDate xsi:type="bus:dateTimeProp">
  418. <value xsi:type="xsd:dateTime">
  419. <out:variable name="xsl_start_date">
  420. <out:value-of select="concat(string($env/form:param[@name = 'p_sched_date1']), 'T', substring-before(string($env/form:param[@name = 'p_sched_time1']), '.'))"/>
  421. </out:variable>
  422. <out:variable name="xsl_UTC_start_date">
  423. <out:value-of select="xtsext:formatDateToUTC( string( $xsl_start_date ), string( $timeZone ) )"/>
  424. </out:variable>
  425. <out:value-of select="concat(substring($xsl_UTC_start_date, 1, 16), ':00')"/>
  426. </value>
  427. </startDate>
  428. <out:choose>
  429. <out:when test="$env/form:param[@name='m_sp_endType'] = 'onDate' and $env/form:param[@name = 'p_sched_date2'] and $env/form:param[@name = 'p_sched_time2']">
  430. <out:variable name="xsl_end_date">
  431. <out:value-of select="concat(string($env/form:param[@name = 'p_sched_date2']), 'T', substring-before(string($env/form:param[@name = 'p_sched_time2']), '.'))"/>
  432. </out:variable>
  433. <out:variable name="xsl_UTC_end_date">
  434. <out:value-of select="xtsext:formatDateToUTC( string( $xsl_end_date ), string( $timeZone ) )"/>
  435. </out:variable>
  436. <endDate xsi:type="bus:dateTimeProp">
  437. <value xsi:type="xsd:dateTime">
  438. <out:value-of select="concat(substring($xsl_UTC_end_date, 1, 16), ':00')"/>
  439. </value>
  440. </endDate>
  441. </out:when>
  442. </out:choose>
  443. <out:if test="not($env/form:param[@name = 'm_sp_type'] = 'trigger') and ($dfIntra = 'true')">
  444. <intradayRecurrenceInterval xsi:type="cm:durationProp">
  445. <value xsi:type="xsd:duration"><out:value-of select="concat('PT',$env/form:param[@name = 'm_sp_intradayRecurrenceIntervalNum'],$env/form:param[@name = 'm_sp_intradayRecurrenceIntervalUnit'])"/></value>
  446. </intradayRecurrenceInterval>
  447. <intradayRecurrenceStart xsi:type="cm:timeProp">
  448. <out:variable name="xsl_intradayRecurrenceStart">
  449. <out:value-of select="concat(string($env/form:param[@name = 'p_sched_date1']),'T',string($env/form:param[@name = 'p_intradayRecurrenceStart']))"/>
  450. </out:variable>
  451. <out:variable name="xsl_UTC_intradayRecurrenceStart">
  452. <out:value-of select="xtsext:formatDateToUTC( string( $xsl_intradayRecurrenceStart ), string( $timeZone ) )"/>
  453. </out:variable>
  454. <value xsi:type="xsd:time"><out:value-of select="substring-after($xsl_UTC_intradayRecurrenceStart,'T')"/></value>
  455. </intradayRecurrenceStart>
  456. <intradayRecurrenceEnd xsi:type="cm:timeProp">
  457. <out:variable name="xsl_intradayRecurrenceEnd">
  458. <out:value-of select="concat(string($env/form:param[@name = 'p_sched_date1']),'T',string($env/form:param[@name = 'p_intradayRecurrenceEnd']))"/>
  459. </out:variable>
  460. <out:variable name="xsl_UTC_intradayRecurrenceEnd">
  461. <out:value-of select="xtsext:formatDateToUTC( string( $xsl_intradayRecurrenceEnd ), string( $timeZone ) )"/>
  462. </out:variable>
  463. <value xsi:type="xsd:time"><out:value-of select="substring-after($xsl_UTC_intradayRecurrenceEnd,'T')"/></value>
  464. </intradayRecurrenceEnd>
  465. </out:if>
  466. <endType xsi:type="bus:nmtokenProp">
  467. <value xsi:type="xsd:string"><out:value-of select="$env/form:param[@name = 'm_sp_endType']"/></value>
  468. </endType>
  469. </out:if>
  470. <type xsi:type="bus:nmtokenProp">
  471. <value xsi:type="xsd:string">
  472. <out:choose>
  473. <out:when test="starts-with($env/form:param[@name = 'm_sp_type'],'monthly')">
  474. <out:choose>
  475. <out:when test="$env/form:param[@name = 'sub_type'] = 'relative'">
  476. <out:choose>
  477. <out:when test="$dfIntra = 'true'">monthlyRelativeWithIntradayRecurrence</out:when>
  478. <out:otherwise>monthlyRelative</out:otherwise>
  479. </out:choose>
  480. </out:when>
  481. <out:otherwise>
  482. <out:choose>
  483. <out:when test="$dfIntra = 'true'">monthlyAbsoluteWithIntradayRecurrence</out:when>
  484. <out:otherwise>monthlyAbsolute</out:otherwise>
  485. </out:choose>
  486. </out:otherwise>
  487. </out:choose>
  488. </out:when>
  489. <out:when test="starts-with($env/form:param[@name = 'm_sp_type'],'yearly')">
  490. <out:choose>
  491. <out:when test="$env/form:param[@name = 'sub_type'] = 'relative'">
  492. <out:choose>
  493. <out:when test="$dfIntra = 'true'">yearlyRelativeWithIntradayRecurrence</out:when>
  494. <out:otherwise>yearlyRelative</out:otherwise>
  495. </out:choose>
  496. </out:when>
  497. <out:otherwise>
  498. <out:choose>
  499. <out:when test="$dfIntra = 'true'">yearlyAbsoluteWithIntradayRecurrence</out:when>
  500. <out:otherwise>yearlyAbsolute</out:otherwise>
  501. </out:choose>
  502. </out:otherwise>
  503. </out:choose>
  504. </out:when>
  505. <out:otherwise>
  506. <out:variable name="spType" select="$env/form:param[@name = 'm_sp_type']"/>
  507. <out:choose>
  508. <out:when test="($dfIntra='true') and not(contains($spType,'WithIntradayRecurrence'))">
  509. <out:value-of select="concat($spType,'WithIntradayRecurrence')"/>
  510. </out:when>
  511. <out:when test="not($dfIntra = 'true') and contains($spType,'WithIntradayRecurrence')">
  512. <out:value-of select="substring-before($spType,'WithIntradayRecurrence')"/>
  513. </out:when>
  514. <out:otherwise><out:value-of select="$spType"/></out:otherwise>
  515. </out:choose>
  516. </out:otherwise>
  517. </out:choose>
  518. </value>
  519. </type>
  520. <out:choose>
  521. <out:when test="starts-with($env/form:param[@name = 'm_sp_type'],'daily')">
  522. <dailyPeriod xsi:type="bus:nmtokenProp">
  523. <value xsi:type="xsd:string">
  524. <out:value-of select="$env/form:param[@name = 'm_sp_dailyPeriod']"/>
  525. </value>
  526. </dailyPeriod>
  527. <everyNPeriods xsi:type="bus:positiveIntegerProp">
  528. <value xsi:type="xsd:integer">
  529. <out:choose>
  530. <out:when test="$env/form:param[@name = 'm_sp_dailyPeriod'] = 'minute'">
  531. <out:value-of select="$env/form:param[@name = 'm_sp_everyNminutes']"/>
  532. </out:when>
  533. <out:when test="$env/form:param[@name = 'm_sp_dailyPeriod'] = 'hour'">
  534. <out:value-of select="$env/form:param[@name = 'm_sp_everyNhours']"/>
  535. </out:when>
  536. <out:when test="$env/form:param[@name = 'm_sp_dailyPeriod'] = 'day'">
  537. <out:value-of select="$env/form:param[@name = 'm_sp_everyNdays']"/>
  538. </out:when>
  539. </out:choose>
  540. </value>
  541. </everyNPeriods>
  542. </out:when>
  543. <out:when test="starts-with($env/form:param[@name = 'm_sp_type'],'weekly')">
  544. <everyNPeriods xsi:type="bus:positiveIntegerProp">
  545. <value xsi:type="xsd:integer">
  546. <out:value-of select="$env/form:param[@name = 'm_sp_everyNweeks']"/>
  547. </value>
  548. </everyNPeriods>
  549. <weeklySunday xsi:type="bus:booleanProp">
  550. <value xsi:type="xsd:boolean">
  551. <out:choose>
  552. <out:when test="$env/form:param[@name = 'm_sp_weeklySunday']='true'">true</out:when>
  553. <out:otherwise>false</out:otherwise>
  554. </out:choose>
  555. </value>
  556. </weeklySunday>
  557. <weeklyMonday xsi:type="bus:booleanProp">
  558. <value xsi:type="xsd:boolean">
  559. <out:choose>
  560. <out:when test="$env/form:param[@name = 'm_sp_weeklyMonday']='true'">true</out:when>
  561. <out:otherwise>false</out:otherwise>
  562. </out:choose>
  563. </value>
  564. </weeklyMonday>
  565. <weeklyTuesday xsi:type="bus:booleanProp">
  566. <value xsi:type="xsd:boolean">
  567. <out:choose>
  568. <out:when test="$env/form:param[@name = 'm_sp_weeklyTuesday']='true'">true</out:when>
  569. <out:otherwise>false</out:otherwise>
  570. </out:choose>
  571. </value>
  572. </weeklyTuesday>
  573. <weeklyWednesday xsi:type="bus:booleanProp">
  574. <value xsi:type="xsd:boolean">
  575. <out:choose>
  576. <out:when test="$env/form:param[@name = 'm_sp_weeklyWednesday']='true'">true</out:when>
  577. <out:otherwise>false</out:otherwise>
  578. </out:choose>
  579. </value>
  580. </weeklyWednesday>
  581. <weeklyThursday xsi:type="bus:booleanProp">
  582. <value xsi:type="xsd:boolean">
  583. <out:choose>
  584. <out:when test="$env/form:param[@name = 'm_sp_weeklyThursday']='true'">true</out:when>
  585. <out:otherwise>false</out:otherwise>
  586. </out:choose>
  587. </value>
  588. </weeklyThursday>
  589. <weeklyFriday xsi:type="bus:booleanProp">
  590. <value xsi:type="xsd:boolean">
  591. <out:choose>
  592. <out:when test="$env/form:param[@name = 'm_sp_weeklyFriday']='true'">true</out:when>
  593. <out:otherwise>false</out:otherwise>
  594. </out:choose>
  595. </value>
  596. </weeklyFriday>
  597. <weeklySaturday xsi:type="bus:booleanProp">
  598. <value xsi:type="xsd:boolean">
  599. <out:choose>
  600. <out:when test="$env/form:param[@name = 'm_sp_weeklySaturday']='true'">true</out:when>
  601. <out:otherwise>false</out:otherwise>
  602. </out:choose>
  603. </value>
  604. </weeklySaturday>
  605. </out:when>
  606. <out:when test="starts-with($env/form:param[@name = 'm_sp_type'],'monthly')">
  607. <out:choose>
  608. <out:when test="$env/form:param[@name = 'sub_type'] = 'relative'">
  609. <everyNPeriods xsi:type="bus:positiveIntegerProp">
  610. <value xsi:type="xsd:integer">
  611. <out:value-of select="$env/form:param[@name = 'm_sp_everyNmonthsRel']"/>
  612. </value>
  613. </everyNPeriods>
  614. <monthlyRelativeDay xsi:type="bus:nmtokenProp">
  615. <value xsi:type="xsd:string">
  616. <out:value-of select="$env/form:param[@name = 'm_sp_monthlyRelativeDay']"/>
  617. </value>
  618. </monthlyRelativeDay>
  619. <monthlyRelativeWeek xsi:type="bus:nmtokenProp">
  620. <value xsi:type="xsd:string">
  621. <out:value-of select="$env/form:param[@name = 'm_sp_monthlyRelativeWeek']"/>
  622. </value>
  623. </monthlyRelativeWeek>
  624. </out:when>
  625. <out:otherwise>
  626. <everyNPeriods xsi:type="bus:positiveIntegerProp">
  627. <value xsi:type="xsd:integer">
  628. <out:value-of select="$env/form:param[@name = 'm_sp_everyNmonthsAbs']"/>
  629. </value>
  630. </everyNPeriods>
  631. <monthlyAbsoluteDay xsi:type="bus:positiveIntegerProp">
  632. <value xsi:type="xsd:integer">
  633. <out:value-of select="$env/form:param[@name = 'm_sp_monthlyAbsoluteDay']"/>
  634. </value>
  635. </monthlyAbsoluteDay>
  636. </out:otherwise>
  637. </out:choose>
  638. </out:when>
  639. <out:when test="starts-with($env/form:param[@name = 'm_sp_type'],'yearly')">
  640. <out:choose>
  641. <out:when test="$env/form:param[@name = 'sub_type'] = 'relative'">
  642. <yearlyRelativeMonth xsi:type="bus:nmtokenProp">
  643. <value xsi:type="xsd:string">
  644. <out:value-of select="$env/form:param[@name = 'm_sp_yearlyRelativeMonth']"/>
  645. </value>
  646. </yearlyRelativeMonth>
  647. <yearlyRelativeDay xsi:type="bus:positiveIntegerProp">
  648. <value xsi:type="xsd:integer">
  649. <out:value-of select="$env/form:param[@name = 'm_sp_yearlyRelativeDay']"/>
  650. </value>
  651. </yearlyRelativeDay>
  652. <yearlyRelativeWeek xsi:type="bus:nmtokenProp">
  653. <value xsi:type="xsd:string">
  654. <out:value-of select="$env/form:param[@name = 'm_sp_yearlyRelativeWeek']"/>
  655. </value>
  656. </yearlyRelativeWeek>
  657. </out:when>
  658. <out:otherwise>
  659. <yearlyAbsoluteMonth xsi:type="bus:nmtokenProp">
  660. <value xsi:type="xsd:string">
  661. <out:value-of select="$env/form:param[@name = 'm_sp_yearlyAbsoluteMonth']"/>
  662. </value>
  663. </yearlyAbsoluteMonth>
  664. <yearlyAbsoluteDay xsi:type="bus:positiveIntegerProp">
  665. <value xsi:type="xsd:integer">
  666. <out:value-of select="$env/form:param[@name = 'm_sp_yearlyAbsoluteDay']"/>
  667. </value>
  668. </yearlyAbsoluteDay>
  669. </out:otherwise>
  670. </out:choose>
  671. </out:when>
  672. </out:choose>
  673. <out:if test="key('env-param','m_schedule_owner_reset')='true'">
  674. <credential xsi:type="bus:baseClassArrayProp">
  675. <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:credential[1]">
  676. <item xsi:type="bus:credential">
  677. <searchPath xsi:type="cm:stringProp">
  678. <value xsi:type="xsd:string">
  679. <out:choose>
  680. <out:when test="not($env/form:param[@name='m_sp_credential'])">
  681. <out:value-of select="/root/command/*/*[local-name()='credentialPath']"/>
  682. </out:when>
  683. <out:otherwise>
  684. <out:value-of select="$env/form:param[@name='m_sp_credential']"/>
  685. </out:otherwise>
  686. </out:choose>
  687. </value>
  688. </searchPath>
  689. </item>
  690. </value>
  691. </credential>
  692. </out:if>
  693. <timeZoneID xsi:type="bus:stringProp">
  694. <value xsi:type="xsd:string"><out:value-of select="$timeZone"/></value>
  695. </timeZoneID>
  696. </out:template>
  697. </xsl:template>
  698. <xsl:template name="build_runOptionArray">
  699. <xsl:param name="class"/>
  700. <xsl:param name="type"/>
  701. <xsl:param name="name"/>
  702. <runOption xmlns="http://developer.cognos.com/schemas/xts-cm/1/" class="{$class}">
  703. <name><xsl:value-of select="$name"/></name>
  704. <items>
  705. <out:for-each select="$env/*[starts-with(@name,concat('m_ro_','{$name}'))]">
  706. <out:if test="(@name!='m_ro_outputFormat_HTML' or $env/*[@name='m_ro_outputF_HTML_Type']='true') and (@name!='m_ro_outputFormat_XLS2000' or $env/*[@name='m_ro_outputF_XLS2000_Type']='true') and . != ''">
  707. <item><out:value-of select="."/></item>
  708. </out:if>
  709. </out:for-each>
  710. </items>
  711. </runOption>
  712. </xsl:template>
  713. <xsl:template match="*">
  714. <xsl:copy>
  715. <xsl:copy-of select="@*"/>
  716. <xsl:apply-templates/>
  717. </xsl:copy>
  718. </xsl:template>
  719. </xsl:stylesheet>