123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (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).
- -->
- <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:uic="http://developer.cognos.com/schemas/uic/presentation/markup/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:resource-prop="http://developer.cognos.com/admin/properties" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:ns1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" xmlns:admui="http://developer.cognos.com/schemas/xts/admui" xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2" xmlns:cogadminext="xalan://com.cognos.admin.xts.ext.XTSExt" exclude-result-prefixes="wsrf-rp resource-prop admui xtsext xsl ns1 ui uic SOAP-ENV muws2 xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <!-- display variables -->
- <admui:variables/>
- <ui:commonTemplates/>
- <xsl:variable name="sortColumn">
- <xsl:choose>
- <xsl:when test="key('env-param', 'sort_column') != ''">
- <xsl:value-of select="key('env-param', 'sort_column')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="sortOrder">
- <xsl:choose>
- <xsl:when test="normalize-space(key('env-param', 'sort_order')) != ''">
- <xsl:value-of select="key('env-param', 'sort_order')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/root" priority="2">
- <xsl:variable name="relationshipTypes" select="/root/relationships/wsrf-rp:GetResourcePropertyResponse/resource-prop:SupportedRelationships"/>
- <uic:fragment>
- <!-- find out what the root relationship type is -->
- <xsl:variable name="selectedRelationshipType">
- <xsl:choose>
- <xsl:when test="key('env-param','rootRelationshipType') != ''">
- <xsl:value-of select="key('env-param','rootRelationshipType')"/>
- </xsl:when>
- <xsl:when test="key('env-param','selectedRelationshipType') != ''">
- <xsl:value-of select="key('env-param','selectedRelationshipType')"/>
- </xsl:when>
- <xsl:when test="key('env-param','relationshipType') != ''">
- <xsl:value-of select="key('env-param','relationshipType')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$relationshipTypes//resource-prop:Relationship[@default='true']/resource-prop:Name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="application">
- <xsl:value-of select="key('env-param','application')"/>
- </xsl:variable>
- <xsl:variable name="defaultResourceId">
- <xsl:value-of select="cogadminext:getDefaultResourceId(string($application))"/>
- </xsl:variable>
-
-
-
- <!-- get the caption for the root breadcrumb -->
- <xsl:variable name="rootCaption" select="$relationshipTypes//resource-prop:Relationship[resource-prop:Name = string($selectedRelationshipType)]/resource-prop:Caption"/>
- <script>
- <xsl:if test="not($selectedRelationshipType = 'templates')">
- _THIS_onReloadEvent = function(evt) {
- if (evt.source != _THIS_) {
- removeReloadEventListener(_THIS_, "_THIS_onReloadEvent");
- raiseReloadEvent(_THIS_);
- _THIS_.raiseEvent("fragment.refresh");
- }
- }
- addReloadEventListener(_THIS_, "_THIS_onReloadEvent");
- </xsl:if>
-
- function getBCDepth(depth) {
- return depth ? depth : 1;
- }
-
- var _THIS_context = new relationships_context(
- {
- sortColumn: '<xsl:value-of select="$sortColumn"/>',
- sortOrder: '<xsl:value-of select="$sortOrder"/>'
- });
- _THIS_setContext = function(resourceID, storeID) {
- _THIS_.relationshipsObj.breadcrumbArray[_THIS_.relationshipsObj.breadcrumbArray.length-1].selectedResourceID=resourceID;
- _THIS_.relationshipsObj.breadcrumbArray[_THIS_.relationshipsObj.breadcrumbArray.length-1].selectedStoreID=storeID;
- }
-
- if (!_THIS_.relationshipsObj) {
- _THIS_.relationshipsObj = new cogadmin_relationships(_THIS_, '_THIS_', '<xts:string id="IDS_ADM_ACT_NO_SELECTION" encode="javascript"/>');
- <!-- first time we hit the page, so add the root breadcrumb information -->
- _THIS_.relationshipsObj.addBreadcrumb('<xsl:value-of select="xtsext:javascriptencode(string($selectedRelationshipType))"/>','<xsl:value-of select="xtsext:javascriptencode(string($defaultResourceId))"/>','<xsl:value-of select="xtsext:javascriptencode(string(./muws2:QueryRelationshipsByTypeResponse/muws2:Relationship/muws2:Participant[1]/resource-prop:StoreID))"/>');
- }
- else {
- _THIS_.relationshipsObj.clearResourceInfo();
- }
-
- <!-- if we're at the root, then we need to keep track of the action and group action context id's -->
- <xsl:variable name="resourceID" select="key('env-param','resourceID')"/>
- <xsl:if test="$resourceID='' or $resourceID=$defaultResourceId">
- <!-- get the currently selected relationship for the system -->
- <xsl:variable name="relationshipName">
- <xsl:choose>
- <xsl:when test="key('env-param','relationshipType') != ''">
- <xsl:value-of select="key('env-param','relationshipType')"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- get the default relationship -->
- <xsl:value-of select="$relationshipTypes/resource-prop:Relationship[@default='true'][1]/*[local-name()='Name']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- need to get the action and groupAction ID's -->
- <!-- the action can be nested inside a sub-menu, hence the // in the searchpath -->
- <xsl:variable name="currentAction" select="$relationshipTypes//resource-prop:Relationship[resource-prop:Name = string($relationshipName)]"/>
- <xsl:variable name="groupActionID">
- <xsl:choose>
- <!-- check the current relationship -->
- <xsl:when test="$currentAction/resource-prop:ActionContexts/resource-prop:Context[@type='GroupAction']/@id != ''">
- <xsl:value-of select="$currentAction/resource-prop:ActionContexts/resource-prop:Context[@type='GroupAction']/@id"/>
- </xsl:when>
- <!-- if we're in a container, then check to see if the contain has the action ID's -->
- <xsl:when test="$currentAction/parent::*[@container='true']/resource-prop:ActionContexts/resource-prop:Context[@type='GroupAction']/@id != ''">
- <xsl:value-of select="$currentAction/parent::*[@container='true']/resource-prop:ActionContexts/resource-prop:Context[@type='GroupAction']/@id"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="actionID">
- <xsl:choose>
- <!-- check the current relationship -->
- <xsl:when test="$currentAction/resource-prop:ActionContexts/resource-prop:Context[@type='Action']/@id != ''">
- <xsl:value-of select="$currentAction/resource-prop:ActionContexts/resource-prop:Context[@type='Action']/@id"/>
- </xsl:when>
- <!-- if we're in a container, then check to see if the contain has the action ID's -->
- <xsl:when test="$currentAction/parent::*[@container='true']/resource-prop:ActionContexts/resource-prop:Context[@type='Action']/@id != ''">
- <xsl:value-of select="$currentAction/parent::*[@container='true']/resource-prop:ActionContexts/resource-prop:Context[@type='Action']/@id"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- _THIS_.relationshipsObj.setRootActionContext('<xsl:value-of select="xtsext:javascriptencode(string($actionID))"/>','<xsl:value-of select="xtsext:javascriptencode(string($groupActionID))"/>');
- </xsl:if>
-
-
- function _THIS_getJSHandler() {
- return _THIS_.relationshipsObj;
- }
-
- function closeSettingsDialog() {
- ui_modal_dialog.close();
- raiseReloadEvent(_THIS_);
- }
- <!-- build the supported relationships menu -->
- var g_THIS_relationshipsMenu=new ui_menu({id: "_THIS_", fragment: "_THIS_", items:[
- <xsl:for-each select="$relationshipTypes/resource-prop:Relationship[not(@container)]">
- <xsl:variable name="isSelected">
- <xsl:value-of select="resource-prop:Name = $selectedRelationshipType"/>
- </xsl:variable>
- {
- title: "<xsl:value-of select="resource-prop:Caption"/>",
- selected: <xsl:value-of select="$isSelected"/>,
- action: function(evt) {
- _THIS_.relationshipsObj.keepBreadcrumbs(1);
- _THIS_.relationshipsObj.switchRelationshipType('<xsl:value-of select="xtsext:javascriptencode(string(resource-prop:Name))"/>');
- _THIS_.retrieve(_THIS_.relationshipsObj.buildURLParams(_THIS_context));
- }
- }
- <xsl:if test="position() != last()">,</xsl:if>
- </xsl:for-each>
- <xsl:for-each select="$relationshipTypes/resource-prop:Relationship[@container]">
- , {
- title: "<xsl:value-of select="xtsext:javascriptencode(string(resource-prop:Caption))"/>",
- items: [
- <xsl:for-each select="resource-prop:Relationship">
- <xsl:variable name="isSelected">
- <xsl:value-of select="resource-prop:Name = $selectedRelationshipType"/>
- </xsl:variable>
- {
- title: "<xsl:value-of select="resource-prop:Caption"/>",
- selected: <xsl:value-of select="$isSelected"/>,
- action: function(evt) {
- _THIS_.relationshipsObj.keepBreadcrumbs(1);
- _THIS_.relationshipsObj.switchRelationshipType('<xsl:value-of select="xtsext:javascriptencode(string(resource-prop:Name))"/>');
- _THIS_.retrieve(_THIS_.relationshipsObj.buildURLParams(_THIS_context));
- }
- }
- <xsl:if test="position() != last()">,</xsl:if>
- </xsl:for-each>
- ]
- }
- </xsl:for-each>
- ]});
-
- _THIS_.navigate = function(resourceID, storeID,depth) {
- _THIS_.relationshipsObj.addBreadcrumb('containedBy', resourceID, storeID,depth);
- _THIS_.retrieve(_THIS_.relationshipsObj.buildURLParams(_THIS_context));
- }
-
- <!-- init the popup for the properties dialog -->
- <xsl:variable name="progressImage">
- <admui:imageURL image="progress.gif" type="cogadmin"/>
- </xsl:variable>
- initPopup('<xsl:value-of select="xtsext:javascriptencode(string($progressImage))"/>', '<xts:string id="IDS_ADM_MESSAGE_STOP" encode="javascript"/>');
- </script>
- <table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
- <tr>
- <td width="90%">
- <!-- breadcrumbs -->
- <uic:breadcrumbs width="100%" height="18">
- <xsl:variable name="bcDepth">
- <xsl:value-of select="key('env-param','bcDepth')"/>
- </xsl:variable>
- <!-- root -->
- <uic:complexBreadcrumb>
- <xsl:choose>
- <xsl:when test="$bcDepth = '' or $bcDepth = 1">
- <uic:text>
- <xsl:variable name="parentCaption"><xsl:value-of select="$relationshipTypes/resource-prop:Relationship[@container and ./resource-prop:Relationship/resource-prop:Name = string($selectedRelationshipType)]/resource-prop:Caption"/></xsl:variable>
- <!-- if the relationships is contained, prefix the caption with the parent caption -->
- <xsl:if test="$parentCaption != ''">
- <xsl:value-of select="concat($parentCaption,' - ')"/>
- </xsl:if>
- <xsl:value-of select="$rootCaption"/>
- </uic:text>
- </xsl:when>
- <xsl:otherwise>
- <uic:link>
- <uic:text>
- <xsl:variable name="parentCaption"><xsl:value-of select="$relationshipTypes/resource-prop:Relationship[@container and ./resource-prop:Relationship/resource-prop:Name = string($selectedRelationshipType)]/resource-prop:Caption"/></xsl:variable>
- <!-- if the relationships is contained, prefix the caption with the parent caption -->
- <xsl:if test="$parentCaption != ''">
- <xsl:value-of select="concat($parentCaption,' - ')"/>
- </xsl:if>
- <xsl:value-of select="$rootCaption"/>
- </uic:text>
- <uic:href>#</uic:href>
- <uic:onclick>_THIS_.relationshipsObj.keepBreadcrumbs(1); _THIS_.retrieve(_THIS_.relationshipsObj.buildURLParams(_THIS_context));</uic:onclick>
- </uic:link>
- </xsl:otherwise>
- </xsl:choose>
- <uic:icon uic:noSpace="true" aria-haspopup="true" aria-labelledBy="{concat('_THIS_breadcrumb',position())}">
- <uic:src>
- <admui:imageURL image="dropdown_arrow.gif" type="skin_shared"/>
- </uic:src>
- <uic:tooltip>
- <xts:string id="IDS_ADM_TOP_CHANGE_VIEW"/>
- </uic:tooltip>
- <uic:onclick>ui_menuShow(event,g_THIS_relationshipsMenu);</uic:onclick>
- </uic:icon>
- </uic:complexBreadcrumb>
-
- <!-- build up the breadcrumbs -->
- <xsl:for-each select="//root/breadcrumbs/*[local-name()='GetMultipleResourcePropertiesResponse'][position() < $bcDepth]/*[local-name()='Caption']">
- <xsl:sort select="@name"/>
- <xsl:variable name="jsEncodedResourceID" select="xtsext:javascriptencode(string(key('env-param',concat('bc_resid_',position()))))"/>
- <xsl:variable name="jsEncodedStoreID" select="xtsext:javascriptencode(string(key('env-param',concat('bc_id_',position()))))"/>
- <xsl:variable name="displayName" select="."/>
- <uic:complexBreadcrumb>
- <xsl:choose>
- <xsl:when test="position() != last()">
- <uic:link>
- <uic:text>
- <xsl:value-of select="$displayName"/>
- </uic:text>
- <uic:href>#</uic:href>
- <uic:onclick>_THIS_.relationshipsObj.keepBreadcrumbs(<xsl:value-of select="position() + 1"/>); _THIS_.retrieve(_THIS_.relationshipsObj.buildURLParams(_THIS_context));</uic:onclick>
- </uic:link>
- </xsl:when>
- <xsl:otherwise>
- <uic:text>
- <xsl:value-of select="$displayName"/>
- </uic:text>
- </xsl:otherwise>
- </xsl:choose>
- <uic:icon uic:noSpace="true" aria-haspopup="true" aria-labelledBy="{concat('_THIS_breadcrumb',position()+1)}">
- <uic:src>
- <admui:imageURL image="dropdown_arrow.gif" type="skin_shared"/>
- </uic:src>
- <uic:tooltip>
- <xts:string id="IDS_ADM_TOP_SIBLING_NAVIGATION"/>
- </uic:tooltip>
- <uic:onclick>_THIS_.relationshipsObj.getSiblingMenu(event, '<xsl:value-of select="position()"/>');</uic:onclick>
- </uic:icon>
- </uic:complexBreadcrumb>
- </xsl:for-each>
- </uic:breadcrumbs>
- </td>
- <xsl:if test="not($selectedRelationshipType = 'templates')">
- <!-- group actions (if it's not Templates-->
- <td width="10%" align="right">
- <uic:icon>
- <uic:src>
- <admui:imageURL image="action_toolbar.gif" type="cogadmin"/>
- </uic:src>
- <uic:tooltip>
- <xts:string id="IDS_ADM_TOP_GROUP_ACTIONS"/>
- </uic:tooltip>
- <uic:onclick>_THIS_.relationshipsObj.showGroupActionsMenu(event);</uic:onclick>
- </uic:icon>
- </td>
- </xsl:if>
- </tr>
- </table>
- </uic:fragment>
- </xsl:template>
- <xsl:template match="node()" priority="-1">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="text()" priority="-1">
- <xsl:value-of select="."/>
- </xsl:template>
- </xsl:stylesheet>
|