123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseAdministrationPortal">
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
-
- <!-- Load object-specific property tabs map ============================================================== -->
- <xts:block id="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
- <!--
- ===============================================================================================
- callMorphlet - Calls the appropriate morphlet using the passed in params which will return
- markup to be displayed or the expected results
- ===============================================================================================
- -->
- <xts:block
- id="callMorphlet"
- nodelist="requestParams,env, http, session, credential, cookies, header, user"
- processor="XSLT"
- type="exec"
- condition=".[ /root/env/param[@name='controller_state'] != '' ]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:req-params="http://developer.cognos.com/schemas/request/params"
- exclude-result-prefixes="xsl dlgctrl xtsext req-params">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:variable name="object-class">
- <xsl:choose>
- <xsl:when test="key('env-param','m_new_class') != ''">
- <xsl:value-of select="key('env-param','m_new_class')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','m_class')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:template match="/">
- <xts:sequence>
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
- <dlgctrl:stackName>addEntriesStack</dlgctrl:stackName>
- <req-params:param name="defaultTarget">/portal/properties_members.xts</req-params:param>
- <req-params:param name="titlePostfix">
- <xsl:choose>
- <xsl:when test="key('env-param','m_new_class')='group'">
- <xts:string id="IDS_ADDENTRIES_TITLE_NEW_GROUP"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_new_class')='role'">
- <xts:string id="IDS_ADDENTRIES_TITLE_NEW_ROLE"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_new_class')='distributionList'">
- <xts:string id="IDS_ADDENTRIES_TITLE_NEW_DISTRIBUTION_LIST"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','m_name')"/>
- </xsl:otherwise>
- </xsl:choose>
- </req-params:param>
- <req-params:param name="defaultSearchPath">
- <xsl:text>/directory</xsl:text>
- <xsl:if test="key('env-param','m_class')='tenant'">
- <xsl:text>/tenants</xsl:text>
- </xsl:if>
- </req-params:param>
- <req-params:param name="showUsers"><xsl:value-of select="key('env-param','m_class')!='tenant'"/></req-params:param>
- <req-params:param name="typeDialog"><xsl:value-of select="key('env-param','m_class')!='tenant'"/></req-params:param>
- <req-params:param name="addEntriesUI">
- <xsl:choose>
- <xsl:when test="$object-class = 'distributionList'">
- <xsl:value-of select="'recipients_distribution'"/>
- </xsl:when>
- <xsl:when test="$object-class = 'group'">
- <xsl:value-of select="'groupMembers'"/>
- </xsl:when>
- <xsl:when test="$object-class = 'role'">
- <xsl:value-of select="'members'"/>
- </xsl:when>
- <xsl:when test="$object-class = 'tenant'">
- <xsl:value-of select="'tenantMembers'"/>
- </xsl:when>
- </xsl:choose>
- </req-params:param>
- <req-params:param name="returnProperties">
- <req-params:property name="userName"/>
- <req-params:property name="storeID"/>
- </req-params:param>
- </dlgctrl:XTS2Request>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- processReponse - Process the response from the callMorphlet block and either displays
- the markup or processes the results
- ===============================================================================================
- -->
- <xts:block
- id="processResponse"
- nodelist="output,http,env,system,user,morphletResponse,credential,cookies"
- path="/portal/addEntries/logicsheets/process_added_entries.xslt"
- processor="XSLT"
- dependency="callMorphlet"
- type="exec"
- condition=".[ /root/env/param[@name='controller_state'] != '' ]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
- <!--
- ===============================================================================================
- Create some morphlet variables.
- Since this morphlet is used both from the New Group/Role wizard and for the Members
- tab in the Properties dialog, these 2 variables help the morphlet make appropriate
- determinations.
- ===============================================================================================
- -->
- <xts:block id="create_morphlet_vars" dependency="processResponse formlogic_init" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/mode='addEntries')]" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="root">
- <xsl:variable name="in-wizard">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name = 'm_new_class'] != ''">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="object-class">
- <xsl:choose>
- <xsl:when test="$in-wizard = 'true'">
- <xsl:value-of select="/root/env/param[@name = 'm_new_class']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/env/param[@name = 'm_class']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="is-everyone">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='m_obj']='CAMID("::Everyone")'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="is-all-auth-users">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='m_obj']='CAMID("::All Authenticated Users")'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Append these variables in the input document. -->
- <xts:sequence>
- <xts:append>
- <morphlet>
- <variable name="in-wizard">
- <xsl:value-of select="$in-wizard"/>
- </variable>
- <variable name="object-class">
- <xsl:value-of select="$object-class"/>
- </variable>
- <variable name="is-everyone">
- <xsl:value-of select="$is-everyone"/>
- </variable>
- <variable name="is-all-auth-users">
- <xsl:value-of select="$is-all-auth-users"/>
- </variable>
- </morphlet>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
-
- <!--
- ===============================================================================================
- Get the "members" property from Content Manager or from the packed list (web64encoded)
-
- In either case the input document will resemble this:
- <root>
- <object>
- <queryResponse xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <role>
- <objectClass>role</objectClass>
- <defaultName>MarcRole</defaultName>
- <ancestors>
- <ancestorInfo>
- <searchPath>/directory</searchPath>
- <title>Directory</title>
- </ancestorInfo>
- <ancestorInfo>
- <searchPath>/directory/namespace[@defaultName='Cognos']</searchPath>
- <title>Cognos</title>
- </ancestorInfo>
- </ancestors>
- <members>
- <group>
- <objectClass>group</objectClass>
- <searchPath>/directory/namespace[@defaultName='Cognos']/group[@defaultName='Everyone']</searchPath>
- <ancestors>
- <ancestorInfo>
- <searchPath>/directory</searchPath>
- <title>Directory</title>
- </ancestorInfo>
- <ancestorInfo>
- <searchPath>/directory/namespace[@defaultName='Cognos']</searchPath>
- <title>Cognos</title>
- </ancestorInfo>
- </ancestors>
- </group>
- </members>
- </role>
- </queryResponse>
- </object>
- </root>
-
- ===============================================================================================
- -->
- <xts:block id="get_content" type="exec" mode="interpret" processor="XSLT" dependency="create_morphlet_vars" condition=".[not(/root/mode='addEntries')]">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="query-values" select="/root/env/param"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="$query-values[@name = 'm_p_members']">
- <xts:append>
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string($query-values[@name='m_p_members'])), true())" disable-output-escaping="yes"/>
- </xts:append>
- </xsl:when>
- <xsl:otherwise>
- <xts:append>
- <xsl:if test="/root/morphlet/variable[@name = 'in-wizard']='false'">
- <object>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <search>
- <xsl:value-of select="/root/env/param[@name = 'm_obj']"/>
- <xsl:text>[permission("read")]</xsl:text>
- </search>
-
- <xsl:variable name="memberProp">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='m_class']='tenant'">
- <xsl:text>tenantMembers</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>members</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <properties>
- <property name="searchPath"/>
- <property name="defaultName"/>
- <property name="{$memberProp}"/>
- <property name="permissions"/>
- <property name="iconURI"/>
- </properties>
- <options schemaInfo="true">
- <refProps>
- <refProp refPropName="{$memberProp}">
- <properties>
- <property name="defaultName"/>
- <property name="searchPath"/>
- <property name="ancestors"/>
- <property name="defaultScreenTip"/>
- <property name="userName"/>
- <property name="storeID"/>
- <property name="hidden"/>
- </properties>
- </refProp>
- </refProps>
- </options>
- </query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </object>
- </xsl:if>
- <list/>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
-
- <xts:delete select="/root/env/param[@name='pagerfrommembers']"/>
- <xts:delete select="/root/env/param[@name='pagertomembers']"/>
- <xts:delete select="/root/env/param[@name='pagerfrom_dmembers']"/>
- <xts:delete select="/root/env/param[@name='pagerto_dmembers']"/>
-
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- copy_members
-
- Copy the members from /root/object/cm:queryResponse//cm:members to /root/list
- ===============================================================================================
- -->
- <xts:block id="copy_members" dependency="get_content" type="exec" mode="interpret" processor="XML" condition=".[not(/root/mode='addEntries') and /root/morphlet/variable[@name='in-wizard']='false' and not(/root/env/param[@name = 'm_p_members'])]" mandatory="false">
- <xts:sequence>
- <xts:append select="/root/list">
- <xts:queryNode select="/root/object//*[(local-name()='members' or local-name()='tenantMembers') and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/']/*"/>
- </xts:append>
- <xts:delete select="/root/object//*[(local-name()='members' or local-name()='tenantMembers') and namespace-uri()='http://developer.cognos.com/schemas/xts-cm/1/']/*"/>
- </xts:sequence>
- </xts:block>
- <!--
- ===============================================================================================
- execute_command
-
- Execute the operation: delete, additems_
- ===============================================================================================
- -->
- <xts:block id="execute_command" dependency="copy_members" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/mode='addEntries')]">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:x="x">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="query-values" select="/root/env/param"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="$query-values[@name='listop']='delete'">
- <xsl:for-each select="/root/env/param[starts-with(@name,'members_chk_')]">
- <xsl:variable name="storeID">
- <xsl:value-of select="."/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="/root/list/*[*[local-name()='storeID']=$storeID][x:added]">
- <!-- Since this was a newly added entry, just remove from the list. -->
- <xts:delete select="/root/list/*[*[local-name()='storeID']='{$storeID}']"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- For entries that were already in the list, simply append a deleted marker. -->
- <xts:append select="/root/list/*[*[local-name()='storeID']='{$storeID}']">
- <xsl:element name="x:deleted" namespace="x"/>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xts:delete select="/root/env/param[starts-with(@name, 'members_chk_')]"/>
- </xsl:when>
- <xsl:when test="/root/newEntries">
- <xsl:variable name="operations">
- <xsl:for-each select="/root/newEntries/*">
- <xsl:variable name="storeID" select="*[local-name()='storeID']"/>
- <xsl:choose>
- <xsl:when test="not(*[local-name()='storeID'] = /root/list/*/*[local-name()='storeID'])">
- <xts:append select="/root/list">
- <xsl:element name="{local-name()}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="*"/>
- <xsl:element name="x:added" namespace="x"/>
- </xsl:element>
- </xts:append>
- </xsl:when>
- <xsl:when test="/root/list/*[*[local-name()='storeID'] = $storeID]/x:deleted">
- <xts:delete select="/root/list/*[*[local-name()='storeID']='{$storeID}']/*[local-name() = 'deleted']"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:append select="/root">
- <duplicateEntry/>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:if test="$operations">
- <xts:sequence>
- <xsl:copy-of select="$operations"/>
- <!-- Remove this node after we're done with it. -->
- <xts:delete select="/root/newEntries"/>
- </xts:sequence>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- encode_list
-
- Serialize the data (web64 encoded)
- ===============================================================================================
- -->
- <xts:block id="encode_list" dependency="execute_command" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/mode='addEntries')]">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="in-wizard" select="/root/morphlet/variable[@name = 'in-wizard']"/>
- <xsl:variable name="xtscm" select="'http://developer.cognos.com/schemas/xts-cm/1/'"/>
- <pf:serialize-xml/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:delete select="/root/env/param[@name = 'm_p_members']"/>
- <xts:append select="/root/env">
- <xsl:variable name="markup">
- <xsl:apply-templates mode="markup" select="/root/list | /root/object"/>
- </xsl:variable>
- <param name="m_p_members">
- <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport),xtsext:web64encode(string($markup), true()))"/>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- getObjects - get object class names
- ===============================================================================================
- -->
- <xts:block id="classNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
- <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
- </xts:block>
-
- <!--
- ===============================================================================================
- Render the HTML page
- ===============================================================================================
- -->
- <xts:block id="renderPage" dependency="encode_list formlogic_init getTabs classNames" mode="output" processor="XSLT" type="exec" mimeType="text/html" condition=".[not(/root/mode='addEntries')]">
- <!-- portal specific information -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <!-- Get the new theme framework. -->
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
- <!-- apply the form logic -->
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <!-- Prevent the href from appearing in the status bar. -->
- <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- 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:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:x="x"
- xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
- exclude-result-prefixes="xsl lyt dp dc pf df cp cf cm utml xtsext x dt xts bus">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <!-- current file name -->
- <xsl:variable name="mname" select="'properties_members.xts'"/>
- <xsl:variable name="m_class" select="/root/morphlet/variable[@name = 'object-class']"/>
- <xsl:variable name="in-wizard" select="/root/morphlet/variable[@name = 'in-wizard']"/>
- <xsl:variable name="is-everyone" select="/root/morphlet/variable[@name='is-everyone']='true'"/>
- <xsl:variable name="is-all-auth-users" select="/root/morphlet/variable[@name='is-all-auth-users']='true'"/>
- <!-- add any theme variables -->
- <pf:variables/>
- <xsl:variable name="back-url" select="key('env-param','backURL')"/>
- <pf:gen-icon/>
- <!-- start the output -->
- <xsl:template match="root">
- <xsl:variable name="the-object" select="/root/object/cm:queryResponse/child::*[position() = 1]"/>
- <xsl:variable name="theObjectName">
- <xsl:choose>
- <xsl:when test="key('env-param','m_name')!=''"><xsl:value-of select="key('env-param','m_name')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$the-object/*[local-name()='defaultName']"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="wizardTitle">
- <xsl:choose>
- <xsl:when test="key('env-param','m_new_class')='distributionList'">
- <xts:string id="IDS_NEW_DISTRIBUTION_LIST_TITLE"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_new_class')='role'">
- <xts:string id="IDS_NEW_COGNOS_ROLE_TITLE"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_new_class')='group'">
- <xts:string id="IDS_NEW_COGNOS_GROUP_TITLE"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="browserTitle">
- <xsl:choose>
- <xsl:when test="$in-wizard != 'true' and $theObjectName!=''">
- <xts:string id="IDS_PROPERTIES_TITLE"><xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="$theObjectName"/></span></xts:param></xts:string>
- </xsl:when>
- <xsl:when test="$in-wizard = 'true'">
- <xts:string id="IDS_NEW_TITLE_MEMBERS"><xts:param name="wizardTitle"><xsl:value-of select="$wizardTitle"/></xts:param></xts:string>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_PROPERTIES"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"/>
- <!-- Page and title -->
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
- <dp:meta>
- <pf:meta/>
- <!-- Standard meta tags -->
- </dp:meta>
- <dp:script>
- <!-- Help system -->
- <pf:help context="HID_USERS_GROUPS_ROLES"/>
- <!-- Define selectall and deselectall functions.-->
- <dc:confirm-cancel/>
-
- <script language="javascript">
- function init()
- {
- if (document.pform.controller_state)
- {
- document.pform.controller_state.value = '';
- }
- }
- function doBMTCancel()
- {
- window.external.OnClose(1);
- }
- <xsl:if test="key('env-param','m_obj') = 'CAMID("::System Administrators")'">
- function validateDelete()
- {
- frm = document.pform;
- memberCount = <xsl:value-of select="count(/root/list/*[not(x:deleted)])"/>;
- pagerSize = <xsl:text/>
- <xsl:choose>
- <xsl:when test="key('session-param','linesPerPage')!=''">
- <xsl:value-of select="key('session-param','linesPerPage')"/>;
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>;
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- if we're not on page 1 -->
- if (frm.m_memberspage > 1)
- return true;
-
- <!-- if we have more members then the size of the pager, then we have multiple pages -->
- if (memberCount > pagerSize)
- return true;
-
- <!-- get the number of members that were selected to be deleted -->
- i=0;
- checkedCount = 0;
- while (frm[i])
- {
- if (frm[i].name.indexOf("members_chk_") != -1)
- {
- if (frm[i].checked)
- {
- checkedCount++;
- }
-
- }
- i++;
- }
-
- if (checkedCount >= memberCount)
- {
- window.alert("<xts:string id="IDS_PROP_MEMBERS_DELETE_ERROR" encode="javascript"/>");
- return false;
- }
-
- return true;
- }
- </xsl:if>
- </script>
- </dp:script>
- <!--
- The value of this variable determines if the page is rendered in read-only mode.
- -->
- <xsl:variable name="has_policy_permission" select="contains(concat(' ', $the-object/cm:permissions, ' '), ' setPolicy ')"/>
- <xsl:variable name="has_write_permission">
- <xsl:choose>
- <xsl:when test="$the-object/cm:searchPath='CAMID("::Everyone")' or $the-object/cm:searchPath='CAMID("::All Authenticated Users")' or $the-object/cm:members/@modifiable='false' or (not(contains(concat(' ',$the-object/cm:permissions,' '),' write ')) and $in-wizard!='true')">
- <xsl:value-of select="'false'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'true'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="showOKCancel" select="$has_write_permission = 'true' or $has_policy_permission"/>
-
- <utml:form name="pform" action="{$gateway}" method="post">
- <!-- Determine if this form is read-only. -->
- <utml:read-only>
- <xsl:choose>
- <xsl:when test="$has_write_permission='true'">
- <xsl:text>false</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>true</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </utml:read-only>
- <!-- this defines the form command operation to be performed when all the collected properties are submitted. -->
- <utml:input type="hidden" name="ifrmcmd" utml:update="false">
- <utml:value>
- <xsl:choose>
- <xsl:when test="$in-wizard = 'true'">
- <xsl:text>create</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>save</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </utml:value>
- </utml:input>
- <utml:input type="hidden" name="m_class" utml:update="false">
- <utml:value>
- <xsl:value-of select="$m_class"/>
- </utml:value>
- </utml:input>
- <utml:input type="hidden" name="controller_state" value="" utml:update="false"/>
- <!-- Dialog header -->
- <xsl:if test="$in-wizard='true'">
- <dp:header>
- <!-- Header titles -->
- <dp:title>
- <xsl:copy-of select="$browserTitle"/>
- </dp:title>
- <!-- Only put the description in the header for the wizard. -->
- <dp:description headerBorder="true">
- <xts:string id="IDS_NEW_INTRO_MEMBERS"/>
- </dp:description>
- <dp:close>
- <xsl:choose>
- <xsl:when test="key('env-param','from_bmt')">
- <a href="javascript:doBMTCancel()">
- <dp:closeMarker/>
- </a>
- </xsl:when>
- <xsl:when test="(/root/env/param[@name = 'ps_nav_stack']) and not(/root/env/param[@name = 'ps_nav_stack'] = '') ">
- <utml:a utml:op="stack-down">
- <dp:closeMarker/>
- </utml:a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{$back-url}">
- <dp:closeMarker/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </dp:close>
- </dp:header>
- </xsl:if>
- <xsl:if test="$in-wizard != 'true'">
- <dp:header>
- <!-- Header titles -->
- <dp:title>
- <xsl:copy-of select="$browserTitle"/>
- </dp:title>
- <dp:close>
- <xsl:choose>
- <xsl:when test="key('env-param','from_bmt')">
- <a href="javascript:doBMTCancel()">
- <dp:closeMarker/>
- </a>
- </xsl:when>
- <xsl:when test="$showOKCancel and (/root/env/param[@name = 'ps_nav_stack']) and not(/root/env/param[@name = 'ps_nav_stack'] = '') ">
- <utml:a utml:op="stack-down">
- <dp:closeMarker/>
- </utml:a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{$back-url}">
- <dp:closeMarker/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </dp:close>
- </dp:header>
- <!-- Property tabs -->
- <df:propertiesTabs select="members">
- <df:hasSetPolicy><xsl:value-of select="$has_policy_permission"/></df:hasSetPolicy>
- </df:propertiesTabs>
- <!-- Tab description -->
- <dp:description>
- <xsl:choose>
- <xsl:when test="$is-everyone = true()">
- <xts:string id="IDS_PROP_MEMBERS_EVERYONE"/>
- </xsl:when>
- <xsl:when test="$is-all-auth-users = true()">
- <xts:string id="IDS_PROP_MEMBERS_ALL_AUTHENTICATED_USERS"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_NEW_INTRO_MEMBERS"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:description>
- </xsl:if>
- <xsl:if test="$is-everyone = false() and $is-all-auth-users = false()">
- <xsl:variable name="objectClassCount" select="count(/root/list/*[not(x:deleted)]/*[local-name()='objectClass'])"/>
- <xsl:if test="$objectClassCount > count(/root/list/*[not(x:deleted)]/*[(local-name()='defaultName' and .!='') or (local-name()='userName' and .!='')]) or $objectClassCount > count(/root/list/*[not(x:deleted)]/*[local-name()='ancestors' and .!=''])">
- <lyt:layout style="1" border="no">
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:text>
- <img width="32" height="32">
- <xsl:attribute name="src"><xsl:value-of select="concat($image_root,'msg_warning.gif')"/></xsl:attribute>
- <xsl:attribute name="alt"></xsl:attribute>
- </img>
- <xts:string id="IDS_PROP_MEMBERS_WARN_HIDDEN"/>
- </dp:text>
- </dp:section>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- </xsl:if>
- <xsl:variable name="width">
- <xsl:choose>
- <xsl:when test="$in-wizard='true'">70%</xsl:when>
- <xsl:otherwise>100%</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <lyt:layout style="1" border="no">
- <lyt:section>
- <utml:input type="hidden" name="listop" value="" utml:update="false"/>
- <utml:change name="changed_m_p_members" utml:update="false" utml:condition="count( /root/list/*/x:added | /root/list/*/x:deleted ) > 0"/>
- <cf:main-pager-section name="members" form="pform" width="{$width}" genDelete="yes">
- <cf:param name="item-path">/root/list/*[not(x:deleted)]</cf:param>
- <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
- <cf:param name="lines-per-page">
- <xsl:choose>
- <xsl:when test="key('session-param','linesPerPage')!=''">
- <xsl:value-of select="key('session-param','linesPerPage')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
- </xsl:otherwise>
- </xsl:choose>
- </cf:param>
- <cf:param name="actions">
- <cp:action>
- <xsl:if test="$has_write_permission='true'">
- <utml:a utml:op="maintain" utml:hide-when-read-only="true">
- <utml:href>
- document.pform.controller_state.value='addEntries|navigate';
- </utml:href>
- <utml:target>
- <xsl:value-of select="concat($app, '/', $mname)"/>
- </utml:target>
- <xsl:text/><xts:string id="IDS_COMMAND_ADD"/><xsl:text/>
- </utml:a>
- </xsl:if>
- </cp:action>
- <cp:action>
- <xsl:if test="$has_write_permission='true'">
- <utml:a>
- <utml:href>
- <xsl:text>if(!isSelected('members_chk_')){alert("<xts:string id="IDS_REMOVE_WARNING" encode="javascript"/>");return;}</xsl:text>
- <!-- if we're dealing with the system administrators group then make sure the user doesn't delete all the members -->
- <xsl:if test="key('env-param','m_obj') = 'CAMID("::System Administrators")'">
- <xsl:text/>if(!validateDelete())return;
- </xsl:if>
- <xsl:text>document.pform.listop.value='delete';if(window.preDeletemembers)preDeletemembers('pform','members_chk_');</xsl:text>
- </utml:href>
- <utml:target>
- <xsl:value-of select="concat($app,'/',$mname)"/>
- </utml:target>
- <xsl:text/><xts:string id="IDS_REMOVE"/><xsl:text/>
- </utml:a>
- </xsl:if>
- </cp:action>
- </cf:param>
- <cf:param name="rows">
- <cp:tableHeader>
- <cp:columnHeader width="16" toggleName="members_chk_" noLabel="true" utml="utml"/>
- <cp:columnHeader width="16"/>
- <cp:columnHeader width="100%">
- <!-- All of this is to align the header (...> Name) with the contents of the table-->
- <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
- <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text> </xsl:text>
- <img height="5" width="1" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
- <xsl:text/><xts:string id="IDS_NAME"/><xsl:text/>
- </cp:columnHeader>
- <cp:columnHeader width="150">
- <xts:string id="IDS_TYPE"/>
- </cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent>
- <xsl:variable name="entryLabel">
- <xsl:choose>
- <xsl:when test="(cm:defaultName!='' or cm:userName!='') and cm:ancestors!=''">
- <xsl:value-of select="cm:defaultName"/>
- <xsl:if test="cm:userName!=''">
- <xsl:text> (</xsl:text>
- <xsl:value-of select="cm:userName"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_PROP_ENTRY_NOT_FOUND"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <cp:columnContent>
- <xsl:choose>
- <xsl:when test="$has_write_permission='true'">
- <utml:input type="checkbox" utml:update="false">
- <xsl:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><xsl:value-of select="$entryLabel"/></xts:param></xts:string></xsl:attribute>
- <utml:prefix>
- <xsl:text>members_chk_</xsl:text>
- </utml:prefix>
- <utml:name>
- <xsl:value-of select="position()"/>
- </utml:name>
- <utml:value>
- <xsl:value-of select="cm:storeID"/>
- </utml:value>
- </utml:input>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:call-template name="gen-icon">
- <xsl:with-param name="showAction" select="false()"/>
- <xsl:with-param name="hiddenObject" select="cm:hidden"/>
- </xsl:call-template>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:choose>
- <xsl:when test="(cm:defaultName!='' or cm:userName!='') and cm:ancestors!=''">
- <img width="20" height="16" align="absmiddle" src="{$skin_images}path.gif">
- <xsl:attribute name="alt">
- <cf:do-the-path-link>
- <cf:param name="familytree">cm:ancestors</cf:param>
- <cf:param name="familymember">cm:defaultName</cf:param>
- <cf:param name="onlyAncestors">true</cf:param>
- </cf:do-the-path-link>
- </xsl:attribute>
- </img>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$entryLabel"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_PROP_ENTRY_NOT_FOUND"/>
- </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:if test="cm:objectClass!='nil'">
- <xsl:variable name="objectClass"><xsl:value-of select="cm:objectClass"/></xsl:variable>
- <xsl:value-of select="/root/objectClass/class[@name=$objectClass]"/>
- </xsl:if>
- </cp:columnContent>
- </cp:tableContent>
- </cf:param>
- </cf:main-pager-section>
- </lyt:section>
- </lyt:layout>
- </xsl:if>
- <dp:footer>
- <xsl:choose>
- <xsl:when test="$in-wizard = 'true'">
- <xsl:choose>
- <xsl:when test="key('env-param', 'from_bmt')">
- <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doBMTCancel()"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_CANCEL" df:style="back-url"/>
- </xsl:otherwise>
- </xsl:choose>
- <df:button df:id="IDS_BACK" df:style="maintain">
- <df:target>
- <xsl:value-of select="concat($app, '/new_general.xts')"/>
- </df:target>
- </df:button>
- <df:button df:id="IDS_NEXT"/>
- <df:button df:id="IDS_FINISH" utml:validate="true" df:style="submit"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$showOKCancel">
- <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
- <xsl:choose>
- <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
- <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_CLOSE" df:style="back-url"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- <!-- if the user tried to add a duplicate entry -->
- <script language="javascript">
- <xsl:if test="/root/duplicateEntry">
- <xsl:variable name="msg">
- <xts:string id="IDS_DUPLICATE_ENTRY"/>
- </xsl:variable>
-
- window.alert('<xsl:value-of select="normalize-space($msg)"/>');
- </xsl:if>
- </script>
- </utml:form>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="debug" type="exec" mode="output" processor="XSLT" condition=".[/root/session/param[@name = 'debug'] = '1']" mandatory="false" mimeType="text/html" dependency="renderPage processResponse">
- <!-- Get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <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">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|