123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2013
- 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).
- -->
- <!--
- ===============================================================================================
- Creates an object in CM based on parameters passed in.
- Should create a CM command like so:
- <add xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <search>/content/folder[@defaultName="blah"]</search>
- <objects>
- <folder>
- <defaultName>Dave</defaultName>
- <defaultDescription>Dave's folder</defaultDescription>
- ...
- </folder>
- </objects>
- </add>
- ===============================================================================================
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <!--
- ===============================================================================================
- formlogic_init - standard form logic initialization
- ===============================================================================================
- -->
- <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='m_pagedef_allow_everyone']='true']" mandatory="false"/>
-
- <!--
- ===============================================================================================
- Query for the default destination container
- ===============================================================================================
- -->
- <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init" condition=".[/root/env/param[@name='m_pagedef_allow_everyone']='true']" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:variable name="path">
- <xsl:value-of select="string(/root/env/param[@name='m_path'])"/>
- </xsl:variable>
- <xts:sequence>
- <xts:append>
- <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:requests>
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:value-of select="$path"/>
- </cm:search>
- <cm:properties>
- <cm:property name="policies"/>
- </cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- preCreate
- A block to take care of tasks that should be done before the save. For example decoding
- certain parameters like m_p_members or jobSteps.
- Also silently wires off creating URL objects based on system configurations
- ===============================================================================================
- -->
- <xts:block id="preCreate" processor="XSLT" type="exec" dependency="getContent">
- <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/"
- xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <cms:prop-decode/>
- <xsl:template match="/root/command/form:create/form:env">
- <xts:sequence>
-
- <!-- decode all properties -->
- <xsl:apply-templates select="form:param[@name='emailToRunOptions' or @name='jobOptions' or @name='jobSteps' or starts-with(@name, 'm_p_')]" mode="decode"/>
- <!--
- Feature 572184: Last minute check to see if this creat (add) operation is clear to go.
- - If this is a request to create a URL object when it is disabled system-wide then bypass the creat operation
- -->
- <xsl:if test="/root/system/param[@name='disableURLObjectCreation'] = 'true' and form:param[@name='m_new_class'] = 'URL'">
- <xts:append>
- <skipCreate/>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doCreate
- ===============================================================================================
- -->
- <xts:block id="doCreate" processor="XSLT" type="exec" dependency="preCreate" condition=".[not(root/skipCreate)]">
- <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:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/"
- 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:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- exclude-result-prefixes="cms xts send cm pf form 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:apply-templates select="root/command/form:create/form:env"/>
- </xsl:template>
- <xsl:template match="form:env">
- <!-- this is the class of the new object -->
- <xsl:variable name="cls" select="form:param[@name='m_new_class']"/>
- <!-- optional parameter to override the default CM update action -->
- <xsl:variable name="update-action">
- <xsl:if test="form:param[@name='update-action'] = 'update' or form:param[@name='update-action'] = 'replace'">
- <xsl:value-of select="form:param[@name='update-action']"/>
- </xsl:if>
- </xsl:variable>
- <xts:sequence>
- <!-- prepare and send the add request -->
- <xts:append>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" faultBlock="createFault">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:value-of select="form:param[@name='m_p_path']"/>
- </cm:search>
- <cm:objects>
- <xsl:element name="{$cls}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:apply-templates/>
- <xsl:if test="$cls='reportView'">
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string(form:param[@name = 'reportViewExecutionFormat'])), true() )" disable-output-escaping="yes"/>
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string(form:param[@name = 'reportViewExecutionLocale'])), true() )" disable-output-escaping="yes"/>
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string(form:param[@name = 'reportViewOptions'])), true() )" disable-output-escaping="yes"/>
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string(form:param[@name = 'reportViewParameters'])), true() )" disable-output-escaping="yes"/>
- </xsl:if>
- <xsl:if test="$cls='powerPlay8ReportView'">
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string(form:param[@name = 'powerPlay8ReportViewOptions'])), true() )" disable-output-escaping="yes"/>
- </xsl:if>
- <xsl:if test="form:param[starts-with(@name, 'm_ml_')]">
- <xsl:call-template name="gen-multilingual-arrays"/>
- </xsl:if>
-
- <xsl:if test="form:param[@name='m_new_class']='dataSource'">
- <cm:dataSourceCapabilities>
- <xsl:for-each select="key('env-param', 'm_dscap')">
- <cm:capability>
- <xsl:value-of select="concat('http://developer.cognos.com/ceba/constants/dataSourceCapabilityEnum#', string(.))"/>
- </cm:capability>
- </xsl:for-each>
- </cm:dataSourceCapabilities>
- </xsl:if>
- <xsl:if test="/root/system/param[@name='ui_objects']/object[@class=string($cls) and @runnable='T']">
- <xsl:call-template name="gen-default-retention">
- <xsl:with-param name="cls" select="$cls"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$cls='agentDefinitionView'">
- <cm:allowNotification>
- <xsl:choose>
- <xsl:when test="form:param[@name='m_agent_allowNotification']">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </cm:allowNotification>
- </xsl:if>
- <xsl:if test="$cls='pageDefinition' and form:param[@name='m_pagedef_allow_everyone']='true'">
- <cm:policies>
- <xsl:variable name="destinationFldrRef" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
- <xsl:copy-of select="$destinationFldrRef/cm:policies/cm:policy[cm:securityObject/cm:searchPath != 'CAMID("::Everyone")']"/>
- <cm:policy>
- <cm:securityObject>
- <cm:searchPath>CAMID("::Everyone")</cm:searchPath>
- </cm:securityObject>
- <xsl:for-each select="$destinationFldrRef/cm:policies/cm:policy[cm:securityObject/cm:searchPath = 'CAMID("::Everyone")']/cm:permission[@name !='read']">
- <xsl:copy-of select="."/>
- </xsl:for-each>
- <cm:permission name="read" access="grant"/>
- </cm:policy>
- </cm:policies>
- </xsl:if>
- <xsl:if test="$cls='jobDefinition'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <!-- copy the job options and rebuild the options and value elements since the count might be wrong -->
- <xsl:copy-of select="/root/*[local-name()='jobOptions']/*[local-name()='options']/*[local-name()='value']/*"/>
- <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- <xts:transform name="XML" src="portal/options.xml"/>
- <optionType>jobOptions</optionType>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
- </xsl:if>
- <xsl:if test="$cls='contentTask'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- <xts:transform name="XML" src="portal/options.xml"/>
- <optionType>contentTaskProperties</optionType>
- <optionType>contentTaskOptions</optionType>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
- </xsl:if>
- <xsl:if test="$cls='indexUpdateTask'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- <xts:transform name="XML" src="portal/options.xml"/>
- <optionType>indexOptions</optionType>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
- </xsl:if>
- <!--
- Handle the layout property for pagelet objects.
- I should be reading the env data from the <command/create> element but that causes
- unwanted namespace problems when xml-encoding the layout xml.
- -->
- <xsl:if test="$cls='pagelet'">
- <cm:layout>
- <xts:transform name="XMLEncode">
- <xts:transform src="portal/mypages/transform/gen_pagelet_layout.xslt" processor="XSLT">
- <xsl:copy-of select="."/>
- </xts:transform>
- </xts:transform>
- </cm:layout>
- </xsl:if>
- <xsl:if test="$cls='metricsFileImportTask' or $cls='metricsMaintenanceTask'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/cleanEnv.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- </root>
- </xts:transform>
- <xts:transform name="XML" src="portal/options.xml"/>
- <optionType>metricsOptions</optionType>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
- </xsl:if>
- <xsl:if test="form:param[@name='m_new_class']='powerPlayReport'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/cleanEnv.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- </root>
- </xts:transform>
- <xts:transform name="XML" src="portal/options.xml"/>
- <optionType>powerPlayOptions</optionType>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
- <xsl:if test="form:param[@name='m_ppro_outputFormat']='HTML' and not(form:param[@name='m_p_defaultPortalAction'])">
- <cm:defaultPortalAction>edit</cm:defaultPortalAction>
- </xsl:if>
- </xsl:if>
- <xsl:if test="string($cls)='drillPath'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/portal/options/cleanEnv.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- </root>
- </xts:transform>
- <xts:transform name="XML" src="portal/options.xml"/>
- <optionType>drillPathOptions</optionType>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
- </xsl:if>
- <xsl:if test="form:param[starts-with(string(@name),'drillParam_')]">
- <cm:parameterAssignments type="cm:parameterAssignmentDataItemArrayProp">
- <xsl:for-each select="form:param[starts-with(string(@name),'drillParam_')]">
- <xsl:if test="string(.)!=''">
- <cm:parameterAssignmentDataItem>
- <cm:parameterName><xsl:value-of select="xtsext:web64decode( string( substring-after( string(@name),'drillParam_' ) ), true() )"/></cm:parameterName>
- <cm:dataItemName><xsl:value-of select="string(.)"/></cm:dataItemName>
- </cm:parameterAssignmentDataItem>
- </xsl:if>
- </xsl:for-each>
- </cm:parameterAssignments>
- </xsl:if>
- <xsl:if test="$cls='powerPlayReport' and form:param[starts-with(string(@name),'m_ppdb_')]">
- <cm:dataBlocks>
- <xsl:if test="string(form:param[string(@name)='m_ppdb_parameters'])!=''">
- <cm:dataBlock>
- <cm:data><xsl:value-of select="form:param[string(@name)='m_ppdb_parameters']"/></cm:data>
- <cm:id>parameters</cm:id>
- </cm:dataBlock>
- </xsl:if>
- <xsl:if test="string(form:param[string(@name)='m_ppdb_reportConfiguration'])!=''">
- <cm:dataBlock>
- <cm:data><xsl:value-of select="form:param[string(@name)='m_ppdb_reportConfiguration']"/></cm:data>
- <cm:id>reportConfiguration</cm:id>
- </cm:dataBlock>
- </xsl:if>
- <xsl:if test="string(form:param[string(@name)='m_ppdb_reportSpecification'])!=''">
- <cm:dataBlock>
- <cm:data><xsl:value-of select="form:param[string(@name)='m_ppdb_reportSpecification']"/></cm:data>
- <cm:id>reportSpecification</cm:id>
- </cm:dataBlock>
- </xsl:if>
- </cm:dataBlocks>
- </xsl:if>
- <xsl:if test="$cls='powerPlay8Report' and form:param[starts-with(string(@name),'m_pp8properties')]">
- <xts:transform name="XMLDecode">
- <xsl:copy-of select="form:param[string(@name)='m_pp8properties']"/>
- </xts:transform>
- </xsl:if>
- <xsl:if test="$cls='queryServiceTask' and form:param[string(@name)='m_queryServiceOptions']">
- <xsl:value-of select="form:param[@name='m_queryServiceOptions']" disable-output-escaping="yes"/>
- </xsl:if>
- </xsl:element>
- </cm:objects>
- <xsl:choose>
- <xsl:when test="$update-action!=''">
- <cm:options updateAction="{$update-action}"/>
- </xsl:when>
- <xsl:when test="$cls='runTimeState'">
- <cm:options updateAction="replace"/>
- </xsl:when>
- <xsl:when test="form:param[@name='overwriteExistingItems'] = 'true'">
- <cm:options updateAction="replace"/>
- </xsl:when>
- <xsl:otherwise>
- <cm:options updateAction="fail"/>
- </xsl:otherwise>
- </xsl:choose>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template match="form:param[starts-with(@name,'m_p_')]">
- <!-- this is the class of the new object -->
- <xsl:variable name="cls" select="../form:param[@name='m_new_class']"/>
- <xsl:variable name="paramName">
- <xsl:choose>
- <xsl:when test="starts-with(@name, 'm_p_archiveLocation_')">
- <xsl:value-of select="substring-after(@name, 'm_p_archiveLocation_')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after(@name, 'm_p_')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- create an element for each property passed in -->
- <xsl:element name="{$paramName}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:if test="string($cls)='metricsExportTask' and @name='m_p_specification'">
- <xsl:attribute name="type">dataIntegrationServiceSpecificationProp</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="string($cls)='migrationTask' and @name='m_p_specification'">
- <xsl:element name="value">
- <xsl:attribute name="xsi:type">bus:specification</xsl:attribute>
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <!-- name is the on CM property that must be encoded *before* giving to CM -->
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
- <xsl:template name="gen-multilingual-arrays">
- <xsl:element name="name" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:for-each select="form:param[starts-with(@name, 'm_ml_name_')]">
- <xsl:variable name="localeVal">
- <xsl:value-of select="xtsext:substringAfterLast(string(@name), '_')"/>
- </xsl:variable>
- <xsl:element name="item" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:element name="locale"><xsl:value-of select="$localeVal"/></xsl:element>
- <xsl:element name="value"><xsl:value-of select="."/></xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- <xsl:element name="description" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:for-each select="form:param[starts-with(@name, 'm_ml_description_')]">
- <xsl:variable name="localeVal">
- <xsl:value-of select="xtsext:substringAfterLast(string(@name), '_')"/>
- </xsl:variable>
- <xsl:element name="item" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:element name="locale"><xsl:value-of select="$localeVal"/></xsl:element>
- <xsl:element name="value"><xsl:value-of select="."/></xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- <xsl:element name="screenTip" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:for-each select="form:param[starts-with(@name, 'm_ml_screenTip_')]">
- <xsl:variable name="localeVal">
- <xsl:value-of select="xtsext:substringAfterLast(string(@name), '_')"/>
- </xsl:variable>
- <xsl:element name="item" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:element name="locale"><xsl:value-of select="$localeVal"/></xsl:element>
- <xsl:element name="value"><xsl:value-of select="."/></xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template match="form:param[starts-with(@name,'m_ppc_')]">
- <!-- create an element for each property passed in -->
- <xsl:element name="{substring-after(@name, 'm_ppc_')}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <!-- name is the on CM property that must be encoded *before* giving to CM -->
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="gen-default-retention">
- <xsl:param name="cls"/>
- <xsl:element name="retentions" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:element name="retentionRule" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:attribute name="objectClass">
- <xsl:value-of select="'history'"/>
- </xsl:attribute>
- <xsl:attribute name="prop">
- <xsl:value-of select="'creationTime'"/>
- </xsl:attribute>
- <xsl:attribute name="maxObjects">
- <xsl:choose>
- <xsl:when test="$cls='exportDeployment' or $cls='importDeployment'">
- <xsl:value-of select="'1'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'5'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
- <xsl:if test="$cls='reportView'">
- <xsl:element name="retentionRule" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:attribute name="objectClass">
- <xsl:value-of select="'reportVersion'"/>
- </xsl:attribute>
- <xsl:attribute name="prop">
- <xsl:value-of select="'creationTime'"/>
- </xsl:attribute>
- <xsl:attribute name="maxObjects">
- <xsl:value-of select="'1'"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <!--
- -shortcuts are coming back with a different implementaion this may not be used
- TODO: THE @name='m_p_shortcut' IS PART OF THE HACK FOR BUG #348025 ABOVE, THIS
- SHOULD ALSO BE REMOVED WHEN THE BUG IS FIXED...
- ->
- <xsl:template match="form:param[@name != 'm_p_shortcut']">
- <xsl:variable name="nm" select="@name"/>
- <xsl:if test="not(preceding-sibling::form:param[@name=$nm]) and starts-with($nm, 'm_p_')">
- <- create an element for each property passed in ->
- <xsl:element name="{substring-after(@name, 'm_p_')}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <- name is the on CM property that must be encoded *before* giving to CM ->
- <xsl:value-of select="."/>
- <xsl:for-each select="following-sibling::form:param[@name = $nm]">
- <xsl:value-of select="' '"/>
- <xsl:value-of select="."/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <- pull in any templates to handle "special" properties on CM objects -->
- <cms:prop-save/>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="createFault" type="fault" processor="XSLT">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml"/>
- <xsl:template match="/root/fault">
- <xsl:choose>
- <xsl:when test="./*[local-name() = 'exception']/*[local-name() = 'exceptionDetail']/*[local-name() = 'exception']/*[local-name()='errorCode'] = 'cmDuplicateName'">
- <copyFault>
- <xsl:copy-of select="."/>
- </copyFault>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- create_default_signon
- This blocks creates a default signon for the Everyone group with the supplied
- encrypted credentials. This block only executes when the m_new_class parameter
- is 'dataSourceConnection' and when the m_default_signon parameter is present.
- NOTE: This block doesn't seem to function with the XSLTC processor. The
- <xsl:value-of select=""/> inside of the <search> node never returns a value,
- causing the add request to fail.
- ================================================================================
- -->
- <xts:block id="create_default_signon" type="exec" mode="interpret" processor="XSLT" dependency="doCreate" mandatory="false" condition=".[/root/command/*[local-name()='create' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='env' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='param' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/' and @name='m_new_class']='dataSourceConnection' and /root/command/*[local-name()='create' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='env' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='param' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/' and @name='m_default_signon'] and not(root/copyFault) and not(root/fault)]">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <defaultSignon>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <add xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <search>
- <xsl:value-of select="/root/cm:addResponse/cm:dataSourceConnection/cm:searchPath"/>
- </search>
- <objects>
- <dataSourceSignon>
- <defaultName><xsl:value-of select="/root/command/form:create/form:env/form:param[@name='m_p_defaultName']"/></defaultName>
- <credentials>
- <xsl:value-of select="/root/command/form:create/form:env/form:param[@name='m_default_signon']"/>
- </credentials>
- <consumers>
- <group>
- <searchPath>CAMID("::Everyone")</searchPath>
- </group>
- </consumers>
- <xsl:variable name="tenantID" select="/root/command/form:create/form:env/form:param[@name='m_p_tenantID']"/>
- <xsl:if test="$tenantID">
- <tenantID><xsl:value-of select="$tenantID"/></tenantID>
- </xsl:if>
- </dataSourceSignon>
- </objects>
- </add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </defaultSignon>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- create_proxy_credential
- Creates a proxy credential with the supplied encrypted credentials. This block
- only executes when the m_new_class parameter is 'dataSourceConnection' and when
- the m_proxy_signon parameter is present.
- ================================================================================
- -->
-
- <xts:block id="create_proxy_credential" type="exec" mode="interpret" processor="XSLT" dependency="doCreate" mandatory="false" condition=".[/root/command/*[local-name()='create' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='env' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='param' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/' and @name='m_new_class']='dataSourceConnection' and /root/command/*[local-name()='create' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='env' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/']/*[local-name()='param' and namespace-uri()='http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/' and @name='m_connection_proxy_enabled']='true' and not(root/copyFault) and not(root/fault)]">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <add xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <search>
- <xsl:value-of select="/root/cm:addResponse/cm:dataSourceConnection/cm:searchPath"/>
- </search>
- <objects>
- <credential>
- <defaultName>proxy</defaultName>
- <defaultDescription>
- <xsl:value-of select="/root/command/form:create/form:env/form:param[@name='m_proxy_signon']"/>
- </defaultDescription>
- <credentials>
- <xsl:value-of select="/root/command/form:create/form:env/form:param[@name='m_proxy_signon']"/>
- </credentials>
- <xsl:variable name="tenantID" select="/root/command/form:create/form:env/form:param[@name='m_p_tenantID']"/>
- <xsl:if test="$tenantID">
- <tenantID><xsl:value-of select="$tenantID"/></tenantID>
- </xsl:if>
- </credential>
- </objects>
- </add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- postCreate
- A block to take care of tasks that should be done after creating the primary object. For example saving the jobStepDefinition
- child objects of a jobDefinition
- ===============================================================================================
- -->
- <xts:block id="postCreate" dependency="doCreate" condition=".[not(root/copyFault) and not(root/fault) and not(root/skipCreate)]" processor="XSLT" type="exec" 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:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/"
- xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
- 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:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
- xmlns:x="x"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- Handle any jobStepDefinition adds that are required -->
- <pf:variables/>
- <xsl:template match="/">
- <xsl:variable name="env" select="/root/command/form:create/form:env"/>
- <xsl:if test="$env/form:param[@name='m_new_class']='agentDefinitionView'">
- <xts:sequence>
- <xts:append>
- <send:request provider="cm">
- <bus:add>
- <search xsi:type="xsd:string">
- <xsl:value-of select="/root/cm:addResponse/*/cm:searchPath"/>
- </search>
- <objects xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:baseClass[1]">
- <item xsi:type="bus:reportView">
- <base xsi:type="bus:baseClassArrayProp">
- <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:baseClass[1]">
- <item xsi:type="bus:baseClass">
- <searchPath xsi:type="bus:stringProp"><value xsi:type="xsd:string" xml:space="preserve"><xsl:value-of select="$env/form:param[@name='m_p_base']"/>/report</value></searchPath>
- </item>
- </value>
- </base>
- </item>
- </objects>
- </bus:add>
- </send:request>
- </xts:append>
- </xts:sequence>
- </xsl:if>
- <xsl:for-each select="/root/steps[cm:queryResponse/cm:jobStepDefinition]">
- <xts:sequence>
- <xts:append>
- <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:add>
- <cm:objects>
- <xsl:for-each select="cm:queryResponse/cm:jobStepDefinition">
- <cm:jobStepDefinition>
- <cm:searchPath>
- <xsl:value-of select="/root/cm:addResponse/cm:jobDefinition/cm:searchPath"/>
- </cm:searchPath>
- <cm:displaySequence>
- <xsl:value-of select="cm:displaySequence"/>
- </cm:displaySequence>
- <cm:stepObject>
- <xsl:element name="{local-name(cm:stepObject/*[1])}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:searchPath>
- <xsl:value-of select="cm:stepObject/*[1]/cm:searchPath"/>
- </cm:searchPath>
- </xsl:element>
- </cm:stepObject>
- <xsl:if test="*[local-name()='options']/*">
- <xsl:copy-of select="*[local-name()='options']"/>
- </xsl:if>
- <cm:parameters>
- <xsl:copy-of select="*[local-name()='parameters']/*"/>
- </cm:parameters>
- <xsl:if test="$env/form:param[@name='m_p_tenantID']">
- <cm:tenantID><xsl:value-of select="$env/form:param[@name='m_p_tenantID']"/></cm:tenantID>/cm:tenantID>
- </xsl:if>
- </cm:jobStepDefinition>
- </xsl:for-each>
- </cm:objects>
- <cm:options updateAction="fail"/>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:for-each>
- <!-- Create portlet instances for a new pagelet object (in the future pagelet instances) -->
- <xsl:variable name="portletInstanceObjects">
- <xsl:choose>
- <xsl:when test="$env/form:param[@name = 'pagexml']/*/cps:portletInstance">
- <xsl:for-each select="$env/form:param[@name = 'pagexml']/*/cps:portletInstance">
- <cm:portletInstance>
- <cm:searchPath><xsl:value-of select="/root/cm:addResponse/cm:pagelet/cm:searchPath"/></cm:searchPath>
- <cm:defaultName><xsl:value-of select="cps:id"/></cm:defaultName>
- <cm:portlet>
- <cm:baseClass>
- <cm:searchPath><xsl:value-of select="concat('storeID("', cps:portletId, '")')"/></cm:searchPath>
- </cm:baseClass>
- </cm:portlet>
- </cm:portletInstance>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="$env/form:param[starts-with(@name,'m_mp_portlet')]">
- <xsl:for-each select="$env/form:param[starts-with(@name,'m_mp_portlet')]">
- <cm:portletInstance>
- <cm:searchPath><xsl:value-of select="/root/cm:addResponse/cm:pagelet/cm:searchPath"/></cm:searchPath>
- <cm:defaultName><xsl:value-of select="substring-after(@name, 'm_mp_portlet_')"/></cm:defaultName>
- <cm:portlet>
- <cm:baseClass>
- <cm:searchPath><xsl:value-of select="."/></cm:searchPath>
- </cm:baseClass>
- </cm:portlet>
- </cm:portletInstance>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$portletInstanceObjects">
- <xts:sequence>
- <xts:append>
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:add>
- <cm:objects>
- <xsl:copy-of select="$portletInstanceObjects"/>
- </cm:objects>
- <cm:options updateAction="fail"/>
- </cm:add>
- </xts:transform>
- </send:request>
- </xts:append>
- </xts:sequence>
- </xsl:if>
- </xsl:template>
- <!-- pull in any templates to handle "special" properties on CM objects -->
- <cms:prop-save/>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- <!-- operation results -->
- <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="postCreate">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <response xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
- <xsl:choose>
- <xsl:when test="cm:addResponse">
- <xsl:copy-of select="cm:addResponse/child::*"/>
- </xsl:when>
- <xsl:when test="./copyFault">
- <error>
- <errorCode>
- <xsl:value-of select="./copyFault/fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='errorCode']"/>
- </errorCode>
- <errorMessage>
- <xsl:value-of select="./copyFault/fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']/*[local-name()='messageString']"/>
- </errorMessage>
- </error>
- </xsl:when>
- <!--
- In case we are skipping the create operation, let the response default to <error/>.
- It won't make a difference plus it is only appropriate to return an error given that
- this is likely a bogus request (causing the create operation to be bypassed.
- -->
- <xsl:otherwise><error/></xsl:otherwise>
- </xsl:choose>
- </response>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|