tools_directory.xts 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817
  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/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseUsersGroupsAndRolesTool canUseDataSourcesTool canUseDistributionListsAndContactsTool or or">
  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. ===============================================================================================
  21. Saves cut/copied entries in a user session - Only executes after a cut or a copy operation.
  22. ===============================================================================================
  23. -->
  24. <xts:block id="groupEdit" path="portal/set_clipboard.xml" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name='editentries']]">
  25. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  26. <xts:logicsheet path="logicsheets/portal.xsl"/>
  27. </xts:block>
  28. <!-- ======================================================== -->
  29. <!-- Session Management -->
  30. <!-- ======================================================== -->
  31. <!-- Reads session-sensitive info from CM -->
  32. <xts:block processor="XSLT" type="exec" mandatory="false"
  33. id="refreshSession"
  34. path="portal/cc/read_session.xml"
  35. condition=".[
  36. string(/root/cookies/cookie[@name = 'cc_session']) = ''
  37. or /root/env/param[@name='m_reload']
  38. or /root/env/param[@name='m_root'] ]">
  39. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  40. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  41. </xts:block>
  42. <!-- Update the <session> element for this request. -->
  43. <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession secureBackURL" processor="XSLT" type="exec"
  44. condition=".[
  45. /root/newSession
  46. or /root/env/param[@name='ui']
  47. or /root/env/param[@name='d']
  48. or /root/env/param[starts-with(@name,'m_s_')]
  49. or /root/env/param[@name = 'resetSort'] ]"
  50. mandatory="false"/>
  51. <!-- Save changes to the state info in a cookie -->
  52. <xts:block mode="interpret" processor="XSLT" type="exec"
  53. id="setSession"
  54. path="portal/set_session.xml"
  55. dependency="groupEdit buildSession getPath mergeTenantNames"
  56. condition=".[/root/updateSession]"
  57. mandatory="false"/>
  58. <!-- Load predefined actions map ============================================================== -->
  59. <xts:block id="getActions" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  60. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_actions.xslt"/>
  61. </xts:block>
  62. <!--
  63. =============================================
  64. Request properties of the current container
  65. =============================================
  66. -->
  67. <xts:block id="getPath" processor="XSLT" type="exec" dependency="buildSession">
  68. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  69. <xts:logicsheet path="logicsheets/portal.xsl"/>
  70. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  71. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  72. <pf:variables/>
  73. <xsl:template match="root">
  74. <xsl:variable name="tooltab">
  75. <xsl:value-of select="/root/env/param[@name = 'tool_tab']"/>
  76. </xsl:variable>
  77. <xsl:if test="($tooltab = '') or ($tooltab != 'u' and $tooltab != 'd' and $tooltab != 'l')">
  78. <xts:sequence>
  79. <xts:delete select="/root/env/param[@name='search' or @name='tool_tab' or @name='m_path']"/>
  80. <xts:append select="/root/env">
  81. <param name="m_path">
  82. <xsl:value-of select="'/directory'"/>
  83. </param>
  84. </xts:append>
  85. </xts:sequence>
  86. </xsl:if>
  87. <xsl:variable name="tool-tab-desired">
  88. <xsl:choose>
  89. <xsl:when test="/root/env/param[@name = 'tool_tab']">
  90. <xsl:value-of select="/root/env/param[@name = 'tool_tab']"/>
  91. </xsl:when>
  92. <xsl:otherwise>
  93. <!-- Default to Users, Groups, and Roles if the tool_tab parameter is not present. -->
  94. <xsl:text>u</xsl:text>
  95. </xsl:otherwise>
  96. </xsl:choose>
  97. </xsl:variable>
  98. <xsl:variable name="checkCanUseUsersGroupsAndRolesTool" select="string(/root/header/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']/*[local-name()='userCapabilities']/item[text()='canUseUsersGroupsAndRolesTool'])"/>
  99. <xsl:variable name="checkCanUseDataSourcesTool" select="string(/root/header/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']/*[local-name()='userCapabilities']/item[text()='canUseDataSourcesTool'])"/>
  100. <xsl:variable name="checkCanUseDistributionListsAndContactsTool" select="string(/root/header/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']/*[local-name()='userCapabilities']/item[text()='canUseDistributionListsAndContactsTool'])"/>
  101. <xsl:variable name="tool-tab">
  102. <xsl:choose>
  103. <xsl:when test="$tool-tab-desired = 'u'">
  104. <xsl:choose>
  105. <xsl:when test="$checkCanUseUsersGroupsAndRolesTool=''">
  106. <xsl:choose>
  107. <xsl:when test="$checkCanUseDataSourcesTool=''">l</xsl:when>
  108. <xsl:otherwise>d</xsl:otherwise>
  109. </xsl:choose>
  110. </xsl:when>
  111. <xsl:otherwise>
  112. <xsl:value-of select="$tool-tab-desired"/>
  113. </xsl:otherwise>
  114. </xsl:choose>
  115. </xsl:when>
  116. <xsl:when test="$tool-tab-desired = 'd'">
  117. <xsl:choose>
  118. <xsl:when test="$checkCanUseDataSourcesTool=''">
  119. <xsl:choose>
  120. <xsl:when test="$checkCanUseUsersGroupsAndRolesTool=''">l</xsl:when>
  121. <xsl:otherwise>u</xsl:otherwise>
  122. </xsl:choose>
  123. </xsl:when>
  124. <xsl:otherwise>
  125. <xsl:value-of select="$tool-tab-desired"/>
  126. </xsl:otherwise>
  127. </xsl:choose>
  128. </xsl:when>
  129. <xsl:otherwise>
  130. <xsl:choose>
  131. <xsl:when test="$checkCanUseDistributionListsAndContactsTool=''">
  132. <xsl:choose>
  133. <xsl:when test="$checkCanUseUsersGroupsAndRolesTool=''">d</xsl:when>
  134. <xsl:otherwise>u</xsl:otherwise>
  135. </xsl:choose>
  136. </xsl:when>
  137. <xsl:otherwise>
  138. <xsl:value-of select="$tool-tab-desired"/>
  139. </xsl:otherwise>
  140. </xsl:choose>
  141. </xsl:otherwise>
  142. </xsl:choose>
  143. </xsl:variable>
  144. <xsl:variable name="m_path" select="/root/env/param[@name='m_path']"/>
  145. <xsl:variable name="m_pathID" select="/root/env/param[@name='m_pathID']"/>
  146. <xsl:variable name="path">
  147. <xsl:choose>
  148. <xsl:when test="$tool-tab!='u' and $tool-tab!='l'">
  149. <xsl:choose>
  150. <xsl:when test="starts-with($m_path, &quot;CAMID(&apos;:&apos;)&quot;) or starts-with($m_path, 'CAMID(&quot;:&quot;)')">
  151. <xsl:value-of select="$m_path"/>
  152. </xsl:when>
  153. <xsl:otherwise>
  154. <xsl:value-of select="'CAMID(&quot;:&quot;)'"/>
  155. </xsl:otherwise>
  156. </xsl:choose>
  157. </xsl:when>
  158. <xsl:otherwise>
  159. <xsl:choose>
  160. <xsl:when test="$m_path!='' and contains(string($m_path), '/rule')">
  161. <xsl:value-of select="substring-before($m_path, '/rule')"/>
  162. </xsl:when>
  163. <xsl:when test="$m_path!='' and contains(string($m_path), '/alert')">
  164. <xsl:value-of select="substring-before($m_path, '/alert')"/>
  165. </xsl:when>
  166. <xsl:when test="$m_path!=''">
  167. <xsl:value-of select="$m_path"/>
  168. </xsl:when>
  169. <xsl:otherwise>
  170. <xsl:text>/directory</xsl:text>
  171. </xsl:otherwise>
  172. </xsl:choose>
  173. </xsl:otherwise>
  174. </xsl:choose>
  175. </xsl:variable>
  176. <xts:sequence>
  177. <xts:append>
  178. <path>
  179. <!-- Request properties of the current container. -->
  180. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  181. <send:request provider="cm">
  182. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  183. <cm:query>
  184. <cm:search>
  185. <xsl:choose>
  186. <xsl:when test="$m_pathID!=''">
  187. <xsl:text>storeID('</xsl:text>
  188. <xsl:value-of select="$m_pathID"/>
  189. <xsl:text>')</xsl:text>
  190. </xsl:when>
  191. <xsl:otherwise>
  192. <xsl:value-of select="$path"/>
  193. </xsl:otherwise>
  194. </xsl:choose>
  195. </cm:search>
  196. <cm:properties>
  197. <cm:property name="objectClass"/>
  198. <cm:property name="defaultName"/>
  199. <cm:property name="ancestors"/>
  200. <cm:property name="permissions"/>
  201. <cm:property name="searchPath"/>
  202. <cm:property name="storeID"/>
  203. <xsl:if test="$tool-tab = 'd'">
  204. <cm:property name="credentialNamespaces"/>
  205. <cm:property name="connectionString"/>
  206. </xsl:if>
  207. </cm:properties>
  208. <cm:options>
  209. <cm:refProps>
  210. <cm:refProp refPropName="parent">
  211. <cm:properties>
  212. <cm:property name="searchPath"/>
  213. </cm:properties>
  214. </cm:refProp>
  215. </cm:refProps>
  216. </cm:options>
  217. </cm:query>
  218. </xts:transform>
  219. </send:request>
  220. </xts:transform>
  221. </path>
  222. </xts:append>
  223. <xts:delete select="/root/env/param[@name='m_pathID']"/>
  224. <xts:append select="/root/env">
  225. <param name="m_pathID"><xts:queryValue select="/root/path/*[local-name()='queryResponse']/*/*[local-name()='storeID']"/></param>
  226. </xts:append>
  227. <!--
  228. Leaving the storeID in the response changes the behaviour of the parent permissions action and causes the OK/Cancel buttons to return the user to the root of the Cognos Namespace.
  229. Now that we've captured it we can delete it from the response to avoid this side effect.
  230. -->
  231. <xts:delete select="/root/path/*[local-name()='queryResponse']/*/*[local-name()='storeID']"/>
  232. <xts:delete select="/root/env/param[@name='tool_tab']"/>
  233. <xts:append select="/root/env">
  234. <param name="tool_tab"><xsl:value-of select="$tool-tab"/></param>
  235. </xts:append>
  236. </xts:sequence>
  237. </xsl:template>
  238. </xsl:stylesheet>
  239. </xts:block>
  240. <!--
  241. =======================================================================================
  242. When the enable-3rdparty-namespace-browsing system.xml parameter is set to false, we
  243. force the UI into search mode whenever we enter any part of a 3rd party namespace.
  244. =======================================================================================
  245. -->
  246. <xts:block id="secure-3rdpartyNS-browsing" dependency="getPath" nodelist="system,path" processor="XSLT" type="exec" condition=".[not(/root/env/param[@name='search'])]" mandatory="false">
  247. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  248. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  249. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  250. <xsl:template match="root">
  251. <xsl:variable name="m_path" select="/root/path/cm:queryResponse/*/cm:searchPath"/>
  252. <xsl:variable name="inDirectoryRoot" select="/root/path/cm:queryResponse/*/cm:objectClass/cm:value='directory'"/>
  253. <xsl:variable name="insideCognosNamespace" select="(starts-with($m_path, &quot;CAMID(&apos;:&quot;) or starts-with($m_path, 'CAMID(&quot;:'))"/>
  254. <xsl:variable name="insideAccount" select="(/root/path/cm:queryResponse/*/cm:objectClass/cm:value='account') or (/root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo/cm:objectClass='account')"/>
  255. <xsl:variable name="canBrowse3rdPartyNamespace" select="not(/root/system/param[@name='enable-3rdparty-namespace-browsing']='false')"/>
  256. <xsl:if test="not($canBrowse3rdPartyNamespace or $inDirectoryRoot or $insideCognosNamespace or $insideAccount)">
  257. <xts:sequence>
  258. <xts:append select="/root/env">
  259. <param name="search"/>
  260. </xts:append>
  261. </xts:sequence>
  262. </xsl:if>
  263. </xsl:template>
  264. </xsl:stylesheet>
  265. </xts:block>
  266. <!--
  267. ======================================
  268. Generat the search expression
  269. ======================================
  270. -->
  271. <xts:block id="generateSearchExp" processor="XSLT" type="exec" dependency="secure-3rdpartyNS-browsing" condition=".[/root/env/param[@name='search']]" mandatory="false">
  272. <xts:logicsheet path="logicsheets/searchlogic.xslt"/>
  273. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  274. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  275. xmlns:search="http://developer.cognos.com/schemas/xts/logicsheets/xslt/searchlogic/"
  276. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  277. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  278. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  279. exclude-result-prefixes="search cm cml xtsext">
  280. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  281. <cml:object-predicates/>
  282. <xsl:template match="root">
  283. <xsl:variable name="browsingUserMyFolder" select="/root/path/cm:queryResponse/*/cm:objectClass='account' or /root/path/cm:queryResponse/*/cm:ancestors/*/cm:objectClass='account'"/>
  284. <xsl:variable name="tool-tab">
  285. <xsl:choose>
  286. <xsl:when test="/root/env/param[@name = 'tool_tab']">
  287. <xsl:value-of select="/root/env/param[@name = 'tool_tab']"/>
  288. </xsl:when>
  289. <xsl:otherwise>
  290. <!-- Default to Users, Groups, and Roles if the tool_tab parameter is not present. -->
  291. <xsl:text>u</xsl:text>
  292. </xsl:otherwise>
  293. </xsl:choose>
  294. </xsl:variable>
  295. <xsl:variable name="path">
  296. <xsl:choose>
  297. <xsl:when test="/root/env/param[@name = 'm_path'] and /root/env/param[@name = 'm_path'] != ''">
  298. <xsl:choose>
  299. <xsl:when test="$tool-tab='u' and contains(string(/root/env/param[@name='m_path']), '/alert')">
  300. <xsl:value-of select="substring-before(string(/root/env/param[@name = 'm_path']), '/alert')"/>
  301. </xsl:when>
  302. <xsl:when test="$tool-tab='u' and contains(string(/root/env/param[@name='m_path']), '/rule')">
  303. <xsl:value-of select="substring-before(string(/root/env/param[@name = 'm_path']), '/rule')"/>
  304. </xsl:when>
  305. <xsl:otherwise>
  306. <xsl:value-of select="/root/env/param[@name = 'm_path']"/>
  307. </xsl:otherwise>
  308. </xsl:choose>
  309. </xsl:when>
  310. <xsl:otherwise>/directory</xsl:otherwise>
  311. </xsl:choose>
  312. </xsl:variable>
  313. <!-- get current namespace path-->
  314. <xsl:variable name="t-ns-path">
  315. <xsl:choose>
  316. <xsl:when test="/root/path/cm:queryResponse/child::*[local-name() = 'namespace']">
  317. <xsl:value-of select="/root/path/cm:queryResponse/child::*/cm:searchPath"/>
  318. </xsl:when>
  319. <xsl:otherwise>
  320. <xsl:value-of select="/root/path/cm:queryResponse/child::*/cm:ancestors/cm:ancestorInfo[./cm:objectClass = 'namespace']/cm:searchPath"/>
  321. </xsl:otherwise>
  322. </xsl:choose>
  323. </xsl:variable>
  324. <xsl:variable name="ns-path">
  325. <xsl:choose>
  326. <xsl:when test="$t-ns-path != ''">
  327. <xsl:value-of select="$t-ns-path"/>
  328. </xsl:when>
  329. <!-- By default, use cognos namespace.-->
  330. <xsl:otherwise>
  331. <xsl:value-of select="'CAMID(&quot;:&quot;)'"/>
  332. </xsl:otherwise>
  333. </xsl:choose>
  334. </xsl:variable>
  335. <xts:sequence>
  336. <xsl:choose>
  337. <xsl:when test="$tool-tab = 'u' and $browsingUserMyFolder">
  338. <search:gen-search-exp defaultRoot="directory">
  339. <search:defaultTypes>
  340. <search:defaultType>document</search:defaultType>
  341. <search:defaultType>shortcut</search:defaultType>
  342. <search:defaultType>analysis</search:defaultType>
  343. <search:defaultType>agentDefinition</search:defaultType>
  344. <search:defaultType>agentDefinitionView</search:defaultType>
  345. <search:defaultType>analyticsPackage</search:defaultType>
  346. <search:defaultType>cd</search:defaultType>
  347. <search:defaultType>contentReference</search:defaultType>
  348. <search:defaultType>report</search:defaultType>
  349. <search:defaultType>query</search:defaultType>
  350. <search:defaultType>reportView</search:defaultType>
  351. <search:defaultType>folder</search:defaultType>
  352. <search:defaultType>subscriptionFolder</search:defaultType>
  353. <search:defaultType>URL</search:defaultType>
  354. <search:defaultType>pagelet</search:defaultType>
  355. <search:defaultType>package</search:defaultType>
  356. <search:defaultType>jobDefinition</search:defaultType>
  357. <search:defaultType>powerPlayCube</search:defaultType>
  358. <search:defaultType>powerPlayReport</search:defaultType>
  359. <search:defaultType>powerPlay8Report</search:defaultType>
  360. <search:defaultType>reportTemplate</search:defaultType>
  361. <search:defaultType>reportDataServiceAgentDefinition</search:defaultType>
  362. <search:defaultType>metricsFileImportTask</search:defaultType>
  363. <search:defaultType>metricsDataSourceETLTask</search:defaultType>
  364. <search:defaultType>metricsMaintenanceTask</search:defaultType>
  365. <search:defaultType>metricsExportTask</search:defaultType>
  366. </search:defaultTypes>
  367. </search:gen-search-exp>
  368. </xsl:when>
  369. <xsl:when test="$tool-tab = 'u'">
  370. <search:gen-search-exp defaultRoot="directory">
  371. <search:defaultTypes>
  372. <search:defaultType>namespace</search:defaultType>
  373. <search:defaultType>namespaceFolder</search:defaultType>
  374. <search:defaultType>group</search:defaultType>
  375. <search:defaultType>role</search:defaultType>
  376. <search:defaultType>account</search:defaultType>
  377. </search:defaultTypes>
  378. </search:gen-search-exp>
  379. </xsl:when>
  380. <xsl:when test="$tool-tab = 'd'">
  381. <search:gen-search-exp defaultRoot="directory">
  382. <search:defaultTypes>
  383. <search:defaultType>dataSource</search:defaultType>
  384. <search:defaultType>dataSourceConnection</search:defaultType>
  385. <search:defaultType>dataSourceSignon</search:defaultType>
  386. <search:defaultType>modelView</search:defaultType>
  387. </search:defaultTypes>
  388. </search:gen-search-exp>
  389. </xsl:when>
  390. <xsl:when test="$tool-tab = 'l'">
  391. <search:gen-search-exp defaultRoot="directory">
  392. <search:defaultTypes>
  393. <search:defaultType>namespace</search:defaultType>
  394. <search:defaultType>namespaceFolder</search:defaultType>
  395. <search:defaultType>distributionList</search:defaultType>
  396. <search:defaultType>contact</search:defaultType>
  397. </search:defaultTypes>
  398. </search:gen-search-exp>
  399. </xsl:when>
  400. </xsl:choose>
  401. </xts:sequence>
  402. </xsl:template>
  403. </xsl:stylesheet>
  404. </xts:block>
  405. <!--
  406. ===============================================================================================
  407. Get the list of objects from Content Manager
  408. ===============================================================================================
  409. -->
  410. <xts:block id="getContent" processor="XSLT" type="exec" dependency="generateSearchExp getPath getActions">
  411. <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
  412. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  413. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  414. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  415. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  416. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  417. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  418. exclude-result-prefixes="send cm cml">
  419. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  420. <cml:object-predicates/>
  421. <xsl:variable name="inDirectoryRoot" select="/root/path/cm:queryResponse/*/cm:objectClass/cm:value='directory'"/>
  422. <xsl:variable name="tool-tab">
  423. <xsl:choose>
  424. <xsl:when test="/root/env/param[@name = 'tool_tab']">
  425. <xsl:value-of select="/root/env/param[@name = 'tool_tab']"/>
  426. </xsl:when>
  427. <xsl:otherwise>
  428. <!-- Default to Users, Groups, and Roles if the tool_tab parameter is not present. -->
  429. <xsl:text>u</xsl:text>
  430. </xsl:otherwise>
  431. </xsl:choose>
  432. </xsl:variable>
  433. <xsl:variable name="m_sort">
  434. <xsl:value-of select="/root/session/param[@name='s_dir']"/>
  435. </xsl:variable>
  436. <xsl:variable name="m_path" select="/root/env/param[@name='m_path']"/>
  437. <xsl:variable name="path" select="/root/path/*[local-name()='queryResponse']/*/*[local-name()='searchPath']"/>
  438. <xsl:variable name="userPrefs" select="/root/session/param"/>
  439. <xsl:variable name="userPrefsDefault" select="/root/system/param[@name='defaultPortalPreferences']"/>
  440. <xsl:variable name="maxObjects">
  441. <xsl:choose>
  442. <xsl:when test="string(/root/env/param[@name = 'm_pagerto']) !='' and string(/root/env/param[@name = 'm_pagerfrom']) !=''">
  443. <xsl:value-of select="(/root/env/param[@name = 'm_pagerto'] - /root/env/param[@name = 'm_pagerfrom']) + 1"/>
  444. </xsl:when>
  445. <xsl:when test="$userPrefs[@name='linesPerPage']!=''">
  446. <xsl:value-of select="$userPrefs[@name='linesPerPage']"/>
  447. </xsl:when>
  448. <xsl:otherwise>
  449. <xsl:value-of select="$userPrefsDefault/pref[@name='lines']"/>
  450. </xsl:otherwise>
  451. </xsl:choose>
  452. </xsl:variable>
  453. <xsl:variable name="skipObjects">
  454. <xsl:choose>
  455. <xsl:when test="/root/env/param[@name = 'm_newsearch'] ='true'">0</xsl:when>
  456. <xsl:when test="/root/env/param[@name = 'm_pagerfrom'] and /root/env/param[@name = 'm_pagerfrom']!=''">
  457. <xsl:value-of select="(/root/env/param[@name = 'm_pagerfrom'])-1"/>
  458. </xsl:when>
  459. <xsl:when test="/root/env/param[@name='m_section']!=''">
  460. <xsl:choose>
  461. <xsl:when test="/root/env/param[@name='m_section']!='-1'">
  462. <xsl:value-of select="((/root/env/param[@name='m_section']) -1)"/>
  463. </xsl:when>
  464. <xsl:otherwise>
  465. <xsl:value-of select="($maxObjects) * -1"/>
  466. </xsl:otherwise>
  467. </xsl:choose>
  468. </xsl:when>
  469. <xsl:otherwise>0</xsl:otherwise>
  470. </xsl:choose>
  471. </xsl:variable>
  472. <xsl:variable name="browsingUserMyFolder" select="/root/path/cm:queryResponse/*/cm:objectClass='account' or /root/path/cm:queryResponse/*/cm:ancestors/*/cm:objectClass='account'"/>
  473. <xsl:variable name="browsingUserSubscriptionFolder" select="/root/path/cm:queryResponse/*/cm:objectClass='subscriptionFolder'"/>
  474. <xsl:variable name="userMyFolderPath" select="/root/*[local-name()='path']/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[cm:objectClass='account']/cm:searchPath"/>
  475. <xsl:variable name="browsingUserMyWatchItems" select="/root/path/cm:queryResponse/*/cm:objectClass='subscriptionFolder' and /root/path/cm:queryResponse/*/cm:parent/*/cm:objectClass='account'"/>
  476. <xsl:variable name="watchitem" select="/root/env/param[@name='m_watch_item']"/>
  477. <xsl:variable name="class-filter">
  478. <xsl:choose>
  479. <xsl:when test="/root/path/cm:queryResponse/*/cm:objectClass='account'">
  480. <xsl:text>[@objectClass='folder' or @objectClass='subscriptionFolder']</xsl:text>
  481. </xsl:when>
  482. <xsl:when test="/root/path/cm:queryResponse/*/cm:ancestors/*/cm:objectClass='account'">
  483. <xsl:text>[@objectClass!='model' and @objectClass!='packageConfiguration']</xsl:text>
  484. </xsl:when>
  485. <xsl:when test="$tool-tab='u'">
  486. <xsl:text>[@objectClass='account' or @objectClass='group' or @objectClass='role' or @objectClass='namespace' or @objectClass='namespaceFolder']</xsl:text>
  487. </xsl:when>
  488. <xsl:when test="$tool-tab='d'">
  489. <xsl:text>[@objectClass='dataSource' or @objectClass='dataSourceConnection' or @objectClass='dataSourceSignon' or @objectClass='rolapDataSource' or @objectClass='model' or @objectClass='modelView' or @objectClass='rolapVirtualDataSource']</xsl:text>
  490. </xsl:when>
  491. <xsl:when test="$tool-tab='l'">
  492. <xsl:text>[@objectClass='contact' or @objectClass='distributionList' or @objectClass='namespaceFolder' or @objectClass='namespace']</xsl:text>
  493. </xsl:when>
  494. </xsl:choose>
  495. </xsl:variable>
  496. <xsl:template match="/">
  497. <xsl:if test="/root/search">
  498. <xsl:variable name="inside3rdPartyNamespace">
  499. <xsl:variable name="nsObj" select="/root/path/cm:queryResponse/*"/>
  500. <xsl:variable name="insideCognosNamespace" select="(starts-with($nsObj/cm:searchPath, &quot;CAMID(&apos;:&quot;) or starts-with($nsObj/cm:searchPath, 'CAMID(&quot;:'))"/>
  501. <xsl:value-of select="($nsObj/cm:objectClass='namespace' or $nsObj/cm:ancestors/cm:ancestorInfo/cm:objectClass='namespace') and not($insideCognosNamespace)"/>
  502. </xsl:variable>
  503. <xsl:if test="$inside3rdPartyNamespace = 'true'">
  504. <xts:sequence>
  505. <xts:delete select="/root/env/param[@name='queryNamespaceSearchDefaultMethodOptionSetting']"/>
  506. <xts:append select="/root/env">
  507. <param name="queryNamespaceSearchDefaultMethodOptionSetting">true</param>
  508. </xts:append>
  509. </xts:sequence>
  510. </xsl:if>
  511. </xsl:if>
  512. <xts:sequence>
  513. <!-- Don't need to query CM if we are in search dialog without running a search query. -->
  514. <xsl:if test="/root/search/expression or not(/root/search)">
  515. <xts:append>
  516. <xsl:choose>
  517. <!-- we should not call this if we're in search, under alert or rule. Also, only when we're under user's watch items folder -->
  518. <xsl:when test="$browsingUserMyWatchItems and not(contains($m_path, '/rule')) and not(contains($m_path, '/alert')) and not(/root/search)">
  519. <xsl:variable name="searchPathRule">
  520. <xsl:choose>
  521. <xsl:when test="not(contains($m_path, '/rule'))">
  522. <xsl:value-of select="concat($m_path, '/rule')"/>
  523. </xsl:when>
  524. <xsl:otherwise>
  525. <xsl:value-of select="$path"/>
  526. </xsl:otherwise>
  527. </xsl:choose>
  528. </xsl:variable>
  529. <xsl:variable name="searchPathAlert">
  530. <xsl:choose>
  531. <xsl:when test="not(contains($path, '/alert'))">
  532. <xsl:value-of select="concat($path, '/alert')"/>
  533. </xsl:when>
  534. <xsl:otherwise>
  535. <xsl:value-of select="$path"/>
  536. </xsl:otherwise>
  537. </xsl:choose>
  538. </xsl:variable>
  539. <queryResponse xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  540. <queryReply xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  541. <subscriptionFolder xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  542. <objectClass>subscriptionFolder</objectClass>
  543. <defaultName type="cm:tokenProp"><xts:string id="IDS_MYSUB_ALERTS"/></defaultName>
  544. <subscriptionFolderType type="cm:tokenProp">alert</subscriptionFolderType>
  545. <defaultScreenTip type="cm:stringProp" nil="true"/>
  546. <permissions type="xsd:string">execute read setPolicy traverse write</permissions>
  547. <usage type="cm:nmtokenProp">object</usage>
  548. <disabled type="cm:booleanProp">false</disabled>
  549. <hidden type="cm:booleanProp">false</hidden>
  550. <iconURI type="cm:anyURIProp">icon_watch_alert.gif</iconURI>
  551. <hasChildren type="cm:booleanProp">true</hasChildren>
  552. <searchPath><xsl:value-of select="$searchPathAlert"/></searchPath>
  553. </subscriptionFolder>
  554. <subscriptionFolder>
  555. <objectClass>subscriptionFolder</objectClass>
  556. <defaultName type="cm:tokenProp"><xts:string id="IDS_MYSUB_SUBSCRIPTIONS"/></defaultName>
  557. <subscriptionFolderType type="cm:tokenProp">rule</subscriptionFolderType>
  558. <defaultScreenTip type="cm:stringProp" nil="true"/>
  559. <permissions type="xsd:string">execute read setPolicy traverse write</permissions>
  560. <usage type="cm:nmtokenProp">object</usage>
  561. <disabled type="cm:booleanProp">false</disabled>
  562. <hidden type="cm:booleanProp">false</hidden>
  563. <iconURI type="cm:anyURIProp">icon_watch_rule.gif</iconURI>
  564. <hasChildren type="cm:booleanProp">true</hasChildren>
  565. <searchPath><xsl:value-of select="$searchPathRule"/></searchPath>
  566. </subscriptionFolder>
  567. </queryReply>
  568. </queryResponse>
  569. </xsl:when>
  570. <xsl:otherwise>
  571. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  572. <send:request provider="cm">
  573. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  574. <cm:query>
  575. <cm:requests>
  576. <cm:query>
  577. <cm:search>
  578. <xsl:choose>
  579. <xsl:when test="/root/search/expression">
  580. <xsl:choose>
  581. <!-- If we are inside an external namespace then do not add the predicate -->
  582. <xsl:when test="$path!='CAMID(&quot;:&quot;)' and starts-with($path, 'CAMID(') and not($browsingUserMyFolder) and not($browsingUserSubscriptionFolder)">
  583. <xsl:value-of select="/root/search/expression"/>
  584. </xsl:when>
  585. <!-- if we are searching for modelViews then do not add the predicate -->
  586. <xsl:when test="/root/env/param[@name = 'stype'] = 'modelView'">
  587. <xsl:value-of select="/root/search/expression"/>
  588. </xsl:when>
  589. <xsl:otherwise>
  590. <xsl:value-of select="concat(/root/search/expression, $hidden-objects-predicate)"/>
  591. </xsl:otherwise>
  592. </xsl:choose>
  593. </xsl:when>
  594. <xsl:when test="$browsingUserMyWatchItems and not(contains($m_path, '/rule'))">
  595. <xsl:value-of select="concat('//*[containsReferences(@notificationList,', $userMyFolderPath, ')]', $visibility-predicate)"/>
  596. </xsl:when>
  597. <!-- if we're in a model, then don't use the hidden objects predicate. Models contain modelViews which are not UIClass objects. -->
  598. <xsl:when test="contains($path, '/model[')">
  599. <xsl:value-of select="$path"/>/*<xsl:value-of select="concat($class-filter, /root/system/param[@name='visible'])"/>
  600. </xsl:when>
  601. <!-- if we're in the Cognos namespace and we're not browsing a users My Folders, then check for permissions -->
  602. <xsl:when test="(starts-with($path, &quot;CAMID(&apos;:&quot;) or starts-with($path, 'CAMID(&quot;:')) and not($browsingUserMyFolder)">
  603. <xsl:value-of select="$path"/>/*<xsl:value-of select="concat($class-filter, $visibility-predicate)"/>
  604. </xsl:when>
  605. <xsl:otherwise>
  606. <!-- TODO: Add the visibility check here when cm fixes issue with 3rd party namespaces -->
  607. <xsl:value-of select="concat($path, '/*', $class-filter)"/>
  608. <!-- Bug 516145 - if we're getting a list of namespaces use the namespace filter-->
  609. <xsl:if test="not(starts-with($m_path, 'CAMID(')) and not($browsingUserMyFolder)">
  610. <xsl:text/><xsl:value-of select="/root/system/param[@name='namespace_filter']"/><xsl:text/>
  611. <xsl:text/><xsl:value-of select="$hidden-objects-predicate"/><xsl:text/>
  612. </xsl:if>
  613. <xsl:if test="$browsingUserMyFolder">
  614. <xsl:text/>
  615. <xsl:value-of select="$visibility-predicate"/>
  616. <xsl:text/>
  617. </xsl:if>
  618. <!-- no need to check for permissions in a third party namespace. Security is configured by the third party tool -->
  619. </xsl:otherwise>
  620. </xsl:choose>
  621. </cm:search>
  622. <cm:sortBy>
  623. <xsl:if test="not($browsingUserMyWatchItems)">
  624. <cm:sort name="usage" order="ascending"/>
  625. </xsl:if>
  626. <xsl:choose>
  627. <xsl:when test="/root/search/expression">
  628. <cm:sort name="defaultName" order="ascending"/>
  629. </xsl:when>
  630. <xsl:when test="$m_sort='na'">
  631. <cm:sort name="defaultName" order="ascending"/>
  632. </xsl:when>
  633. <xsl:when test="$m_sort='nd'">
  634. <cm:sort name="defaultName" order="descending"/>
  635. </xsl:when>
  636. <xsl:when test="$m_sort='ma'">
  637. <cm:sort name="modificationTime" order="ascending"/>
  638. </xsl:when>
  639. <xsl:when test="$m_sort='md'">
  640. <cm:sort name="modificationTime" order="descending"/>
  641. </xsl:when>
  642. <xsl:when test="$m_sort = 'ia'">
  643. <cm:sort name="objectClass" order="ascending"/>
  644. </xsl:when>
  645. <xsl:when test="$m_sort = 'id'">
  646. <cm:sort name="objectClass" order="descending"/>
  647. </xsl:when>
  648. <xsl:otherwise>
  649. <cm:sort name="defaultName"/>
  650. </xsl:otherwise>
  651. </xsl:choose>
  652. </cm:sortBy>
  653. <cm:properties>
  654. <!-- include the cml variables -->
  655. <cml:prop-base/>
  656. <cm:property name="documentType"/>
  657. <cm:property name="launchableType"/>
  658. <cm:property name="userName"/>
  659. <cm:property name="hasChildren"/>
  660. <cm:property name="position"/>
  661. <cm:property name="connectionString"/>
  662. <!-- If we are doing search or we're inside Alerts folder then request ancestors too -->
  663. <xsl:if test="/root/search/expression or ($browsingUserMyWatchItems and not(contains($m_path, '/rule')))">
  664. <cm:property name="ancestors"/>
  665. </xsl:if>
  666. <xsl:if test="$inDirectoryRoot">
  667. <cm:property name="active"/>
  668. </xsl:if>
  669. </cm:properties>
  670. <cm:options maxObjects="{($maxObjects)+1}" skipObjects="{$skipObjects}">
  671. <xsl:if test="$browsingUserMyFolder">
  672. <cm:refProps>
  673. <cm:refProp refPropName="target">
  674. <cm:properties>
  675. <cm:property name="searchPath"/>
  676. <cm:property name="defaultName"/>
  677. <cm:property name="defaultOutputFormat"/>
  678. <cm:property name="uri"/>
  679. <cm:property name="base"/>
  680. <cm:property name="format"/>
  681. <cm:property name="contentLocale"/>
  682. <cm:property name="permissions"/>
  683. <cm:property name="usage"/>
  684. <cm:property name="documentType"/>
  685. <cm:property name="launchableType"/>
  686. </cm:properties>
  687. </cm:refProp>
  688. <cm:refProp refPropName="base">
  689. <cm:properties>
  690. <cm:property name="searchPath"/>
  691. <cm:property name="permissions"/>
  692. <cm:property name="defaultOutputFormat"/>
  693. </cm:properties>
  694. </cm:refProp>
  695. </cm:refProps>
  696. </xsl:if>
  697. </cm:options>
  698. </cm:query>
  699. <!-- need to get the searchPath property of the namespace object if we're in the user, groups and roles tab and we're not searching -->
  700. <xsl:if test="($tool-tab='u' or $tool-tab='l') and not(/root/search/expression)">
  701. <xsl:choose>
  702. <xsl:when test="count(/root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo) = 1">
  703. <cm:query>
  704. <cm:search>
  705. <xsl:value-of select="$path"/>
  706. </cm:search>
  707. <cm:properties>
  708. <cm:property name="capabilities"/>
  709. <cm:property name="searchPath"/>
  710. <cm:property name="permissions"/>
  711. </cm:properties>
  712. </cm:query>
  713. </xsl:when>
  714. <xsl:when test="($tool-tab='u' or $tool-tab='l') and /root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[2]/*">
  715. <cm:query>
  716. <cm:search>
  717. <xsl:value-of select="/root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[2]/cm:searchPath"/>
  718. </cm:search>
  719. <cm:properties>
  720. <cm:property name="capabilities"/>
  721. <cm:property name="searchPath"/>
  722. <cm:property name="permissions"/>
  723. </cm:properties>
  724. </cm:query>
  725. </xsl:when>
  726. </xsl:choose>
  727. </xsl:if>
  728. </cm:requests>
  729. </cm:query>
  730. </xts:transform>
  731. </send:request>
  732. </xts:transform>
  733. </xsl:otherwise>
  734. </xsl:choose>
  735. </xts:append>
  736. </xsl:if>
  737. <!-- Reset m_newsearch to false, so next time the skipObjects will be set to 0.-->
  738. <xsl:if test="/root/env/param[@name = 'm_newsearch'] = 'true' ">
  739. <xts:replace select="/root/env/param[@name = 'm_newsearch']">
  740. <param name="m_newsearch">false</param>
  741. </xts:replace>
  742. </xsl:if>
  743. </xts:sequence>
  744. <!--<xts:sequence>
  745. <xts:delete select="/root/env/param[starts-with(@name, 'checkbox_')]"/>
  746. </xts:sequence>-->
  747. <xts:sequence>
  748. <xts:delete select="/root/env/param[@name='pagerfrom']"/>
  749. <xts:delete select="/root/env/param[@name='pagerto']"/>
  750. <xts:delete select="/root/env/param[@name='pagerfrom_d']"/>
  751. <xts:delete select="/root/env/param[@name='pagerto_d']"/>
  752. <xts:delete select="/root/env/param[@name='m_path']"/>
  753. <xts:delete select="/root/env/param[@name='tool_tab']"/>
  754. <xts:append select="/root/env">
  755. <param name="m_path">
  756. <xsl:choose>
  757. <xsl:when test="$tool-tab='u'">
  758. <xsl:value-of select="$m_path"/>
  759. </xsl:when>
  760. <xsl:otherwise>
  761. <xsl:value-of select="$path"/>
  762. </xsl:otherwise>
  763. </xsl:choose>
  764. </param>
  765. <param name="tool_tab">
  766. <xsl:value-of select="$tool-tab"/>
  767. </param>
  768. </xts:append>
  769. <xsl:call-template name="createNewAncestors"/>
  770. </xts:sequence>
  771. </xsl:template>
  772. <xsl:template name="createNewAncestors">
  773. <xsl:variable name="watchSearchPath">
  774. <xsl:value-of select="/root/path/*[local-name()='queryResponse']/*/cm:ancestors/cm:ancestorInfo[./cm:objectClass='subscriptionFolder']/cm:searchPath"/>
  775. </xsl:variable>
  776. <xsl:variable name="currentWatchSearchPath">
  777. <xsl:value-of select="/root/path/*[local-name()='queryResponse']/*/cm:searchPath"/>
  778. </xsl:variable>
  779. <xsl:variable name="currentDefaultName">
  780. <xsl:value-of select="/root/path/*[local-name()='queryResponse']/*/cm:defaultName"/>
  781. </xsl:variable>
  782. <xsl:variable name="countSubcriptionAncestors" select="count(/root/*[local-name()='path']/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[./cm:objectClass='subscriptionFolder'])"/>
  783. <xsl:variable name="countSubcriptionAncestorsNewPath" select="count(/root/*[local-name()='newPath']/*[local-name()='ancestors']/*[local-name()='ancestorInfo']/*[local-name()='objectClass' and .='subscriptionFolder'])"/>
  784. <xsl:variable name="watchItemLabel">
  785. <xsl:choose>
  786. <xsl:when test="$countSubcriptionAncestors and $countSubcriptionAncestors &gt; 0">
  787. <xts:string id="IDS_MYSUB_SUBSCRIPTIONS"/>
  788. </xsl:when>
  789. <xsl:otherwise>
  790. <xts:string id="IDS_MYSUB_ALERTS"/>
  791. </xsl:otherwise>
  792. </xsl:choose>
  793. </xsl:variable>
  794. <xsl:variable name="watchItemSearchPath">
  795. <xsl:choose>
  796. <!-- if the last element is an account then we are inside a the watch my item root -->
  797. <xsl:when test="/root/path/cm:queryResponse/*/cm:ancestors/*[last()]/*[local-name()='objectClass']='account'">
  798. <xsl:value-of select="$watchSearchPath"/>
  799. </xsl:when>
  800. <!-- If there are more then 1 subscriptionFolder then we're inside the Rule folder -->
  801. <xsl:when test="$countSubcriptionAncestors and $countSubcriptionAncestors &gt; 0">
  802. <xsl:value-of select="concat($watchSearchPath, '/rule')"/>
  803. </xsl:when>
  804. <!-- The alert is not a real folder... therefore we should under alert folder. -->
  805. <xsl:otherwise>
  806. <xsl:value-of select="concat($watchSearchPath, '/alert')"/>
  807. </xsl:otherwise>
  808. </xsl:choose>
  809. </xsl:variable>
  810. <xts:append select="/root">
  811. <newPath>
  812. <ancestors>
  813. <xsl:for-each select="/root/path/cm:queryResponse/*/cm:ancestors/*">
  814. <xsl:copy-of select="."/>
  815. <xsl:if test="$watchSearchPath != '' and $watchSearchPath = cm:searchPath">
  816. <xsl:element name="ancestorInfo" xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  817. <objectClass type="cm:classEnum">subscriptionFolder</objectClass>
  818. <searchPath>
  819. <xsl:value-of select="$watchItemSearchPath"/>
  820. </searchPath>
  821. <title>
  822. <xsl:value-of select="$watchItemLabel"/>
  823. </title>
  824. </xsl:element>
  825. </xsl:if>
  826. </xsl:for-each>
  827. <xsl:if test="contains($m_path, '/alert') or contains($m_path, '/rule')">
  828. <xsl:element name="ancestorInfo" xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  829. <objectClass type="cm:classEnum">subscriptionFolder</objectClass>
  830. <searchPath>
  831. <xsl:value-of select="$currentWatchSearchPath"/>
  832. </searchPath>
  833. <title><xsl:value-of select="$currentDefaultName"/></title>
  834. <addedItem>true</addedItem>
  835. </xsl:element>
  836. </xsl:if>
  837. </ancestors>
  838. <xsl:for-each select="/root/path/cm:queryResponse/*/*[local-name()!='ancestors']">
  839. <xsl:choose>
  840. <xsl:when test="(contains($m_path, '/alert') or contains($m_path, '/rule')) and local-name()='defaultName'">
  841. <defaultName>
  842. <xsl:choose>
  843. <xsl:when test="contains($m_path, '/rule')"><xts:string id="IDS_MYSUB_SUBSCRIPTIONS"/></xsl:when>
  844. <xsl:otherwise><xts:string id="IDS_MYSUB_ALERTS"/></xsl:otherwise>
  845. </xsl:choose>
  846. </defaultName>
  847. </xsl:when>
  848. <xsl:otherwise>
  849. <xsl:copy-of select="."/>
  850. </xsl:otherwise>
  851. </xsl:choose>
  852. </xsl:for-each>
  853. </newPath>
  854. </xts:append>
  855. </xsl:template>
  856. </xsl:stylesheet>
  857. </xts:block>
  858. <!-- Merge the tenantNames into the response -->
  859. <xts:block processor="XSLT" type="exec" mandatory="false"
  860. path="/portal/tenancy/mergeTenantNames.xslt"
  861. id="mergeTenantNames"
  862. dependency="getContent"
  863. condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
  864. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  865. </xts:block>
  866. <!--
  867. ===============================================================================================
  868. Load class names map
  869. ===============================================================================================
  870. -->
  871. <xts:block id="getClassNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  872. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  873. </xts:block>
  874. <!--
  875. ===============================================================================================
  876. Render the page
  877. ===============================================================================================
  878. -->
  879. <xts:block id="format" dependency="mergeTenantNames getClassNames" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  880. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  881. <xts:logicsheet path="logicsheets/toollogic.xslt"/>
  882. <!-- Cognos Central main behaviour logic -->
  883. <xts:logicsheet path="logicsheets/portal.xsl"/>
  884. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  885. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  886. <xts:logicsheet path="logicsheets/presentation/main/search.xsl"/>
  887. <!-- Cognos Central controls logic -->
  888. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  889. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  890. <!-- Generic logicsheets -->
  891. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  892. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  893. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  894. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  895. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:tool="http://developer.cognos.com/schemas/xts/logicsheets/xslt/toollogic/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" 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/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" exclude-result-prefixes="cml xts bus tool cm mt mf lyt dp cf cp utml xtsext pf">
  896. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  897. <!-- current file name -->
  898. <xsl:variable name="mname" select="'legacy_tools/tools_directory.xts'"/>
  899. <xsl:variable name="inDirectoryRoot" select="/root/path/cm:queryResponse/*/cm:objectClass/cm:value='directory'"/>
  900. <xsl:variable name="browsingUserMyFolder" select="/root/path/cm:queryResponse/*/cm:objectClass='account'"/>
  901. <xsl:variable name="browsingUserContent" select="/root/path/cm:queryResponse/*/cm:ancestors/*/cm:objectClass='account'"/>
  902. <xsl:variable name="insideCognosNamespace" select="(starts-with($m_path, &quot;CAMID(&apos;:&quot;) or starts-with($m_path, 'CAMID(&quot;:'))"/>
  903. <xsl:variable name="insideAccount" select="(/root/path/cm:queryResponse/*/cm:objectClass/cm:value='account') or (/root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo/cm:objectClass='account')"/>
  904. <xsl:variable name="userCanNotTraverse" select="not(contains(/root/path/cm:queryResponse/*/cm:permissions, 'traverse'))"/>
  905. <xsl:variable name="userCanNotWrite" select="not(contains(/root/path/cm:queryResponse/*/cm:permissions, 'write'))"/>
  906. <xsl:variable name="canBrowse3rdPartyNamespace" select="not(/root/system/param[@name='enable-3rdparty-namespace-browsing']='false')"/>
  907. <xsl:variable name="browsingUserMyWatchItems" select="/root/path/cm:queryResponse/*/cm:objectClass='subscriptionFolder' and /root/path/cm:queryResponse/*/cm:parent/*/cm:objectClass='account'"/>
  908. <xsl:variable name="insideROLAPDataSource" select="(/root/path/cm:queryResponse/*/cm:objectClass/cm:value='rolapDataSource') or (/root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo/cm:objectClass='rolapDataSource')"/>
  909. <xsl:variable name="insideROLAPModel" select="/root/path/cm:queryResponse/*/cm:objectClass/cm:value='model'"/>
  910. <cp:flyoutControl/>
  911. <!-- start the output -->
  912. <xsl:template match="/root">
  913. <xsl:variable name="tab">
  914. <xsl:choose>
  915. <xsl:when test="key('env-param','tool_tab') = 'd'"><xts:string id="IDS_DIRECTORY_DATASOURCE_TAB"/></xsl:when>
  916. <xsl:when test="key('env-param','tool_tab') = 'l'"><xts:string id="IDS_DIRECTORY_DISTRLIST_TAB"/></xsl:when>
  917. <xsl:otherwise><xts:string id="IDS_DIRECTORY_UGR_TAB"/></xsl:otherwise>
  918. </xsl:choose>
  919. </xsl:variable>
  920. <xsl:variable name="toolName"><xts:string id="IDS_TOOLS_DIRECTORY"/></xsl:variable>
  921. <tool:page formName="frmEntryAdmin" stateParams="m_path m_pathID m_section m_pagerfrom m_pagerto" hideHeaders="true">
  922. <tool:name>
  923. <xts:string id="IDS_TOOLS_TITLE">
  924. <xts:param name="toolTab"><xsl:value-of select="$tab"/></xts:param>
  925. <xts:param name="toolName"><xsl:value-of select="$toolName"/></xts:param>
  926. </xts:string>
  927. </tool:name>
  928. <tool:title>
  929. <xsl:value-of select="$toolName"/>
  930. </tool:title>
  931. <tool:regionLabel id="lbl_page_region">
  932. <xsl:value-of select="$tab"/>
  933. </tool:regionLabel>
  934. <xsl:if test="$inDirectoryRoot">
  935. <tool:script>
  936. function doDeleteOne(path, msg)
  937. {
  938. if (confirm(msg))
  939. {
  940. document.forms[frmEditForm].backURL.value = "<xsl:value-of select="xtsext:javascriptencode(string($back-url))"/>";
  941. document.forms[frmEditForm].ifrmcmd.value = "delete"; <!--set the operation, and submit it. -->
  942. document.forms[frmEditForm].m_obj.value = path;
  943. document.forms[frmEditForm].m.value = "<xsl:value-of select="$app"/>/submit.xts";
  944. document.forms[frmEditForm].submit();
  945. }
  946. else
  947. {
  948. return;
  949. }
  950. }
  951. </tool:script>
  952. <input type="hidden" name="m_obj" value=""/>
  953. </xsl:if>
  954. <tool:hideEditToolbarButtons test="not($browsingUserContent) and ($tool-tab='u' and not(starts-with($m_path, &quot;CAMID(&apos;:&quot;) or starts-with($m_path, 'CAMID(&quot;:')))"/>
  955. <tool:hideCopyToolbarButton test="$browsingUserContent"/>
  956. <tool:search mod="$tool-tab='u' and not(starts-with($m_path, &quot;CAMID(&apos;:&quot;) or starts-with($m_path, 'CAMID(&quot;:')) and not($browsingUserContent)">
  957. <mt:stypes>
  958. <xsl:choose>
  959. <xsl:when test="$tool-tab = 'u' and ($browsingUserContent or $browsingUserMyFolder)">
  960. <mt:stype name="interactiveReport"><xts:string id="IDS_OBJ_INTERACTIVEREPORT"/></mt:stype>
  961. <mt:stype name="analyticsPackage"><xts:string id="IDS_OBJ_AATOCPACKAGE"/></mt:stype>
  962. <mt:stype name="agentDefinition"><xts:string id="IDS_OBJ_AGENT"/></mt:stype>
  963. <mt:stype name="agentDefinitionView"><xts:string id="IDS_OBJ_AGENTVIEW"/></mt:stype>
  964. <mt:stype name="analysis"><xts:string id="IDS_OBJ_ANALYSIS"/></mt:stype>
  965. <mt:stype name="contentReference"><xts:string id="IDS_OBJ_MVC_CONTENT_REFERENCE"/></mt:stype> <!-- Not actual object type, returns Content Reference objects -->
  966. <mt:stype name="dataMovementTask"><xts:string id="IDS_OBJ_DATAMOVEMENTTASK"/></mt:stype>
  967. <mt:stype name="dataMovementTaskAlias"><xts:string id="IDS_OBJ_DATAMOVEMENTTASKALIAS"/></mt:stype>
  968. <mt:stype name="document"><xts:string id="IDS_OBJ_DOCUMENT"/></mt:stype>
  969. <mt:stype name="advisorView"><xts:string id="IDS_OBJ_LAUNCHABLE_ADVISOR_VIEW"/></mt:stype>
  970. <mt:stype name="advisorCanvas"><xts:string id="IDS_OBJ_LAUNCHABLE_ADVISOR_CANVAS"/></mt:stype>
  971. <mt:stype name="_folderAndSubscriptionFolder"><xts:string id="IDS_OBJ_FOLDER"/></mt:stype>
  972. <mt:stype name="cd"><xts:string id="IDS_OBJ_LAUNCHABLE_CD"/></mt:stype> <!-- Not actual object type, returns Cognos Insight objects -->
  973. <mt:stype name="jobDefinition"><xts:string id="IDS_OBJ_JOBDEFINITION"/></mt:stype>
  974. <mt:stype name="metricsExportTask"><xts:string id="IDS_OBJ_METRICSEXPORTTASK"/></mt:stype>
  975. <mt:stype name="metricsDataSourceETLTask"><xts:string id="IDS_OBJ_METRICSDATASOURCEETLTASK"/></mt:stype>
  976. <mt:stype name="metricsFileImportTask"><xts:string id="IDS_OBJ_METRICSFILEIMPORTTASK"/></mt:stype>
  977. <mt:stype name="metricsMaintenanceTask"><xts:string id="IDS_OBJ_METRICSMAINTENANCETASK"/></mt:stype>
  978. <mt:stype name="metricsPackage"><xts:string id="IDS_OBJ_METRICSPACKAGE"/></mt:stype> <!-- Not actual object type, package with userInterfaces for metrics manager-->
  979. <mt:stype name="package"><xts:string id="IDS_OBJ_PACKAGE"/></mt:stype>
  980. <mt:stype name="pagelet"><xts:string id="IDS_OBJ_PAGELET"/></mt:stype>
  981. <mt:stype name="planningPackage"><xts:string id="IDS_OBJ_PLANNING_PACKAGE"/></mt:stype> <!-- Not actual object type, package with userInterfaces for planning package-->
  982. <mt:stype name="planningTask"><xts:string id="IDS_OBJ_PLANNING_TASK"/></mt:stype>
  983. <mt:stype name="powerPlayCube"><xts:string id="IDS_OBJ_POWERPLAYCUBE"/></mt:stype>
  984. <mt:stype name="powerPlayReport"><xts:string id="IDS_OBJ_POWERPLAYREPORT"/></mt:stype>
  985. <mt:stype name="powerPlay8Report"><xts:string id="IDS_OBJ_POWERPLAY8REPORT"/></mt:stype>
  986. <mt:stype name="powerPlay8ReportView"><xts:string id="IDS_OBJ_POWERPLAY8REPORTVIEW"/></mt:stype>
  987. <mt:stype name="query"><xts:string id="IDS_OBJ_QUERY"/></mt:stype>
  988. <mt:stype name="report"><xts:string id="IDS_OBJ_REPORT"/></mt:stype>
  989. <mt:stype name="reportTemplate"><xts:string id="IDS_OBJ_REPORTTEMPLATE"/></mt:stype>
  990. <mt:stype name="reportView"><xts:string id="IDS_OBJ_REPORTVIEW"/></mt:stype>
  991. <mt:stype name="shortcut"><xts:string id="IDS_SHORTCUTS"/></mt:stype>
  992. <mt:stype name="reportDataServiceAgentDefinition"><xts:string id="IDS_OBJ_SUBSCRIPTION"/></mt:stype>
  993. <mt:stype name="URL"><xts:string id="IDS_OBJ_URL"/></mt:stype>
  994. <mt:stype name="TM1Package"><xts:string id="IDS_OBJ_TM1PACKAGE"/></mt:stype>
  995. <mt:stype name="dashboard"><xts:string id="IDS_OBJ_DASHBOARD"/></mt:stype>
  996. </xsl:when>
  997. <xsl:when test="$tool-tab = 'u'">
  998. <mt:stype name="namespaceFolder"><xts:string id="IDS_OBJ_NAMESPACEFOLDER"/></mt:stype>
  999. <mt:stype name="group"><xts:string id="IDS_OBJ_GROUP"/></mt:stype>
  1000. <mt:stype name="namespace"><xts:string id="IDS_OBJ_NAMESPACE"/></mt:stype>
  1001. <mt:stype name="role"><xts:string id="IDS_OBJ_ROLE"/></mt:stype>
  1002. <mt:stype name="account"><xts:string id="IDS_OBJ_ACCOUNT"/></mt:stype>
  1003. </xsl:when>
  1004. <xsl:when test="$tool-tab = 'd'">
  1005. <mt:stype name="dataSourceConnection"><xts:string id="IDS_OBJ_DATASOURCECONNECTION"/></mt:stype>
  1006. <mt:stype name="dataSource"><xts:string id="IDS_OBJ_DATASOURCE"/></mt:stype>
  1007. <mt:stype name="dataSourceSignon"><xts:string id="IDS_OBJ_DATASOURCESIGNON"/></mt:stype>
  1008. <mt:stype name="modelView"><xts:string id="IDS_OBJ_MODELVIEW"/></mt:stype>
  1009. </xsl:when>
  1010. <xsl:when test="$tool-tab = 'l'">
  1011. <mt:stype name="contact"><xts:string id="IDS_OBJ_CONTACT"/></mt:stype>
  1012. <mt:stype name="distributionList"><xts:string id="IDS_OBJ_DISTRIBUTIONLIST"/></mt:stype>
  1013. <mt:stype name="namespaceFolder"><xts:string id="IDS_OBJ_NAMESPACEFOLDER"/></mt:stype>
  1014. <mt:stype name="namespace"><xts:string id="IDS_OBJ_NAMESPACE"/></mt:stype>
  1015. </xsl:when>
  1016. </xsl:choose>
  1017. </mt:stypes>
  1018. <mt:scopes>
  1019. <mt:scope>fb</mt:scope>
  1020. <mt:scope>fo</mt:scope>
  1021. <xsl:if test="not($browsingUserContent) and not($browsingUserMyFolder)">
  1022. <mt:scope type="security">any</mt:scope>
  1023. </xsl:if>
  1024. </mt:scopes>
  1025. <mt:close-params>
  1026. <param>backURL</param>
  1027. <param>tool_tab</param>
  1028. <param>m_path</param>
  1029. <param>m_section</param>
  1030. </mt:close-params>
  1031. </tool:search>
  1032. <tool:pathSearch>
  1033. <xsl:choose>
  1034. <xsl:when test="$tool-tab='u' and /root/*[local-name()='path']/*[local-name()='queryResponse']/*[local-name()='subscriptionFolder']">
  1035. <cf:do-the-path-link>
  1036. <cf:param name="familytree">newPath/*[local-name()='ancestors']</cf:param>
  1037. <cf:param name="familymember">newPath/*[local-name()='defaultName']</cf:param>
  1038. <cf:param name="lastIsLink">true</cf:param>
  1039. <cf:param name="anchorpath">
  1040. <a>
  1041. <xsl:choose>
  1042. <xsl:when test="*[local-name()='title']">
  1043. <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'))"/><xsl:value-of select="concat('&amp;m_path=', xtsext:protect(xtsext:urlencode(string(cm:searchPath)),'url','searchPath','getdata'))"/><xsl:value-of select="concat('&amp;tool_tab=', $tool-tab)"/><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>
  1044. <xsl:value-of select="*[local-name()='title']"/>
  1045. </xsl:when>
  1046. <xsl:otherwise>
  1047. <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'))"/><xsl:value-of select="concat('&amp;m_path=', xtsext:protect(xtsext:urlencode(string(newPath/*[local-name()='searchPath'])),'url','searchPath','getdata'))"/><xsl:value-of select="concat('&amp;tool_tab=', $tool-tab)"/><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>
  1048. <xsl:value-of select="newPath/*[local-name()='defaultName']"/>
  1049. </xsl:otherwise>
  1050. </xsl:choose>
  1051. </a>
  1052. </cf:param>
  1053. </cf:do-the-path-link>
  1054. </xsl:when>
  1055. <xsl:otherwise>
  1056. <cf:do-the-path-link>
  1057. <cf:param name="familytree">path/cm:queryResponse/*/cm:ancestors</cf:param>
  1058. <cf:param name="familymember">path/cm:queryResponse/*/cm:defaultName</cf:param>
  1059. <cf:param name="lastIsLink">
  1060. <xsl:choose>
  1061. <xsl:when test="$canBrowse3rdPartyNamespace or $insideCognosNamespace or $insideAccount">true</xsl:when>
  1062. <xsl:otherwise>false</xsl:otherwise>
  1063. </xsl:choose>
  1064. </cf:param>
  1065. <cf:param name="anchorpath">
  1066. <xsl:choose>
  1067. <xsl:when test="$tool-tab!='u' and $tool-tab!='l' and /root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[1] = self::node()">
  1068. <xsl:value-of select="cm:title"/>
  1069. </xsl:when>
  1070. <xsl:otherwise>
  1071. <xsl:choose>
  1072. <xsl:when test="cm:title">
  1073. <a>
  1074. <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'))"/><xsl:value-of select="concat('&amp;m_path=', xtsext:protect(xtsext:urlencode(string(cm:searchPath)),'url','searchPath','getdata'))"/><xsl:value-of select="concat('&amp;tool_tab=', $tool-tab)"/><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>
  1075. <xsl:value-of select="cm:title"/>
  1076. </a>
  1077. </xsl:when>
  1078. <xsl:when test="$canBrowse3rdPartyNamespace or $insideCognosNamespace or $insideAccount">
  1079. <a>
  1080. <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'))"/><xsl:value-of select="concat('&amp;m_path=', xtsext:protect(xtsext:urlencode(string(path/cm:queryResponse/*/cm:searchPath)),'url','searchPath','getdata'))"/><xsl:value-of select="concat('&amp;tool_tab=', $tool-tab)"/><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>
  1081. <xsl:value-of select="path/cm:queryResponse/*/cm:defaultName"/>
  1082. </a>
  1083. </xsl:when>
  1084. <xsl:otherwise>
  1085. <xsl:value-of select="path/cm:queryResponse/*/cm:defaultName"/>
  1086. </xsl:otherwise>
  1087. </xsl:choose>
  1088. </xsl:otherwise>
  1089. </xsl:choose>
  1090. </cf:param>
  1091. </cf:do-the-path-link>
  1092. </xsl:otherwise>
  1093. </xsl:choose>
  1094. </tool:pathSearch>
  1095. <tool:tabs tabset-name="directory">
  1096. <xsl:value-of select="/root/env/param[@name='tool_tab']"/>
  1097. </tool:tabs>
  1098. <tool:path>
  1099. <xsl:choose>
  1100. <xsl:when test="$tool-tab='u' and /root/path/*[local-name()='queryResponse']/*[local-name()='subscriptionFolder']">
  1101. <cf:do-the-path-link>
  1102. <cf:param name="familytree">newPath/*[local-name()='ancestors']</cf:param>
  1103. <cf:param name="familymember">newPath/*[local-name()='defaultName']</cf:param>
  1104. <cf:param name="anchorpath">
  1105. <a>
  1106. <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'))"/><xsl:value-of select="concat('&amp;m_path=', xtsext:protect(xtsext:urlencode(string(cm:searchPath)),'url','searchPath','getdata'))"/><xsl:value-of select="concat('&amp;tool_tab=', $tool-tab)"/><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>
  1107. <xsl:value-of select="*[local-name()='title']"/>
  1108. </a>
  1109. </cf:param>
  1110. </cf:do-the-path-link>
  1111. </xsl:when>
  1112. <xsl:otherwise>
  1113. <cf:do-the-path-link>
  1114. <cf:param name="familytree">path/cm:queryResponse/*/cm:ancestors</cf:param>
  1115. <cf:param name="familymember">path/cm:queryResponse/*/cm:defaultName</cf:param>
  1116. <cf:param name="anchorpath">
  1117. <xsl:choose>
  1118. <xsl:when test="$tool-tab!='u' and $tool-tab!='l' and /root/path/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[1] = self::node()">
  1119. <xsl:value-of select="cm:title"/>
  1120. </xsl:when>
  1121. <xsl:otherwise>
  1122. <a>
  1123. <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'))"/><xsl:value-of select="concat('&amp;m_path=', xtsext:protect(xtsext:urlencode(string(cm:searchPath)),'url','searchPath','getdata'))"/><xsl:value-of select="concat('&amp;tool_tab=', $tool-tab)"/><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>
  1124. <xsl:value-of select="cm:title"/>
  1125. </a>
  1126. </xsl:otherwise>
  1127. </xsl:choose>
  1128. </cf:param>
  1129. </cf:do-the-path-link>
  1130. </xsl:otherwise>
  1131. </xsl:choose>
  1132. </tool:path>
  1133. <tool:actions>
  1134. <mt:toolbar cogadmin="true">
  1135. <xsl:choose>
  1136. <!-- The toolbar items below are only available inside the Cognos namespace. -->
  1137. <xsl:when test="not($insideROLAPDataSource) and $insideCognosNamespace and not($browsingUserContent) and not($browsingUserMyFolder)">
  1138. <!-- don't show the new printer and new dataSource icons when the user doesn't have write permissions to the Cognos namespace -->
  1139. <xsl:if test="not($insideROLAPDataSource)and ($tool-tab!='d' or $m_class != 'namespace' or contains(/root/path/cm:queryResponse/*/cm:permissions, 'write'))">
  1140. <mt:tool-group cogadmin="true">
  1141. <xsl:if test="$m_class != 'dataSource' and $m_class != 'dataSourceConnection' and $tool-tab != 'd'">
  1142. <xsl:choose>
  1143. <xsl:when test="$userCanNotWrite or $userCanNotTraverse">
  1144. <mt:tool cogadmin="true" name="new" disable="true" new-class="namespaceFolder"/>
  1145. </xsl:when>
  1146. <xsl:otherwise>
  1147. <mt:tool cogadmin="true" name="new" new-class="namespaceFolder"/>
  1148. </xsl:otherwise>
  1149. </xsl:choose>
  1150. </xsl:if>
  1151. <xsl:choose>
  1152. <xsl:when test="$tool-tab='u'">
  1153. <xsl:choose>
  1154. <xsl:when test="$userCanNotWrite or $userCanNotTraverse">
  1155. <mt:tool cogadmin="true" name="new" disable="true" new-class="group"/>
  1156. <mt:tool cogadmin="true" name="new" disable="true" new-class="role"/>
  1157. </xsl:when>
  1158. <xsl:otherwise>
  1159. <mt:tool cogadmin="true" name="new" new-class="group"/>
  1160. <mt:tool cogadmin="true" name="new" new-class="role"/>
  1161. </xsl:otherwise>
  1162. </xsl:choose>
  1163. </xsl:when>
  1164. <xsl:when test="$tool-tab='d'">
  1165. <xsl:choose>
  1166. <xsl:when test="$m_class='dataSource'">
  1167. <xsl:variable name="isExternalRepository" select="contains(/root/cm:queryResponse/cm:queryReply/cm:dataSourceConnection/cm:connectionString,'LOCAL;RP-CMIS-FILENET')"/>
  1168. <xsl:variable name="isDataSource" select="/root/cm:queryResponse/cm:queryReply/cm:dataSourceConnection/cm:connectionString"/>
  1169. <xsl:choose>
  1170. <xsl:when test="$userCanNotWrite or $userCanNotTraverse">
  1171. <mt:tool cogadmin="true" name="new" disable="true" new-class="dataSourceConnection"/>
  1172. </xsl:when>
  1173. <xsl:otherwise>
  1174. <xsl:choose>
  1175. <xsl:when test="$isExternalRepository">
  1176. <mt:tool cogadmin="true" name="new" new-class="dataSourceConnection" class-subType="application/externalRepository"/>
  1177. </xsl:when>
  1178. <xsl:when test="$isDataSource">
  1179. <mt:tool cogadmin="true" name="new" new-class="dataSourceConnection" class-subType="application/dataSource"/>
  1180. </xsl:when>
  1181. <xsl:otherwise>
  1182. <mt:tool cogadmin="true" name="new" new-class="dataSourceConnection"/>
  1183. </xsl:otherwise>
  1184. </xsl:choose>
  1185. </xsl:otherwise>
  1186. </xsl:choose>
  1187. </xsl:when>
  1188. <xsl:when test="$m_class='dataSourceConnection'">
  1189. <xsl:choose>
  1190. <xsl:when test="/root/path/cm:queryResponse/*/cm:credentialNamespaces[@nil='true'] or contains(/root/path/cm:queryResponse/cm:dataSourceConnection/cm:connectionString,';LOCAL;PC;')">
  1191. <xsl:variable name="isFileSystemExternalRepository" select="contains(/root/path/cm:queryResponse/cm:dataSourceConnection/cm:connectionString,';DRIVER_NAME=com.ibm.cognos.cm.fileSystemPlugin.FileSystemArchivePlugin')"/>
  1192. <xsl:variable name="isCMISExternalRepository" select="contains(/root/path/cm:queryResponse/cm:dataSourceConnection/cm:connectionString,';DRIVER_NAME=com.ibm.cognos.cm.CMISRepository.CMISRepositoryPlugin')"/>
  1193. <xsl:variable name="allowOneSignon">
  1194. <xsl:if test="$isCMISExternalRepository and count(/root/cm:queryResponse/cm:queryReply/cm:dataSourceSignon) &gt;= 1"><xsl:text>true</xsl:text></xsl:if>
  1195. </xsl:variable>
  1196. <xsl:choose>
  1197. <xsl:when test="$userCanNotWrite or $userCanNotTraverse or $isFileSystemExternalRepository or $allowOneSignon = 'true'">
  1198. <mt:tool cogadmin="true" name="new" disable="true" new-class="dataSourceSignon"/>
  1199. </xsl:when>
  1200. <xsl:otherwise>
  1201. <mt:tool cogadmin="true" name="new" new-class="dataSourceSignon"/>
  1202. </xsl:otherwise>
  1203. </xsl:choose>
  1204. </xsl:when>
  1205. <xsl:otherwise>
  1206. <td class="toolbarImageNormal" onmouseover="this.className = 'toolbarImageOver'" onmouseout="this.className = 'toolbarImageNormal'">
  1207. <img height="16" width="16" border="0">
  1208. <xsl:attribute name="src"><xsl:value-of select="concat($image_root,'action_new_signon_dis.gif')"/></xsl:attribute>
  1209. <xsl:attribute name="alt"><xts:string id="IDS_NEW_SIGNON_DISABLED"/></xsl:attribute>
  1210. </img>
  1211. </td>
  1212. </xsl:otherwise>
  1213. </xsl:choose>
  1214. </xsl:when>
  1215. <xsl:otherwise>
  1216. <xsl:choose>
  1217. <xsl:when test="$userCanNotWrite or $userCanNotTraverse">
  1218. <mt:tool cogadmin="true" name="new" disable="true" new-class="dataSource"/>
  1219. </xsl:when>
  1220. <xsl:otherwise>
  1221. <mt:tool cogadmin="true" name="new" new-class="dataSource"/>
  1222. </xsl:otherwise>
  1223. </xsl:choose>
  1224. </xsl:otherwise>
  1225. </xsl:choose>
  1226. </xsl:when>
  1227. <xsl:when test="$tool-tab='l'">
  1228. <xsl:choose>
  1229. <xsl:when test="$userCanNotWrite or $userCanNotTraverse">
  1230. <mt:tool cogadmin="true" name="new" disable="true" new-class="contact"/>
  1231. <mt:tool cogadmin="true" name="new" disable="true" new-class="distributionList"/>
  1232. </xsl:when>
  1233. <xsl:otherwise>
  1234. <mt:tool cogadmin="true" name="new" new-class="contact"/>
  1235. <mt:tool cogadmin="true" name="new" new-class="distributionList"/>
  1236. </xsl:otherwise>
  1237. </xsl:choose>
  1238. </xsl:when>
  1239. </xsl:choose>
  1240. </mt:tool-group>
  1241. </xsl:if>
  1242. <mt:tool-group cogadmin="true">
  1243. <xsl:if test="($tool-tab='d' and key('env-param','m_path') != 'CAMID(&quot;:&quot;)') or $tool-tab='l' or $tool-tab='u'">
  1244. <mt:tool cogadmin="true" name="cut"/>
  1245. <mt:tool cogadmin="true" name="copy"/>
  1246. <xsl:choose>
  1247. <xsl:when test="$m_class='dataSourceConnection'">
  1248. <xsl:choose>
  1249. <xsl:when test="/root/path/cm:queryResponse/*/cm:credentialNamespaces[@nil='true'] or contains(/root/path/cm:queryResponse/cm:dataSourceConnection/cm:connectionString,';LOCAL;PC;')">
  1250. <mt:tool cogadmin="true" name="paste" mode="tools"/>
  1251. </xsl:when>
  1252. <xsl:otherwise>
  1253. <td class="toolbarImageNormal" onmouseover="this.className = 'toolbarImageOver'" onmouseout="this.className = 'toolbarImageNormal'">
  1254. <img height="16" width="16" border="0">
  1255. <xsl:attribute name="src"><xsl:value-of select="concat($image_root,'action_paste_dis.gif')"/></xsl:attribute>
  1256. <xsl:attribute name="alt"><xts:string id="IDS_PASTE_SIGNON_DISABLED"/></xsl:attribute>
  1257. </img>
  1258. </td>
  1259. </xsl:otherwise>
  1260. </xsl:choose>
  1261. </xsl:when>
  1262. <xsl:otherwise>
  1263. <mt:tool cogadmin="true" name="paste" mode="tools"/>
  1264. </xsl:otherwise>
  1265. </xsl:choose>
  1266. </xsl:if>
  1267. <mt:tool cogadmin="true" name="delete" mode="tools"/>
  1268. </mt:tool-group>
  1269. </xsl:when>
  1270. <!-- when browsing a users my folders -->
  1271. <xsl:when test="($browsingUserContent and not($browsingUserMyWatchItems)) or contains($m_path, '/rule')">
  1272. <mt:tool-group cogadmin="true">
  1273. <mt:tool cogadmin="true" name="cut"/>
  1274. <mt:tool cogadmin="true" name="copy"/>
  1275. <mt:tool cogadmin="true" name="paste" mode="tools"/>
  1276. <mt:tool cogadmin="true" name="delete" mode="tools"/>
  1277. </mt:tool-group>
  1278. </xsl:when>
  1279. </xsl:choose>
  1280. <xsl:choose>
  1281. <xsl:when test="not(contains($m_path, '/alert'))">
  1282. <mt:tool-group cogadmin="true" lastgroup="true">
  1283. <!-- do not show this properties for rule as the folder does not exist -->
  1284. <xsl:if test="not($insideROLAPModel) and not(contains($m_path, '/rule'))">
  1285. <mt:tool cogadmin="true" name="parent_properties">
  1286. <tool-name>directory_properties</tool-name>
  1287. <request-path>/root/path/cm:queryResponse/*</request-path>
  1288. </mt:tool>
  1289. </xsl:if>
  1290. <!-- only show the edit user profile when at the root of the Cognos namespace -->
  1291. <xsl:if test="$tool-tab='u' and ($m_path=&quot;CAMID(&apos;:&apos;)&quot; or $m_path='CAMID(&quot;:&quot;)')">
  1292. <mt:tool cogadmin="true" name="defaultUserProfile"/>
  1293. </xsl:if>
  1294. <xsl:choose>
  1295. <xsl:when test="$userCanNotTraverse">
  1296. <mt:tool cogadmin="true" name="search" disable="true"/>
  1297. </xsl:when>
  1298. <xsl:otherwise>
  1299. <mt:tool cogadmin="true" name="search"/>
  1300. </xsl:otherwise>
  1301. </xsl:choose>
  1302. </mt:tool-group>
  1303. </xsl:when>
  1304. <!-- TODO: enable this action for alerts when the functionality is available -->
  1305. <!--xsl:when test="contains($m_path, '/alert')">
  1306. <mt:tool-group>
  1307. <xsl:choose>
  1308. <xsl:when test="$userCanNotTraverse">
  1309. <mt:tool cogadmin="true" name="removeMeAlert" disable="true"/>
  1310. </xsl:when>
  1311. <xsl:otherwise>
  1312. <mt:tool cogadmin="true" name="removeMeAlert" currentPath="{$m_path}"/>
  1313. </xsl:otherwise>
  1314. </xsl:choose>
  1315. </mt:tool-group>
  1316. </xsl:when-->
  1317. </xsl:choose>
  1318. </mt:toolbar>
  1319. </tool:actions>
  1320. <tool:contents>
  1321. <xsl:choose>
  1322. <!-- If no traverse permissions then just do not display the pager -->
  1323. <xsl:when test="$userCanNotTraverse">
  1324. <mt:objectNoneFound id="IDS_NO_TRAVERSE_CONTAINER"/>
  1325. </xsl:when>
  1326. <!-- 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 -->
  1327. <xsl:when test="not(/root/path/cm:queryResponse/*)">
  1328. <mt:containerNoAccess/>
  1329. </xsl:when>
  1330. <xsl:when test="$browsingUserContent or $browsingUserMyFolder">
  1331. <tool:browser virtualPage="true" useQueryReply="true" hideActions="true">
  1332. <tool:selectables>
  1333. <xsl:if test="$browsingUserContent">
  1334. <xsl:text>allObjects</xsl:text>
  1335. </xsl:if>
  1336. </tool:selectables>
  1337. <tool:containers>
  1338. <xsl:text>folder subscriptionFolder package</xsl:text>
  1339. </tool:containers>
  1340. <tool:columnHeaders session-name="s_dir">
  1341. <xsl:choose>
  1342. <xsl:when test="$browsingUserMyWatchItems and (not(contains($m_path, '/alert')))">
  1343. <cp:columnHeader width="20" id="columnHeader_1st"/>
  1344. </xsl:when>
  1345. <xsl:otherwise>
  1346. <cp:columnHeader width="20" sort="i" id="columnHeader_1st">
  1347. <cp:sortHref>
  1348. <xsl:value-of select="$back-url"/>&amp;m_s_dir=<xsl:text/>
  1349. <xsl:choose>
  1350. <xsl:when test="key('session-param', 's_dir') = 'ia' ">id</xsl:when>
  1351. <xsl:when test="key('session-param', 's_dir') = 'id' "/>
  1352. <xsl:otherwise>ia</xsl:otherwise>
  1353. </xsl:choose>
  1354. </cp:sortHref>
  1355. </cp:columnHeader>
  1356. </xsl:otherwise>
  1357. </xsl:choose>
  1358. <xsl:choose>
  1359. <xsl:when test="$browsingUserMyWatchItems and not(contains($m_path, '/alert'))">
  1360. <cp:columnHeader width="100%" id="columnHeader_name"><xts:string id="IDS_NAME"/></cp:columnHeader>
  1361. </xsl:when>
  1362. <xsl:when test="$browsingUserMyWatchItems and contains($m_path, '/alert')">
  1363. <cp:columnHeader width="100%" id="columnHeader_name">
  1364. <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text>&#160;</xsl:text><xts:string id="IDS_NAME"/><xsl:text/>
  1365. </cp:columnHeader>
  1366. </xsl:when>
  1367. <xsl:otherwise>
  1368. <cp:columnHeader width="100%" sort="n" id="columnHeader_name">
  1369. <cp:sortHref>
  1370. <xsl:value-of select="$back-url"/>&amp;m_s_dir=<xsl:text/>
  1371. <xsl:choose>
  1372. <xsl:when test="key('session-param', 's_dir') = 'na' ">nd</xsl:when>
  1373. <xsl:when test="key('session-param', 's_dir') = 'nd' "/>
  1374. <xsl:otherwise>na</xsl:otherwise>
  1375. </xsl:choose>
  1376. </cp:sortHref>
  1377. <xts:string id="IDS_NAME"/>
  1378. </cp:columnHeader>
  1379. </xsl:otherwise>
  1380. </xsl:choose>
  1381. <xsl:if test="not($browsingUserMyWatchItems) or contains($m_path, '/alert') or contains($m_path, '/rule')">
  1382. <cp:columnHeader sort="m" id="columnHeader_modified">
  1383. <cp:sortHref>
  1384. <xsl:value-of select="$back-url"/>&amp;m_s_dir=<xsl:text/>
  1385. <xsl:choose>
  1386. <xsl:when test="key('session-param', 's_dir') = 'ma' ">md</xsl:when>
  1387. <xsl:when test="key('session-param', 's_dir') = 'md' "/>
  1388. <xsl:otherwise>ma</xsl:otherwise>
  1389. </xsl:choose>
  1390. </cp:sortHref>
  1391. <xts:string id="IDS_MODIFIED"/>
  1392. </cp:columnHeader>
  1393. </xsl:if>
  1394. </tool:columnHeaders>
  1395. <tool:columnContents>
  1396. <cp:columnContent scope="row">
  1397. <!-- Render the path -->
  1398. <xsl:if test="$browsingUserMyWatchItems and contains($m_path, '/alert')">
  1399. <img width="20" height="16" align="absmiddle" src="{$skin_images}path.gif">
  1400. <xsl:attribute name="alt">
  1401. <xsl:variable name="object-start-at-path">
  1402. <xsl:if test="starts-with(cm:searchPath, '~') or starts-with(cm:searchPath,key('session-param', 'e_hp'))">
  1403. <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
  1404. </xsl:if>
  1405. <xsl:if test="starts-with(cm:searchPath,'/content')">
  1406. <xsl:value-of select="$defaultContentRoot"/>
  1407. </xsl:if>
  1408. </xsl:variable>
  1409. <cf:do-the-path-link>
  1410. <cf:param name="familytree">cm:ancestors</cf:param>
  1411. <cf:param name="familymember">cm:defaultName</cf:param>
  1412. <cf:param name="home"><xsl:value-of select="$object-start-at-path"/></cf:param>
  1413. </cf:do-the-path-link>
  1414. </xsl:attribute>
  1415. </img><xsl:text>&#160;</xsl:text>
  1416. </xsl:if>
  1417. <xsl:choose>
  1418. <xsl:when test="contains(concat(' ', $containers, ' '), concat(' ', cm:objectClass, ' ')) and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  1419. <a>
  1420. <xsl:attribute name="href"><xsl:call-template name="gen-url"/></xsl:attribute>
  1421. <xsl:value-of select="cm:defaultName"/>
  1422. <xsl:if test="cm:userName != ''">
  1423. <xsl:text> (</xsl:text>
  1424. <xsl:value-of select="cm:userName"/>
  1425. <xsl:text>)</xsl:text>
  1426. </xsl:if>
  1427. </a>
  1428. </xsl:when>
  1429. <xsl:when test="contains($hierarchy-objects, concat(' ', cm:objectClass, ' ')) and cm:hasChildren = 'true' and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  1430. <a>
  1431. <xsl:attribute name="href"><xsl:call-template name="gen-url"/></xsl:attribute>
  1432. <xsl:value-of select="cm:defaultName"/>
  1433. <xsl:if test="cm:userName != ''">
  1434. <xsl:text> (</xsl:text>
  1435. <xsl:value-of select="cm:userName"/>
  1436. <xsl:text>)</xsl:text>
  1437. </xsl:if>
  1438. </a>
  1439. </xsl:when>
  1440. <xsl:otherwise>
  1441. <xsl:value-of select="cm:defaultName"/>
  1442. <xsl:if test="cm:userName != ''">
  1443. <xsl:text> (</xsl:text>
  1444. <xsl:value-of select="cm:userName"/>
  1445. <xsl:text>)</xsl:text>
  1446. </xsl:if>
  1447. </xsl:otherwise>
  1448. </xsl:choose>
  1449. <!-- Render the disabled icon if this entry is disabled -->
  1450. <xsl:choose>
  1451. <xsl:when test="cm:disabled = 'true'">
  1452. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_disabled.gif">
  1453. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1454. </img>
  1455. </xsl:when>
  1456. <xsl:when test="cm:target/*/cm:disabled = 'true' or cm:base/*/cm:disabled = 'true'">
  1457. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_source_disabled.gif">
  1458. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1459. </img>
  1460. </xsl:when>
  1461. </xsl:choose>
  1462. <xsl:text>&#160;&#160;</xsl:text>
  1463. </cp:columnContent>
  1464. <xsl:if test="not($browsingUserMyWatchItems) or contains($m_path, '/alert') or contains($m_path, '/rule')">
  1465. <cp:columnContent>
  1466. <xsl:choose>
  1467. <xsl:when test="cm:modificationTime!=''">
  1468. <xsl:value-of select="xtsext:formatDateFromUTC(string(cm:modificationTime), number('2'), number('3'), string($timeZone), string($contentLocale))"/>
  1469. </xsl:when>
  1470. <xsl:otherwise>&#160;</xsl:otherwise>
  1471. </xsl:choose>
  1472. </cp:columnContent>
  1473. </xsl:if>
  1474. </tool:columnContents>
  1475. </tool:browser>
  1476. </xsl:when>
  1477. <xsl:when test="not(/root/cm:queryResponse/cm:queryReply[2]) or (/root/cm:queryResponse/cm:queryReply[2]/*/cm:capabilities/cm:string = 'sort')">
  1478. <tool:browser virtualPage="true" useQueryReply="true">
  1479. <tool:selectables>
  1480. <xsl:choose>
  1481. <xsl:when test="$tool-tab='u' and $insideCognosNamespace">
  1482. <xsl:text>namespaceFolder account group role</xsl:text>
  1483. </xsl:when>
  1484. <xsl:when test="$tool-tab='d'">
  1485. <xsl:text>namespaceFolder dataSource dataSourceConnection dataSourceSignon rolapDataSource rolapVirtualDataSource</xsl:text>
  1486. </xsl:when>
  1487. <xsl:when test="$tool-tab='l' and $insideCognosNamespace">
  1488. <xsl:text>namespaceFolder contact distributionList</xsl:text>
  1489. </xsl:when>
  1490. </xsl:choose>
  1491. </tool:selectables>
  1492. <tool:containers>
  1493. <xsl:text>namespaceFolder </xsl:text>
  1494. <xsl:choose>
  1495. <xsl:when test="$tool-tab='u' or $tool-tab='l'">
  1496. <xsl:text>namespace</xsl:text>
  1497. </xsl:when>
  1498. <xsl:when test="$tool-tab='d'">
  1499. <xsl:text>dataSource dataSourceConnection rolapDataSource model</xsl:text>
  1500. </xsl:when>
  1501. </xsl:choose>
  1502. </tool:containers>
  1503. <tool:hierarchy-objects>account group role</tool:hierarchy-objects>
  1504. <tool:columnHeaders session-name="s_dir">
  1505. <cp:columnHeader width="20" sort="i">
  1506. <cp:sortHref>
  1507. <xsl:value-of select="$back-url"/>&amp;m_s_dir=<xsl:text/>
  1508. <xsl:choose>
  1509. <xsl:when test="key('session-param', 's_dir') = 'ia' ">id</xsl:when>
  1510. <xsl:when test="key('session-param', 's_dir') = 'id' "/>
  1511. <xsl:otherwise>ia</xsl:otherwise>
  1512. </xsl:choose>
  1513. </cp:sortHref>
  1514. </cp:columnHeader>
  1515. <cp:columnHeader width="100%" sort="n" id="columnHeader_name">
  1516. <cp:sortHref>
  1517. <xsl:value-of select="$back-url"/>&amp;m_s_dir=<xsl:text/>
  1518. <xsl:choose>
  1519. <xsl:when test="key('session-param', 's_dir') = 'na' ">nd</xsl:when>
  1520. <xsl:when test="key('session-param', 's_dir') = 'nd' "/>
  1521. <xsl:otherwise>na</xsl:otherwise>
  1522. </xsl:choose>
  1523. </cp:sortHref>
  1524. <xts:string id="IDS_NAME"/>
  1525. </cp:columnHeader>
  1526. <xsl:choose>
  1527. <!-- The sorting on modified is not allowed for external namespaces -->
  1528. <xsl:when test="not(/root/cm:queryResponse/cm:queryReply[2]) or /root/cm:queryResponse/cm:queryReply[2]/*/cm:searchPath = 'CAMID(&quot;:&quot;)' or contains($m_path, '/alert') or contains($m_path, '/rule')">
  1529. <cp:columnHeader sort="m" id="columnHeader_modified">
  1530. <cp:sortHref>
  1531. <xsl:value-of select="$back-url"/>&amp;m_s_dir=<xsl:text/>
  1532. <xsl:choose>
  1533. <xsl:when test="key('session-param', 's_dir') = 'ma' ">md</xsl:when>
  1534. <xsl:when test="key('session-param', 's_dir') = 'md' "/>
  1535. <xsl:otherwise>ma</xsl:otherwise>
  1536. </xsl:choose>
  1537. </cp:sortHref>
  1538. <xts:string id="IDS_MODIFIED"/>
  1539. </cp:columnHeader>
  1540. </xsl:when>
  1541. <xsl:otherwise>
  1542. <cp:columnHeader id="columnHeader_modified">
  1543. <xts:string id="IDS_MODIFIED"/>
  1544. </cp:columnHeader>
  1545. </xsl:otherwise>
  1546. </xsl:choose>
  1547. <xsl:if test="$inDirectoryRoot">
  1548. <cp:columnHeader>
  1549. <xts:string id="IDS_DIRECTORY_ACTIVE"/>
  1550. </cp:columnHeader>
  1551. </xsl:if>
  1552. </tool:columnHeaders>
  1553. <tool:columnContents>
  1554. <cp:columnContent scope="row">
  1555. <xsl:choose>
  1556. <xsl:when test="contains(concat(' ', $containers, ' '), concat(' ', cm:objectClass, ' ')) and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  1557. <a>
  1558. <xsl:attribute name="href"><xsl:call-template name="gen-url"/></xsl:attribute>
  1559. <xsl:value-of select="cm:defaultName"/>
  1560. <xsl:if test="cm:userName != ''">
  1561. <xsl:text> (</xsl:text>
  1562. <xsl:value-of select="cm:userName"/>
  1563. <xsl:text>)</xsl:text>
  1564. </xsl:if>
  1565. </a>
  1566. </xsl:when>
  1567. <xsl:when test="contains($hierarchy-objects, concat(' ', cm:objectClass, ' ')) and cm:hasChildren = 'true' and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  1568. <a>
  1569. <xsl:attribute name="href"><xsl:call-template name="gen-url"/></xsl:attribute>
  1570. <xsl:value-of select="cm:defaultName"/>
  1571. <xsl:if test="cm:userName != ''">
  1572. <xsl:text> (</xsl:text>
  1573. <xsl:value-of select="cm:userName"/>
  1574. <xsl:text>)</xsl:text>
  1575. </xsl:if>
  1576. </a>
  1577. </xsl:when>
  1578. <xsl:otherwise>
  1579. <xsl:value-of select="cm:defaultName"/>
  1580. <xsl:if test="cm:userName != ''">
  1581. <xsl:text> (</xsl:text>
  1582. <xsl:value-of select="cm:userName"/>
  1583. <xsl:text>)</xsl:text>
  1584. </xsl:if>
  1585. </xsl:otherwise>
  1586. </xsl:choose>
  1587. <!-- Render the disabled icon if this entry is disabled -->
  1588. <xsl:choose>
  1589. <xsl:when test="cm:disabled = 'true'">
  1590. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_disabled.gif">
  1591. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1592. </img>
  1593. </xsl:when>
  1594. <xsl:when test="cm:target/*/cm:disabled = 'true' or cm:base/*/cm:disabled = 'true'">
  1595. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_source_disabled.gif">
  1596. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1597. </img>
  1598. </xsl:when>
  1599. </xsl:choose>
  1600. <xsl:text>&#160;&#160;</xsl:text>
  1601. </cp:columnContent>
  1602. <cp:columnContent>
  1603. <xsl:choose>
  1604. <xsl:when test="cm:modificationTime!=''">
  1605. <xsl:value-of select="xtsext:formatDateFromUTC(string(cm:modificationTime), number('2'), number('3'), string($timeZone), string($contentLocale))"/>
  1606. </xsl:when>
  1607. <xsl:otherwise>&#160;</xsl:otherwise>
  1608. </xsl:choose>
  1609. <xsl:text>&#160;&#160;</xsl:text>
  1610. </cp:columnContent>
  1611. <xsl:if test="$inDirectoryRoot">
  1612. <cp:columnContent>
  1613. <xsl:choose>
  1614. <xsl:when test="cm:active = 'true'">
  1615. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}active_namespace.gif">
  1616. <xsl:attribute name="alt"><xts:string id="IDS_DIRECTORY_ACTIVE"/></xsl:attribute>
  1617. </img>
  1618. </xsl:when>
  1619. <xsl:otherwise>&#160;</xsl:otherwise>
  1620. </xsl:choose>
  1621. </cp:columnContent>
  1622. </xsl:if>
  1623. </tool:columnContents>
  1624. <tool:columnFooters session-name="s_dir">
  1625. <cp:columnFooter width="100%" colspan="13" timezone="string(/root/user/param[@name='timeZoneID'])">
  1626. <!-- display the current timestamp -->
  1627. <xsl:variable name="time_now" select="xtsext:getCurrentDateTime(string(/root/user/param[@name='timeZoneID']))"/>
  1628. <xts:string id="IDS_LAST_UPDATED">
  1629. <xts:param name="time">
  1630. <xsl:value-of select="xtsext:formatDateFromUTC(string($time_now), number('2'), number('3'), '', string($contentLocale))"/>
  1631. </xts:param>
  1632. </xts:string>
  1633. </cp:columnFooter>
  1634. </tool:columnFooters>
  1635. <tool:row-actions>
  1636. <tool:action name="supportPropertiesAction" test="not(contains(' model modelView ', concat(' ',cm:objectClass,' ')))"/>
  1637. <tool:action name="supportPermissionsAction" test="cm:objectClass='modelView'"/>
  1638. <tool:action name="supportTestConnection"/>
  1639. <tool:action name="supportAllActionsAction" test="cm:objectClass!='model'"/>
  1640. <tool:action name="supportDeleteAction" test="cm:active='false'"/>
  1641. <tool:action name="supportCreateProfileAction" test="cm:modificationTime=''"/>
  1642. </tool:row-actions>
  1643. </tool:browser>
  1644. </xsl:when>
  1645. <xsl:otherwise>
  1646. <tool:browser virtualPage="true" useQueryReply="true">
  1647. <tool:selectables>
  1648. <xsl:text>namespaceFolder </xsl:text>
  1649. <xsl:choose>
  1650. <xsl:when test="$tool-tab='u'">
  1651. <xsl:text>account group role</xsl:text>
  1652. </xsl:when>
  1653. <xsl:when test="$tool-tab='l'">
  1654. <xsl:text>contact distributionList</xsl:text>
  1655. </xsl:when>
  1656. </xsl:choose>
  1657. </tool:selectables>
  1658. <tool:containers>
  1659. <xsl:text>namespaceFolder </xsl:text>
  1660. <xsl:choose>
  1661. <xsl:when test="$tool-tab='u'">
  1662. <xsl:text>namespace</xsl:text>
  1663. </xsl:when>
  1664. </xsl:choose>
  1665. </tool:containers>
  1666. <tool:hierarchy-objects>account group role</tool:hierarchy-objects>
  1667. <tool:columnHeaders>
  1668. <cp:columnHeader width="20">
  1669. </cp:columnHeader>
  1670. <cp:columnHeader width="100%" id="columnHeader_name">
  1671. <xts:string id="IDS_NAME"/>
  1672. </cp:columnHeader>
  1673. <cp:columnHeader id="columnHeader_modified">
  1674. <xts:string id="IDS_MODIFIED"/>
  1675. </cp:columnHeader>
  1676. <xsl:if test="$inDirectoryRoot">
  1677. <cp:columnHeader>
  1678. <xts:string id="IDS_DIRECTORY_ACTIVE"/>
  1679. </cp:columnHeader>
  1680. </xsl:if>
  1681. </tool:columnHeaders>
  1682. <tool:columnContents>
  1683. <cp:columnContent scope="row">
  1684. <xsl:choose>
  1685. <xsl:when test="contains(concat(' ', $containers, ' '), concat(' ', cm:objectClass, ' ')) and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  1686. <a>
  1687. <xsl:attribute name="href"><xsl:call-template name="gen-url"/></xsl:attribute>
  1688. <xsl:value-of select="cm:defaultName"/>
  1689. <xsl:if test="cm:userName != ''">
  1690. <xsl:text> (</xsl:text>
  1691. <xsl:value-of select="cm:userName"/>
  1692. <xsl:text>)</xsl:text>
  1693. </xsl:if>
  1694. </a>
  1695. </xsl:when>
  1696. <xsl:when test="contains($hierarchy-objects, concat(' ', cm:objectClass, ' ')) and cm:hasChildren = 'true' and contains(concat(' ', cm:permissions, ' '), ' traverse ')">
  1697. <a>
  1698. <xsl:attribute name="href"><xsl:call-template name="gen-url"/></xsl:attribute>
  1699. <xsl:value-of select="cm:defaultName"/>
  1700. <xsl:if test="cm:userName != ''">
  1701. <xsl:text> (</xsl:text>
  1702. <xsl:value-of select="cm:userName"/>
  1703. <xsl:text>)</xsl:text>
  1704. </xsl:if>
  1705. </a>
  1706. </xsl:when>
  1707. <xsl:otherwise>
  1708. <xsl:value-of select="cm:defaultName"/>
  1709. <xsl:if test="cm:userName != ''">
  1710. <xsl:text> (</xsl:text>
  1711. <xsl:value-of select="cm:userName"/>
  1712. <xsl:text>)</xsl:text>
  1713. </xsl:if>
  1714. </xsl:otherwise>
  1715. </xsl:choose>
  1716. <!-- Render the disabled icon if this entry is disabled -->
  1717. <xsl:choose>
  1718. <xsl:when test="cm:disabled = 'true'">
  1719. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_disabled.gif">
  1720. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1721. </img>
  1722. </xsl:when>
  1723. <xsl:when test="cm:target/*/cm:disabled = 'true' or cm:base/*/cm:disabled = 'true'">
  1724. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}state_source_disabled.gif">
  1725. <xsl:attribute name="alt"><xts:string id="IDS_DISABLED"/></xsl:attribute>
  1726. </img>
  1727. </xsl:when>
  1728. </xsl:choose>
  1729. <xsl:text>&#160;&#160;</xsl:text>
  1730. </cp:columnContent>
  1731. <cp:columnContent>
  1732. <xsl:choose>
  1733. <xsl:when test="cm:modificationTime!=''">
  1734. <xsl:value-of select="xtsext:formatDateFromUTC(string(cm:modificationTime), number('2'), number('3'), string($timeZone), string($contentLocale))"/>
  1735. </xsl:when>
  1736. <xsl:otherwise>&#160;</xsl:otherwise>
  1737. </xsl:choose>
  1738. <xsl:text>&#160;&#160;</xsl:text>
  1739. </cp:columnContent>
  1740. <xsl:if test="$inDirectoryRoot">
  1741. <cp:columnContent>
  1742. <xsl:choose>
  1743. <xsl:when test="cm:active = 'true'">
  1744. <img height="16" width="16" hspace="4" align="absmiddle" src="{$image_root}active_namespace.gif">
  1745. <xsl:attribute name="alt"><xts:string id="IDS_DIRECTORY_ACTIVE"/></xsl:attribute>
  1746. </img>
  1747. </xsl:when>
  1748. <xsl:otherwise>&#160;</xsl:otherwise>
  1749. </xsl:choose>
  1750. </cp:columnContent>
  1751. </xsl:if>
  1752. </tool:columnContents>
  1753. <tool:row-actions>
  1754. <tool:action name="supportPropertiesAction"/>
  1755. <tool:action name="supportTestConnection"/>
  1756. <tool:action name="supportAllActionsAction"/>
  1757. <tool:action name="supportDeleteAction" test="cm:active='false'"/>
  1758. <tool:action name="supportCreateProfileAction" test="cm:modificationTime=''"/>
  1759. </tool:row-actions>
  1760. </tool:browser>
  1761. </xsl:otherwise>
  1762. </xsl:choose>
  1763. </tool:contents>
  1764. </tool:page>
  1765. </xsl:template>
  1766. <!-- This will add the template that adjusts the URL for sorting. -->
  1767. <mf:tweak-url/>
  1768. <cp:tabControl/>
  1769. </xsl:stylesheet>
  1770. </xts:block>
  1771. <!--
  1772. =============================================
  1773. Output debug dump
  1774. =============================================
  1775. -->
  1776. <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">
  1777. <!-- get the debug logic sheet -->
  1778. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  1779. <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">
  1780. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  1781. <xsl:template match="/">
  1782. <dbg:dumpxml select="/root"/>
  1783. </xsl:template>
  1784. </xsl:stylesheet>
  1785. </xts:block>
  1786. </xts:morphlet>