tools_portaladmin.xts 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  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="canUsePortalAdministrationTool">
  13. <!--
  14. ===============================================================================================
  15. If external backURLs are not allowed then verify the backURL is in the crn domain and replace it if it isn't
  16. ===============================================================================================
  17. -->
  18. <xts:block id="secureBackURL" path="portal/secureBackURL.xml" processor="XSLT" type="exec" condition=".[/root/system/param[@name = 'allowExternalURLs'] = 'false']" mandatory="false"/>
  19. <!-- ======================================================== -->
  20. <!-- Session Management -->
  21. <!-- ======================================================== -->
  22. <!-- Reads session-sensitive info from CM -->
  23. <xts:block processor="XSLT" type="exec" mandatory="false"
  24. id="refreshSession"
  25. path="portal/cc/read_session.xml"
  26. condition=".[
  27. string(/root/cookies/cookie[@name = 'cc_session']) = ''
  28. or /root/env/param[@name='m_reload']
  29. or /root/env/param[@name='m_root'] ]">
  30. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  31. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  32. </xts:block>
  33. <!-- Update the <session> element for this request. -->
  34. <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession secureBackURL" processor="XSLT" type="exec"
  35. condition=".[
  36. /root/newSession
  37. or /root/env/param[@name='ui']
  38. or /root/env/param[@name='d']
  39. or /root/env/param[starts-with(@name,'m_s_')]
  40. or /root/env/param[@name = 'resetSort'] ]"
  41. mandatory="false"/>
  42. <!-- Save changes to the state info in a cookie -->
  43. <xts:block mode="interpret" processor="XSLT" type="exec"
  44. id="setSession"
  45. path="portal/set_session.xml"
  46. dependency="buildSession mergeTenantNames"
  47. condition=".[/root/updateSession]"
  48. mandatory="false"/>
  49. <!--
  50. ======================================
  51. Generat the search expression
  52. ======================================
  53. -->
  54. <xts:block id="generateSearchExp" processor="XSLT" type="exec" dependency="buildSession" condition=".[/root/env/param[@name='search']]" mandatory="false">
  55. <xts:logicsheet path="logicsheets/searchlogic.xslt"/>
  56. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  57. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  58. xmlns:search="http://developer.cognos.com/schemas/xts/logicsheets/xslt/searchlogic/"
  59. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  60. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  61. exclude-result-prefixes="search cml xtsext">
  62. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  63. <cml:object-predicates/>
  64. <xsl:template match="root">
  65. <xsl:variable name="path">
  66. <xsl:choose>
  67. <xsl:when test="/root/env/param[@name = 'm_path'] and /root/env/param[@name = 'm_path'] != ''">
  68. <xsl:value-of select="/root/env/param[@name = 'm_path']"/>
  69. </xsl:when>
  70. <xsl:otherwise>/portal/portalPackage[@defaultName='connection']/portletFolder</xsl:otherwise>
  71. </xsl:choose>
  72. </xsl:variable>
  73. <xts:sequence>
  74. <search:gen-search-exp defaultRoot="portal/portalPackage[@defaultName='connection']/portletFolder">
  75. <search:defaultTypes>
  76. <search:defaultType>portletProducer</search:defaultType>
  77. <search:defaultType>portlet</search:defaultType>
  78. </search:defaultTypes>
  79. </search:gen-search-exp>
  80. </xts:sequence>
  81. </xsl:template>
  82. </xsl:stylesheet>
  83. </xts:block>
  84. <!--
  85. =============================================
  86. Request properties of the portlets
  87. =============================================
  88. -->
  89. <xts:block id="getContent" processor="XSLT" type="exec" dependency="buildSession generateSearchExp">
  90. <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
  91. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  92. <xts:logicsheet path="logicsheets/portal.xsl"/>
  93. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  94. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  95. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  96. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  97. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  98. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  99. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  100. exclude-result-prefixes="xsl cm pf send cml xtsext">
  101. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  102. <pf:variables/>
  103. <cml:object-predicates/>
  104. <xsl:template match="root">
  105. <xsl:variable name="userPrefs" select="/root/session/param"/>
  106. <xsl:variable name="userPrefsDefault" select="/root/system/param[@name='defaultPortalPreferences']"/>
  107. <xsl:variable name="maxObjects">
  108. <xsl:choose>
  109. <xsl:when test="string(/root/env/param[@name = 'm_pagerto']) !='' and string(/root/env/param[@name = 'm_pagerfrom']) !=''">
  110. <xsl:value-of select="(/root/env/param[@name = 'm_pagerto'] - /root/env/param[@name = 'm_pagerfrom']) + 1"/>
  111. </xsl:when>
  112. <xsl:when test="$userPrefs[@name='linesPerPage']!=''">
  113. <xsl:value-of select="$userPrefs[@name='linesPerPage']"/>
  114. </xsl:when>
  115. <xsl:otherwise>
  116. <xsl:value-of select="$userPrefsDefault/pref[@name='lines']"/>
  117. </xsl:otherwise>
  118. </xsl:choose>
  119. </xsl:variable>
  120. <xsl:variable name="skipObjects">
  121. <xsl:choose>
  122. <xsl:when test="/root/env/param[@name = 'm_newsearch'] ='true'">0</xsl:when>
  123. <xsl:when test="/root/env/param[@name = 'm_pagerfrom'] and /root/env/param[@name = 'm_pagerfrom']!=''">
  124. <xsl:value-of select="(/root/env/param[@name = 'm_pagerfrom'])-1"/>
  125. </xsl:when>
  126. <xsl:when test="/root/env/param[@name='m_section']!=''">
  127. <xsl:choose>
  128. <xsl:when test="/root/env/param[@name='m_section']!='-1'">
  129. <xsl:value-of select="((/root/env/param[@name='m_section']) -1)"/>
  130. </xsl:when>
  131. <xsl:otherwise>
  132. <xsl:value-of select="($maxObjects) * -1"/>
  133. </xsl:otherwise>
  134. </xsl:choose>
  135. </xsl:when>
  136. <xsl:otherwise>0</xsl:otherwise>
  137. </xsl:choose>
  138. </xsl:variable>
  139. <xsl:variable name="path">
  140. <xsl:choose>
  141. <xsl:when test="/root/env/param[@name='m_path']!=''">
  142. <xsl:value-of select="/root/env/param[@name='m_path']"/>
  143. </xsl:when>
  144. <xsl:otherwise>
  145. <xsl:text>/portal/portalPackage[@defaultName='connection']/portletFolder</xsl:text>
  146. </xsl:otherwise>
  147. </xsl:choose>
  148. </xsl:variable>
  149. <xsl:variable name="m_sort" select="/root/session/param[@name='s_ct']"/>
  150. <xts:sequence>
  151. <xts:append>
  152. <content>
  153. <!-- Request properties of the portlet objects. -->
  154. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  155. <send:request provider="cm">
  156. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  157. <cm:query>
  158. <cm:requests>
  159. <cm:query>
  160. <cm:search>
  161. <xsl:value-of select="$path"/>
  162. </cm:search>
  163. <cm:properties>
  164. <cm:property name="objectClass"/>
  165. <cm:property name="defaultName"/>
  166. <cm:property name="ancestors"/>
  167. <cm:property name="searchPath"/>
  168. <cm:property name="storeID"/>
  169. <cm:property name="permissions"/>
  170. <cm:property name="tenantID"/>
  171. </cm:properties>
  172. </cm:query>
  173. <xsl:if test="/root/search/expression or not(/root/search)">
  174. <cm:query>
  175. <cm:search>
  176. <xsl:choose>
  177. <xsl:when test="/root/search/expression">
  178. <xsl:value-of select="/root/search/expression"/>
  179. </xsl:when>
  180. <xsl:otherwise>
  181. <xsl:value-of select="$path"/>/*<xsl:value-of select="$visibility-predicate"/>
  182. </xsl:otherwise>
  183. </xsl:choose>
  184. </cm:search>
  185. <cm:properties>
  186. <cm:property name="defaultName"/>
  187. <cm:property name="hasChildren"/>
  188. <cm:property name="permissions"/>
  189. <cm:property name="searchPath"/>
  190. <cm:property name="storeID"/>
  191. <cm:property name="modificationTime"/>
  192. <cm:property name="displaySequence"/>
  193. <cm:property name="canCustomize"/>
  194. <cm:property name="name"/>
  195. <cm:property name="position"/>
  196. <cm:property name="defaultScreenTip"/>
  197. <cm:property name="disabled"/>
  198. <cm:property name="hidden"/>
  199. <cm:property name="ancestors"/>
  200. <cm:property name="iconURI"/>
  201. </cm:properties>
  202. <cm:options maxObjects="{($maxObjects+1)}" skipObjects="{$skipObjects}">
  203. <cm:refProps>
  204. <cm:refProp refPropName="parent">
  205. <cm:properties>
  206. <cm:property name="permissions"/>
  207. </cm:properties>
  208. </cm:refProp>
  209. </cm:refProps>
  210. </cm:options>
  211. <cm:sortBy>
  212. <xsl:choose>
  213. <xsl:when test="$m_sort = 'da'">
  214. <cm:sort name="modificationTime" order="ascending"/>
  215. </xsl:when>
  216. <xsl:when test="$m_sort = 'dd'">
  217. <cm:sort name="modificationTime" order="descending"/>
  218. </xsl:when>
  219. <xsl:when test="$m_sort = 'na'">
  220. <cm:sort name="defaultName" order="ascending"/>
  221. </xsl:when>
  222. <xsl:when test="$m_sort = 'nd'">
  223. <cm:sort name="defaultName" order="descending"/>
  224. </xsl:when>
  225. <xsl:otherwise>
  226. <cm:sort name="displaySequence" order="ascending"/>
  227. </xsl:otherwise>
  228. </xsl:choose>
  229. </cm:sortBy>
  230. </cm:query>
  231. </xsl:if>
  232. </cm:requests>
  233. </cm:query>
  234. </xts:transform>
  235. </send:request>
  236. </xts:transform>
  237. </content>
  238. </xts:append>
  239. <!-- The tool does not browse from the root of the /portal content area. As a result we need to tweak the ancestor property to
  240. make the pathlinks control work -->
  241. <xts:delete select="/root/content/*[local-name()='queryResponse']/*[local-name()='queryReply']/*/*[local-name()='ancestors']/*[./*[local-name()='objectClass']='portal' or ./*[local-name()='objectClass']='portalPackage']"/>
  242. <!-- Reset m_newsearch to false, so next time the skipObjects will be set to 0.-->
  243. <xsl:if test="/root/env/param[@name = 'm_newsearch'] = 'true' ">
  244. <xts:replace select="/root/env/param[@name = 'm_newsearch']">
  245. <param name="m_newsearch">false</param>
  246. </xts:replace>
  247. </xsl:if>
  248. </xts:sequence>
  249. <xts:sequence>
  250. <!-- This is required for proper functioning of the pager control -->
  251. <xts:delete select="/root/env/param[@name='pagerfrom' or @name='pagerto' or @name='pagerfrom_d' or @name='pagerto_d']"/>
  252. </xts:sequence>
  253. <xts:sequence>
  254. <xsl:if test="not(/root/env/param[@name = 'm_path']) or /root/env/param[@name = 'm_path'] = '' ">
  255. <xts:append select="/root/env">
  256. <param name="m_path">/portal/portalPackage[@defaultName='connection']/portletFolder</param>
  257. </xts:append>
  258. </xsl:if>
  259. </xts:sequence>
  260. </xsl:template>
  261. </xsl:stylesheet>
  262. </xts:block>
  263. <!-- Merge the tenantNames into the response -->
  264. <xts:block processor="XSLT" type="exec" mandatory="false"
  265. path="/portal/tenancy/mergeTenantNames.xslt"
  266. id="mergeTenantNames"
  267. dependency="getContent"
  268. condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
  269. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  270. </xts:block>
  271. <!--
  272. ===============================================================================================
  273. Load class names map
  274. ===============================================================================================
  275. -->
  276. <xts:block id="getClassNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  277. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  278. </xts:block>
  279. <!--
  280. ===============================================================================================
  281. head - This block generates the HTML <head> tag.
  282. ===============================================================================================
  283. -->
  284. <xts:block id="head" type="exec" mode="output" processor="XSLT" dependency="mergeTenantNames" mimeType="text/html" contentId="head" partId="1" xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/">
  285. <xts:logicsheet path="logicsheets/toollogic2.xslt"/>
  286. <xts:logicsheet path="logicsheets/portal.xsl"/>
  287. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  288. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  289. <xts:logicsheet path="logicsheets/validation.xslt"/>
  290. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  291. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cm tool pf mt mf cf cp xsl xts xtsext">
  292. <xsl:output method="html" encoding="utf-8" indent="no"/>
  293. <!-- current file name -->
  294. <xsl:variable name="mname" select="'legacy_tools/tools_portaladmin.xts'"/>
  295. <tool:variables formName="frmEntryAdmin" stateParams="m_path m_section m_pagerto m_pagerfrom"/>
  296. <xsl:template match="/">
  297. <tool:head title="IDS_TOOLS_PORTAL_ADMIN" tab="IDS_TOOLS_PORTAL_ADMIN_PORTLETS_TAB" helpid="HID_ADMIN_PORTLETS"/>
  298. </xsl:template>
  299. </xsl:stylesheet>
  300. </xts:block>
  301. <!--
  302. ===============================================================================================
  303. banner - This block generates the portal banner at the top of the tool.
  304. ===============================================================================================
  305. -->
  306. <xts:block id="banner" type="exec" mode="output" processor="XSLT" dependency="mergeTenantNames" mimeType="text/html" contentId="banner" partId="1" xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/">
  307. <xts:logicsheet path="logicsheets/toollogic2.xslt"/>
  308. <!-- Cognos Central main behaviour logic -->
  309. <xts:logicsheet path="logicsheets/portal.xsl"/>
  310. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  311. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  312. <!-- Cognos Central controls logic -->
  313. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  314. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  315. <xts:logicsheet path="logicsheets/validation.xslt"/>
  316. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  317. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="tool pf mf mt cf cp cm xtsext xts">
  318. <xsl:output method="html" encoding="utf-8" indent="no"/>
  319. <!-- current file name -->
  320. <xsl:variable name="mname" select="'legacy_tools/tools_portaladmin.xts'"/>
  321. <xsl:variable name="the-object" select="/root/content/cm:queryResponse/cm:queryReply[1]/*"/>
  322. <xsl:variable name="userCanNotTraverse" select="not(contains(/root/content/cm:queryResponse/cm:queryReply[1]/*/cm:permissions, 'traverse'))"/>
  323. <xsl:variable name="canRead" select="contains(concat(' ',$the-object/cm:permissions,' '),' read ')"/>
  324. <xsl:variable name="canWrite" select="contains(concat(' ',$the-object/cm:permissions,' '),' write ')"/>
  325. <cp:flyoutControl/>
  326. <tool:variables formName="frmEntryAdmin" stateParams="m_path m_section m_pagerfrom m_pagerto"/>
  327. <xsl:variable name="searchIsEnabled">
  328. <xsl:choose>
  329. <xsl:when test="key('env-param', 'search')">true</xsl:when>
  330. <xsl:otherwise>false</xsl:otherwise>
  331. </xsl:choose>
  332. </xsl:variable>
  333. <xsl:template match="/">
  334. <tool:banner title="IDS_TOOLS_PORTAL_ADMIN" hideHeaders="true">
  335. <tool:tabs tabset-name="portalAdmin">p</tool:tabs>
  336. <tool:path>
  337. <cf:do-the-path-link>
  338. <cf:param name="familytree">$the-object/cm:ancestors</cf:param>
  339. <cf:param name="familymember">$the-object/cm:defaultName</cf:param>
  340. <cf:param name="lastIsLink"><xsl:value-of select="$searchIsEnabled"/></cf:param>
  341. <cf:param name="anchorpath">
  342. <xsl:choose>
  343. <xsl:when test="cm:title">
  344. <a>
  345. <xsl:attribute name="href"><xsl:value-of select="concat($gateway, '?b_action=xts.run')"/><xsl:value-of select="concat('&amp;m=', key('env-param', 'm'))"/>&amp;m_path=<pf:idToSearchPathForURL source="cm:storeID"/><xsl:if test="key('env-param', 'backURL')"><xsl:value-of select="concat('&amp;backURL=', xtsext:protect(xtsext:urlencode(string(key('env-param', 'backURL'))),'url','url','getdata'))"/></xsl:if></xsl:attribute>
  346. <xsl:value-of select="cm:title"/>
  347. </a>
  348. </xsl:when>
  349. <xsl:otherwise>
  350. <a>
  351. <xsl:attribute name="href"><xsl:value-of select="concat($gateway, '?b_action=xts.run')"/><xsl:value-of select="concat('&amp;m=', key('env-param', 'm'))"/>&amp;m_path=<pf:idToSearchPathForURL source="$the-object/cm:storeID"/><xsl:if test="key('env-param', 'backURL')"><xsl:value-of select="concat('&amp;backURL=', xtsext:protect(xtsext:urlencode(string(key('env-param', 'backURL'))),'url','url','getdata'))"/></xsl:if></xsl:attribute>
  352. <xsl:value-of select="$the-object/cm:defaultName"/>
  353. </a>
  354. </xsl:otherwise>
  355. </xsl:choose>
  356. </cf:param>
  357. </cf:do-the-path-link>
  358. <xsl:if test="$searchIsEnabled='true'">
  359. <xsl:text/>&#160;&#160;-&#160;&#160;<span class="bold"><xts:string id="IDS_SEARCH"/></span><xsl:text/>
  360. </xsl:if>
  361. </tool:path>
  362. <tool:actions>
  363. <mt:toolbar cogadmin="true">
  364. <xsl:choose>
  365. <xsl:when test="$searchIsEnabled='true'">
  366. <xsl:choose>
  367. <xsl:when test="count(/root/content/cm:queryResponse/cm:queryReply[2]/*) = 0">
  368. <mt:tool-group cogadmin="true" lastgroup="true">
  369. <mt:tool cogadmin="true" name="delete" mode="tools" disable="true"/>
  370. </mt:tool-group>
  371. </xsl:when>
  372. <xsl:otherwise>
  373. <mt:tool-group cogadmin="true" lastgroup="true">
  374. <xsl:choose>
  375. <xsl:when test="not($canWrite)">
  376. <mt:tool cogadmin="true" name="delete" mode="tools" disable="true"/>
  377. </xsl:when>
  378. <xsl:otherwise>
  379. <mt:tool cogadmin="true" name="delete" mode="tools"/>
  380. </xsl:otherwise>
  381. </xsl:choose>
  382. </mt:tool-group>
  383. </xsl:otherwise>
  384. </xsl:choose>
  385. </xsl:when>
  386. <xsl:otherwise>
  387. <xsl:choose>
  388. <xsl:when test="$the-object/cm:objectClass = 'portletProducer'">
  389. <xsl:choose>
  390. <!-- user needs traverse, write and read to create a new portlet -->
  391. <xsl:when test="$userCanNotTraverse or not($canRead) or not($canWrite)">
  392. <mt:tool cogadmin="true" name="new_portlets" disable="true"/>
  393. </xsl:when>
  394. <xsl:otherwise>
  395. <mt:tool cogadmin="true" name="new_portlets"/>
  396. </xsl:otherwise>
  397. </xsl:choose>
  398. </xsl:when>
  399. </xsl:choose>
  400. <mt:tool-group cogadmin="true">
  401. <xsl:choose>
  402. <xsl:when test="not($canWrite)">
  403. <mt:tool cogadmin="true" name="delete" mode="tools" disable="true"/>
  404. </xsl:when>
  405. <xsl:otherwise>
  406. <mt:tool cogadmin="true" name="delete" mode="tools"/>
  407. </xsl:otherwise>
  408. </xsl:choose>
  409. </mt:tool-group>
  410. <mt:tool-group cogadmin="true" lastgroup="true">
  411. <mt:tool cogadmin="true" name="parent_properties">
  412. <tool-name>portaladmin</tool-name>
  413. <request-path>$the-object</request-path>
  414. </mt:tool>
  415. <xsl:choose>
  416. <xsl:when test="$userCanNotTraverse">
  417. <mt:tool cogadmin="true" name="search" disable="true"/>
  418. </xsl:when>
  419. <xsl:otherwise>
  420. <mt:tool cogadmin="true" name="search"/>
  421. </xsl:otherwise>
  422. </xsl:choose>
  423. </mt:tool-group>
  424. </xsl:otherwise>
  425. </xsl:choose>
  426. </mt:toolbar>
  427. </tool:actions>
  428. </tool:banner>
  429. </xsl:template>
  430. <cp:tabControl/>
  431. </xsl:stylesheet>
  432. </xts:block>
  433. <!--
  434. ===============================================================================================
  435. search - This block generates the search interface, when it is enabled.
  436. ===============================================================================================
  437. -->
  438. <xts:block id="search" type="exec" mode="output" processor="XSLT" dependency="mergeTenantNames" mimeType="text/html" contentId="search" partId="1" condition=".[/root/env/param[@name='search']]" mandatory="false"
  439. xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/"
  440. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  441. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  442. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  443. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  444. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  445. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/">
  446. <xts:logicsheet path="logicsheets/toollogic2.xslt"/>
  447. <xts:logicsheet path="logicsheets/portal.xsl"/>
  448. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  449. <xts:logicsheet path="logicsheets/presentation/main/search.xsl"/>
  450. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  451. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  452. <!-- Generic logicsheets -->
  453. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  454. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  455. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  456. <xts:logicsheet path="logicsheets/validation.xslt"/>
  457. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  458. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="pf mt dp lyt xts">
  459. <xsl:output method="html" encoding="utf-8" indent="no"/>
  460. <xsl:variable name="mname" select="'legacy_tools/tools_portaladmin.xts'"/>
  461. <tool:variables formName="frmEntryAdmin" stateParams="m_path m_section m_pagerfrom m_pagerto"/>
  462. <cp:flyoutControl/>
  463. <xsl:template match="/">
  464. <mt:search type="tools">
  465. <mt:stypes>
  466. <mt:stype name="portlet"><xts:string id="IDS_OBJ_PORTLET"/></mt:stype>
  467. <mt:stype name="portletProducer"><xts:string id="IDS_OBJ_PORTLETPRODUCER"/></mt:stype>
  468. </mt:stypes>
  469. <mt:close-params>
  470. <param>backURL</param>
  471. <param>m_path</param>
  472. </mt:close-params>
  473. </mt:search>
  474. </xsl:template>
  475. </xsl:stylesheet>
  476. </xts:block>
  477. <!--
  478. ===============================================================================================
  479. body - This block generates the tool contents.
  480. ===============================================================================================
  481. -->
  482. <xts:block id="body" type="exec" mode="output" processor="XSLT" dependency="mergeTenantNames getClassNames" mimeType="text/html" contentId="body" partId="1"
  483. xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/"
  484. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  485. xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
  486. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  487. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  488. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  489. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  490. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/">
  491. <xts:logicsheet path="logicsheets/toollogic2.xslt"/>
  492. <!-- Cognos Central main behaviour logic -->
  493. <xts:logicsheet path="logicsheets/portal.xsl"/>
  494. <xts:logicsheet path="logicsheets/permissions.xsl"/>
  495. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  496. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  497. <!-- Cognos Central controls logic -->
  498. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  499. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  500. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  501. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  502. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="tool pf pm mf mt cf cp dp cm xtsext xts">
  503. <xsl:output method="html" encoding="utf-8" indent="no"/>
  504. <!-- current file name -->
  505. <xsl:variable name="mname" select="'legacy_tools/tools_portaladmin.xts'"/>
  506. <xsl:variable name="the-object" select="/root/content/cm:queryResponse/cm:queryReply[1]/*"/>
  507. <xsl:variable name="canReadParent" select="contains($the-object/cm:permissions, 'read')"/>
  508. <xsl:variable name="userCanNotTraverse" select="not(contains(/root/content/cm:queryResponse/cm:queryReply[1]/*/cm:permissions, 'traverse'))"/>
  509. <tool:variables formName="frmEntryAdmin" stateParams="m_path m_section m_pagerto m_pagerfrom"/>
  510. <xsl:template match="/">
  511. <tool:content formName="frmEntryAdmin" tool="portaladmin">
  512. <xsl:choose>
  513. <!-- when we get an empty response for the ancestor then the user used a bookmark and he no longer has access or the directory was deleted -->
  514. <xsl:when test="not($the-object)">
  515. <mt:containerNoAccess/>
  516. </xsl:when>
  517. <xsl:when test="$userCanNotTraverse">
  518. <mt:objectNoneFound id="IDS_NO_TRAVERSE_CONTAINER"/>
  519. </xsl:when>
  520. <xsl:when test="/root/search/emptySearchExpression">
  521. <mt:objectNoneFound id="IDS_EMPTY_QUERY"/>
  522. </xsl:when>
  523. <xsl:otherwise>
  524. <xsl:if test="/root/search/expression or not(/root/search)">
  525. <cf:main-pager-section virtualPage="true" width="100%">
  526. <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
  527. <cf:param name="item-path">root/content/cm:queryResponse/cm:queryReply[2]/*</cf:param>
  528. <cf:param name="lines-per-page">
  529. <xsl:value-of select="key('session-param', 'linesPerPage')"/>
  530. </cf:param>
  531. <cf:param name="rows">
  532. <cp:tableHeader session-name="s_ct">
  533. <cp:columnHeader toggleName="checkbox_" form="pfrmEntryAdmin"/>
  534. <cp:columnHeader width="20"/>
  535. <cp:columnHeader width="100%" sort="n">
  536. <cp:sortHref>
  537. <xsl:value-of select="$back-url"/>&amp;m_s_ct=<xsl:choose>
  538. <xsl:when test="key('session-param', 's_ct') = 'na' ">nd</xsl:when>
  539. <xsl:when test="key('session-param', 's_ct') = 'nd' ">sa</xsl:when>
  540. <xsl:otherwise>na</xsl:otherwise>
  541. </xsl:choose>
  542. </cp:sortHref>
  543. <xsl:if test="/root/env/param[@name='search']">
  544. <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
  545. <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text>&#160;</xsl:text>
  546. <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
  547. </xsl:if>
  548. <xts:string id="IDS_NAME"/>
  549. </cp:columnHeader>
  550. <xsl:if test="not(/root/env/param[@name='search'])">
  551. <cp:columnHeader sort="d">
  552. <cp:sortHref>
  553. <xsl:value-of select="$back-url"/>&amp;m_s_ct=<xsl:choose>
  554. <xsl:when test="key('session-param', 's_ct') = 'da' ">dd</xsl:when>
  555. <xsl:when test="key('session-param', 's_ct') = 'dd' ">sa</xsl:when>
  556. <xsl:otherwise>da</xsl:otherwise>
  557. </xsl:choose>
  558. </cp:sortHref>
  559. <xts:string id="IDS_MODIFIED"/>
  560. </cp:columnHeader>
  561. </xsl:if>
  562. <cp:columnHeader width="100">
  563. <xsl:if test="@valign and @valign!=''">
  564. <xsl:attribute name="valign">
  565. <xsl:value-of select="@valign"/>
  566. </xsl:attribute>
  567. </xsl:if>
  568. <cp:columnCondition><xsl:value-of select="/root/session/param[@name='e_showTenantInfo']='true'"/></cp:columnCondition>
  569. <xts:string id="IDS_OBJ_TENANT"/>
  570. </cp:columnHeader>
  571. <cp:columnHeader>
  572. <xts:string id="IDS_HEADING_ACTIONS"/>
  573. </cp:columnHeader>
  574. </cp:tableHeader>
  575. <cp:tableContent>
  576. <cp:common-render-variables>
  577. <!-- Common variables used in rendering icons, actions .. etc. -->
  578. <pm:permissions/>
  579. <mf:common-entry-varaibles/>
  580. </cp:common-render-variables>
  581. <cp:columnContent>
  582. <input type="checkbox" value="{xtsext:urlencode(string(cm:searchPath))}" name="checkbox_{position()}">
  583. <xsl:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><xsl:value-of select="xtsext:htmlencode(cm:defaultName)"/></xts:param></xts:string></xsl:attribute>
  584. </input>
  585. </cp:columnContent>
  586. <cp:columnContent>
  587. <xsl:call-template name="gen-icon">
  588. <xsl:with-param name="class" select="$class"/>
  589. <xsl:with-param name="hiddenObject" select="$hiddenObject"/>
  590. </xsl:call-template>
  591. </cp:columnContent>
  592. <cp:columnContent scope="row">
  593. <xsl:if test="/root/env/param[@name='search']">
  594. <img width="20" height="16" align="absmiddle" src="{$skin_images}path.gif">
  595. <xsl:attribute name="alt">
  596. <cf:do-the-path-link>
  597. <cf:param name="familytree">cm:ancestors</cf:param>
  598. <cf:param name="familymember">cm:defaultName</cf:param>
  599. </cf:do-the-path-link>
  600. </xsl:attribute>
  601. </img><xsl:text>&#160;</xsl:text>
  602. </xsl:if>
  603. <xsl:variable name="parentHasReadPermission" select="contains(cm:parent/*/cm:permissions, 'read')"/>
  604. <xsl:variable name="url-encoded-id"><pf:idToSearchPathForURL source="cm:storeID"/></xsl:variable>
  605. <mf:entry-name tool="portalAdmin"/>
  606. <xsl:text>&#160;&#160;</xsl:text>
  607. </cp:columnContent>
  608. <xsl:if test="not(/root/env/param[@name='search'])">
  609. <cp:columnContent>
  610. <!-- this will give us the time formatted with the java long(2) date and medium(3) time using the locale date and time patterns provided by java -->
  611. <nobr>
  612. <xsl:value-of select="xtsext:formatDateFromUTC( string( cm:modificationTime ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
  613. </nobr>
  614. <xsl:text>&#160;&#160;</xsl:text>
  615. </cp:columnContent>
  616. </xsl:if>
  617. <cp:columnContent>
  618. <cp:columnCondition><xsl:value-of select="/root/session/param[@name='e_showTenantInfo']='true'"/></cp:columnCondition>
  619. <xsl:value-of select="cm:tenantName"/>
  620. </cp:columnContent>
  621. <cp:columnContent>
  622. <nobr>
  623. <xsl:call-template name="action-properties">
  624. <xsl:with-param name="class" select="$class"/>
  625. <xsl:with-param name="supportPropertiesAction" select="true()"/>
  626. <xsl:with-param name="supportPortletControlAction" select="true()"/>
  627. <xsl:with-param name="supportAllActionsAction" select="true()"/>
  628. <xsl:with-param name="canWrite" select="contains(cm:permissions, 'write')"/>
  629. <xsl:with-param name="canRead" select="contains(cm:permissions, 'read')"/>
  630. </xsl:call-template>
  631. </nobr>
  632. </cp:columnContent>
  633. </cp:tableContent>
  634. <cp:tableFooter>
  635. <cp:columnFooter width="100%" colspan="11" timezone="string(/root/user/param[@name='timeZoneID'])">
  636. <!-- display the current timestamp -->
  637. <xsl:variable name="time_now" select="xtsext:getCurrentDateTime(string(/root/user/param[@name='timeZoneID']))"/>
  638. <xts:string id="IDS_LAST_UPDATED">
  639. <xts:param name="time">
  640. <xsl:value-of select="xtsext:formatDateFromUTC(string($time_now), number('2'), number('3'), '', string($contentLocale))"/>
  641. </xts:param>
  642. </xts:string>
  643. </cp:columnFooter>
  644. </cp:tableFooter>
  645. </cf:param>
  646. </cf:main-pager-section>
  647. </xsl:if>
  648. </xsl:otherwise>
  649. </xsl:choose>
  650. </tool:content>
  651. </xsl:template>
  652. <!-- Insert common templates -->
  653. <mt:actions mode="tools"/>
  654. <pf:gen-action/>
  655. <pf:gen-icon/>
  656. <pf:gen-url/>
  657. </xsl:stylesheet>
  658. </xts:block>
  659. <!--
  660. ===============================================================================================
  661. render-page - Main page rendering block.
  662. ===============================================================================================
  663. -->
  664. <xts:block id="render-page" type="exec" mode="interpret" processor="XSLT" dependency="head banner search body" mimeType="text/html" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt">
  665. <xts:logicsheet path="logicsheets/portal.xsl"/>
  666. <!-- Cognos Central main behaviour logic -->
  667. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  668. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/theme/main/mf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl cm pf mt mf bus xts xos SOAP-ENV">
  669. <xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"/>
  670. <pf:variables/>
  671. <xsl:template match="/root">
  672. <xts:sequence>
  673. <xts:replace select="/root/output/*[local-name() = 'part']">
  674. <xos:part>
  675. <xos:entityHeader>
  676. <xos:param name="Content-Type">text/html; charset=utf-8</xos:param>
  677. </xos:entityHeader>
  678. <xos:entityBody>
  679. <html>
  680. <!-- copy in the head content -->
  681. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'head']"/>
  682. <mt:page>
  683. <!-- copy in the banner -->
  684. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'banner']"/>
  685. <!-- copy in the search part, when it exists -->
  686. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'search']"/>
  687. <!-- copy in the body -->
  688. <xsl:copy-of select="output/xos:part/xos:entityBody/xos:content[@id = 'body']"/>
  689. </mt:page>
  690. </html>
  691. </xos:entityBody>
  692. </xos:part>
  693. </xts:replace>
  694. </xts:sequence>
  695. </xsl:template>
  696. </xsl:stylesheet>
  697. </xts:block>
  698. <!--
  699. =============================================
  700. Output debug dump
  701. =============================================
  702. -->
  703. <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="render-page">
  704. <!-- get the debug logic sheet -->
  705. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  706. <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">
  707. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  708. <xsl:template match="/">
  709. <dbg:dumpxml select="/root"/>
  710. </xsl:template>
  711. </xsl:stylesheet>
  712. </xts:block>
  713. </xts:morphlet>