123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2012
- 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:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:pui="http://developer.cognos.com/common/portal/logic/ui/1/"
- xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
- xmlns:nui="http://developer.cognos.com/schemas/cps/logic/nav/ui/1/"
- xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
- xmlns:valerr="http://developer.cognos.com/validation/errrormessages/1/"
- xmlns:layout="http://developer.cognos.com/common/layout"
- xmlns:java="java:com.cognos.portal.utils.CCLLocaleUtils"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts xtsext ui nui nav">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="useLocale">
- <xsl:choose>
- <xsl:when test="not(/root/customs/param[@name='title']/value)">
- <xsl:value-of select="/root/preferences/param[@name='contentLocale']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="langs">
- <xsl:for-each select="/root/customs/param[@name='title']/value">
- <xsl:value-of select="@xml:lang"/>
- <xsl:if test="not(position() = last())">,</xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:value-of select="java:getBestFitLocale(string(/root/preferences/param[@name='contentLocale']),string($langs))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="productLocale">
- <xsl:value-of select="/root/preferences/param[@name='productLocale']"/>
- </xsl:variable>
- <xsl:variable name="isBidiEnabled">
- <xsl:value-of select="/root/preferences/param[@name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#biDirectionalFeaturesEnabled']"/>
- </xsl:variable>
- <xsl:variable name="baseTextDirection">
- <xsl:variable name="ns_name">
- <xsl:value-of select="/root/preferences/param[@name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#baseTextDirection']"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$ns_name != ''">
- <xsl:value-of select="translate(substring-after($ns_name,'#'),'LTRA','ltra')"/>
- </xsl:when>
- <xsl:otherwise>auto</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <layout:selectortemplates/>
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="/root/interactions/param[@name='formaction'] = 'objectSelect'">
- <xsl:call-template name="generateMarkupForObjectSelect"/>
- </xsl:when>
- <xsl:otherwise>
- <div>
- <layout formName="form">
- <xsl:call-template name="generateMarkupForFullPage"/>
- </layout>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="generateMarkupForObjectSelect">
- <xsl:variable name="navItemResponse" select="/root/init/objectResponse/nav:getItemResponse"/>
- <xsl:variable name="formAction" select="/root/interactions/param[@name='formaction']"/>
- <xsl:variable name="selectionId" select="/root/interactions/param[@name='p_navSelectionId']"/>
- <xsl:variable name="selectedChannel">
- <xsl:choose>
- <xsl:when test="/root/interactions/param[@name='tmp_channel'] != ''">
- <xsl:value-of select="/root/interactions/param[@name='tmp_channel']"/>
- </xsl:when>
- <xsl:when test="/root/state/param[@name='channel'] != ''">
- <xsl:value-of select="/root/state/param[@name='channel']"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='channel'] != ''">
- <xsl:value-of select="/root/customs/param[@name='channel']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <layout:script>
- var isBidiEnabled = <xsl:value-of select="boolean($isBidiEnabled='true')"/>;
- if (isBidiEnabled){
- var bidi = BidiUtils.getInstance();
- bidi.setProperties('<xsl:value-of select="$baseTextDirection"/>',
- '<xsl:value-of select="xtsext:getBTD('', $baseTextDirection, $productLocale)"/>',
- '<xsl:value-of select="$productLocale"/>');
- }
- </layout:script>
- <xsl:choose>
- <xsl:when test="((string($navItemResponse/*/nav:internalId) != '') and not($formAction)) or ($formAction and ($selectionId != ''))">
- <xsl:variable name="imageSrc" select="$navItemResponse/*/nav:imgURL"/>
- <xsl:variable name="hidden" select="$navItemResponse/*/nav:hidden"/>
- <xsl:variable name="fullName" select="$navItemResponse/*/nav:fullName"/>
- <xsl:variable name="selectedId" select="$navItemResponse/*/nav:internalId"/>
- <xsl:variable name="targetId">
- <xsl:choose>
- <xsl:when test="$navItemResponse/nav:shortcut/*/nav:internalId">
- <xsl:value-of select="$navItemResponse/nav:shortcut/*/nav:internalId"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$navItemResponse/*/nav:internalId"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="objectType">
- <xsl:choose>
- <xsl:when test="$navItemResponse/nav:shortcut/*/nav:type">
- <xsl:value-of select="$navItemResponse/nav:shortcut/*/nav:type"/>
- </xsl:when>
- <xsl:when test="$navItemResponse/*/nav:type">
- <xsl:value-of select="$navItemResponse/*/nav:type"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <layout:section format="select-dialog">
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_CVIEW_ENTRY_CAPTION"/></layout:text>
- </layout:label>
- <layout:row format="select-image">
- <layout:img src="{$imageSrc}" alt="{$navItemResponse/nav:item/nav:name}" title="{$navItemResponse/nav:item/nav:name}">
- <xsl:if test="$hidden = 'true' ">
- <layout:faded/>
- </xsl:if>
- </layout:img>
- <layout:text><xsl:value-of select="$fullName"/></layout:text>
- <xsl:if test="$objectType = 'query' or $objectType = 'report' or $objectType = 'reportView' or $objectType = 'analysis' or $objectType = 'shortcut'">
- <layout:link href="#" onclick="_THIS_openAdvancedPropEdit();" onkeypress="if (event.keyCode==9) return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) _THIS_openAdvancedPropEdit(); return false;" class="cogstyle-layout-left">
- <xts:string id="IDS_PROP_ADVANCED_PROP_EDIT_PROPERTIES"/>
- </layout:link>
- </xsl:if>
- </layout:row>
- <layout:row>
- <layout:link href="#" onclick="_THIS_chooseObject('prop', '_THIS_objectSelectionDiv', 'fragments.universalviewer.selection'); return false;" onkeypress="if (event.keyCode==9) return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) _THIS_chooseObject('prop', '_THIS_objectSelectionDiv', 'fragments.universalviewer.selection'); return false;">
- <xts:string id="IDS_PROP_OBJECT_SELECT_CAPTION"/>
- </layout:link>
- <layout:link href="#" onclick="_THIS_resetObject('_THIS_objectSelectionDiv');" onkeypress="if (event.keyCode==9) return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) _THIS_resetObject('_THIS_objectSelectionDiv'); return false;">
- <xts:string id="IDS_PROP_OBJECT_RESET_CAPTION"/>
- </layout:link>
- </layout:row>
- <layout:hidden id="navSelectId" name="p_navSelectionId" value="{$selectedId}"/>
- <layout:hidden id="targetId" name="p_targetId" value="{$targetId}"/>
- </layout:section>
- <layout:section format="none">
- <layout:field id="viewChannel" name="p_channel" type="text" maxlength="1024">
- <xsl:attribute name="valerr:message" namespace="http://developer.cognos.com/validation/errrormessages/1/" ><xts:string id='IDS_PROP_ERR_INVALID_CHANNEL_NAME' encode='javascript'/></xsl:attribute>
- <xsl:if test="$isBidiEnabled = 'true'">
- <xsl:attribute name="dir">
- <xsl:value-of select="xtsext:getBTD(string($selectedChannel), $baseTextDirection, $productLocale)"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$isBidiEnabled = 'true' and $baseTextDirection = 'auto'">
- <xsl:attribute name="onfocus">
- bidi.onfocus(this)
- </xsl:attribute>
- </xsl:if>
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_CHANNEL_CAPTION"/></layout:text>
- <xsl:choose>
- <xsl:when test="$objectType = 'query' or $objectType = 'report' or $objectType = 'reportView' or $objectType = 'analysis' or $objectType = 'shortcut'">
- <xsl:variable name="adprop"><xts:string id="IDS_PROP_ADVANCED_PROP_EDIT_PROPERTIES"/></xsl:variable>
- <layout:hint>
- <layout:text format="hasLink">
- <xts:string id="IDS_PROP_CHANNEL_MESSAGE_CAPTION"/>
- <xts:string id="IDS_PROP_CHANNEL_MESSAGE_REPORT_CAPTION">
- <xts:param name="link">
- <layout:link href="#" onclick="_THIS_openAdvancedPropEdit();" onkeypress="if (event.keyCode==9) return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) _THIS_openAdvancedPropEdit(); return false;">
- <xsl:value-of select="$adprop"/>
- </layout:link>
- </xts:param>
- </xts:string>
- </layout:text>
- </layout:hint>
- </xsl:when>
- <xsl:otherwise>
- <layout:hint><xts:string id="IDS_PROP_CHANNEL_MESSAGE_CAPTION"/></layout:hint>
- </xsl:otherwise>
- </xsl:choose>
- </layout:label>
- <layout:value><xsl:value-of select="$selectedChannel"/></layout:value>
- </layout:field>
- <layout:hidden id="tempChannel" name="tmp_channel" value="{$selectedChannel}"/>
- </layout:section>
- </xsl:when>
- <xsl:otherwise>
- <layout:section format="select-dialog">
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_CVIEW_ENTRY_CAPTION"/></layout:text>
- </layout:label>
- <layout:row format="select">
- <layout:text><xts:string id="IDS_PROP_OBJECT_NONE"/></layout:text>
- </layout:row>
- <layout:row>
- <layout:link href="#" onclick="_THIS_chooseObject('prop', '_THIS_objectSelectionDiv', 'fragments.universalviewer.selection'); return false;" onkeypress="if (event.keyCode==9) return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) _THIS_chooseObject('prop', '_THIS_objectSelectionDiv', 'fragments.universalviewer.selection'); return false;">
- <xts:string id="IDS_PROP_OBJECT_SELECT_CAPTION"/>
- </layout:link>
- </layout:row>
- <layout:hidden id="navSelectId" name="p_navSelectionId" value=""/>
- </layout:section>
- <layout:section format="none">
- <layout:field id="viewChannel" name="p_channel" type="text" maxlength="1024">
- <xsl:attribute name="valerr:message" namespace="http://developer.cognos.com/validation/errrormessages/1/" ><xts:string id='IDS_PROP_ERR_INVALID_CHANNEL_NAME' encode='javascript'/></xsl:attribute>
- <xsl:if test="$isBidiEnabled = 'true'">
- <xsl:attribute name="dir">
- <xsl:value-of select="xtsext:getBTD(string($selectedChannel), $baseTextDirection, $productLocale)"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$isBidiEnabled = 'true' and $baseTextDirection = 'auto'">
- <xsl:attribute name="onfocus">
- bidi.onfocus(this)
- </xsl:attribute>
- </xsl:if>
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_CHANNEL_CAPTION"/></layout:text>
- <layout:hint><layout:text><xts:string id="IDS_PROP_CHANNEL_MESSAGE_CAPTION"/></layout:text></layout:hint>
- </layout:label>
- <layout:value><xsl:value-of select="$selectedChannel"/></layout:value>
- </layout:field>
- <layout:hidden id="tempChannel" name="tmp_channel" value="{$selectedChannel}"/>
- </layout:section>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="generateMarkupForFullPage">
- <xsl:variable name="titleOptions">
- <xsl:choose>
- <xsl:when test="/root/state/param[@name='viewerTitleOptions'] != ''">
- <xsl:value-of select="/root/state/param[@name='viewerTitleOptions']"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='viewerTitleOptions'] != ''">
- <xsl:value-of select="/root/customs/param[@name='viewerTitleOptions']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="selectedChannel">
- <xsl:choose>
- <xsl:when test="/root/interactions/param[@name='tmp_channel'] != ''">
- <xsl:value-of select="/root/interactions/param[@name='tmp_channel']"/>
- </xsl:when>
- <xsl:when test="/root/state/param[@name='channel'] != ''">
- <xsl:value-of select="/root/state/param[@name='channel']"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='channel'] != ''">
- <xsl:value-of select="/root/customs/param[@name='channel']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="fragHeight">
- <xsl:choose>
- <xsl:when test="/root/state/param[@name='viewerFragmentHeight'] != ''">
- <xsl:value-of select="/root/state/param[@name='viewerFragmentHeight']"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='viewerFragmentHeight'] != ''">
- <xsl:value-of select="/root/customs/param[@name='viewerFragmentHeight']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <div>
- <pui:aboutscript/>
- <pui:helpscript/>
- <layout:form name="_THIS_form" action="_THIS?/THIS_" method="get">
- <layout:script>
- var _THIS_itemList = new Array("title");
- function _THIS_refreshEdit(evt)
- {
- if(evt.eventPhase == evt.AT_TARGET)
- {
- checkToRefresh("_THIS_form",evt,"<xts:string id="IDS_PROP_REFRESH_LANGUAGE_MSG" encode="javascript"/>");
- }
- }
- _THIS_.addEventListener("fragment.refresh","_THIS_refreshEdit",false);
- function _THIS_submitEditForm(formAction)
- {
- if (_THIS_validateFormFields())
- {
- var action = $("_THIS_formAction");
- action.setAttribute("value", formAction);
- if($("_THIS_navSelectId"))
- {
- if ((formAction == 'save')&&($("_THIS_navSelectId").value != ''))
- {
- $("_THIS_navSelectId").value = $("_THIS_navSelectId").value;
- }
- if (_THIS_.removeFragChildren)
- _THIS_.removeFragChildren();
- }
- document._THIS_form.submit();
- }
- }
- function _THIS_uviewReset(evt)
- {
- if (evt.eventPhase == evt.AT_TARGET){
- if (_THIS_.removeFragChildren)
- _THIS_.removeFragChildren();
- }
- }
- _THIS_.addEventListener("fragment.reset","_THIS_uviewReset",false);
- function _THIS_cancelEdit()
- {
- _THIS_.setMode('view');
- }
-
-
-
- function _THIS_validateFormFields()
- {
- var valid = true;
-
- var titleErr = validateMultiLingualProperty("selectLang", "title", "form", "_THIS_", _THIS_, _THIS_itemList);
- if (titleErr != CValidator.RES_VALID)
- {
- var entryEl = document.getElementById("_THIS_title");
- alert(entryEl.getAttribute("valerr:message"));
- entryEl.focus();
- return false;
- }
-
- //check the view channel
- var channel = $("_THIS_viewChannel");
- if (channel)
- {
- var channelErr = _THIS_.validate("channel", channel.value);
- if (channelErr != CValidator.RES_VALID)
- {
- alert(channel.getAttribute("valerr:message"));
- channel.focus();
- return false;
- }
- }
-
- //check the frag height
- var fragHeight = $("_THIS_viewFragHeight");
- if (fragHeight)
- {
-
- var fragHeightErr = _THIS_.validate("viewerFragmentHeight", fragHeight.value);
- if (fragHeightErr != CValidator.RES_VALID)
- {
- if (fragHeightErr == CValidator.RES_NUMERIC_NAN)
- {
- alert("<xts:string id='IDS_PROP_INVALID_HEIGHT' encode='javascript'/>");
- }
- else if (fragHeightErr == CValidator.RES_NUMERIC_MAX)
- {
- alert("<xts:string id='IDS_PROP_MAX_HEIGHT' encode='javascript'/>");
- }
- else
- {
- alert("<xts:string id='IDS_GEN_CLIENT_VALIDATION_ERROR' encode='javascript'/>");
- }
-
- fragHeight.focus();
- return false;
- }
- }
- return true;
- }
-
- function _THIS_createHiddenElement(id, name, value)
- {
- var hiddenElem;
- if ($("_THIS_selectedLanguage"))
- {
- hiddenElem = $(id);
- }
- else
- {
- hiddenElem = xCreateElement("input");
- hiddenElem.setAttribute("name", name);
- hiddenElem.setAttribute("value", value);
- hiddenElem.setAttribute("type", "hidden");
- hiddenElem.setAttribute("id", id);
- document._THIS_form.appendChild(hiddenElem);
- }
- hiddenElem.setAttribute("value", value);
- }
-
- function _THIS_reloadAfterSelectObject(response)
- {
- response = _THIS_decode(response);
- var xml = new _THIS_XMLBuilderLoadXMLFromString(response);
- if(xml)
- {
- var idNode = _F_DOM.selectSingleNode(xml, "/return/object/item[name= 'id']/value");
- var id = _F_DOM.text(idNode);
- var tmpChannel = $("_THIS_viewChannel").value;
- _THIS_.addEventListener("fragment.retrieve.after","_THIS_closeSelectDialog",false);
- var funcParms = "_THIS_.retrieve(\"p_navSelectionId=" + id + "&tmp_channel=" + tmpChannel + "&formaction=objectSelect\",\"" + _THIS_currentObjDiv + "\")";
- setTimeout(funcParms,1);
- _THIS_clearCustomizations();
- return;
- }
- }
-
- function _THIS_closeSelectDialog(evt)
- {
- if(evt.eventPhase == evt.AT_TARGET)
- setTimeout('_THIS_closeSD()', 350);
- }
-
- //CQ234492 To remove the delay in IE when closing the select dialog and focusing back to the main window
- function _THIS_closeSD() {
- _THIS_modalDialog.hide();
- _THIS_modalDialog.destroy();
- _THIS_modalDialog = null;
- _THIS_.removeEventListener("fragment.retrieve.after","_THIS_closeSelectDialog",false);
- }
-
- function _THIS_resetObject( divId)
- {
- _THIS_.retrieve('p_navSelectionId=&tmp_channel=&formaction=objectSelect', divId);
- return;
- }
-
- function _THIS_XMLBuilderLoadXMLFromString (markup)
- {
- var xmlDocument = null;
- if (window.ActiveXObject || "ActiveXObject" in window)
- {
- try
- {
- xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
- xmlDocument.loadXML(markup);
- }
- catch (e)
- {
- }
- }
- else if (typeof DOMParser != 'undefined')
- {
- xmlDocument = new DOMParser().parseFromString(markup, 'application/xml');
- }
- return xmlDocument;
- }
- function _THIS_decode(text)
- {
- var amp_re = /&amp;/g;
- var lt_re = /&lt;/g;
- var gt_re = /&gt;/g;
- var apos_re = /&apos;/g;
- // Decode stuff which has been encoded/escaped out.
- // ORDER IS IMPORTANT - amp_re must be the last value to replace!
- text = text.replace(lt_re, "<");
- text = text.replace(gt_re, ">");
- text = text.replace(apos_re, "'");
- text = text.replace(amp_re, "&");
- return text;
- }
- function _THIS_ccModalCallBack(cmd,sResponse)
- {
- if(cmd == 'ok' && sResponse)
- _THIS_reloadAfterSelectObject(sResponse);
- else{
- _THIS_modalDialog.hide();
- _THIS_modalDialog.destroy();
- _THIS_modalDialog = null;
- }
- }
-
- var _THIS_currentObjDiv = "";
- var _THIS_currentObjType ="";
- var _THIS_currentProperty ="";
- var _THIS_modalDialog = null;
- function _THIS_chooseObject(propName, updateDivId, objType) {
- var defaultPath = "/";
-
- if($("_THIS_navSelectId") !== undefined && $("_THIS_navSelectId").value != ""){
- defaultPath = "storeID(\"" + $("_THIS_navSelectId").value + "\")";
- }
-
- var theAmp = "&";
- var cForm = document._THIS_form;
- _THIS_currentObjDiv = updateDivId;
- _THIS_currentObjType = objType;
- _THIS_currentProperty = propName;
- if (objType =="folder" || objType == "package")
- objType += ".container";
- var url = "_THIS?frag-urlType=gateway&b_action=xts.run/THIS_" + theAmp +
- "m=portal/select/select.xts" + theAmp +
- "so.defaultObject=" + defaultPath + theAmp + "so.defaultLocation=" + defaultPath + theAmp + "so.select=" + objType + theAmp +
- "md.callBack=xml" + theAmp + "md.displayOptions=h1" + theAmp +
- "backURL=javascript:parent.ui_modal_dialog.close()";
- var iframeStaticHeight = parseInt(xClientHeight() * .75);
- var iframeStaticWidth = parseInt(xClientWidth() * .75);
- if (_THIS_modalDialog == null)
- _THIS_modalDialog = new ui_dialog("modalDialogViewer", '<xts:string id="IDS_GEN_SELECTION_TITLE" encode="javascript"/>', ui_dialog.style.BTN_NOBUTTONS | ui_dialog.style.CENTER | ui_dialog.style.IFRAME, -1, -1, iframeStaticWidth, iframeStaticHeight, _THIS_.div, url);
- _THIS_modalDialog.show();
- ccModalCallBack = _THIS_ccModalCallBack;
- }
-
- function _THIS_openAdvancedPropEdit() {
- var theAmp = "&";
- var navId = $("_THIS_targetId").value;
- var tmpChannel = $("_THIS_viewChannel").value;
- var fragDialog = new ui_dialog("advProps", '<xts:string id="IDS_PROP_ADVANCED_PROP_EDIT_TITLE" encode="javascript"/>', ui_dialog.style.BTN_OKCANCEL | ui_dialog.style.CENTER | ui_dialog.style.RESIZABLE, -1, -1, 600, 400, _THIS_.div);
- fragDialog.setContent("<div id=" + _THIS_.id + "dialogPrefcontent></div>");
- fragDialog.fragment = new fragment("/cm/" + navId, _THIS_.id + "dialogPref");
- fragDialog.fragment.modes = ["view", "edit"];
- fragDialog.show();
- fragDialog.fragment.mode = 'edit';
- fragDialog.fragment.retrieve('frag-view=dialog&p_navSelectionId=' + navId + '&tmp_channel=' + tmpChannel);
- fragDialog.fragment.ownerFragment = _THIS_;
- fragDialog.fragment.ownerDialog = fragDialog;
- fragDialog.data = _THIS_getCustomizations();
- _THIS_.dialog = fragDialog;
- }
-
- function _THIS_getCustomizations()
- {
- var customizationsHiddenElem = $("_THIS_dlgCustomizations");
- var propsObj = null;
- if ((customizationsHiddenElem)&&(customizationsHiddenElem.value != ''))
- {
- propsObj = _THIS_buildObjFromUrl(customizationsHiddenElem.value);
- }
- return propsObj;
- }
-
- function _THIS_saveCustomizations(url)
- {
- $("_THIS_dlgCustomizations").value = url;
- }
-
- function _THIS_clearCustomizations()
- {
- $("_THIS_dlgCustomizations").value = '';
- }
-
- function _THIS_buildObjFromUrl(url)
- {
- var propsObj = null;
- var paramsArray = url.split("&");
- if (paramsArray.length > 0)
- {
- propsObj = new Object();
- for (var i=0; i < paramsArray.length; i++)
- {
- var equalPos = paramsArray[i].indexOf("=");
- if (equalPos > 0){
- var key = paramsArray[i].substring(0,equalPos);
- var val = paramsArray[i].substring(equalPos + 1, paramsArray[i].length);
- var decodedVal = decodeURIComponent(val);
- propsObj[key] = decodedVal;
- }
- }
- }
- return propsObj;
- }
- function _THIS_handleDialogEvents(evt){
- switch(evt.name){
- case "cognos.viewer.plugin.preferences.save":
- _THIS_saveCustomizations(evt.payload);
- _THIS_.dialog.fragment.destroy();
- _THIS_.dialog.hide();
- _THIS_.dialog.destroy();
- break;
-
- case "cognos.viewer.plugin.preferences.close":
- _THIS_.dialog.fragment.destroy();
- _THIS_.dialog.destroy();
- break;
- }
- evt.stopPropagation();
- }
-
-
- _THIS_.addEventListener("cognos.viewer.plugin.preferences.*", "_THIS_handleDialogEvents", false);
-
- function _THIS_resetRadio(format)
- {
- if( format == "type")
- document._THIS_form._THIS_viewerTitleOptions[1].checked=true;
- else
- {
- document._THIS_form._THIS_viewerTitleOptions[0].checked=true;
- }
- }
-
- </layout:script>
- <layout:section format="header">
- <layout:text><xts:string id="IDS_PROP_EDIT_CVIEW_TITLE"/></layout:text>
- <layout:actionlist>
- <layout:action>
- <pui:aboutlink/>
- </layout:action>
- <layout:action>
- <pui:helplink/>
- </layout:action>
- </layout:actionlist>
- </layout:section>
- <layout:section>
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_TITLE_CAPTION"/></layout:text>
- </layout:label>
- <layout:radio name="p_viewerTitleOptions" id="viewerTitleOptions">
- <xsl:if test="($titleOptions = 'entryName')">
- <xsl:attribute name="selected">true</xsl:attribute>
- </xsl:if>
- <layout:text><xts:string id="IDS_PROP_CVIEW_ENTRY_NAME_TEXT"/></layout:text>
- <layout:value>entryName</layout:value>
- </layout:radio>
- <layout:radio name="p_viewerTitleOptions" id="viewerTitleOptions">
- <xsl:if test="($titleOptions = 'customTitle') or ($titleOptions = '')">
- <xsl:attribute name="selected">true</xsl:attribute>
- </xsl:if>
- <layout:text><xts:string id="IDS_PROP_CVIEW_TITLE_NAME_TEXT"/></layout:text>
- <layout:value>customTitle</layout:value>
- <layout:rcsection>
- <layout:localeselectorcontrol name="selectLang">
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_LANGUAGE_CAPTION"/></layout:text>
- </layout:label>
- <layout:controlparameters>
- <formname>_THIS_form</formname>
- <contentlocales><xsl:copy-of select="/root/input[@name='configurationResponse']/config/param[@name='contentLocales']/*"/></contentlocales>
- <customs><xsl:copy-of select="/root/customs/*"/></customs>
- <fieldlist>title</fieldlist>
- <preferences><xsl:copy-of select="/root/preferences/*"/></preferences>
- </layout:controlparameters>
- </layout:localeselectorcontrol>
- <layout:field id="title" size="40" name="p_title" type="text" maxlength="256" onblur="savelangitem('_THIS_','form','selectLang',this)" onkeydown="_THIS_resetRadio('type')" >
- <xsl:variable name="titleValue">
- <xsl:choose>
- <xsl:when test="/root/customs/param[@name='title']/value[@xml:lang=$useLocale]">
- <xsl:value-of select="/root/customs/param[@name='title']/value[@xml:lang=$useLocale]"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='title']/value[1]">
- <xsl:value-of select="/root/customs/param[@name='title']/value[1]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/fragment/meta/customProperties[@name='title']/default/value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="valerr:message" namespace="http://developer.cognos.com/validation/errrormessages/1/" ><xts:string id="IDS_GEN_TITLE_VALIDATION_ERROR" /></xsl:attribute>
- <xsl:if test="$isBidiEnabled = 'true'">
- <xsl:attribute name="dir">
- <xsl:value-of select="xtsext:getBTD(string($titleValue), $baseTextDirection, $productLocale)"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$isBidiEnabled = 'true' and $baseTextDirection = 'auto'">
- <xsl:attribute name="onfocus">
- bidi.onfocus(this)
- </xsl:attribute>
- </xsl:if>
- <layout:label><layout:text><xts:string id="IDS_PROP_TITLE_CAPTION"/></layout:text></layout:label>
- <layout:value>
- <xsl:value-of select="$titleValue"/>
- </layout:value>
- </layout:field>
- </layout:rcsection>
- </layout:radio>
- </layout:section>
- <layout:section id="objectSelectionDiv">
- <xsl:call-template name="generateMarkupForObjectSelect"/>
- </layout:section>
- <layout:section format="division" divider="true">
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_CVIEW_VIEW_OPTIONS"/></layout:text>
- </layout:label>
- <layout:section>
- <layout:field id="viewFragHeight" name="p_viewerFragmentHeight" type="text" maxlength="4">
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_FRAGMENT_FRAGMENT_HEIGHT_CAPTION"/></layout:text>
- </layout:label>
- <layout:value><xsl:value-of select="$fragHeight"/></layout:value>
- </layout:field>
- </layout:section>
- </layout:section>
- <layout:section format="division" divider="true">
- <layout:label>
- <layout:text><xts:string id="IDS_PROP_CVIEW_ADVANCED_OPTIONS"/></layout:text>
- </layout:label>
- <layout:section>
- <layout:checkbox id="delayExecution" name="p_delayExecution" type="checkbox" selected="{/root/customs/param[@name='delayExecution']}">
- <layout:text><xts:string id="IDS_PROP_EDIT_DELAY_EXECUTION_CAPTION"/></layout:text>
- <layout:value>true</layout:value>
- </layout:checkbox>
- </layout:section>
- </layout:section>
-
- <layout:section format="footer" divider="true">
- <layout:row>
- <layout:button onclick="_THIS_submitEditForm('save'); return true;" onkeypress="if (event.keyCode==9) return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) _THIS_submitEditForm('save'); return false;">
- <layout:value><xts:string id="IDS_PROP_OK_BUTTON_TEXT"/></layout:value>
- </layout:button>
- <layout:button onclick="_THIS_cancelEdit();" onkeypress="if (event.keyCode==9) return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) _THIS_cancelEdit(); return false;">
- <layout:value><xts:string id="IDS_PROP_CANCEL_BUTTON_TEXT"/></layout:value>
- </layout:button>
- </layout:row>
- </layout:section>
- <!-- hidden inputs -->
- <xsl:variable name="reportParams">
- <xsl:choose>
- <xsl:when test="/root/state/param[@name='viewerReportParams'] != ''">
- <xsl:value-of select="/root/state/param[@name='viewerReportParams']"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='viewerReportParams'] != ''">
- <xsl:value-of select="/root/customs/param[@name='viewerReportParams']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="displayParams">
- <xsl:choose>
- <xsl:when test="/root/state/param[@name='displayPromptParams'] != ''">
- <xsl:value-of select="/root/state/param[@name='displayPromptParams']"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='displayPromptParams'] != ''">
- <xsl:value-of select="/root/customs/param[@name='displayPromptParams']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dialogCustoms">
- <xsl:choose>
- <xsl:when test="/root/state/param[@name='dialogCustomizations'] != ''">
- <xsl:value-of select="/root/state/param[@name='dialogCustomizations']"/>
- </xsl:when>
- <xsl:when test="/root/customs/param[@name='dialogCustomizations'] != ''">
- <xsl:value-of select="/root/customs/param[@name='dialogCustomizations']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <layout:hidden id="viewerReportParams" name="p_viewerReportParams" value="{$reportParams}"/>
- <layout:hidden id="displayPromptParams" name="p_displayPromptParams" value="{$displayParams}"/>
- <layout:hidden id="dlgCustomizations" name="p_dialogCustomizations" value="{$dialogCustoms}" />
- <layout:hidden id="formAction" name="formaction" value="init"/>
- </layout:form>
- </div>
- </xsl:template>
- </xsl:stylesheet>
|