new_indexUpdate.xts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseAdministrationPortal">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init - standard form logic initialization
  16. ===============================================================================================
  17. -->
  18. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  19. <!--
  20. ===============================================================================================
  21. callMorphlet - Calls the appropriate morphlet using the passed in params which will return
  22. markup to be displayed or the expected results
  23. ===============================================================================================
  24. -->
  25. <xts:block
  26. id="callMorphlet"
  27. nodelist="requestParams,env, http, session, credential, cookies, header, user"
  28. processor="XSLT"
  29. type="exec"
  30. dependency="formlogic_init"
  31. condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false">
  32. <xts:logicsheet path="logicsheets/portal.xsl"/>
  33. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  34. <xsl:stylesheet version="1.0"
  35. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  36. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  37. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  38. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  39. exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  40. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  41. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  42. <xsl:template match="/">
  43. <xts:sequence>
  44. <dlgctrl:XTS2Request>
  45. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  46. <dlgctrl:stackName>addEntriesStack</dlgctrl:stackName>
  47. <req-params:param name="defaultTarget">/portal/new_indexUpdate.xts</req-params:param>
  48. <req-params:param name="titlePostfix"><xts:string id="IDS_NEW_INDEX_UPDATE_TASK_TITLE"/></req-params:param>
  49. <req-params:param name="defaultSearchPath">/</req-params:param>
  50. <req-params:param name="addEntriesUI">indexUpdateLocations</req-params:param>
  51. <req-params:param name="allowRootBrowsing">true</req-params:param>
  52. <req-params:param name="allowDuplicates">false</req-params:param>
  53. <req-params:param name="returnProperties">
  54. <req-params:property name="userInterfaces"/>
  55. <req-params:property name="hidden"/>
  56. </req-params:param>
  57. </dlgctrl:XTS2Request>
  58. </xts:sequence>
  59. </xsl:template>
  60. </xsl:stylesheet>
  61. </xts:block>
  62. <!--
  63. ===============================================================================================
  64. processReponse - Process the response from the callMorphlet block and either displays
  65. the markup or processes the results
  66. ===============================================================================================
  67. -->
  68. <xts:block
  69. id="processResponse"
  70. nodelist="output,http,env,system,user,morphletResponse,credential,cookies"
  71. path="/portal/addEntries/logicsheets/process_added_entries.xslt"
  72. processor="XSLT"
  73. dependency="callMorphlet"
  74. type="exec"
  75. condition=".[ /root/env/param[@name='controller_state'] != '' ]"
  76. mandatory="false">
  77. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  78. <xts:logicsheet path="logicsheets/portal.xsl"/>
  79. </xts:block>
  80. <xts:block id="unpackSelectedItems" type="exec" mode="interpret" processor="XSLT" dependency="processResponse" condition=".[/root/env/param[@name='m_indexUpdate']!='' and not(/root/mode='addEntries')]" mandatory="false">
  81. <xsl:stylesheet version="1.0"
  82. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  83. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  84. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  85. <xsl:template match="/">
  86. <xts:sequence>
  87. <xts:append>
  88. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='m_indexUpdate'])), true())" disable-output-escaping="yes"/>
  89. </xts:append>
  90. </xts:sequence>
  91. </xsl:template>
  92. </xsl:stylesheet>
  93. </xts:block>
  94. <!--
  95. ===============================================================================================
  96. execute_command
  97. Execute the operation: delete, additems_
  98. ===============================================================================================
  99. -->
  100. <xts:block id="execute_command" dependency="unpackSelectedItems" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/mode='addEntries')]" mandatory="false">
  101. <xts:logicsheet path="logicsheets/portal.xsl"/>
  102. <xts:logicsheet path="logicsheets/contentadmin.xsl"/>
  103. <xsl:stylesheet version="1.0"
  104. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  105. xmlns:adm="http://developer.cognos.com/schemas/xts/logicsheets/contentadmin/"
  106. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  107. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  108. exclude-result-prefixes="xsl xtsext adm pf">
  109. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  110. <pf:variables/>
  111. <xsl:template match="/">
  112. <adm:executeIndexUpdateCommand/>
  113. </xsl:template>
  114. </xsl:stylesheet>
  115. </xts:block>
  116. <!--
  117. ===============================================================================================
  118. encode_list
  119. Serialize the data (web64 encoded)
  120. ===============================================================================================
  121. -->
  122. <xts:block id="encode_list" dependency="execute_command getContent" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/mode='addEntries')]" mandatory="false">
  123. <xts:logicsheet path="logicsheets/portal.xsl"/>
  124. <xsl:stylesheet version="1.0"
  125. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  126. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  127. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  128. exclude-result-prefixes="xsl xtsext pf">
  129. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  130. <pf:serialize-xml/>
  131. <pf:variables/>
  132. <xsl:template match="/">
  133. <xts:sequence>
  134. <xts:delete select="/root/env/param[@name = 'm_indexUpdate']"/>
  135. <xts:append select="/root/env">
  136. <xsl:variable name="markup">
  137. <xsl:apply-templates mode="markup" select="/root/indexUpdates"/>
  138. </xsl:variable>
  139. <param name="m_indexUpdate">
  140. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport),xtsext:web64encode(string($markup), true()))"/>
  141. </param>
  142. </xts:append>
  143. <xts:delete select="/root/env/param[@name='m_io_includedObjects']"/>
  144. <xts:delete select="/root/env/param[@name='m_io_excludedObjects']"/>
  145. <xts:delete select="/root/env/param[@name='m_io_force']"/>
  146. <xts:delete select="/root/env/param[@name='m_io_indexObjectTypes']"/>
  147. <xts:delete select="/root/env/param[@name='m_io_indexReferencedData']"/>
  148. <xts:delete select="/root/env/param[@name='m_io_indexModeledData']"/>
  149. </xts:sequence>
  150. </xsl:template>
  151. </xsl:stylesheet>
  152. </xts:block>
  153. <!--
  154. ===============================================================================================
  155. getObjects - get object class names
  156. ===============================================================================================
  157. -->
  158. <xts:block id="classNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml" condition=".[not(/root/mode='addEntries')]" mandatory="false">
  159. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  160. </xts:block>
  161. <!--
  162. ===============================================================================================
  163. Generate the HTML
  164. ===============================================================================================
  165. -->
  166. <xts:block id="format" dependency="encode_list classNames" mode="output" processor="XSLT" type="exec" mimeType="text/html" condition=".[not(/root/mode='addEntries')]" mandatory="false">
  167. <xts:logicsheet path="logicsheets/contentadmin.xsl"/>
  168. <xts:logicsheet path="logicsheets/portal.xsl"/>
  169. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  170. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  171. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  172. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  173. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  174. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  175. <xts:logicsheet path="logicsheets/validation.xslt"/>
  176. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  177. <xsl:stylesheet version="1.0"
  178. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  179. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  180. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  181. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  182. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  183. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  184. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  185. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  186. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  187. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  188. xmlns:adm="http://developer.cognos.com/schemas/xts/logicsheets/contentadmin/"
  189. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  190. exclude-result-prefixes="xsl cf cp pf df dp lyt cm utml xts xtsext adm">
  191. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  192. <!-- current file name -->
  193. <xsl:variable name="mname" select="'new_indexUpdate.xts'"/>
  194. <pf:variables/>
  195. <pf:gen-icon/>
  196. <!-- start the output -->
  197. <xsl:template match="/root">
  198. <xsl:variable name="has_write_permission" select="true()"/>
  199. <xsl:variable name="wizard-title"><xts:string id="IDS_NEW_INDEX_UPDATE_TASK_TITLE"/></xsl:variable>
  200. <xsl:variable name="browserTitle">
  201. <xts:string id="IDS_INDEX_UPDATE_TASK_SELECT_TYPE_TITLE">
  202. <xts:param name="wizardName">
  203. <xsl:value-of select="$wizard-title"/>
  204. </xts:param>
  205. </xts:string>
  206. </xsl:variable>
  207. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  208. <dp:meta>
  209. <pf:meta/>
  210. <!-- Standard meta tags -->
  211. </dp:meta>
  212. <script language="javascript" src="{$webcontent}/{$app}/js/list.js"/>
  213. <dp:script>
  214. <!-- Help system -->
  215. <pf:help/>
  216. <script language="JavaScript">
  217. function init()
  218. {
  219. if (document.pform.controller_state)
  220. {
  221. document.pform.controller_state.value = '';
  222. }
  223. }
  224. function validate()
  225. {
  226. <xsl:if test="count(/root/indexUpdates/include/*) = 0">
  227. alert('<xts:string id="IDS_INDEX_UPDATE_NO_ADDED_ENTRY" encode="javascript"/>');
  228. return false;
  229. </xsl:if>
  230. return true;
  231. }
  232. function clearSelections()
  233. {
  234. for(var i=0; document.pform.length > i; i++)
  235. {
  236. if (document.pform.elements[i].name.substring( 0, 17) == 'checkbox_location')
  237. {
  238. document.pform.elements[i].checked = false;
  239. }
  240. }
  241. }
  242. </script>
  243. </dp:script>
  244. <utml:form name="pform" method="post" action="{$gateway}">
  245. <utml:excludes>checkbox_location checkbox_located_in checkbox_based_on</utml:excludes>
  246. <utml:input type="hidden" name="ifrmcmd" utml:update="false" value="create"/>
  247. <utml:input type="hidden" name="controller_state" value="" utml:update="false"/>
  248. <utml:input type="hidden" name="listop" value="" utml:update="false"/>
  249. <utml:input type="hidden" name="include_or_exclude" value="" utml:update="false"/>
  250. <xsl:for-each select="/root/indexUpdates/include/*">
  251. <utml:input type="hidden" name="m_io_includedObjects" utml:update="false">
  252. <xsl:attribute name="value"><xsl:value-of select="cm:searchPath"/></xsl:attribute>
  253. </utml:input>
  254. </xsl:for-each>
  255. <xsl:for-each select="/root/indexUpdates/exclude/*">
  256. <utml:input type="hidden" name="m_io_excludedObjects" utml:update="false">
  257. <xsl:attribute name="value"><xsl:value-of select="cm:searchPath"/></xsl:attribute>
  258. </utml:input>
  259. </xsl:for-each>
  260. <!-- dialog header -->
  261. <dp:header>
  262. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  263. <!-- description tabs -->
  264. <dp:description>
  265. <xts:string id="IDS_INDEX_UPDATE_TASK_HINT"/>
  266. </dp:description>
  267. </dp:header>
  268. <lyt:layout style="1" title="IDS_INDEX_UPDATE_TASK_TABLE_TITLE_INCLUDE" border="yes">
  269. <lyt:section>
  270. <adm:indexUpdateOptions IncludeOrExclude="include"/>
  271. </lyt:section>
  272. </lyt:layout>
  273. <lyt:layout style="1" title="IDS_INDEX_UPDATE_TASK_TABLE_TITLE_EXCLUDE" border="yes">
  274. <lyt:section>
  275. <adm:indexUpdateOptions IncludeOrExclude="exclude"/>
  276. </lyt:section>
  277. </lyt:layout>
  278. <dp:footer>
  279. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  280. <df:button df:id="IDS_BACK" df:style="maintain">
  281. <df:target>
  282. <xsl:value-of select="concat($app, '/new_general.xts')"/>
  283. </df:target>
  284. </df:button>
  285. <df:button df:id="IDS_NEXT" df:style="maintain" utml:validate="true">
  286. <df:target>
  287. <xsl:value-of select="concat($app, '/new_select_action.xts')"/>
  288. </df:target>
  289. </df:button>
  290. <df:button df:id="IDS_FINISH"/>
  291. </dp:footer>
  292. <!-- if the user tried to add a duplicate entry -->
  293. <script language="javascript">
  294. <xsl:variable name="indexUpdateItems" select="/root/indexUpdates/*[local-name()=key('env-param','include_or_exclude')]/*"/>
  295. <xsl:if test="/root/totalEntriesCount and (/root/totalEntriesCount != count($indexUpdateItems))">
  296. window.alert("<xts:string id="IDS_DUPLICATE_ENTRY" encode="javascript"/>");
  297. </xsl:if>
  298. </script>
  299. </utml:form>
  300. </dp:page>
  301. </xsl:template>
  302. </xsl:stylesheet>
  303. </xts:block>
  304. <!--
  305. ===============================================================================================
  306. getContent - This block pre-populates the list of included content with Public Folders. This is the default entry to be shown before
  307. the user selets any content. This block should only run the first time we reach the "Select the content" page of the wizard.
  308. ===============================================================================================
  309. -->
  310. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init" condition=".[not(root/indexUpdates) and not(/root/env/param[@name='listop'] = 'delete') and not(/root/env/param[@name='controller_state'])]" mandatory="false">
  311. <xts:logicsheet path="logicsheets/contentadmin.xsl"/>
  312. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  313. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  314. <xsl:stylesheet version="1.0"
  315. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  316. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  317. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  318. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  319. xmlns:adm="http://developer.cognos.com/schemas/xts/logicsheets/contentadmin/"
  320. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  321. exclude-result-prefixes="xsl cml cm send adm">
  322. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  323. <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  324. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  325. <xsl:template match="/">
  326. <xts:sequence>
  327. <xts:append>
  328. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  329. <send:request provider="cm">
  330. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  331. <cm:query>
  332. <cm:search>/content</cm:search>
  333. <cm:properties>
  334. <cm:property name="defaultName"/>
  335. <cm:property name="hidden"/>
  336. <cm:property name="searchPath"/>
  337. <cm:property name="searchPathForURL"/>
  338. <cm:property name="ancestors"/>
  339. </cm:properties>
  340. <cm:options schemaInfo="true"/>
  341. </cm:query>
  342. </xts:transform>
  343. </send:request>
  344. </xts:transform>
  345. </xts:append>
  346. <xts:append>
  347. <indexUpdates>
  348. <include>
  349. <xts:queryNode select="/root/*[local-name()='queryResponse']/*"/>
  350. </include>
  351. </indexUpdates>
  352. </xts:append>
  353. </xts:sequence>
  354. </xsl:template>
  355. </xsl:stylesheet>
  356. </xts:block>
  357. <!--
  358. =============================================
  359. Output debug dump
  360. =============================================
  361. -->
  362. <xts:block id="debug" type="exec" mode="output" processor="XSLT" condition=".[/root/env/param[@name='d'] = '1' or /root/session/param[@name='debug'] = '1']" mandatory="false" mimeType="text/html" dependency="format">
  363. <!-- get the debug logic sheet -->
  364. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  365. <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">
  366. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  367. <xsl:template match="/">
  368. <dbg:dumpxml select="/root"/>
  369. </xsl:template>
  370. </xsl:stylesheet>
  371. </xts:block>
  372. </xts:morphlet>