new_package.xts 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738
  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, 2019
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" messageBase="messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" includeConfig="true" requiredCapability="canUseDataSourcesTool canUseSelfServicePackageWizard or">
  9. <!--
  10. ===============================================================================================
  11. formlogic_init - standard form logic initialization
  12. ===============================================================================================
  13. -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!--
  16. ================================================================================
  17. encrypt the password
  18. ================================================================================
  19. -->
  20. <xts:block id="encrypt_password" path="/portal/encryptConnectionPasswords.xslt" dependency="formlogic_init" type="exec" mode="interpret" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='m_cube_password' or @name='test_cube_password' or @name='m_connection_password' or @name='test_password'] != '']"/>
  21. <!--
  22. ================================================================================
  23. If the wizard dialog number is not set then create one.
  24. ================================================================================
  25. -->
  26. <xts:block id="pre-process" dependency="encrypt_password" processor="XSLT" nodelist="" type="exec" condition=".[not(/root/env/param[@name='m_wizardDialogNumber'])]" mandatory="false">
  27. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xtsext">
  28. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  29. <xsl:template match="/">
  30. <xts:sequence>
  31. <xts:append select="/root/env">
  32. <param name="m_wizardDialogNumber">
  33. <xsl:value-of select="'0'"/>
  34. </param>
  35. </xts:append>
  36. </xts:sequence>
  37. </xsl:template>
  38. </xsl:stylesheet>
  39. </xts:block>
  40. <!--
  41. ================================================================================
  42. Remove from ennvironment not needed parameters
  43. ================================================================================
  44. -->
  45. <xts:block id="cleanupEnv" dependency="pre-process" processor="XSLT" nodelist="" type="exec" condition=".[/root/env/param[starts-with(@name,'package_dialog_checkbox')]]" mandatory="false">
  46. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xtsext">
  47. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  48. <xsl:template match="/">
  49. <xts:sequence>
  50. <xts:delete select="/root/env/param[starts-with(@name,'package_dialog_checkbox_')]"/>
  51. </xts:sequence>
  52. </xsl:template>
  53. </xsl:stylesheet>
  54. </xts:block>
  55. <!--
  56. ===============================================================================================
  57. get_content
  58. ===============================================================================================
  59. -->
  60. <xts:block id="getParameters" dependency="cleanupEnv" nodelist="env, system, header" processor="XSLT" type="exec" mode="interpret" mandatory="false">
  61. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  62. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  63. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  64. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  65. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  66. <xsl:variable name="level" select="key('env-param', 'm_wizardDialogNumber')"/>
  67. <xsl:variable name="path">
  68. <xsl:choose>
  69. <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
  70. <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
  71. </xsl:when>
  72. <!-- the package location can be passed by Transformer -->
  73. <xsl:when test="/root/env/param[@name='from_transf']!='' and string(/root/env/param[@name='m_package_dialog_0_location_packageLocation'])!=''">
  74. <xsl:value-of select="/root/env/param[@name='m_package_dialog_0_location_packageLocation']"/>
  75. </xsl:when>
  76. <xsl:when test="/root/env/param[@name='m_selfServicePackageLocation']!=''">
  77. <xsl:value-of select="/root/env/param[@name='m_selfServicePackageLocation']"/>
  78. </xsl:when>
  79. <xsl:otherwise>
  80. <xsl:value-of select="'/content'"/>
  81. </xsl:otherwise>
  82. </xsl:choose>
  83. </xsl:variable>
  84. <xsl:template match="/">
  85. <xts:sequence>
  86. <xts:append>
  87. <xts:transform src="transforms/fm/fm-params.xslt" processor="XSLT">
  88. <send:request provider="metadataService" testBlock="testMetadataResponse" faultBlock="createFault">
  89. <md1:updateMetadata xmlns:md1="http://developer.cognos.com/schemas/metadataService/1">
  90. <request>
  91. <xts:transform name="XMLEncode">
  92. <mdprovider type="transientAction" action="execute" seq="1">
  93. <transaction saved="false" seq="1">
  94. <action seq="1" type="CmWizardPublishLwm">
  95. <inputparams>
  96. <param seq="1" type="cclnode">
  97. <value>
  98. <xts:transform name="XMLEncode">
  99. <parameters xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  100. <value>
  101. <item>
  102. <name>datasource</name>
  103. <value>
  104. <item xsi:type="bus:simpleParmValueItem">
  105. <inclusive>true</inclusive>
  106. <use><xsl:value-of select="key('env-param', 'm_dataSourceName')"/></use>
  107. </item>
  108. </value>
  109. </item>
  110. <!-- Special process for packageName, packageDescription...
  111. because these parameters need to be ordered-->
  112. <!-- when level is 0 then it's the first time we hit the wizard. -->
  113. <xsl:if test="$level != '' and $level !='0'">
  114. <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  115. <name>packageName</name>
  116. <value>
  117. <item xsi:type="bus:simpleParmValueItem">
  118. <inclusive>true</inclusive>
  119. <use><xsl:value-of select="key('env-param', 'm_package_dialog_0_text_packageName')"/></use>
  120. </item>
  121. </value>
  122. </item>
  123. <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  124. <name>packageDescription</name>
  125. <value>
  126. <item xsi:type="bus:simpleParmValueItem">
  127. <inclusive>true</inclusive>
  128. <use><xsl:value-of select="key('env-param', 'm_package_dialog_0_textArea_packageDescription')"/></use>
  129. </item>
  130. </value>
  131. </item>
  132. <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  133. <name>packageScreenTip</name>
  134. <value>
  135. <item xsi:type="bus:simpleParmValueItem">
  136. <inclusive>true</inclusive>
  137. <use><xsl:value-of select="key('env-param', 'm_package_dialog_0_text_packageScreenTip')"/></use>
  138. </item>
  139. </value>
  140. </item>
  141. <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  142. <name>packageLocation</name>
  143. <value>
  144. <item xsi:type="bus:simpleParmValueItem">
  145. <inclusive>true</inclusive>
  146. <use><xsl:value-of select="key('env-param', 'm_package_dialog_0_location_packageLocation')"/></use>
  147. </item>
  148. </value>
  149. </item>
  150. <!-- Here process the trees and fields. -->
  151. <xsl:for-each select="/root/env/param[generate-id(.) = generate-id(key('env-param',@name)) and starts-with(@name, 'm_package_dialog_') and not(contains(@name, 'packageName') or contains(@name, 'packageDescription') or contains(@name, 'packageLocation') or contains(@name, 'packageScreenTip') or contains(@name, '_selected'))]">
  152. <xsl:sort select="@name"/>
  153. <xsl:variable name="levelParam" select="substring-before(substring-after(@name, 'm_package_dialog_'), '_')"/>
  154. <xsl:variable name="localParamName" select="@name"/>
  155. <xsl:variable name="paramSelected" select="concat(@name, '_selected')"/>
  156. <xsl:variable name="value" select="."/>
  157. <xsl:variable name="selectedValues" select="/root/env/param[@name=$localParamName]"/>
  158. <xsl:if test="$levelParam!='' and not(number($level) &lt;= number($levelParam))">
  159. <xsl:choose>
  160. <xsl:when test="contains(@name, '_tree_')">
  161. <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  162. <name><xsl:value-of select="substring-after(@name, '_tree_')"/></name>
  163. <value>
  164. <item xsi:type="bus:simpleParmValueItem">
  165. <inclusive>true</inclusive>
  166. <use><xsl:value-of select="$value"/></use>
  167. </item>
  168. </value>
  169. </item>
  170. </xsl:when>
  171. <xsl:when test="contains(@name, '_list_')">
  172. <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  173. <name><xsl:value-of select="substring-after(@name, '_list_')"/></name>
  174. <xsl:choose>
  175. <!-- do not copy the value if it is empty and the selection is true (optional) -->
  176. <xsl:when test="not($selectedValues) and /root/env/param[@name= $paramSelected] and /root/env/param[@name= $paramSelected]='true'"/>
  177. <xsl:otherwise>
  178. <value>
  179. <xsl:for-each select="/root/env/param[@name=$localParamName]">
  180. <item xsi:type="bus:simpleParmValueItem">
  181. <inclusive>true</inclusive>
  182. <use><xsl:value-of select="."/></use>
  183. </item>
  184. </xsl:for-each>
  185. </value>
  186. </xsl:otherwise>
  187. </xsl:choose>
  188. </item>
  189. </xsl:when>
  190. <xsl:when test="contains(@name, '_text_') or contains(@name, '_textArea_') or contains(@name, '_radioGroup_') or contains(@name,'_checkbox_')">
  191. <xsl:variable name="paramName">
  192. <xsl:choose>
  193. <xsl:when test="contains(@name, '_text_')">
  194. <xsl:value-of select="substring-after(@name, '_text_')"/>
  195. </xsl:when>
  196. <xsl:when test="contains(@name, '_textArea_')">
  197. <xsl:value-of select="substring-after(@name, '_textArea_')"/>
  198. </xsl:when>
  199. <xsl:when test="contains(@name, '_radioGroup_')">
  200. <xsl:value-of select="substring-after(@name, '_radioGroup_')"/>
  201. </xsl:when>
  202. <xsl:when test="contains(@name, '_checkbox_')">
  203. <xsl:value-of select="substring-after(@name, '_checkbox_')"/>
  204. </xsl:when>
  205. </xsl:choose>
  206. </xsl:variable>
  207. <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  208. <name><xsl:value-of select="$paramName"/></name>
  209. <value>
  210. <item xsi:type="bus:simpleParmValueItem">
  211. <inclusive>true</inclusive>
  212. <use><xsl:value-of select="$value"/></use>
  213. </item>
  214. </value>
  215. </item>
  216. </xsl:when>
  217. </xsl:choose>
  218. </xsl:if>
  219. </xsl:for-each>
  220. </xsl:if>
  221. </value>
  222. </parameters>
  223. </xts:transform>
  224. </value>
  225. </param>
  226. </inputparams>
  227. <domchanges/>
  228. <result success="t">
  229. <outputparams>
  230. <param seq="1" type="cclnode">
  231. <value/>
  232. </param>
  233. </outputparams>
  234. </result>
  235. </action>
  236. </transaction>
  237. </mdprovider>
  238. </xts:transform>
  239. </request>
  240. </md1:updateMetadata>
  241. </send:request>
  242. </xts:transform>
  243. </xts:append>
  244. </xts:sequence>
  245. <xsl:if test="key('env-param', 'm_wizardDialogNumber')='0'">
  246. <xts:sequence>
  247. <xts:append>
  248. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  249. <send:request provider="cm">
  250. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  251. <cm:query>
  252. <cm:search>
  253. <xsl:value-of select="$path"/>
  254. </cm:search>
  255. <cm:properties>
  256. <cm:property name="objectClass"/>
  257. <cm:property name="defaultName"/>
  258. <cm:property name="storeID"/>
  259. <cm:property name="ancestors"/>
  260. <cm:property name="permissions"/>
  261. </cm:properties>
  262. </cm:query>
  263. </xts:transform>
  264. </send:request>
  265. </xts:transform>
  266. </xts:append>
  267. </xts:sequence>
  268. </xsl:if>
  269. <xts:sequence>
  270. <xts:delete select="/root/env/param[@name='package_rename']"/>
  271. </xts:sequence>
  272. </xsl:template>
  273. </xsl:stylesheet>
  274. </xts:block>
  275. <!--
  276. ===============================================================================================
  277. getPackageInfo. This one returns the storeid of a package after being created.
  278. ===============================================================================================
  279. -->
  280. <xts:block id="getPackageInfo" dependency="getParameters" nodelist="env, system, header" condition=".[/root/env/param[@name='from_transf']!='' and /root/env/param[@name='m_package_dialog_0_text_packageName']!='' and count(/root/*[local-name() = 'theFMDataSource']/response/outputparams/param/*[local-name()='mdproviderResponse'])=0]" processor="XSLT" type="exec" mode="interpret" mandatory="false">
  281. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  282. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  283. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  284. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  285. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  286. <xsl:variable name="level" select="key('env-param', 'm_wizardDialogNumber')"/>
  287. <xsl:variable name="class-filter">
  288. <xsl:text>[@objectClass='package']</xsl:text>
  289. </xsl:variable>
  290. <xsl:variable name="path">
  291. <xsl:choose>
  292. <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
  293. <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
  294. </xsl:when>
  295. <!-- the package location can be passed by Transformer -->
  296. <xsl:when test="string(/root/env/param[@name='m_package_dialog_0_location_packageLocation'])!=''">
  297. <xsl:value-of select="/root/env/param[@name='m_package_dialog_0_location_packageLocation']"/>
  298. </xsl:when>
  299. <xsl:when test="/root/env/param[@name='m_selfServicePackageLocation']!=''">
  300. <xsl:value-of select="/root/env/param[@name='m_selfServicePackageLocation']"/>
  301. </xsl:when>
  302. <xsl:otherwise>
  303. <xsl:value-of select="'/content'"/>
  304. </xsl:otherwise>
  305. </xsl:choose>
  306. </xsl:variable>
  307. <xsl:template match="/">
  308. <xsl:if test="key('env-param', 'm_package_dialog_0_text_packageName')!=''">
  309. <xts:sequence>
  310. <xts:append>
  311. <thePackage>
  312. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  313. <send:request provider="cm">
  314. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  315. <cm:query>
  316. <cm:search>
  317. <xsl:value-of select="$path"/>/*<xsl:value-of select="concat($class-filter, /root/system/param[@name='visible'], '[@defaultName=&quot;',key('env-param', 'm_package_dialog_0_text_packageName'), '&quot;]')"/>
  318. </cm:search>
  319. <cm:properties>
  320. <cm:property name="objectClass"/>
  321. <cm:property name="defaultName"/>
  322. <cm:property name="storeID"/>
  323. <cm:property name="searchPath"/>
  324. </cm:properties>
  325. </cm:query>
  326. </xts:transform>
  327. </send:request>
  328. </xts:transform>
  329. </thePackage>
  330. </xts:append>
  331. </xts:sequence>
  332. </xsl:if>
  333. </xsl:template>
  334. </xsl:stylesheet>
  335. </xts:block>
  336. <!-- Test block -->
  337. <xts:block id="testMetadataResponse" type="test">
  338. <md1:updateMetadataResponse xmlns:md1="http://developer.cognos.com/schemas/metadataService/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  339. <metadata>&lt;response&gt;&lt;status mode=&quot;ro&quot; primary=&quot;true&quot; success=&quot;true&quot;/&gt;&lt;outputparams&gt;&lt;param seq=&quot;1&quot; type=&quot;cclnode&quot;&gt;&lt;mdproviderResponse xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;schema4.xsd&quot;&gt;
  340. &lt;url&gt;/metadataUIService?pid=importWizard&lt;/url&gt;
  341. &lt;/mdproviderResponse&gt;&lt;/param&gt;&lt;/outputparams&gt;&lt;/response&gt;</metadata>
  342. </md1:updateMetadataResponse>
  343. </xts:block>
  344. <!--
  345. ===============================================================================================
  346. getMyFolder - grab MyFolder info so don't have to rely on session
  347. ===============================================================================================
  348. -->
  349. <xts:block id="getMyFolder" processor="XSLT" type="exec" dependency="cleanupEnv">
  350. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  351. <xsl:stylesheet
  352. xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  353. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  354. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  355. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  356. <xsl:template match="/">
  357. <xts:sequence>
  358. <xts:append>
  359. <myfolder>
  360. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  361. <send:request provider="cm">
  362. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  363. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  364. <cm:search>~/folder</cm:search>
  365. <cm:properties>
  366. <cm:property name="defaultName"/>
  367. <cm:property name="permissions"/>
  368. <cm:property name="storeID"/>
  369. <cm:property name="parent"/>
  370. </cm:properties>
  371. </cm:query>
  372. </xts:transform>
  373. </send:request>
  374. </xts:transform>
  375. </myfolder>
  376. </xts:append>
  377. </xts:sequence>
  378. </xsl:template>
  379. </xsl:stylesheet>
  380. </xts:block>
  381. <!--
  382. ==================================================================================================
  383. getSelfServicePackageInfo - DOMify the javascript and "cform" associated with the "Back" button when creating a self service package.
  384. ==================================================================================================
  385. -->
  386. <xts:block id="getSelfServicePackageInfo" condition=".[(/root/env/param[@name='m_selfServicePackageLocation']!='' or /root/env/param[@name='from_CC']='true') and /root/env/param[@name='m_wizardDialogNumber']='0']" processor="XSLT" type="exec" dependency="getParameters" mandatory="false">
  387. <xts:logicsheet path="logicsheets/portal.xsl"/>
  388. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  389. <xsl:stylesheet version="1.0"
  390. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  391. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  392. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  393. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  394. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  395. xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xtsext cm cml pf xts">
  396. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  397. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  398. <pf:variables/>
  399. <xsl:template match="/">
  400. <xsl:variable name="newPackageFromCC" select="/root/env/param[@name='from_CC']='true' and /root/env/param[@name='m_selfServicePackageLocation']=''"/>
  401. <xsl:variable name="path">
  402. <xsl:choose>
  403. <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
  404. <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
  405. </xsl:when>
  406. <!-- the package location can be passed by Transformer -->
  407. <xsl:when test="/root/env/param[@name='from_transf']!='' and string(/root/env/param[@name='m_package_dialog_0_location_packageLocation'])!=''">
  408. <xsl:value-of select="/root/env/param[@name='m_package_dialog_0_location_packageLocation']"/>
  409. </xsl:when>
  410. <xsl:when test="/root/env/param[@name='m_selfServicePackageLocation']!=''">
  411. <xsl:value-of select="/root/env/param[@name='m_selfServicePackageLocation']"/>
  412. </xsl:when>
  413. <xsl:when test="not($newPackageFromCC)">
  414. <xsl:value-of select="'/content'"/>
  415. </xsl:when>
  416. </xsl:choose>
  417. </xsl:variable>
  418. <xts:sequence>
  419. <xts:append select="/root">
  420. <selfServicePackage>
  421. <theScript>
  422. <xsl:text>function processSelfServicePackageBackButton()
  423. {
  424. if (document.cform)
  425. {
  426. window.setTimeout( "document.cform.submit();" , 1 );
  427. }
  428. }</xsl:text>
  429. </theScript>
  430. <theForm>
  431. <form name="cform" action="{$gateway}" method="post">
  432. <input type="hidden" name="b_action" value="xts.run"/>
  433. <input type="hidden" name="so.select" value="selfServicePackage"/>
  434. <input type="hidden" name="so.backURL" value="{/root/env/param[@name='backURL']}"/>
  435. <input type="hidden" name="backURL" value="{/root/env/param[@name='backURL']}"/>
  436. <input type="hidden" name="so.return.m" value="{$app}/new_package.xts"/>
  437. <input type="hidden" name="so.defaultObject" value="{/root/env/param[@name='m_dataSourcePath']}"/>
  438. <input type="hidden" name="m_selfServicePackageLocation" value="{$path}"/>
  439. <input type="hidden" name="m_new_class" value="package"/>
  440. <input type="hidden" name="m" value="{$app}/select/select.xts"/>
  441. <input type="hidden" name="from_CC" value="{/root/env/param[@name='from_CC']}"/>
  442. </form>
  443. </theForm>
  444. </selfServicePackage>
  445. </xts:append>
  446. </xts:sequence>
  447. </xsl:template>
  448. </xsl:stylesheet>
  449. </xts:block>
  450. <!--
  451. ===============================================================================================
  452. renderPage - render the page
  453. ===============================================================================================
  454. -->
  455. <xts:block id="render_wizard_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getPackageInfo getMyFolder getSelfServicePackageInfo">
  456. <xts:logicsheet path="logicsheets/portal.xsl"/>
  457. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  458. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  459. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  460. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  461. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  462. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  463. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  464. <xts:logicsheet path="logicsheets/validation.xslt"/>
  465. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  466. <xsl:stylesheet version="1.0"
  467. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  468. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  469. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  470. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  471. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  472. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  473. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  474. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  475. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  476. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  477. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  478. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  479. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  480. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" exclude-result-prefixes="xts xsl dcx cf cp pf df dp dt lyt cm cml utml xtsext">
  481. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  482. <!-- current file name -->
  483. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  484. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  485. <xsl:variable name="mname" select="'new_package.xts'"/>
  486. <pf:variables/>
  487. <xsl:variable name="newPackageFromCC" select="/root/env/param[@name='from_CC']='true' and /root/env/param[@name='m_selfServicePackageLocation']=''"/>
  488. <xsl:variable name="path">
  489. <xsl:choose>
  490. <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
  491. <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
  492. </xsl:when>
  493. <!-- the package location can be passed by Transformer -->
  494. <xsl:when test="/root/env/param[@name='from_transf']!='' and string(/root/env/param[@name='m_package_dialog_0_location_packageLocation'])!=''">
  495. <xsl:value-of select="/root/env/param[@name='m_package_dialog_0_location_packageLocation']"/>
  496. </xsl:when>
  497. <xsl:when test="/root/env/param[@name='m_selfServicePackageLocation']!=''">
  498. <xsl:value-of select="/root/env/param[@name='m_selfServicePackageLocation']"/>
  499. </xsl:when>
  500. <xsl:when test="not($newPackageFromCC)">
  501. <xsl:value-of select="'/content'"/>
  502. </xsl:when>
  503. </xsl:choose>
  504. </xsl:variable>
  505. <xsl:variable name="storeId">
  506. <xsl:value-of select="/root/*[local-name()='thePackage']/*[local-name()='queryResponse']/*[local-name()='package']/*[local-name()='storeID']"/>
  507. </xsl:variable>
  508. <!-- Determine if path coming in is My Folders -->
  509. <xsl:variable name="pathId" select="string(/root/*[local-name()='queryResponse']/*/cm:storeID)"/>
  510. <xsl:variable name="myFldrId" select="string(/root/myfolder/*/*/cm:storeID)"/>
  511. <!-- Determine if the current path points to the personal folder space, but only when not doing New Package in CC -->
  512. <xsl:variable name="isPersonalPath" select="$myFldrId = $pathId and not($newPackageFromCC)"/>
  513. <!-- determine if current path is under personal folder -->
  514. <xsl:variable name="underMyFldr" select="boolean(/root/*[local-name()='queryResponse']/*/cm:ancestors/*/cm:storeID[ . =$myFldrId])"/>
  515. <xsl:variable name="accountPath" select="/root/myfolder/*/*/cm:parent/*/cm:searchPath"/>
  516. <xsl:variable name="searchPath">
  517. <xsl:value-of select="/root/*[local-name()='thePackage']/*[local-name()='queryResponse']/*[local-name()='package']/*[local-name()='searchPath']"/>
  518. </xsl:variable>
  519. <xsl:variable name="fromTransformer" select="key('env-param', 'from_transf')"/>
  520. <xsl:variable name="backURL" select="key('env-param','backURL')"/>
  521. <!-- connection templates for the controls -->
  522. <xsl:variable name="the-object" select="/root/*[local-name() = 'theFMDataSource']/response/outputparams/param/*[local-name()='mdproviderResponse']"/>
  523. <xsl:variable name="UIHint" select="/root/*[local-name() = 'theFMDataSource']/response/outputparams/param/*[local-name()='mdproviderResponse']/UIHint/message"/>
  524. <xsl:variable name="dialogTitle" select="/root/*[local-name() = 'theFMDataSource']/response/outputparams/param/*[local-name()='mdproviderResponse']/dialogTitle"/>
  525. <!-- Determine if we can write to the currently selected folder. -->
  526. <xsl:variable name="canWrite" select="contains(/root/cm:queryResponse/*/cm:permissions, 'write') and contains(/root/cm:queryResponse/*/cm:permissions, 'traverse')"/>
  527. <xsl:variable name="m_wizardDialogNumber" select="key('env-param', 'm_wizardDialogNumber')"/>
  528. <xsl:template match="/root">
  529. <xsl:choose>
  530. <xsl:when test="/root/copyFault">
  531. <xsl:variable name="browserTitle"><xts:string id="IDS_COGNOS_REPORTS"/></xsl:variable>
  532. <xsl:variable name="redirect-url"> <!-- Redirection URL which may be used for the No answer. -->
  533. <xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name = 'backURL']))"/>
  534. </xsl:variable>
  535. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  536. <dp:meta>
  537. <pf:meta/>
  538. <dp:script>
  539. <!-- Help system -->
  540. <pf:help context="HID_MODELS_PKGS"/>
  541. </dp:script>
  542. <!-- Standard meta tags -->
  543. </dp:meta>
  544. <!--pf:script/-->
  545. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"></script>
  546. <script language="javascript">
  547. function closePage()
  548. {
  549. <xsl:choose>
  550. <xsl:when test="$fromTransformer">
  551. window.external.OnClose(1);
  552. </xsl:when>
  553. <xsl:otherwise>
  554. <!-- Clear the cookie value mfst -->
  555. clearSessionEntry('mfst');
  556. document.location.href = '<xsl:value-of select="$redirect-url"/>';
  557. </xsl:otherwise>
  558. </xsl:choose>
  559. }
  560. function validate()
  561. {
  562. var f = document.pform;
  563. if (trim(f.package_rename.value) == '')
  564. {
  565. alert('<xts:string id="IDS_DUPLICATE_ERROR_EMPTY_STRING" encode="javascript"/>');
  566. return false;
  567. }
  568. return true;
  569. }
  570. function performAction()
  571. {
  572. var fr = document.pform;
  573. if (!validate())
  574. { return; }
  575. fr.m.value = 'portal/new_package.xts';
  576. fr.m_package_dialog_0_text_packageName.value = fr.package_rename.value;
  577. document.pform.submit()
  578. }
  579. </script>
  580. <form name="pform" method="post" action="{$gateway}">
  581. <dp:header>
  582. <!-- header titles-->
  583. <dp:title showName="false">
  584. <xsl:value-of select="$browserTitle"/>
  585. </dp:title>
  586. <!-- header introduction -->
  587. <dp:close>
  588. <xsl:variable name="close"><xts:string id="IDS_CLOSE"/></xsl:variable>
  589. <a href="javascript:closePage();"><img height="16" width="16" class="dialogClose" vspace="2" border="0" src="{$skin_images}close.gif" alt="{$close}" onmouseover="this.className = 'dialogCloseOver'" onmouseout="this.className = 'dialogClose'"/></a>
  590. </dp:close>
  591. </dp:header>
  592. <xsl:call-template name="declareHiddenInputs"/>
  593. <lyt:layout style="1">
  594. <lyt:section>
  595. <dp:group>
  596. <dp:groupItem valign="top">
  597. <img height="32" width="32" border="0">
  598. <xsl:attribute name="src">
  599. <xsl:value-of select="$webcontent"/>/<xsl:value-of select="$app"/>
  600. <xsl:text/>/images/msg_warning.gif<xsl:text/>
  601. </xsl:attribute>
  602. </img>
  603. </dp:groupItem>
  604. <dp:groupItem>
  605. <!-- used for alignment -->
  606. <dp:text/><xsl:text>&#160;</xsl:text>
  607. </dp:groupItem>
  608. <dp:groupItem valign="top">
  609. <dp:text nospace="nospace" wrap="wrap">
  610. <xts:string id="IDS_DUPLICATE_ERROR_RENAME_ERROR"><xts:param name="entryName"><xsl:value-of select="/root/env/param[@name='m_package_dialog_0_text_packageName']"/></xts:param></xts:string>
  611. <br/><br/>
  612. <xts:string id="IDS_DUPLICATE_ERROR_RENAME_ENTRY_OPTION"/><br/>
  613. <input name="package_rename" type="text" maxlength="100" size="45" class="pInput"/>
  614. <br/><br/>
  615. <xts:string id="IDS_DUPLICATE_ERROR_CONTINUE"/>
  616. <br/>
  617. </dp:text>
  618. </dp:groupItem>
  619. </dp:group>
  620. </lyt:section>
  621. </lyt:layout>
  622. <dp:footer>
  623. <!-- Default. Use Ok/Cancel buttons -->
  624. <df:button df:id="IDS_DUPLICATE_ERROR_OK" df:style="href" df:href="javascript:performAction();"/>
  625. <df:button df:id="IDS_DUPLICATE_ERROR_CANCEL" df:style="href" df:href="javascript:closePage();"/>
  626. </dp:footer>
  627. </form>
  628. </dp:page>
  629. <xts:delete select="/root/copyFault"/>
  630. </xsl:when>
  631. <xsl:when test="$the-object and ($the-object/url !='')">
  632. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page>
  633. <form name="pform" method="post" action="{$gateway}">
  634. <script language="javascript" src="{$webcontent}/{$app}/js/cookie_jar.js"/>
  635. <script language="javascript">
  636. var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  637. var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  638. var sCookiePath = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  639. var sCookieDomain = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  640. var sCookieSecure = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
  641. function init() {
  642. <!-- Clear the cookie value mfst -->
  643. clearSessionEntry('mfst');
  644. }
  645. </script>
  646. </form>
  647. </dp:page>
  648. <xsl:variable name="mdsrv-target-url">
  649. <xsl:value-of select="concat($gateway, $the-object/url,'&amp;backURL=', xtsext:urlencode(string($backURL)))"/>
  650. </xsl:variable>
  651. <xsl:call-template name="redirect">
  652. <xsl:with-param name="url" select="$mdsrv-target-url"/>
  653. </xsl:call-template>
  654. </xsl:when>
  655. <xsl:when test="$the-object and count($the-object/*) > 1">
  656. <xsl:variable name="currentTitle">
  657. <xsl:choose>
  658. <xsl:when test="$dialogTitle=''"><xts:string id="IDS_COGNOS_REPORTS"/></xsl:when>
  659. <xsl:otherwise><xsl:value-of select="$dialogTitle"/></xsl:otherwise>
  660. </xsl:choose>
  661. </xsl:variable>
  662. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$currentTitle">
  663. <dp:meta>
  664. <pf:meta/>
  665. <!-- Standard meta tags -->
  666. </dp:meta>
  667. <dp:script>
  668. <!-- Help system -->
  669. <pf:help context="HID_MODELS_PKGS"/>
  670. </dp:script>
  671. <link href="{$webRoot}/prompting/reportskin/prompting/promptCommon.css" type="text/css" rel="stylesheet"></link>
  672. <pf:script/>
  673. <script language="javascript" src="{$webRoot}/prompting/prompting.js">//</script>
  674. <script language="javascript" src="{$webRoot}/prompting/CTreeIE5NS6.js" type="text/javascript">//</script>
  675. <script type="text/javascript">
  676. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/prompting/res/promptingStrings_<xsl:value-of select="$productLocale"/>.js</xsl:attribute>
  677. <xsl:text/>//<xsl:text/>
  678. </script>
  679. <script language="javascript" src="{$webcontent}/{$app}/js/tree.js"/>
  680. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"/>
  681. <script type="text/javascript">
  682. var currentLevel = <xsl:value-of select="xtsext:javascriptencode(key('env-param', 'm_wizardDialogNumber'))"/>;
  683. var numberOfCurrentParams = 0;
  684. var levelCounter = 0;
  685. var listOfParams = new Array();
  686. var listOfParamsType = new Array();
  687. var listOfParamsContraints = new Array();
  688. var listOfParamsOptional = new Array();
  689. <xsl:variable name="errmsgMany">
  690. <xts:string id="IDS_ERR_MANDATORY_LISTMANY" encode="javascript"/>
  691. </xsl:variable>
  692. <xsl:variable name="errmsgOne">
  693. <xts:string id="IDS_ERR_MANDATORY_LISTONE" encode="javascript"/>
  694. </xsl:variable>
  695. <xsl:variable name="errmsgLocation">
  696. <xts:string id="IDS_ERR_MANDATORY_LOCATION" encode="javascript"/>
  697. </xsl:variable>
  698. <xsl:variable name="errmsgTree">
  699. <xts:string id="IDS_ERR_MANDATORY_TREE" encode="javascript"/>
  700. </xsl:variable>
  701. <xsl:variable name="errmsgField">
  702. <xts:string id="IDS_ERR_MANDATORY" encode="javascript">
  703. <xts:param name="field">" + label + "</xts:param>
  704. </xts:string>
  705. </xsl:variable>
  706. function validate()
  707. {
  708. var f = document.pform;
  709. var passTest = true;
  710. <xsl:for-each select="$the-object/*[local-name() ='text' or local-name() = 'textArea']">
  711. <xsl:if test="./optional='false'">
  712. var paramField = document.getElementById('m_package_dialog_' + currentLevel + '_' + '<xsl:value-of select="xtsext:javascriptencode(local-name())"/>' + '_' + '<xsl:value-of select="xtsext:javascriptencode(./name)"/>');
  713. if (paramField)
  714. {
  715. passTest = validateInputField(paramField, '<xsl:value-of select="normalize-space(xtsext:javascriptencode(./UILabel))"/>');
  716. }
  717. if( !passTest ) return false;
  718. </xsl:if>
  719. </xsl:for-each>
  720. for (i = 0; i &lt; numberOfCurrentParams; i++)
  721. {
  722. var param = document.getElementById('m_package_dialog_' + currentLevel + '_' + listOfParamsType[i] + '_' + listOfParams[i]);
  723. if(trim(param.value)=='' || trim(param.value) == 'undefined')
  724. {
  725. if(param.multiple == true &amp;&amp; listOfParamsContraints[i] == 'many' &amp;&amp; listOfParamsType[i] == 'list')
  726. {
  727. if (listOfParamsOptional[i] == 'true')
  728. {
  729. //Create a new hidden input in order it get passed when submitting.
  730. var id = 'm_package_dialog_' + currentLevel + '_' + listOfParamsType[i] + '_' + listOfParams[i];
  731. var elem = createHiddenInput (id, 'true');
  732. elem.value = '';
  733. //Create a new hidden input for the selection...
  734. elem = createHiddenInput (id + '_selected' , 'true');
  735. elem.value='false';
  736. }
  737. else {
  738. var errormsg = '<xsl:value-of select="normalize-space($errmsgMany)"/>';
  739. alert(errormsg);
  740. return false;
  741. }
  742. } else if (listOfParamsContraints[i] == 'one' &amp;&amp; listOfParamsType[i] == 'list')
  743. {
  744. if (listOfParamsOptional[i] == 'true')
  745. {
  746. //Create a new hidden input in order it get passed when submitting.
  747. var id = 'm_package_dialog_' + currentLevel + '_' + listOfParamsType[i] + '_' + listOfParams[i];
  748. var elem = createHiddenInput (id, 'true');
  749. elem.value = '';
  750. //Create a new hidden input for the selection...
  751. elem = createHiddenInput (id + '_selected' , 'true');
  752. elem.value='false';
  753. }
  754. else {
  755. var errormsgOne = '<xsl:value-of select="normalize-space($errmsgOne)"/>';
  756. alert(errormsgOne);
  757. return false;
  758. }
  759. }
  760. else if (listOfParamsType[i] == 'location')
  761. {
  762. var errorMsg = '<xsl:value-of select="normalize-space($errmsgLocation)"/>';
  763. alert(errorMsg);
  764. return false;
  765. } else if (listOfParamsContraints[i] == 'one' &amp;&amp; listOfParamsType[i] == 'tree')
  766. {
  767. var errormsg = '<xsl:value-of select="normalize-space($errmsgTree)"/>';
  768. alert(errormsg);
  769. return false;
  770. }
  771. }
  772. }
  773. return true;
  774. }
  775. function createHiddenInput(name, optional)
  776. {
  777. var elem = document.createElement('input');
  778. elem.setAttribute('type', 'hidden');
  779. elem.setAttribute("name", name);
  780. elem.setAttribute("id", name);
  781. document.pform.appendChild(elem);
  782. return elem;
  783. }
  784. function validateInputField(field, label)
  785. {
  786. field.value = trim(field.value);
  787. if (field.value == '')
  788. {
  789. alert("<xsl:value-of select="normalize-space($errmsgField)"/>");
  790. field.focus();
  791. return false;
  792. }
  793. return true;
  794. }
  795. function processNextButton()
  796. {
  797. var f = document.pform;
  798. for (i = 0 ; i &lt; numberOfCurrentParams; i++)
  799. {
  800. //Get the current value from the tree.
  801. if (listOfParamsType[i] == 'tree')
  802. {
  803. var tvalue = document.getElementById('m_package_dialog_' + currentLevel + '_' + listOfParamsType[i] + '_' + listOfParams[i]);
  804. //Set the value.
  805. tvalue.value = getSelectedValue();
  806. var tname = document.getElementById('m_package_dialog_' + currentLevel + '_treeNodeName_' + listOfParams[i]);
  807. tname.value = getSelectedName();
  808. }
  809. }
  810. var val = currentLevel;
  811. val ++;
  812. f.m_wizardDialogNumber.value = val;
  813. if (!validate()) {
  814. return;
  815. }
  816. submitForm('', 'package', 'new_package.xts', '');
  817. }
  818. function processBackButton () {
  819. var val = currentLevel;
  820. val --;
  821. if (val &lt; -1) {
  822. val = 0;
  823. }
  824. document.pform.m_wizardDialogNumber.value = val;
  825. submitForm('', 'package', 'new_package.xts', '');
  826. }
  827. function submitForm( cmname, cmclass, target, cmpath)
  828. {
  829. var form = document.pform;
  830. form.m.value = "<xsl:value-of select="$app"/>/" + target;
  831. <xsl:if test="$fromTransformer=''">
  832. form.backURL.value = "<xsl:value-of select="xtsext:javascriptencode(string($backURL))"/>";
  833. </xsl:if>
  834. document.pform.submit();
  835. }
  836. function getLocation()
  837. {
  838. submitForm('', 'package', 'select/select.xts', '');
  839. }
  840. function setParams() {
  841. <xsl:call-template name="setParams"/>
  842. }
  843. function setParameter(paramName, paramConstraint, paramType)
  844. {
  845. listOfParams[levelCounter] = paramName;
  846. listOfParamsContraints[levelCounter] = paramConstraint;
  847. listOfParamsType[levelCounter] = paramType;
  848. levelCounter++;
  849. }
  850. function setListParameter(paramName, paramConstraint, paramType, paramOpional)
  851. {
  852. listOfParams[levelCounter] = paramName;
  853. listOfParamsContraints[levelCounter] = paramConstraint;
  854. listOfParamsType[levelCounter] = paramType;
  855. listOfParamsOptional[levelCounter] = paramOpional;
  856. levelCounter++;
  857. }
  858. function init() {
  859. numberOfCurrentParams = <xsl:value-of select="count($the-object/*[local-name() = 'text' or local-name() = 'textArea' or local-name() = 'location' or local-name() = 'selectionControl'])"/>;
  860. listOfParams = new Array(numberOfCurrentParams);
  861. listOfParamsContraints = new Array(numberOfCurrentParams);
  862. listOfParamsType = new Array(numberOfCurrentParams);
  863. listOfParamsOptional = new Array(numberOfCurrentParams);
  864. setParams();
  865. if(treeMetadata)
  866. {
  867. if (treeMetadata.getHasBeenDrawn() == false)
  868. {
  869. treeMetadata.removeLoading(treeMetadata.getRootNode());
  870. treeMetadata.drawAll();
  871. treeMetadata.checkData();
  872. }
  873. }
  874. }
  875. <!-- functions for location -->
  876. function changeSelection(divName)
  877. {
  878. var pathdiv = document.getElementById('ng_path');
  879. var mfdiv = document.getElementById('ng_myfolder');
  880. var sMF = document.getElementById('showMyFldr');
  881. switch (divName)
  882. {
  883. case "ng_path":
  884. {
  885. mfdiv.style.display = "none";
  886. pathdiv.style.display = "";
  887. sMF.style.display = ""
  888. break;
  889. }
  890. case "ng_myfolder":
  891. {
  892. mfdiv.style.display = "";
  893. pathdiv.style.display = "none";
  894. sMF.style.display = "none";
  895. setMyFolder();
  896. break;
  897. }
  898. }
  899. }
  900. function setMyFolder()
  901. {
  902. setStateValue("mfst",1);
  903. var packageLocation = "<xsl:value-of select="xtsext:javascriptencode(key('session-param','e_hp'))"/>/folder";
  904. document.pform.m_package_dialog_0_location_packageLocation.value = document.pform.elements["so.defaultLocation"].value = packageLocation;
  905. if(document.pform.elements["m_selfServicePackageLocation"])
  906. document.pform.elements["m_selfServicePackageLocation"].value = packageLocation;
  907. if(document.cform &amp;&amp; document.cform.elements["m_selfServicePackageLocation"])
  908. document.cform.elements["m_selfServicePackageLocation"].value = packageLocation;
  909. }
  910. <xsl:if test="$fromTransformer!=''">
  911. function doCancel()
  912. {
  913. window.external.OnClose(1);
  914. }
  915. </xsl:if>
  916. </script>
  917. <xsl:variable name="CVObject">oCV<xsl:value-of select="/root/env/param[@name='cv.id']"/></xsl:variable>
  918. <form name="pform" method="post" action="{$gateway}">
  919. <dp:header>
  920. <dp:title>
  921. <xsl:value-of select="$dialogTitle"/>
  922. </dp:title>
  923. <dp:close>
  924. <a href="{/root/env/param[@name = 'backURL']}">
  925. <xsl:attribute name="onClick">javascript:resetPageState()</xsl:attribute>
  926. <dp:closeMarker/>
  927. </a>
  928. </dp:close>
  929. </dp:header>
  930. <dp:description>
  931. <xsl:value-of select="$the-object/UIHint/message"/>
  932. </dp:description>
  933. <xsl:call-template name="declareHiddenInputs"/>
  934. <!-- wizard counter -->
  935. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  936. <tr>
  937. <td width="50%" valign="top">
  938. <lyt:layout style="1" width="100%">
  939. <lyt:section>
  940. <dp:list>
  941. <dp:section>
  942. <xsl:for-each select="$the-object/*">
  943. <xsl:choose>
  944. <xsl:when test="local-name() = 'text'">
  945. <xsl:variable name="textName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_text_', ./name)"/>
  946. <xsl:variable name="transformerParam" select="concat('m_transformer_', ./name)"/>
  947. <dp:input>
  948. <dp:section1>
  949. <label for="{$textName}"><xsl:value-of select="./UILabel"/></label>
  950. </dp:section1>
  951. <dp:section2>
  952. <input type="text" maxlength="100" size="30" class="pInput" name="{$textName}" id="{$textName}">
  953. <xsl:attribute name="value">
  954. <xsl:choose>
  955. <xsl:when test="/root/env/param[@name=$textName]">
  956. <xsl:value-of select="/root/env/param[@name=$textName]"/>
  957. </xsl:when>
  958. <xsl:when test="key('env-param', $transformerParam)">
  959. <xsl:value-of select="key('env-param', $transformerParam)"/>
  960. </xsl:when>
  961. <xsl:otherwise>
  962. <xsl:value-of select="./defaultValue"/>
  963. </xsl:otherwise>
  964. </xsl:choose>
  965. </xsl:attribute>
  966. </input>
  967. </dp:section2>
  968. </dp:input>
  969. </xsl:when>
  970. <xsl:when test="local-name() = 'textArea'">
  971. <xsl:variable name="textAreaName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_textArea_', ./name)"/>
  972. <xsl:variable name="transformerParam" select="concat('m_transformer_', ./name)"/>
  973. <dp:input>
  974. <dp:section1>
  975. <label for="{$textAreaName}"><xsl:value-of select="./UILabel"/></label>
  976. </dp:section1>
  977. <dp:section2>
  978. <textArea class="pTextarea" rows="4" cols="30" name="{$textAreaName}" id="{$textAreaName}">
  979. <xsl:attribute name="value">
  980. <xsl:choose>
  981. <xsl:when test="/root/env/param[@name=$textAreaName]">
  982. <xsl:value-of select="/root/env/param[@name=$textAreaName]"/>
  983. </xsl:when>
  984. <xsl:when test="key('env-param', $transformerParam)">
  985. <xsl:value-of select="key('env-param', $transformerParam)"/>
  986. </xsl:when>
  987. <xsl:otherwise>
  988. <xsl:value-of select="./defaultValue"/>
  989. </xsl:otherwise>
  990. </xsl:choose>
  991. </xsl:attribute>
  992. <xsl:choose>
  993. <xsl:when test="/root/env/param[@name=$textAreaName]">
  994. <xsl:value-of select="/root/env/param[@name=$textAreaName]"/>
  995. </xsl:when>
  996. <xsl:when test="key('env-param', $transformerParam)">
  997. <xsl:value-of select="key('env-param', $transformerParam)"/>
  998. </xsl:when>
  999. <xsl:otherwise>
  1000. <xsl:value-of select="./defaultValue"/>
  1001. </xsl:otherwise>
  1002. </xsl:choose>
  1003. </textArea>
  1004. </dp:section2>
  1005. </dp:input>
  1006. </xsl:when>
  1007. <xsl:when test="local-name() = 'location'">
  1008. <xsl:variable name="the-path-object" select="/root/cm:queryResponse/*"/>
  1009. <xsl:variable name="start-at-path">
  1010. <xsl:choose>
  1011. <xsl:when test="starts-with($the-path-object/cm:searchPath, key('session-param', 'e_hp')) or (starts-with($the-path-object/cm:searchPath, '~'))">
  1012. <xsl:value-of select="concat(key('session-param', 'e_hp'),'/folder')"/>
  1013. </xsl:when>
  1014. <xsl:when test="starts-with($the-object/cm:searchPath,'/content')">
  1015. <xsl:value-of select="$defaultContentRoot"/>
  1016. </xsl:when>
  1017. </xsl:choose>
  1018. </xsl:variable>
  1019. <input type="hidden" value="">
  1020. <xsl:attribute name="name">
  1021. <xsl:value-of select="concat('m_package_dialog_', $m_wizardDialogNumber, '_location_', ./name)"/>
  1022. </xsl:attribute>
  1023. <xsl:attribute name="id"><xsl:value-of select="concat('m_package_dialog_', $m_wizardDialogNumber, '_location_', ./name)"/></xsl:attribute>
  1024. </input>
  1025. <lyt:section>
  1026. <dp:list width="100%">
  1027. <xsl:choose>
  1028. <xsl:when test="not(./updateLocation = 'true')">
  1029. <!-- this will default on public folder -->
  1030. <dp:section>
  1031. <dp:label valign="top" width="15%">
  1032. <xts:string id="IDS_PROP_LOCATION"/>
  1033. </dp:label>
  1034. <dp:text wrap="wrap" valign="top" width="40%">
  1035. <cf:do-the-path-link>
  1036. <cf:param name="familytree">$the-path-object/cm:ancestors</cf:param>
  1037. <cf:param name="familymember">$the-path-object/cm:defaultName</cf:param>
  1038. <cf:param name="home">
  1039. <xsl:value-of select="$start-at-path"/>
  1040. </cf:param>
  1041. <cf:param name="onlyAncestors">false</cf:param>
  1042. </cf:do-the-path-link>
  1043. </dp:text>
  1044. </dp:section>
  1045. </xsl:when>
  1046. <xsl:when test="./updateLocation = 'true'">
  1047. <dp:section>
  1048. <dp:label>
  1049. <xts:string id="IDS_NEW_DESTINATION"/>
  1050. </dp:label>
  1051. </dp:section>
  1052. <dp:section wrap="wrap">
  1053. <div id="ng_path" style="padding:0px; display:none; ">
  1054. <xsl:choose>
  1055. <xsl:when test="$canWrite and $path!=''">
  1056. <dp:text valign="top" wrap="wrap">
  1057. <xsl:variable name="rootPath">
  1058. <xsl:choose>
  1059. <xsl:when test="starts-with($path, '/content')">
  1060. <xsl:value-of select="$defaultContentRoot"/>
  1061. </xsl:when>
  1062. <xsl:when test="$isPersonalPath or $underMyFldr">
  1063. <xsl:value-of select="concat($accountPath, '/folder')"/>
  1064. </xsl:when>
  1065. <xsl:otherwise>
  1066. <xsl:value-of select="$path"/>
  1067. </xsl:otherwise>
  1068. </xsl:choose>
  1069. </xsl:variable>
  1070. <cf:do-the-path-link>
  1071. <cf:param name="familytree">$the-path-object/cm:ancestors</cf:param>
  1072. <cf:param name="familymember">$the-path-object/cm:defaultName</cf:param>
  1073. <cf:param name="home">
  1074. <xsl:value-of select="$rootPath"/>
  1075. </cf:param>
  1076. </cf:do-the-path-link>
  1077. </dp:text>
  1078. </xsl:when>
  1079. <xsl:otherwise>
  1080. <dp:inactiveText><i><xts:string id="IDS_NONE"/></i>&#160;&#160;</dp:inactiveText>
  1081. </xsl:otherwise>
  1082. </xsl:choose>
  1083. </div>
  1084. </dp:section>
  1085. <dp:section wrap="wrap">
  1086. <div id="ng_myfolder" style="padding:0px; display:none; ">
  1087. <xsl:choose>
  1088. <xsl:when test="key('session-param', 'e_mroot') != ''">
  1089. <dp:text>
  1090. <xsl:value-of select="key('session-param', 'e_mroot')"/>
  1091. </dp:text>
  1092. </xsl:when>
  1093. <xsl:when test="$the-path-object/cm:defaultName">
  1094. <xts:string id="IDS_PERSONAL"/>
  1095. </xsl:when>
  1096. <xsl:otherwise>
  1097. <dp:inactiveText><i><xts:string id="IDS_NONE"/></i>&#160;&#160;</dp:inactiveText>
  1098. </xsl:otherwise>
  1099. </xsl:choose>
  1100. </div>
  1101. </dp:section>
  1102. <dp:section>
  1103. <dp:group>
  1104. <dp:groupItem valign="top">
  1105. <a href="#">
  1106. <xsl:attribute name="onclick">javascript:resetPageState();javascript:getLocation();</xsl:attribute>
  1107. <xsl:text/>
  1108. <xts:string id="IDS_SELECT_ANOTHER_FOLDER"/>
  1109. <xsl:text/>
  1110. </a>
  1111. </dp:groupItem>
  1112. <dp:section wrap="wrap">
  1113. <dp:groupItem valign="top">
  1114. <div id="showMyFldr" style="padding:0px; display:none; ">
  1115. <xsl:if test="$canWrite">
  1116. <img height="1" width="10" border="0">
  1117. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  1118. </img>
  1119. <xsl:text/>
  1120. <a href="#">
  1121. <xsl:text/>
  1122. <xsl:attribute name="onclick">javascript:changeSelection('ng_myfolder')</xsl:attribute>
  1123. <xsl:text/>
  1124. <xts:string id="IDS_SELECT_MY_FLDR_CM_NAME"><xts:param name="myfldr"><xsl:value-of select="string(/root/session/param[@name='e_mroot'])"/></xts:param></xts:string>
  1125. <xsl:text/>
  1126. </a>
  1127. <xsl:text/>
  1128. </xsl:if>
  1129. </div>
  1130. </dp:groupItem>
  1131. </dp:section>
  1132. </dp:group>
  1133. </dp:section>
  1134. </xsl:when>
  1135. </xsl:choose>
  1136. </dp:list>
  1137. </lyt:section>
  1138. </xsl:when>
  1139. <xsl:when test="local-name() = 'selectionControl'">
  1140. <xsl:choose>
  1141. <xsl:when test="./controlType = 'list'">
  1142. <xsl:variable name="listName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_list_', ./name)"/>
  1143. <xsl:variable name="selectionType" select="./selectionType"/>
  1144. <dp:list width="500">
  1145. <dp:section width="100" height="100">
  1146. <tr>
  1147. <td nowrap="nowrap" colspan="2" class="formLabel">
  1148. <label for="{$listName}"><xsl:value-of select="./caption"/></label>
  1149. </td>
  1150. </tr>
  1151. <select align="left" size="15" name="{$listName}" id="{$listName}">
  1152. <xsl:if test="$selectionType = 'many'">
  1153. <xsl:attribute name="multiple"><xsl:value-of select="'multiple'"/></xsl:attribute>
  1154. </xsl:if>
  1155. <xsl:for-each select="./*[local-name() = 'item']">
  1156. <option>
  1157. <xsl:attribute name="value"><xsl:value-of select="./value"/></xsl:attribute>
  1158. <xsl:if test="./value=key('env-param', $listName)">
  1159. <xsl:attribute name="selected">selected</xsl:attribute>
  1160. </xsl:if>
  1161. <xsl:value-of select="./caption"/>
  1162. </option>
  1163. </xsl:for-each>
  1164. </select>
  1165. </dp:section>
  1166. </dp:list>
  1167. </xsl:when>
  1168. <xsl:when test="./controlType = 'tree'">
  1169. <xsl:variable name="treeName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_tree_', ./name)"/>
  1170. <xsl:variable name="treeNodeName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_treeNodeName_', ./name)"/>
  1171. <input type="hidden">
  1172. <xsl:attribute name="name">
  1173. <xsl:value-of select="$treeName"/>
  1174. </xsl:attribute>
  1175. <xsl:attribute name="id"><xsl:value-of select="$treeName"/></xsl:attribute>
  1176. <xsl:attribute name="value"><xsl:value-of select="key('env-param', $treeName)"/></xsl:attribute>
  1177. </input>
  1178. <input type="hidden">
  1179. <xsl:attribute name="name">
  1180. <xsl:value-of select="$treeNodeName"/>
  1181. </xsl:attribute>
  1182. <xsl:attribute name="id"><xsl:value-of select="$treeNodeName"/></xsl:attribute>
  1183. <xsl:attribute name="value"><xsl:value-of select="key('env-param', $treeNodeName)"/></xsl:attribute>
  1184. </input>
  1185. <dp:list width="500">
  1186. <tr>
  1187. <td nowrap="nowrap" colspan="2" class="formLabel">
  1188. <xsl:value-of select="./UIHint"/>
  1189. </td>
  1190. </tr>
  1191. </dp:list>
  1192. <dp:section>
  1193. <div name="LWMTreeOuterPane" id="LWMTreeOuterPane"/>
  1194. <xsl:variable name="rootIcon">
  1195. <xsl:value-of select="./rootIcon"/>
  1196. </xsl:variable>
  1197. <script type="text/javascript" language="javascript">
  1198. function populate() {
  1199. <xsl:call-template name="populate">
  1200. <xsl:with-param name="path" select="./*"/>
  1201. </xsl:call-template>
  1202. }
  1203. initTree('<xsl:value-of select="xtsext:javascriptencode(./name)"/>', '<xsl:value-of select="xtsext:javascriptencode(./caption)"/>', '<xsl:value-of select="xtsext:javascriptencode($rootIcon)"/>');
  1204. populate();
  1205. </script>
  1206. </dp:section>
  1207. </xsl:when>
  1208. </xsl:choose>
  1209. </xsl:when>
  1210. <xsl:when test="local-name() = 'radioGroup'">
  1211. <xsl:variable name="groupName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_radioGroup_', ./name)"/>
  1212. <xsl:variable name="selectedValue">
  1213. <xsl:choose>
  1214. <xsl:when test="key('env-param', $groupName) != ''">
  1215. <xsl:value-of select="key('env-param', $groupName)"/>
  1216. </xsl:when>
  1217. <xsl:otherwise>
  1218. <xsl:value-of select="./*[local-name()='defaultValue']"/>
  1219. </xsl:otherwise>
  1220. </xsl:choose>
  1221. </xsl:variable>
  1222. <dp:input>
  1223. <dp:section1>
  1224. <xsl:value-of select="./UILabel"/>
  1225. </dp:section1>
  1226. <dp:section2>
  1227. <dp:choice>
  1228. <xsl:for-each select="./*[local-name() = 'item']">
  1229. <dp:section1>
  1230. <input type="radio" name="{$groupName}" value="{./value}" id="ctrl_{$groupName}_{./value}">
  1231. <xsl:if test="./value=$selectedValue">
  1232. <xsl:attribute name="checked">checked</xsl:attribute>
  1233. </xsl:if>
  1234. </input>
  1235. </dp:section1>
  1236. <dp:section2 for="ctrl_{$groupName}_{./value}">
  1237. <xsl:value-of select="./caption"/>
  1238. </dp:section2>
  1239. </xsl:for-each>
  1240. </dp:choice>
  1241. </dp:section2>
  1242. </dp:input>
  1243. </xsl:when>
  1244. <xsl:when test="local-name() = 'checkBoxList'">
  1245. <xsl:variable name="checkboxListName" select="concat('package_dialog_checkbox_', $m_wizardDialogNumber, '_checkbox_', ./checkBox/name)"/>
  1246. <xsl:variable name="listName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_checkbox_', ./checkBox/name)"/>
  1247. <xsl:variable name="transformerParam" select="concat('m_transformer_', ./checkBox/name)"/>
  1248. <xsl:variable name="paramListName" select="./checkBox/name"/>
  1249. <xsl:variable name="selectedValue">
  1250. <xsl:choose>
  1251. <xsl:when test="key('env-param', $listName) != ''">
  1252. <xsl:value-of select="key('env-param', $listName)"/>
  1253. </xsl:when>
  1254. <xsl:when test="key('env-param', $transformerParam) != ''">
  1255. <xsl:value-of select="key('env-param', $transformerParam)"/>
  1256. </xsl:when>
  1257. <xsl:when test="./checkBox/*[local-name()='value'] and ./checkBox/*[local-name()='value']!=''">
  1258. <xsl:value-of select="./checkBox/*[local-name()='value']"/>
  1259. </xsl:when>
  1260. <xsl:otherwise>
  1261. <xsl:value-of select="./checkBox/defaultValue"/>
  1262. </xsl:otherwise>
  1263. </xsl:choose>
  1264. </xsl:variable>
  1265. <div style="margin-top:10px;">
  1266. <dp:input>
  1267. <dp:section1 wrap="true">
  1268. <xsl:value-of select="./UILabel"/>
  1269. </dp:section1>
  1270. <dp:section2>
  1271. <dp:section1>
  1272. <input type="checkbox" style="margin-top=5px;" name="{$checkboxListName}" value="{$selectedValue}" id="ctrl_{$checkboxListName}_{$selectedValue}">
  1273. <xsl:if test="$selectedValue = 'true'">
  1274. <xsl:attribute name="checked">true</xsl:attribute>
  1275. </xsl:if>
  1276. <xsl:attribute name="onClick">javascript:checkboxToggle(this, '<xsl:value-of select="$paramListName"/>')</xsl:attribute>
  1277. <xsl:attribute name="onchange">javascript:checkboxUpdate(this, '<xsl:value-of select="$listName"/>')</xsl:attribute>
  1278. </input>
  1279. <input type="hidden" name="{$listName}" id="{$listName}">
  1280. <xsl:attribute name="value"><xsl:value-of select="$selectedValue"/></xsl:attribute>
  1281. </input>
  1282. </dp:section1>
  1283. <dp:section2>
  1284. <label for="ctrl_{$checkboxListName}_{$selectedValue}"><xsl:value-of select="./checkBox/caption"/></label>
  1285. </dp:section2>
  1286. </dp:section2>
  1287. </dp:input>
  1288. <dp:input>
  1289. <dp:section1></dp:section1>
  1290. <dp:section2>
  1291. <div style="margin-left:10px;">
  1292. <dp:choice>
  1293. <xsl:for-each select="./*[local-name() = 'checkBoxItem']">
  1294. <xsl:variable name="checkboxItemName" select="concat('package_dialog_checkbox_', $m_wizardDialogNumber, '_checkbox_', ./name)"/>
  1295. <xsl:variable name="itemName" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_checkbox_', ./name)"/>
  1296. <xsl:variable name="transformerItemName" select="concat('m_transformer_', ./name)"/>
  1297. <xsl:variable name="paramItemName" select="./name"/>
  1298. <xsl:variable name="selectedItemValue">
  1299. <xsl:choose>
  1300. <xsl:when test="key('env-param', $itemName) != ''">
  1301. <xsl:value-of select="key('env-param', $itemName)"/>
  1302. </xsl:when>
  1303. <xsl:when test="key('env-param', $transformerItemName) != ''">
  1304. <xsl:value-of select="key('env-param', $transformerItemName)"/>
  1305. </xsl:when>
  1306. <xsl:when test="./*[local-name()='value'] and ./*[local-name()='value']!=''">
  1307. <xsl:value-of select="./*[local-name()='value']"/>
  1308. </xsl:when>
  1309. <xsl:otherwise>
  1310. <xsl:value-of select="./*[local-name()='defaultValue']"/>
  1311. </xsl:otherwise>
  1312. </xsl:choose>
  1313. </xsl:variable>
  1314. <dp:section1>
  1315. <input type="checkbox" style="margin-top=2px;" name="{$checkboxItemName}" value="{$selectedItemValue}">
  1316. <xsl:if test="$selectedItemValue = 'true'">
  1317. <xsl:attribute name="checked">true</xsl:attribute>
  1318. </xsl:if>
  1319. <xsl:attribute name="id"><xsl:value-of select="concat('checkbox_', $paramListName,'_', $paramItemName)"/></xsl:attribute>
  1320. <xsl:attribute name="onchange">javascript:checkboxUpdate(this, '<xsl:value-of select="$itemName"/>')</xsl:attribute>
  1321. <xsl:if test="$selectedValue = 'false'">
  1322. <xsl:attribute name="disabled">true</xsl:attribute>
  1323. </xsl:if>
  1324. </input>
  1325. <input type="hidden" name="{$itemName}" id="{$itemName}">
  1326. <xsl:attribute name="value"><xsl:value-of select="$selectedItemValue"/></xsl:attribute>
  1327. </input>
  1328. </dp:section1>
  1329. <dp:section2 for="{concat('checkbox_', $paramListName,'_', $paramItemName)}">
  1330. <xsl:value-of select="./caption"/>
  1331. </dp:section2>
  1332. </xsl:for-each>
  1333. </dp:choice>
  1334. </div>
  1335. </dp:section2>
  1336. </dp:input>
  1337. <script type="text/javascript" language="javascript">
  1338. function checkboxUpdate(object, name) {
  1339. document.pform.elements[name].value = object.checked;
  1340. }
  1341. function checkboxToggle(object, name) {
  1342. var frm = document.pform;
  1343. for (var i=0 ; frm.length &gt; i; i++) {
  1344. var checkboxName = "checkbox_" + name + "_";
  1345. if (frm.elements[i].id.indexOf(checkboxName) != -1)
  1346. {
  1347. if (object.checked) {
  1348. frm.elements[i].disabled = false;
  1349. }
  1350. else {
  1351. frm.elements[i].disabled = true;
  1352. }
  1353. }
  1354. }
  1355. }
  1356. </script>
  1357. </div>
  1358. </xsl:when>
  1359. </xsl:choose>
  1360. </xsl:for-each>
  1361. </dp:section>
  1362. </dp:list>
  1363. </lyt:section>
  1364. </lyt:layout>
  1365. </td>
  1366. </tr>
  1367. </table>
  1368. <xsl:variable name="back-target">
  1369. <xsl:value-of select="concat($app,'/new_package.xts')"/>
  1370. </xsl:variable>
  1371. <dp:footer>
  1372. <xsl:choose>
  1373. <xsl:when test="not($fromTransformer)">
  1374. <df:button df:id="IDS_CANCEL" df:style="back-url" onClick="javascript:resetPageState();"/>
  1375. </xsl:when>
  1376. <xsl:otherwise>
  1377. <df:button df:id="IDS_CANCEL" df:style="href" df:href="#" onClick="javascript:doCancel();"/>
  1378. </xsl:otherwise>
  1379. </xsl:choose>
  1380. <xsl:choose>
  1381. <xsl:when test="(key('env-param','m_selfServicePackageLocation')!='' or $newPackageFromCC) and key('env-param','m_wizardDialogNumber')='0'">
  1382. <df:button df:id="IDS_BACK" df:style="href" df:href="#" onClick="javascript:processSelfServicePackageBackButton();"/>
  1383. </xsl:when>
  1384. <xsl:when test="key('env-param', 'm_wizardDialogNumber') = '0'">
  1385. <df:button df:id="IDS_BACK"/>
  1386. </xsl:when>
  1387. <xsl:otherwise>
  1388. <df:button df:id="IDS_BACK" df:style="href" df:href="#" onClick="javascript:processBackButton();"/>
  1389. </xsl:otherwise>
  1390. </xsl:choose>
  1391. <!-- next -->
  1392. <xsl:choose>
  1393. <xsl:when test="$the-object/isCompleted and $the-object/isCompleted='false'">
  1394. <df:button df:id="IDS_NEXT" df:style="href" df:href="#" onClick="javascript:processNextButton();"/>
  1395. <df:button df:id="IDS_FINISH"/>
  1396. </xsl:when>
  1397. <xsl:otherwise>
  1398. <df:button df:id="IDS_NEXT"/>
  1399. <df:button df:id="IDS_FINISH" df:style="href" df:href="#" onclick="javascript:processNextButton();"/>
  1400. </xsl:otherwise>
  1401. </xsl:choose>
  1402. </dp:footer>
  1403. <script language="javascript">
  1404. var so_return = document.pform.elements['so.return.m'];
  1405. if (so_return)
  1406. {
  1407. so_return.value = 'portal/new_package.xts';
  1408. }
  1409. var new_class = document.pform.elements['m_new_class'];
  1410. if (new_class)
  1411. {
  1412. new_class.value = 'package';
  1413. }
  1414. var mf = getSessionValue("mfst");
  1415. if ( mf !=null &amp;&amp; mf != '' )
  1416. {
  1417. var ngp = document.getElementById('ng_path');
  1418. var ngm = document.getElementById('ng_myfolder');
  1419. var sMF = document.getElementById('showMyFldr');
  1420. if (ngp != null &amp;&amp; ngm != null)
  1421. {
  1422. if( mf == 1 ) {
  1423. ngm.style.display = "";
  1424. ngp.style.display = "none";
  1425. sMF.style.display ="none";
  1426. }
  1427. else {
  1428. ngp.style.display = "";
  1429. ngm.style.display = "none";
  1430. sMF.style.display = "";
  1431. }
  1432. if (ngp.style.display == "")
  1433. {
  1434. <xsl:if test="$canWrite and $path!=''">
  1435. document.pform.m_package_dialog_0_location_packageLocation.value = '<xsl:value-of select="xtsext:javascriptencode($path)"/>';
  1436. </xsl:if>
  1437. } else {
  1438. <xsl:if test="$canWrite and $path!=''">
  1439. document.pform.m_package_dialog_0_location_packageLocation.value = "<xsl:value-of select="xtsext:javascriptencode(key('session-param','e_hp'))"/>/folder";
  1440. </xsl:if>
  1441. }
  1442. }
  1443. } else
  1444. {
  1445. var ngp = document.getElementById('ng_path');
  1446. var ngm = document.getElementById('ng_myfolder');
  1447. var sMF = document.getElementById('showMyFldr');
  1448. if (ngp != null &amp;&amp; ngm != null)
  1449. {
  1450. <!-- Determine which location link entries to display -->
  1451. <xsl:choose>
  1452. <xsl:when test="($path!='' and not($isPersonalPath)) or $newPackageFromCC">
  1453. <!-- display the public group -->
  1454. ngp.style.display = "";
  1455. ngm.style.display = "none";
  1456. sMF.style.display ="";
  1457. setStateValue("mfst",0);
  1458. </xsl:when>
  1459. <xsl:otherwise>
  1460. <!-- display the my folders (private) group -->
  1461. ngm.style.display = "";
  1462. ngp.style.display = "none";
  1463. sMF.style.display ="none";
  1464. setStateValue("mfst",1);
  1465. </xsl:otherwise>
  1466. </xsl:choose>
  1467. if (ngp.style.display == "")
  1468. {
  1469. <xsl:if test="$canWrite and $path!=''">
  1470. document.pform.m_package_dialog_0_location_packageLocation.value = '<xsl:value-of select="xtsext:javascriptencode($path)"/>';
  1471. </xsl:if>
  1472. } else {
  1473. <xsl:if test="$canWrite and $path!=''">
  1474. document.pform.m_package_dialog_0_location_packageLocation.value = "<xsl:value-of select="xtsext:javascriptencode(key('session-param','e_hp'))"/>/folder";
  1475. </xsl:if>
  1476. }
  1477. }
  1478. }
  1479. </script>
  1480. <script language="javascript">
  1481. function resetPageState()
  1482. {
  1483. <!-- Clear the cookie value mfst -->
  1484. clearSessionEntry('mfst');
  1485. document.pform.m_wizardDialogNumber.value = 0;
  1486. }
  1487. <xsl:if test="/root/selfServicePackage/theScript">
  1488. <xsl:value-of select="/root/selfServicePackage/theScript"/>
  1489. </xsl:if>
  1490. </script>
  1491. </form>
  1492. <xsl:if test="selfServicePackage/theForm">
  1493. <!-- The following removes the namespace information that appears on the form -->
  1494. <xsl:apply-templates select="selfServicePackage/theForm/*" mode="rmxmlns"/>
  1495. </xsl:if>
  1496. </dp:page>
  1497. </xsl:when>
  1498. <xsl:when test="$fromTransformer">
  1499. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page>
  1500. <form name="pform" method="post" action="{$gateway}">
  1501. <script language="javascript">
  1502. function init() {
  1503. //Set back the package id for Transformer
  1504. var storeid = '<xsl:value-of select="$storeId"/>';
  1505. if(window.external &amp;&amp; window.external.HasSetPackageStoreID )
  1506. window.external.SetPackageStoreID( storeid );
  1507. var searchPath = '<xsl:value-of select="xtsext:javascriptencode($searchPath)"/>';
  1508. if(window.external &amp;&amp; window.external.HasSetPackageSearchPath )
  1509. window.external.SetPackageSearchPath( searchPath );
  1510. window.external.OnClose(0);
  1511. }
  1512. </script>
  1513. </form>
  1514. </dp:page>
  1515. </xsl:when>
  1516. <xsl:when test="not(/root/fault)">
  1517. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page>
  1518. <form name="pform" method="post" action="{$gateway}">
  1519. <script language="javascript" src="{$webcontent}/{$app}/js/cookie_jar.js"/>
  1520. <script language="javascript">
  1521. var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  1522. var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  1523. var sCookiePath = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  1524. var sCookieDomain = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  1525. var sCookieSecure = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
  1526. function init() {
  1527. <!-- Clear the cookie value mfst -->
  1528. clearSessionEntry('mfst');
  1529. }
  1530. </script>
  1531. </form>
  1532. </dp:page>
  1533. <xsl:call-template name="redirect">
  1534. <xsl:with-param name="url" select="$backURL"/>
  1535. </xsl:call-template>
  1536. </xsl:when>
  1537. </xsl:choose>
  1538. </xsl:template>
  1539. <xsl:template name="populate">
  1540. <xsl:param name="path" select="''"/>
  1541. <xsl:param name="level" select="'0'"/>
  1542. <xsl:variable name="nameParam" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_treeNodeName_', $the-object/*/name)"/>
  1543. <xsl:variable name="valueParam" select="concat('m_package_dialog_', $m_wizardDialogNumber, '_tree_', $the-object/*/name)"/>
  1544. <xsl:variable name="selectedName" select="key('env-param', $nameParam)"/>
  1545. <xsl:variable name="selectedValue" select="key('env-param', $valueParam)"/>
  1546. <xsl:for-each select="$path">
  1547. <xsl:variable name="icon">
  1548. <xsl:value-of select="./icon"/>
  1549. </xsl:variable>
  1550. <xsl:choose>
  1551. <xsl:when test="local-name() = 'itemGroup'">
  1552. <xsl:variable name="caption" select="xtsext:javascriptencode(string(./caption))"/>
  1553. <xsl:variable name="name" select="xtsext:javascriptencode(string(./name))"/>
  1554. <xsl:text/>addNode('itemGroup', '<xsl:value-of select="xtsext:javascriptencode($level)"/>', '<xsl:value-of select="xtsext:javascriptencode($caption)"/>', '<xsl:value-of select="xtsext:javascriptencode($name)"/>','<xsl:value-of select="xtsext:javascriptencode($icon)"/>', '<xsl:value-of select="xtsext:javascriptencode($selectedName)"/>', '<xsl:value-of select="xtsext:javascriptencode($selectedValue)"/>');<xsl:text/>
  1555. </xsl:when>
  1556. <xsl:when test="local-name() = 'item'">
  1557. <xsl:variable name="value" select="xtsext:javascriptencode(string(./value))"/>
  1558. <xsl:variable name="name" select="xtsext:javascriptencode(string(./caption))"/>
  1559. <xsl:text/>addNode('item','<xsl:value-of select="xtsext:javascriptencode($level)"/>', '<xsl:value-of select="xtsext:javascriptencode($name)"/>', '<xsl:value-of select="xtsext:javascriptencode($value)"/>', '<xsl:value-of select="xtsext:javascriptencode($icon)"/>', '<xsl:value-of select="xtsext:javascriptencode(../name)"/>', '<xsl:value-of select="xtsext:javascriptencode(../caption)"/>', '<xsl:value-of select="xtsext:javascriptencode($selectedName)"/>', '<xsl:value-of select="xtsext:javascriptencode($selectedValue)"/>');<xsl:text/>
  1560. </xsl:when>
  1561. </xsl:choose>
  1562. <xsl:if test="local-name() = 'itemGroup'">
  1563. <xsl:call-template name="populate">
  1564. <xsl:with-param name="path" select="./*"/>
  1565. <xsl:with-param name="level" select="number(number($level) + 1)"/>
  1566. </xsl:call-template>
  1567. </xsl:if>
  1568. </xsl:for-each>
  1569. </xsl:template>
  1570. <xsl:template name="setParams">
  1571. <xsl:for-each select="$the-object/*[local-name() = 'text' or local-name() = 'textArea' or local-name() = 'location' or local-name() = 'selectionControl']">
  1572. <xsl:choose>
  1573. <xsl:when test="local-name() = 'text' or local-name() = 'textArea'">
  1574. <xsl:text/>setParameter('<xsl:value-of select="xtsext:javascriptencode(./name)"/>', '<xsl:value-of select="xtsext:javascriptencode(./optional)"/>', '<xsl:value-of select="xtsext:javascriptencode(local-name())"/>');<xsl:text/>
  1575. </xsl:when>
  1576. <xsl:when test="local-name() = 'selectionControl'">
  1577. <xsl:variable name="optional">
  1578. <xsl:choose>
  1579. <xsl:when test="./isOptional and ./isOptional='true'">
  1580. <xsl:value-of select="./isOptional"/>
  1581. </xsl:when>
  1582. <xsl:otherwise>false</xsl:otherwise>
  1583. </xsl:choose>
  1584. </xsl:variable>
  1585. <xsl:text/>setListParameter('<xsl:value-of select="xtsext:javascriptencode(./name)"/>', '<xsl:value-of select="xtsext:javascriptencode(./selectionType)"/>', '<xsl:value-of select="xtsext:javascriptencode(./controlType)"/>', '<xsl:value-of select="xtsext:javascriptencode($optional)"/>');<xsl:text/>
  1586. </xsl:when>
  1587. <xsl:when test="local-name() = 'location'">
  1588. <xsl:text/>setParameter('<xsl:value-of select="xtsext:javascriptencode(./name)"/>', '<xsl:value-of select="xtsext:javascriptencode(./updateLocation)"/>', '<xsl:value-of select="xtsext:javascriptencode(local-name())"/>');<xsl:text/>
  1589. </xsl:when>
  1590. </xsl:choose>
  1591. </xsl:for-each>
  1592. </xsl:template>
  1593. <xsl:template name="redirect">
  1594. <xsl:param name="url"/>
  1595. <html>
  1596. <head>
  1597. <meta http-equiv="refresh">
  1598. <xsl:attribute name="content">0; URL=<xsl:value-of select="$url"/></xsl:attribute>
  1599. </meta>
  1600. <title>
  1601. <xts:string id="IDS_COGNOS_REPORTS"/>
  1602. </title>
  1603. </head>
  1604. </html>
  1605. </xsl:template>
  1606. <xsl:template name="declareHiddenInputs">
  1607. <xsl:variable name="fullTask">
  1608. <xsl:value-of select="'package'"/>.container<xsl:text/>
  1609. </xsl:variable>
  1610. <input type="hidden" name="m_class" value="package"/>
  1611. <input type="hidden" name="so.select">
  1612. <xsl:attribute name="value">
  1613. <xsl:value-of select="$fullTask"/>
  1614. </xsl:attribute>
  1615. </input>
  1616. <input type="hidden" name="so.return.m">
  1617. <xsl:attribute name="value">
  1618. <xsl:value-of select="concat($app,'/', 'new_package.xts')"/>
  1619. </xsl:attribute>
  1620. </input>
  1621. <input name="so.defaultLocation" type="hidden">
  1622. <xsl:attribute name="value"><xsl:value-of select="$path"/></xsl:attribute>
  1623. </input>
  1624. <input name="m_p_defaultName" type="hidden">
  1625. <xsl:attribute name="value">
  1626. <xsl:choose>
  1627. <xsl:when test="key('env-param', 'm_package_dialog_0_text_packageName') != ''">
  1628. <xsl:value-of select="key('env-param', 'm_package_dialog_0_text_packageName')"/>
  1629. </xsl:when>
  1630. <xsl:otherwise>
  1631. <xsl:value-of select="''"/>
  1632. </xsl:otherwise>
  1633. </xsl:choose>
  1634. </xsl:attribute>
  1635. </input>
  1636. <!-- This adds all env items except for those stated here...-->
  1637. <xsl:for-each select="/root/env/param[not(starts-with(@name, 'm_package_dialog_') or starts-with(@name, 'parameter_value_counter') or contains(' m_p_defaultName so.defaultLocation so.select so.return.m m_class m_dataSourceName ', @name))]">
  1638. <input type="hidden">
  1639. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  1640. <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
  1641. </input>
  1642. </xsl:for-each>
  1643. <input name="m_dataSourceName" type="hidden">
  1644. <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'm_dataSourceName')"/></xsl:attribute>
  1645. </input>
  1646. <input name="m" type="hidden">
  1647. <xsl:attribute name="value"><xsl:value-of select="portal/new_package.xts"/></xsl:attribute>
  1648. </input>
  1649. <xsl:for-each select="/root/env/*[starts-with(@name, 'm_package_dialog_')]">
  1650. <xsl:variable name="levelParam" select="substring-before(substring-after(@name, 'm_package_dialog_'), '_')"/>
  1651. <xsl:if test="number($levelParam) &lt; number($m_wizardDialogNumber)">
  1652. <input type="hidden">
  1653. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  1654. <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
  1655. </input>
  1656. </xsl:if>
  1657. </xsl:for-each>
  1658. <xsl:for-each select="/root/env/*[starts-with(@name, 'parameter_value_counter_')]">
  1659. <xsl:variable name="levelParamCounter" select="substring-before(substring-after(@name, 'parameter_value_counter_'), '_')"/>
  1660. <xsl:if test="number($levelParamCounter) &lt; number($m_wizardDialogNumber)">
  1661. <input type="hidden">
  1662. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  1663. <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
  1664. </input>
  1665. </xsl:if>
  1666. </xsl:for-each>
  1667. </xsl:template>
  1668. <!-- Remove namespace from cform info -->
  1669. <xsl:template match="*" mode="rmxmlns">
  1670. <xsl:element name="{local-name()}">
  1671. <xsl:apply-templates select="@* | node()" mode="rmxmlns"/>
  1672. </xsl:element>
  1673. </xsl:template>
  1674. <xsl:template match="@* | text() | comment() | processing-instruction()" mode="rmxmlns">
  1675. <xsl:copy/>
  1676. </xsl:template>
  1677. </xsl:stylesheet>
  1678. </xts:block>
  1679. <xts:block id="createFault" type="fault" processor="XSLT">
  1680. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  1681. <xsl:output method="xml"/>
  1682. <xsl:template match="/root/fault">
  1683. <xsl:choose>
  1684. <xsl:when test="./*[local-name() = 'exception']/*[local-name() = 'exceptionDetail']/*[local-name() = 'exception']/*[local-name()='errorCode'] = 'fmmdDuplicateName'">
  1685. <copyFault>
  1686. <xsl:copy-of select="."/>
  1687. </copyFault>
  1688. </xsl:when>
  1689. <xsl:otherwise>
  1690. <xsl:copy-of select="."/>
  1691. </xsl:otherwise>
  1692. </xsl:choose>
  1693. </xsl:template>
  1694. <xsl:template match="text()"/>
  1695. </xsl:stylesheet>
  1696. </xts:block>
  1697. <!--
  1698. ===============================================================================================
  1699. debug - display debug information
  1700. ===============================================================================================
  1701. -->
  1702. <xts:block id="debug" dependency="render_wizard_page" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  1703. <!-- get the debug logic sheet -->
  1704. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  1705. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  1706. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  1707. <xsl:template match="/">
  1708. <dbg:dumpxml select="/root"/>
  1709. </xsl:template>
  1710. </xsl:stylesheet>
  1711. </xts:block>
  1712. </xts:morphlet>