properties_personal.xts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2013
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  13. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http" condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false"/>
  14. <!-- getTabs - Load object-specific property tabs map ===============================================-->
  15. <xts:block id="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
  16. <!--
  17. ===============================================================================================
  18. callMorphlet - Calls the appropriate morphlet using the passed in params which will return
  19. markup to be displayed or the expected results
  20. ===============================================================================================
  21. -->
  22. <xts:block
  23. id="callMorphlet"
  24. nodelist="requestParams,env, http, session, credential, cookies, header, user"
  25. processor="XSLT"
  26. type="exec"
  27. dependency="formlogic_init"
  28. condition=".[ /root/env/param[@name='controller_state'] != '' ]"
  29. mandatory="false">
  30. <xts:logicsheet path="logicsheets/portal.xsl"/>
  31. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  32. <xsl:stylesheet version="1.0"
  33. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  34. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  35. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  36. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  37. exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  38. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  39. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  40. <xsl:template match="/">
  41. <xts:sequence>
  42. <dlgctrl:XTS2Request>
  43. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  44. <dlgctrl:stackName>addEntriesStack</dlgctrl:stackName>
  45. <req-params:param name="defaultTarget">/portal/properties_personal.xts</req-params:param>
  46. <req-params:param name="titlePostfix"><xts:string id="IDS_PERS_TAB_GENERAL_CREDENTIAL"/></req-params:param>
  47. <req-params:param name="defaultSearchPath">/directory</req-params:param>
  48. <req-params:param name="showUsers">true</req-params:param>
  49. <req-params:param name="addEntriesUI">members</req-params:param>
  50. <req-params:param name="allowDuplicates">false</req-params:param>
  51. <req-params:param name="returnProperties">
  52. <req-params:property name="userName"/>
  53. </req-params:param>
  54. <req-params:param name="typeDialog">true</req-params:param>
  55. </dlgctrl:XTS2Request>
  56. </xts:sequence>
  57. </xsl:template>
  58. </xsl:stylesheet>
  59. </xts:block>
  60. <!--
  61. ===============================================================================================
  62. processReponse - Process the response from the callMorphlet block and either displays
  63. the markup or processes the results
  64. ===============================================================================================
  65. -->
  66. <xts:block
  67. id="processResponse"
  68. nodelist="output,http,env,system,user,morphletResponse,credential,cookies"
  69. path="/portal/addEntries/logicsheets/process_added_entries.xslt"
  70. processor="XSLT"
  71. dependency="callMorphlet"
  72. type="exec"
  73. condition=".[ /root/env/param[@name='controller_state'] != '' ]"
  74. mandatory="false">
  75. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  76. <xts:logicsheet path="logicsheets/portal.xsl"/>
  77. </xts:block>
  78. <!-- getContent - Load object properties ============================================================-->
  79. <xts:block id="getContent" processor="XSLT" type="exec" dependency="processResponse" condition=".[not(/root/mode='addEntries')]" mandatory="false">
  80. <xts:logicsheet path="portal/preferences/common/request/request.xslt"/>
  81. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  82. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  83. <xsl:stylesheet version="1.0"
  84. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  85. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  86. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  87. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  88. xmlns:rdr="http://developer.cognos.com/schemas/xts/rdr/"
  89. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  90. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  91. <xsl:template match="/root">
  92. <rdr:Requests>
  93. <rdr:Request type="personal" mode="properties">
  94. <rdr:searchPath>
  95. <xsl:value-of select="/root/env/param[@name='m_obj']"/>
  96. </rdr:searchPath>
  97. </rdr:Request>
  98. <rdr:Request type="credentials" mode="properties">
  99. <rdr:searchPath>
  100. <xsl:value-of select="concat(string(/root/env/param[@name='m_obj']), '/credential')"/>
  101. </rdr:searchPath>
  102. </rdr:Request>
  103. </rdr:Requests>
  104. </xsl:template>
  105. </xsl:stylesheet>
  106. </xts:block>
  107. <!--
  108. genDisplayList:
  109. Queries CM for the details of every securityObject found in the credential
  110. object's policy list. The results are used to list credential objects.
  111. -->
  112. <xts:block id="genDisplayList" path="/portal/preferences/common/request/credentials/list.xslt" type="exec" mode="interpret" processor="XSLT" dependency="getContent" mandatory="false"
  113. condition=".[not(/root/mode='addEntries') and /root/*[local-name() = 'queryResponse']/*[2][local-name() = 'queryReply']/*[local-name() = 'credential']/*]">
  114. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  115. </xts:block>
  116. <!-- editCredentialList: Handles add, remove commands -->
  117. <xts:block id="editCredentialList" path="/portal/preferences/common/request/credentials/edit.xslt" mode="interpret" type="exec" processor="XSLT" dependency="genDisplayList" condition=".[not(/root/mode='addEntries')]" mandatory="false"/>
  118. <!-- encodeCredentialList -->
  119. <xts:block id="encodeCredentialList" path="/portal/preferences/common/request/credentials/encode.xslt" type="exec" mode="interpret" processor="XSLT" dependency="editCredentialList" mandatory="false" condition=".[not(/root/mode='addEntries') and /root/list/*]">
  120. <xts:logicsheet path="logicsheets/portal.xsl"/>
  121. </xts:block>
  122. <!-- format - render the final output ===============================================================-->
  123. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init getContent getTabs encodeCredentialList" condition=".[not(/root/mode='addEntries')]" mandatory="false">
  124. <xts:logicsheet path="portal/preferences/common/response/personal.xslt"/>
  125. <xts:logicsheet path="logicsheets/portal.xsl"/>
  126. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  127. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  128. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  129. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  130. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  131. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  132. <xts:logicsheet path="logicsheets/formlogic_lite.xslt"/>
  133. <xts:logicsheet path="logicsheets/validation.xslt"/>
  134. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  135. <xsl:stylesheet version="1.0"
  136. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  137. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  138. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  139. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  140. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  141. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  142. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  143. xmlns:st="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/specializetabs/"
  144. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  145. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  146. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  147. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  148. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  149. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  150. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  151. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb"
  152. exclude-result-prefixes="xsl cm cml df dp pf bus dc utml xts xtsext lyt st cf cp">
  153. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  154. <xsl:variable name="mname" select="'properties_personal.xts'"/>
  155. <xsl:variable name="user" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  156. <xsl:variable name="identity" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  157. <xsl:variable name="noUserProfile" select="$user/cm:modificationTime='' and key('env-param','m_obj')!='~'"/>
  158. <xsl:variable name="isNamedAccountReadOnly" select="(not(contains($user/cm:permissions,'write')) and ($is-named='1'))"/>
  159. <xsl:variable name="credentialExists" select="root/credential/cm:searchPath"/>
  160. <pf:variables/>
  161. <pf:modalVariables/>
  162. <xsl:template match="/root">
  163. <xsl:variable name="has_read_permission" select="contains(concat(' ', $user/cm:permissions, ' '), ' read ')"/>
  164. <xsl:variable name="has_traverse_permission" select="contains(concat(' ', $user/cm:permissions, ' '), ' traverse ')"/>
  165. <xsl:variable name="has_write_permission" select="contains(concat(' ', $user/cm:permissions, ' '), ' write ')"/>
  166. <xsl:variable name="has_policy_permission" select="contains(concat(' ', $user/cm:permissions, ' '), ' setPolicy ')"/>
  167. <xsl:variable name="showOKCancel" select="($has_write_permission or $has_policy_permission) and $noUserProfile!=true()"/>
  168. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  169. <xsl:variable name="isAccount" select="$the-object/cm:objectClass = 'account'"/>
  170. <xsl:variable name="theObjectName">
  171. <xsl:choose>
  172. <xsl:when test="key('env-param','m_name')!=''"><xsl:value-of select="key('env-param','m_name')"/></xsl:when>
  173. <xsl:otherwise><xsl:value-of select="$the-object/*[local-name()='defaultName']"/></xsl:otherwise>
  174. </xsl:choose>
  175. </xsl:variable>
  176. <xsl:variable name="browserTitle"><xts:string id="IDS_PROPERTIES_TITLE"><xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="$theObjectName"/></span></xts:param></xts:string></xsl:variable>
  177. <xsl:variable name="showDataSourceCredentialsSection" select="$isAccount and $has_read_permission and $has_traverse_permission"/>
  178. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  179. <dp:meta>
  180. <pf:meta/>
  181. </dp:meta>
  182. <dp:script>
  183. <pf:help context="HID_PERSONALIZE"/>
  184. <!-- Need to statically include js file for IE -->
  185. <script src="{$webRoot}/fragments/fragments.js"/>
  186. <script src="{$webRoot}/ps/j2html/js/j2html.js"/>
  187. <script src="{$webRoot}/ps/cogadmin/js/extension/DataSourceCredentials.js"/>
  188. <script src="{$webRoot}/ps/cogadmin/js/fragmentEmbedder.js"/>
  189. <script language="javascript">
  190. function init()
  191. {
  192. if (document.pform.controller_state)
  193. {
  194. document.pform.controller_state.value = '';
  195. }
  196. }
  197. var fragDef = {};
  198. fragDef.gateway = "<xsl:value-of select="xtsext:javascriptencode($gateway)"/>";
  199. fragDef.webRoot = "<xsl:value-of select="xtsext:javascriptencode($webRoot)"/>";
  200. fragDef.skinRoot = "<xsl:value-of select="xtsext:javascriptencode($skin_root)"/>";
  201. var fragmentEmbedder = new FragmentEmbedder(fragDef);
  202. </script>
  203. </dp:script>
  204. <utml:form name="pform" method="post" action="{$gateway}">
  205. <utml:read-only><xsl:value-of select="$isNamedAccountReadOnly"/></utml:read-only>
  206. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  207. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  208. <utml:input type="hidden" name="m_dataSourceCredentialsToDelete" utml:update="true"/>
  209. <dp:header useBackURL="not($showOKCancel)">
  210. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  211. </dp:header>
  212. <df:propertiesTabs select="personal">
  213. <df:hasSetPolicy>
  214. <xsl:choose>
  215. <xsl:when test="$noUserProfile"><xsl:value-of select="'false'"/></xsl:when>
  216. <xsl:otherwise><xsl:value-of select="$has_policy_permission"/></xsl:otherwise>
  217. </xsl:choose>
  218. </df:hasSetPolicy>
  219. <df:hasUserProfile>
  220. <xsl:if test="$noUserProfile"><xsl:value-of select="'false'"/></xsl:if>
  221. </df:hasUserProfile>
  222. </df:propertiesTabs>
  223. <!-- Body -->
  224. <rdb:preferences mode="properties"/>
  225. <xsl:if test="$has_read_permission and $has_traverse_permission">
  226. <script>
  227. var paramInfo = {};
  228. paramInfo.userPath = "<xsl:value-of select="xtsext:javascriptencode(key('env-param','m_obj'))"/>";
  229. paramInfo.htmlForm = pform;
  230. paramInfo.canWrite = "<xsl:value-of select="$has_write_permission"/>";
  231. var dsParams = com.cognos.admin.extension.DataSourceCredentials.generateDataSourceParams(paramInfo);
  232. fragmentEmbedder.embed('/fragmentproducer/cogadmin/userpreferences/datasourcecredentials','datasourceCredententialsFrag',dsParams);
  233. fragmentEmbedder.loadFragments(true);
  234. </script>
  235. </xsl:if>
  236. <dp:footer>
  237. <xsl:choose>
  238. <xsl:when test="$showOKCancel">
  239. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  240. <xsl:choose>
  241. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  242. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  243. </xsl:when>
  244. <xsl:otherwise>
  245. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  246. </xsl:otherwise>
  247. </xsl:choose>
  248. </xsl:when>
  249. <xsl:otherwise>
  250. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  251. </xsl:otherwise>
  252. </xsl:choose>
  253. </dp:footer>
  254. </utml:form>
  255. </dp:page>
  256. </xsl:template>
  257. <pf:gen-icon/>
  258. </xsl:stylesheet>
  259. </xts:block>
  260. <!--
  261. ===============================================================================================
  262. debug - display debug information
  263. ===============================================================================================
  264. -->
  265. <xts:block id="debug" dependency="format processResponse" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  266. <!-- get the debug logic sheet -->
  267. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  268. <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">
  269. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  270. <xsl:template match="/">
  271. <dbg:dumpxml select="/root"/>
  272. </xsl:template>
  273. </xsl:stylesheet>
  274. </xts:block>
  275. </xts:morphlet>