123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" resolverBase="cogadmin" messageBase="messages/cogadminuimsgs.xml">
- <xts:block id="frag_init" nodelist="env, credential" type="exec" mode="interpret" processor="XSLT" path="cogadmin/logicsheets/fragment_init.xslt" condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]" mandatory="true"/>
-
- <xts:block id="getContent" dependency="frag_init" nodelist="env, header, session, system, http, configProps" type="exec" mode="interpret" processor="XSLT">
- <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
- <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
- <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
- <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
- xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- exclude-result-prefixes="xsl xts SOAP-ENV bus admui xtsext flt send">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <!-- common pager variables -->
- <admui:pagerVariables pagerName="search"/>
-
- <!-- common variables -->
- <admui:variables/>
-
- <xsl:variable name="search_string" select="string(/root/env/param[@name = 'stext'])"/>
- <xsl:variable name="search_modified_filter" select="/root/env/param[@name = 'smodified']"/>
- <xsl:variable name="search_type_filter" select="/root/env/param[@name = 'stype']"/>
- <xsl:variable name="search_method_filter" select="/root/env/param[@name = 'smethod']"/>
- <xsl:variable name="sfield" select="string(/root/env/param[@name = 'sfield'])"/>
- <xsl:variable name="scope" select="string(/root/env/param[@name = 'sscope'])"/>
- <xsl:variable name="type" select="string(/root/env/param[@name = 'type'])"/>
- <xsl:variable name="showNotSpecific" select="string(/root/env/param[@name = 'bshowNotSpecific'])"/>
- <xsl:variable name="search_from" select="string(/root/env/param[@name = 'search_from'])"/>
- <xsl:variable name="search_skip" select="string(/root/env/param[@name = 'search_skip'])"/>
- <xsl:variable name="search_to" select="string(/root/env/param[@name = 'search_to'])"/>
- <xsl:variable name="sort_column" select="string(/root/env/param[@name = 'sort_column'])"/>
- <xsl:variable name="sort_order" select="string(/root/env/param[@name = 'sort_order'])"/>
-
- <xsl:variable name="path">
- <xsl:choose>
- <xsl:when test="$type = 'printers'"><xsl:value-of select="'path:CAMID(":")/*[@objectClass="printer"]'" /></xsl:when>
- <xsl:when test="$type = 'styles'"><xsl:value-of select="'path:/portal/portalSkinFolder/descendant::*[@objectClass="portalSkin" or @objectClass="securedFeature"]'"/></xsl:when>
- <xsl:when test="$type = 'portlets_import'"><xsl:value-of select="'path:/portal/portalPackage[@defaultName="connection"]/portletFolder/descendant::*[@objectClass="portletProducer" or @objectClass="portlet"]'"/></xsl:when>
- <xsl:when test="$type = 'tenants'"><xsl:value-of select="'path:/directory/tenants/*[@objectClass="tenant"]'" /></xsl:when>
- <xsl:when test="$type = 'visualizations'"><xsl:value-of select="'path:/catalog/catalogFolder/*'"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="typeFilter">
- <xsl:choose>
- <xsl:when test="$type = 'visualizations' and ($search_type_filter = 'catalogFolder' or $search_type_filter = 'visualization')">
- <xsl:text/>[@objectClass="<xsl:value-of select="$search_type_filter"/>"]<xsl:text/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="methodFilter">
- <xsl:choose>
- <xsl:when test="not($search_string) or $search_string=''"></xsl:when>
- <xsl:when test="$sfield = 'n'">
- <xsl:choose>
- <xsl:when test="$search_method_filter = '3'">[@defaultName = '<xsl:value-of select="$search_string"/>']</xsl:when>
- <xsl:when test="$search_method_filter = '2'">[starts-with(@defaultName, '<xsl:value-of select="$search_string"/>')]</xsl:when>
- <xsl:otherwise>[contains(@defaultName, '<xsl:value-of select="$search_string"/>')]</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="/root/env/param[@name = 'sfield'] = 'd'">
- <xsl:choose>
- <xsl:when test="$search_method_filter = '3'">[@defaultDescription = '<xsl:value-of select="$search_string"/>']</xsl:when>
- <xsl:when test="$search_method_filter = '2'">[starts-with(@defaultDescription, '<xsl:value-of select="$search_string"/>' )]</xsl:when>
- <xsl:otherwise>[contains(@defaultDescription, '<xsl:value-of select="$search_string"/>' )]</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$search_method_filter = '3'">[@defaultDescription = '<xsl:value-of select="$search_string"/>' or @defaultName = '<xsl:value-of select="$search_string"/>']</xsl:when>
- <xsl:when test="$search_method_filter = '2'">[starts-with(@defaultDescription, '<xsl:value-of select="$search_string"/>' ) or starts-with(@defaultName, '<xsl:value-of select="$search_string"/>')]</xsl:when>
- <xsl:otherwise>[contains(@defaultDescription, '<xsl:value-of select="$search_string"/>' ) or contains(@defaultName, '<xsl:value-of select="$search_string"/>')]</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="modifiedFilter">
- <xsl:if test="$search_modified_filter != 'any' and string($search_modified_filter)!=''">
- <xsl:variable name="offsetamt">
- <xsl:choose>
- <xsl:when test="$search_modified_filter = 't'">0</xsl:when>
- <xsl:when test="$search_modified_filter = 'l3d'">-259200</xsl:when>
- <xsl:when test="$search_modified_filter = 'lw'">-604800</xsl:when>
- <xsl:when test="$search_modified_filter = 'lm'">-2592000</xsl:when>
- <xsl:when test="$search_modified_filter = 'l3m'">-7776000</xsl:when>
- <xsl:when test="$search_modified_filter = 'l6m'">-15552000</xsl:when>
- <xsl:when test="$search_modified_filter = 'ly'">-31536000</xsl:when>
- <xsl:when test="$search_modified_filter = 'l3y'">-94608000</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="offsetunit">second</xsl:variable>
- <xsl:text/>[@modificationTime > '<xsl:value-of select="xtsext:formatDateToUTC(xtsext:getDateTimeOffset(concat(xtsext:substringBeforeLast(xtsext:getCurrentDateTime(/root/user/param[@name='timeZoneID']), 'T'), 'T00:00:00Z'), $offsetamt, $offsetunit), /root/user/param[@name='timeZoneID'])"/>']<xsl:text/>
- </xsl:if>
- </xsl:variable>
- <!-- The NAV requests accept the prefix "path:". When this one is added then we are overriding the path and NAV will just pass it to CM
- This allow us to construct our own path with different filter.
- The admin mode is more appropriate to be used with schedule and history.
- -->
- <xsl:variable name="filteredPath">
- <xsl:choose>
- <xsl:when test="string($scope) = 'p'">
- <xsl:value-of select="'systemDefault'"/>
- </xsl:when>
- <xsl:when test="string($scope) = 'm'">
- <xsl:value-of select="'userDefault'"/>
- </xsl:when>
- <xsl:when test="string($scope) = 'fo' or string($scope) = 'fb'">
- <xsl:value-of select="concat($path, string($methodFilter), string($modifiedFilter), string(/root/system/param[@name='visible']))"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="concat($path, string($typeFilter), string($methodFilter), string($modifiedFilter), string(/root/system/param[@name='visible']))"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/">
- <xsl:if test="not($showNotSpecific = 'true')"><!-- No need to query if the search criteria is not specific enough -->
- <xts:sequence>
- <xts:append select="/root">
- <response>
- <xts:request href="bus://dispatcher" protocol="NAV" responseEnvelope="false" outputHeader="false">
- <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/bus:biBusHeader"/>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <nav:search>
- <nav:validateTag fault="true"/>
-
- <!-- Fields -->
- <nav:fields>
- <xsl:choose>
- <xsl:when test="$sfield = 'n'">
- <xsl:value-of select="'nf'"/>
- </xsl:when>
- <xsl:when test="$sfield = 'd'">
- <xsl:value-of select="'df'"/>
- </xsl:when>
- <xsl:when test="$sfield = 'nd'">
- <xsl:value-of select="'ndf'"/>
- </xsl:when>
- </xsl:choose>
- </nav:fields>
-
- <!-- Method -->
- <nav:match>
- <xsl:choose>
- <xsl:when test="$search_method_filter = '1'">
- <xsl:value-of select="'contains'"/>
- </xsl:when>
- <xsl:when test="$search_method_filter = '2'">
- <xsl:value-of select="'starts'"/>
- </xsl:when>
- <xsl:when test="$search_method_filter = '3'">
- <xsl:value-of select="'exact'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'contains'"/>
- </xsl:otherwise>
- </xsl:choose>
- </nav:match>
-
- <!-- Search text -->
- <nav:string><xsl:value-of select="$search_string"/></nav:string>
- <!-- Modified -->
- <xsl:if test="$search_modified_filter != 'any'">
- <nav:itemModified>
- <xsl:choose>
- <xsl:when test="$search_modified_filter = 't'">0</xsl:when>
- <xsl:when test="$search_modified_filter = 'l3d'">-259200</xsl:when>
- <xsl:when test="$search_modified_filter = 'lw'">-604800</xsl:when>
- <xsl:when test="$search_modified_filter = 'lm'">-2592000</xsl:when>
- <xsl:when test="$search_modified_filter = 'l3m'">-7776000</xsl:when>
- <xsl:when test="$search_modified_filter = 'l6m'">-15552000</xsl:when>
- <xsl:when test="$search_modified_filter = 'ly'">-31536000</xsl:when>
- <xsl:when test="$search_modified_filter = 'l3y'">-94608000</xsl:when>
- </xsl:choose>
- </nav:itemModified>
- </xsl:if>
-
- <!-- Scope -->
- <nav:scope>
- <xsl:value-of select="$filteredPath"/>
- </nav:scope>
-
- <nav:recursive>
- <xsl:choose>
- <xsl:when test="string($scope) = 'fo'">
- <xsl:value-of select="'false'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'false'"/> <!-- original value: true -->
- </xsl:otherwise>
- </xsl:choose>
- </nav:recursive>
-
- <nav:property name="name"/>
- <nav:property name="tenantID"/>
- <nav:property name="permissions"/>
- <nav:property name="lastModifiedDate"/>
- <nav:property name="searchPath"/>
- <nav:property name="imgURL"/>
- <nav:property name="fullName"/>
- <nav:property name="documentType"/>
- <nav:property name="userName"/>
- <nav:property name="hasChildren"/>
- <nav:property name="position"/>
- <nav:property name="connectionString"/>
- <nav:property name="screenTip"/>
- <nav:property name="internalId"/>
- <nav:property name="type"/>
- <nav:property name="icons"/>
- <nav:property name="tenantID"/>
-
- <!-- nav properties -->
- <nav:param name="backUrl">false</nav:param>
- <nav:param name="urlFlags">h1cu</nav:param>
-
- <nav:param name="newSearch">false</nav:param>
- <xsl:choose>
- <xsl:when test="string($scope) = 'm' or string($scope) = 'p'">
- <nav:param name="mode">admin</nav:param>
- </xsl:when>
- </xsl:choose>
- <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
- <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
- <nav:sort>
- <xsl:attribute name="order">
- <xsl:choose>
- <xsl:when test="key('env-param', 'sort_order')='ascending'">ascending</xsl:when>
- <xsl:otherwise>descending</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="key('env-param', 'sort_column') != ''">
- <xsl:value-of select="key('env-param', 'sort_column')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>name</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </nav:sort>
- <!-- common nav params -->
- <admui:commonNavParams/>
- </nav:search>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </response>
- </xts:append>
- </xts:sequence>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!-- Merge the tenantNames into the response -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- path="/portal/tenancy/mergeTenantNames.xslt"
- id="mergeTenantNames"
- dependency="getContent"
- condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <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/"
- xmlns:val="http://developer.cognos.com/schemas/validator/1/"
- exclude-result-prefixes="xsl xts xos xtsext val">
- <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>
- <libraries>
- <library type="text/javascript" href="$WEB$/dojo16/dojo/dojo.js"/>
- <library type="text/javascript" href="$WEB$/ps/cogadmin/js/com/ibm/cognos/admin/dojoInit.js"/>
- <library type="text/javascript" href="$WEB$/ps/cogadmin/js/com/ibm/cognos/admin/xts/search.js"/>
- </libraries>
- <meta/>
- <info>
- <title>
- <xts:string id="IDS_ADM_SEARCH"/>
- </title>
- </info>
- <state>
- <xsl:variable name="state">
- <xsl:text><param name="bshowSearchCriteria"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='bshowSearchCriteria']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="sscope"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='sscope']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="smodified"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='smodified']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="stype"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='stype']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="smethod"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='smethod']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="sfield"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='sfield']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="stext"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='stext']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="bshowNotSpecific"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='bshowNotSpecific']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="search_from"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='search_from']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="search_skip"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='search_skip']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="search_to"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='search_to']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="sort_column"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='sort_column']))"/>
- <xsl:text></param></xsl:text>
- <xsl:text><param name="sort_order"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string(/root/env/param[@name='sort_order']))"/>
- <xsl:text></param></xsl:text>
- </xsl:variable>
- <xsl:value-of select="xtsext:base64encode($state,true())"/>
- </state>
- </fragment>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <xts:block id="renderMarkup" dependency="mergeTenantNames frag_init getMeta" nodelist="env, user, system, state" type="exec" mode="interpret" processor="XSLT">
- <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:nemo="http://developer.cognos.com/nemo"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
- xmlns:fragment="urn:cognos:fragments:validator"
- xmlns:fragment-cogadmin="urn:cognos:fragments:validator:cogadmin"
- exclude-result-prefixes="xsl nemo xts SOAP-ENV xos bus admui">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
- <markup>
- <mimeType>text/html</mimeType>
- <markupXml>
- <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>
- <xts:transform src="/cogadmin/transforms/gen-ui-markup/search.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/presentation/pager.xslt</xts:param>
- <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
- <root>
- <xts:queryNode select="/root/*[local-name()='queryResponse'] | /root/response/* | /root/scheduledBy | /root/user | /root/metadata | /root/system | /root/session | /root/env"/>
- </root>
- </xts:transform>
- <xts:queryNode select="/root/system | /root/session | /root/user"/>
- <objectType><xsl:value-of select="string(/root/env/param[@name = 'type'])" /></objectType>
- <newSearch><xsl:value-of select="string(/root/env/param[@name = 'newSearch'])" /></newSearch>
- </root>
- </xts:transform>
- </markupXml>
- </markup>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|