123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/cogadminuimsgs.xml" resolverBase="cogadmin">
-
- <!--
- ===============================================================================================
- getConfiguration
- ===============================================================================================
- -->
- <xts:block id="getConfiguration" type="exec" mode="interpret" processor="XSLT">
-
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <advancedSettings>
- <xts:function name="getConfiguration">
- <xts:param name="COGADMIN.UIPROFILES.DELETE_LEGACY_UIPROFILES_PAGE_AFTER_IMPORT"/>
- <xts:param name="COGADMIN.UIPROFILES.IMPORT_COGNOS_WORKSPACE_DO_MORE"/>
- </xts:function>
- </advancedSettings>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- upload
- ===============================================================================================
- -->
- <xts:block id="upload" dependency="getConfiguration" type="exec" mode="interpret" processor="XSLT">
-
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence faultSelect="/root/output">
-
- <xsl:variable name="profiles">
- <profile name="professional" cmName="Professional" containerName="Report Studio Profiles" targetName="Report Studio Professional"/>
- <profile name="bua_standalone" cmName="Express" containerName="Report Studio Profiles" targetName="Cognos Workspace Advanced"/>
- <xsl:variable name="includeDoMoreProfile"><xsl:value-of select="/root/advancedSettings/configuration/property[@name='COGADMIN.UIPROFILES.IMPORT_COGNOS_WORKSPACE_DO_MORE']"/></xsl:variable>
- <xsl:if test="$includeDoMoreProfile='true'">
- <profile name="bua" containerName="Cognos Workspace Do More Profiles" targetName="Cognos Workspace Do More"/>
- </xsl:if>
- </xsl:variable>
-
- <xts:append select="/root" faultSelect="/root/output">
- <profiles>
- <xsl:for-each select="$profiles/profile">
- <profile>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="policies"/>
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE" faultBlock="faultHandler" faultSelect="/root/output">
- <xts:param name="systemId">
- <xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='morphlet']"/>@request
- </xts:param>
- <xts:param name="schemaLocation">http://www.ibm.com/xmlns/prod/ba/rs/rsprofile.1/ /cogadmin/controls/pat/profiles/rs_profile.xsd</xts:param>
- <xts:request name="FILEREAD" faultBlock="faultHandler">
- <xsl:attribute name="target">/cogadmin/controls/pat/profiles/profile_<xsl:value-of select="@name"/>.xml</xsl:attribute>
- </xts:request>
- </xts:transform>
- </profile>
- </xsl:for-each>
- </profiles>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- xmlencode
- ===============================================================================================
- -->
- <xts:block id="xmlencode" processor="XSLT" type="exec" dependency="upload" condition=".[not(/root/profiles/profile/*[local-name()='importFault'])]">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root/profiles/profile/*[local-name()!='importFault' and local-name()!='policies']">
- <xts:sequence>
- <xsl:variable name="name" select="../@name"/>
- <xts:replace>
- <xsl:attribute name="select">/root/profiles/profile[@name='<xsl:value-of select="$name"/>']/*[local-name()='RSProfile']</xsl:attribute>
- <data>
- <xts:transform name="XMLEncode">
- <xts:transform src="cogadmin/controls/transforms/stripComments.xslt" processor="XSLT" faultBlock="faultHandler" faultSelect="/root/output">
- <xts:request name="FILEREAD" faultBlock="faultHandler">
- <xsl:attribute name="target">/cogadmin/controls/pat/profiles/profile_<xsl:value-of select="$name"/>.xml</xsl:attribute>
- </xts:request>
- </xts:transform>
- </xts:transform>
- </data>
- </xts:replace>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- getLegacyPolicies
- ===============================================================================================
- -->
- <xts:block id="getLegacyPolicies" processor="XSLT" type="exec" dependency="upload" condition=".[not(/root/profiles/profile/*[local-name()='importFault'])]" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" exclude-result-prefixes="xts send cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <response>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:text>/configuration/uiProfileFolder[@name='User Interface Profiles']/uiProfileFolder[@name='Report Studio Profiles']/uiProfile</xsl:text>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="permissions"/>
- <cm:property name="policies"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </response>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- import
- ===============================================================================================
- -->
- <xts:block id="import" processor="XSLT" type="exec" dependency="getLegacyPolicies" condition=".[not(/root/profiles/profile/*[local-name()='importFault'])]" mandatory="false">
- <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts send cm pf xsi xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <!-- global application variables -->
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xsl:variable name="edition" select="string(/root/configProps/param[@name='cc']/property[@name='edition'])"/>
- <xts:sequence>
- <!-- prepare and send the add request -->
- <xts:append select="/root/response">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="faultHandler">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <xsl:for-each select="/root/profiles/profile[not(./importFault)]">
- <cm:userInterfaceProfile>
- <cm:tenantID/>
- <cm:searchPath>
- <xsl:text>/catalog/catalogFolder[@name='User Interface Profiles']/catalogFolder[@name='</xsl:text>
- <xsl:value-of select="@containerName"/>
- <xsl:text>']</xsl:text>
- </cm:searchPath>
- <cm:defaultName>
- <xsl:value-of select="string(@targetName)"/>
- </cm:defaultName>
- <cm:data xsi:type="xsd:base64Binary">
- <xsl:value-of select="xtsext:base64encode(string(data), false())"/>
- </cm:data>
- <xsl:variable name="profileName" select="@name"/>
- <xsl:choose>
- <xsl:when test="not($profileName='bua')">
- <xsl:variable name="cmName" select="@cmName"/>
- <cm:policies>
- <xsl:variable name="policies" select="/root/response/*[local-name()='queryResponse']/*[local-name()='uiProfile']/*[local-name()='defaultName' and text()=$cmName]/../*[local-name()='policies']"/>
- <xsl:for-each select="$policies/*[local-name()='policy']">
- <xsl:variable name="canSetPolicy" select="*[local-name()='permission']/@name='setPolicy'"/>
- <cm:policy>
- <cm:securityObject type="bus:role">
- <xsl:variable name="searchPath">
- <xsl:choose>
- <xsl:when test="$canSetPolicy">
- <xsl:choose>
- <xsl:when test="$edition='mid-market'">CAMID(":Express Administrators")</xsl:when>
- <xsl:otherwise>CAMID(":Library Administrators")</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="*[local-name()='securityObject']/*[local-name()='searchPath']"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <cm:searchPath type="bus:stringProp"><xsl:value-of select="$searchPath"/></cm:searchPath>
- </cm:securityObject>
- <xsl:choose>
- <xsl:when test="$canSetPolicy">
- <cm:permission name="read" access="grant"/>
- <cm:permission name="write" access="grant"/>
- <cm:permission name="execute" access="grant"/>
- <cm:permission name="setPolicy" access="grant"/>
- <cm:permission name="traverse" access="grant"/>
- </xsl:when>
- <xsl:otherwise>
- <cm:permission name="read" access="grant"/>
- </xsl:otherwise>
- </xsl:choose>
- </cm:policy>
- </xsl:for-each>
- </cm:policies>
- </xsl:when>
- <xsl:otherwise>
- <cm:policies>
- <cm:policy>
- <cm:securityObject type="bus:role">
- <cm:searchPath type="bus:stringProp">
- <xsl:choose>
- <xsl:when test="$edition='mid-market'">CAMID(":Express Administrators")</xsl:when>
- <xsl:otherwise>CAMID(":Library Administrators")</xsl:otherwise>
- </xsl:choose>
- </cm:searchPath>
- </cm:securityObject>
- <cm:permission name="read" access="grant"/>
- <cm:permission name="write" access="grant"/>
- <cm:permission name="execute" access="grant"/>
- <cm:permission name="setPolicy" access="grant"/>
- <cm:permission name="traverse" access="grant"/>
- </cm:policy>
- <cm:policy>
- <cm:securityObject type="bus:role">
- <cm:searchPath type="bus:stringProp">CAMID("::Everyone")</cm:searchPath>
- </cm:securityObject>
- <cm:permission name="read" access="grant"/>
- </cm:policy>
- </cm:policies>
- </xsl:otherwise>
- </xsl:choose>
- </cm:userInterfaceProfile>
- </xsl:for-each>
- </cm:objects>
- <cm:options updateAction="replace" ignoreInvalidObjectReference="true"/>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- updateUserInterfaceProfilesPortlet
- ===============================================================================================
- -->
- <xts:block id="updateUserInterfaceProfilesPortlet" dependency="import" processor="XSLT" type="exec" mandatory="false" condition=".[not(/root/profiles/profile/*[local-name()='importFault'])]">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <updateUserInterfaceProfilesPortletResponse>
- <xts:function name="UpdateUserInterfaceProfilesPortlet" xmlns:xts="http://developer.cognos.com/schemas/xts/"/>
- </updateUserInterfaceProfilesPortletResponse>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- deleteLegacyCMPagelet
- ===============================================================================================
- -->
- <xts:block id="deleteLegacyCMPagelet" dependency="updateUserInterfaceProfilesPortlet" processor="XSLT" type="exec" condition=".[not(/root/advancedSettings/configuration/property[@name='COGADMIN.UIPROFILES.DELETE_LEGACY_UIPROFILES_PAGE_AFTER_IMPORT']='false') and not(/root/profiles/profile/*[local-name()='importFault'])]" mandatory="true">
- <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" 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" exclude-result-prefixes="xts send cm pf xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <!-- global application variables -->
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/response">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="faultHandler">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:delete xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:objects>
- <cm:pagelet>
- <cm:searchPath>/portal/portalPackage[@name='Administration']/pageletFolder[@name='Pagelets']/pageletFolder[@name='Console']/pageletFolder[@name='Security']/pagelet[@name='User Interface Profiles']</cm:searchPath>
- </cm:pagelet>
- <cm:portlet>
- <cm:searchPath>/portal/portalPackage[@name='Administration']/portletFolder[@name='Portlets']/portletFolder[@name='Console']/portletProducer[@name='cogadmin']/portlet[@name='Profiles Administration']</cm:searchPath>
- </cm:portlet>
- </cm:objects>
- <cm:options recursive="true" force="true"/>
- </cm:delete>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- getMeta
- ===============================================================================================
- -->
- <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env" processor="XSLT">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- exclude-result-prefixes="xsl xts xos xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <xos:part>
- <xos:entityHeader>
- <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <fragment>
- <meta/>
- </fragment>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- renderMarkup - renders the results dialog
- -->
- <xts:block id="renderMarkup" type="exec" dependency="getMeta upload" processor="XSLT" mandatory="false">
- <xts:logicsheet path="/cogadmin/logicsheets/presentation/common.xslt"/>
- <xts:logicsheet path="/cogadmin/logicsheets/admin.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
- exclude-result-prefixes="xsl ui xos xtsext SOAP-ENV uic">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
- <markup>
- <mimeType>text/html</mimeType>
- <markupXml>
- <!-- render the HTML -->
- <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
- <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
- <root>
- <!-- Generate UI markup using the response -->
- <xts:transform src="/cogadmin/controls/transforms/gen-ui-markup/importUserInterfaceProfiles.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
- <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
- <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
- <root>
- <xts:queryNode select="/root/profiles | /root/session | /root/env | /root/advancedSettings"/>
- </root>
- </xts:transform>
- <xts:queryNode select="/root/system | /root/session"/>
- </root>
- </xts:transform>
- </markupXml>
- </markup>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- Fault handler: If a fault happens during an action, then we need to catch it and process it.
- -->
- <xts:block id="faultHandler" dependency="load validate import" type="fault" processor="XSLT" >
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml"/>
- <xsl:template match="/root/fault">
- <importFault>
- <xsl:copy-of select="*"/>
- </importFault>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
-
- </xts:morphlet>
|