12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2022
- 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).
- -->
- <!--
- =================================================================================================================================
- email_options_ags.xts
- view email_interface.xml for information on the API.
- this legacy email_option file is for those components who are not compitable with Dojo solution (e.g. rich text editor) yet.
- =================================================================================================================================
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
- <!--
- ===============================================================================================
- processRequestParams - Default any params that weren't passed in. Also this is where we would
- do validation (when time permits).
- ===============================================================================================
- -->
- <xts:block id="processRequestParams" processor="XSLT" type="exec" nodeList="/root/*[local-name()='requestParams']">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- exclude-result-prefixes="xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/*[local-name()='requestParams']">
- <xts:transform src="portal/controls/gen_default_parameters.xslt" processor="XSLT">
- <root>
- <xts:transform name="XML">
- <xts:param name="systemId">portal/emailOptions/email_interface.xml</xts:param>
- </xts:transform>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- </root>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- returnResult - We're done with the email options morphlet, so return the appropriate response
- ===============================================================================================
- -->
- <xts:block id="returnResult" type="exec" processor="XSLT" dependency="processResponse processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'genDefault' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'next' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'back' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'canceled']" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- exclude-result-prefixes="xsl xos xtsext">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <xsl:key name="session-param" match="/root/session/param" use="@name"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <!-- build a part -->
- <xts:transform name="Null" option="part" mimeType="text/xml">
- <xsl:element name="{key('request-param','resultNode')}" namespace="">
- <xsl:choose>
- <xsl:when test="key('request-param','requestState') = 'canceled'">
- <canceled/>
- </xsl:when>
- <!-- generate default delivery options -->
- <xsl:when test="key('request-param','requestState') = 'genDefault'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="portal/emailOptions/transforms/delivery_items.xslt" processor="XSLT">
- <root>
- <xsl:if test="key('session-param','e_hp')!='' and key('session-param','e_hp')!='CAMID("::Anonymous")'">
- <xts:transform src="portal/emailOptions/transforms/generateEmailTo.xslt" processor="XSLT">
- <root>
- <e_hp><xsl:value-of select="key('session-param','e_hp')"/></e_hp>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <search>
- <xsl:value-of select="'~'"/>
- </search>
- <properties>
- <cm:property name="email"/>
- <cm:property name="notificationEMail"/>
- <cm:property name="iconURI"/>
- </properties>
- </query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <xsl:if test="key('request-param','subscription')='true'">
- <!-- add another node to say to use the notification email address -->
- <subscription/>
- </xsl:if>
- </root>
- </xts:transform>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="key('request-param','defaultEmailAsAttachment')='true' and key('request-param','hideEmailAsAttachment')='false' and not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)"><param name="m_ro_emailAsAttachment">true</param></xsl:when>
- <xsl:otherwise><param name="m_ro_emailAsAttachment">false</param></xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="key('request-param','defaultEmailAsAttachment')='true'"><param name="m_ro_emailAsURL">false</param></xsl:when>
- <xsl:when test="key('request-param','hideLinkToReport')='false'"><param name="m_ro_emailAsURL">true</param></xsl:when>
- <xsl:otherwise><param name="m_ro_emailAsURL">false</param></xsl:otherwise>
- </xsl:choose>
- <param name="email_subject">
- <xsl:choose>
- <!-- use the supplied subject when we're given one - else we just make it up -->
- <xsl:when test="key('request-param','defaultSubject')">
- <xsl:value-of select="key('request-param','defaultSubject')"/>
- </xsl:when>
- <!-- only time we'd be defaulting the delivery options and we have a step class if for reports -->
- <!-- Don't pretty print the following section since it'll add spaces in the default subject -->
- <xsl:when test="key('env-param','step-class') != ''"><xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/><xsl:value-of select="concat(' ',key('env-param','step_default_name'))"/></xsl:when>
- <xsl:when test="key('env-param','m_class')='jobDefinition' or key('env-param','m_new_class')='jobDefinition'"><xts:string id="IDS_EMAIL_OPTIONS_JOB_PREFIX"/><xsl:choose><xsl:when test="key('env-param','m_p_defaultName')"><xsl:value-of select="concat(' ',key('env-param','m_p_defaultName'))"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(' ',key('env-param','m_name'))"/></xsl:otherwise></xsl:choose></xsl:when>
- <xsl:otherwise><xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/><xsl:choose><xsl:when test="key('env-param','ui.name')"><xsl:value-of select="concat(' ',key('env-param','ui.name'))"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(' ',key('env-param','m_name'))"/></xsl:otherwise></xsl:choose></xsl:otherwise>
- </xsl:choose>
- </param>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
- <!-- return the task name -->
- <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
- <xsl:call-template name="buildAgentVars"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="portal/emailOptions/transforms/delivery_items.xslt" processor="XSLT">
- <root>
- <xts:transform src="portal/emailOptions/transforms/process_email_address.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- <xsl:if test="key('env-param','addedRecipients') != ''">
- <xsl:choose>
- <!-- if the 'to', 'cc' or 'bcc' fields have changed then rebuild the addedRecipients list -->
- <xsl:when test="key('env-param','recipientsChanged')='true'">
- <xts:transform src="portal/emailOptions/transforms/move_recipients.xslt" processor="XSLT">
- <root>
- <addedRecipients>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
- </xts:transform>
- </addedRecipients>
- <toField><xsl:value-of select="key('env-param','email_to')"/></toField>
- <ccField><xsl:value-of select="key('env-param','email_cc')"/></ccField>
- <bccField><xsl:value-of select="key('env-param','email_bcc')"/></bccField>
- </root>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <addedRecipients>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
- </xts:transform>
- </addedRecipients>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </root>
- </xts:transform>
- <!-- links and attachments -->
- <xsl:if test="key('env-param','links') != ''">
- <links>
- <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </links>
- </xsl:if>
- <!-- attachments -->
- <xsl:if test="key('env-param','attachments') != ''">
- <attachments>
- <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </attachments>
- </xsl:if>
- <!-- richEditBody - validate HTML for allowed tags only-->
- <!-- only perform this transform when we are in Rich Edit Mode -->
- <xsl:if test="key('env-param','hidden_richEditBody') != '' and key('env-param','richEditMode')='true'">
-
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
- <xsl:choose>
- <xsl:when test="key('system-param','allow-email-links')='true'">
- <xts:param name="noNamespaceSchemaLocation">portal/emailOptions/schemas/richEditBodyPartial.xsd</xts:param>
- </xsl:when>
- <xsl:otherwise>
- <xts:param name="noNamespaceSchemaLocation">portal/emailOptions/schemas/richEditBodyFull.xsd</xts:param>
- </xsl:otherwise>
- </xsl:choose>
- <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
- <xts:transform src="portal/emailOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
- <xsl:value-of select="/root/env/param[@name='hidden_richEditBody']" disable-output-escaping="yes"/>
- </xts:transform>
-
- </xts:transform>
- </xsl:if>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
-
- <!-- return the task name -->
- <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
- <xsl:call-template name="buildAgentVars"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
-
- <xsl:template name="buildAgentVars">
- <!-- taskName isn't shown in the UI anymore (trakker bug 478414). Agent studio wants the email subject
- returned as the taskName -->
- <xsl:variable name="quote">"</xsl:variable>
- <xsl:variable name="apos">'</xsl:variable>
- <xsl:variable name="task_name">
- <xsl:choose>
- <xsl:when test="key('env-param','email_subject') and key('env-param','email_subject')!=''">
- <xsl:value-of select="key('env-param','email_subject')"/>
- </xsl:when>
- <xsl:when test="key('request-param','defaultSubject') and key('request-param','defaultSubject')!=''">
- <xsl:value-of select="key('request-param','defaultSubject')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('request-param','taskName')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <taskName>
- <xsl:choose>
- <xsl:when test="contains($task_name,$quote) and contains($task_name,$apos)">
- <xsl:value-of select="translate($task_name,$quote,$apos)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$task_name"/>
- </xsl:otherwise>
- </xsl:choose>
- </taskName>
- <hasAttachment>
- <xsl:choose>
- <xsl:when test="key('env-param','attachments') != '' or key('env-param','links') != ''">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </hasAttachment>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- callMorphlet - Calls the appropriate morphlet using the passed in params which will return
- markup to be displayed or the expected results
- ===============================================================================================
- -->
- <xts:block id="callMorphlet" processor="XSLT" type="exec" dependency="processRequestParams" condition=".[ starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addEntries') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addLinks') ]" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:req-params="http://developer.cognos.com/schemas/request/params"
- exclude-result-prefixes="xsl dlgctrl xtsext req-params">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="starts-with(key('request-param','requestState'),'addEntries')">
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
- <dlgctrl:stackName>add_entries</dlgctrl:stackName>
- <req-params:param name="defaultTarget"><xsl:value-of select="key('request-param','defaultTarget')"/></req-params:param>
- <req-params:param name="titlePostfix"><xsl:value-of select="key('request-param','titlePostfix')"/></req-params:param>
- <req-params:param name="defaultSearchPath">/directory</req-params:param>
- <req-params:param name="showUsers">true</req-params:param>
- <req-params:param name="addEntriesUI"><xsl:value-of select="'recipients'"/></req-params:param>
- <req-params:param name="returnProperties">
- <req-params:property name="userName"/>
- </req-params:param>
- <req-params:param name="isPopup"><xsl:value-of select="key('request-param','addEntriesPopUp')"/></req-params:param>
- <req-params:param name="agentStudio"><xsl:value-of select="key('request-param','agentStudio')"/></req-params:param>
- </dlgctrl:XTS2Request>
- </xsl:when>
- <xsl:when test="starts-with(key('request-param','requestState'),'addLinks')">
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
- <dlgctrl:stackName>add_entries</dlgctrl:stackName>
- <req-params:param name="defaultTarget"><xsl:value-of select="key('request-param','defaultTarget')"/></req-params:param>
- <req-params:param name="titlePostfix"><xsl:value-of select="key('request-param','titlePostfix')"/></req-params:param>
- <req-params:param name="defaultSearchPath">/content</req-params:param>
- <req-params:param name="addEntriesUI"><xsl:value-of select="'links'"/></req-params:param>
- <req-params:param name="isPopup"><xsl:value-of select="key('request-param','addEntriesPopUp')"/></req-params:param>
- <req-params:param name="allowRootBrowsing"><xsl:value-of select="'true'"/></req-params:param>
- <req-params:param name="agentStudio"><xsl:value-of select="key('request-param','agentStudio')"/></req-params:param>
- </dlgctrl:XTS2Request>
- </xsl:when>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- processReponse - Process the response from the callMorphlet block and either displays
- the markup or processes the results
- ===============================================================================================
- -->
- <xts:block id="processResponse" processor="XSLT" dependency="callMorphlet processRequestParams" type="exec" condition=".[ starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addEntries') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addLinks')]" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl dlgctrl xtsext pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <dlgctrl:processXTS2Response>
- <dlgctrl:stackName>add_entries</dlgctrl:stackName>
- <!-- if we got markup back, then simply send it back to the calling morphlet.
- email options should never have to take care of displaying the add entries markup -->
- <dlgctrl:mode match="markup"/>
-
- <!-- got back selected entries -->
- <dlgctrl:mode match="selectedEntries">
- <xsl:if test="/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'] != ''">
- <xts:append select="/root">
- <selectedEntries>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'])), true())"/>
- </xts:transform>
- </selectedEntries>
- </xts:append>
- </xsl:if>
- </dlgctrl:mode>
- </dlgctrl:processXTS2Response>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- businessRules - Take care off any business logic to simplify the UI generation
- ===============================================================================================
- -->
- <xts:block id="businessRules" type="exec" processor="XSLT" dependency="processResponse processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='canceled']]" mandatory="false">
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- exclude-result-prefixes="xsl xtsext">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
-
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <pf:variables/>
-
- <xsl:template match="/">
- <xts:sequence>
- <!-- if it's the first time we hit this page -->
- <xsl:if test="not(/root/env/param[@name='email_body']) and not(/root/env/param[@name='hidden_richEditBody'])">
- <xts:append select="/root">
- <defaultOptions>
- <!-- transform the options blob passed in into env params -->
- <xsl:if test="key('request-param','options') != ''">
- <xts:transform src="portal/emailOptions/transforms/parse_options.xslt" processor="XSLT">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('request-param','options'))), true())"/>
- </xts:transform>
- </xts:transform>
- </xsl:if>
- </defaultOptions>
- </xts:append>
-
- <!-- append all the params to env -->
- <xts:append select="/root/env">
- <xts:queryNode select="/root/defaultOptions/*[local-name() = 'param']"/>
- </xts:append>
- </xsl:if>
-
- <!-- if the 'to', 'cc', or 'bcc' fields have changed, then we must update the blob -->
- <xsl:if test="key('env-param','recipientsChanged')='true' and key('env-param','addedRecipients')!=''">
- <!-- create the new added recipients list -->
- <xts:append select="/root">
- <xts:transform src="portal/emailOptions/transforms/move_recipients.xslt" processor="XSLT">
- <root>
- <addedRecipients>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
- </xts:transform>
- </addedRecipients>
- <toField><xsl:value-of select="key('env-param','email_to')"/></toField>
- <ccField><xsl:value-of select="key('env-param','email_cc')"/></ccField>
- <bccField><xsl:value-of select="key('env-param','email_bcc')"/></bccField>
- </root>
- </xts:transform>
- </xts:append>
-
- <!-- delete the old list -->
- <xts:delete select="/root/env/param[@name='addedRecipients']"/>
-
- <!-- web64 encode the new list -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="addedRecipients">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/addedRecipients/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:if>
-
- <!-- if we're in Event studio, then deal with the links and attachments -->
- <xsl:if test="key('request-param','agentStudio') = 'true'">
-
- <!-- links -->
- <xsl:choose>
- <!-- if the user delete any links -->
- <xsl:when test="key('env-param','links') != '' and /root/env/param[starts-with(@name,'deleted_link_')]='true'">
- <xts:append select="/root">
- <links>
- <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </links>
- </xts:append>
-
- <!-- delete the old list -->
- <xts:delete select="/root/env/param[@name='links']"/>
-
- <!-- web64 encode the new list -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="links">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/links/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- unpack the list of links and attachments -->
- <xsl:when test="key('env-param','links') != ''">
- <xts:append>
- <links>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
- </xts:transform>
- </links>
- </xts:append>
- </xsl:when>
- </xsl:choose>
-
- <!-- attachments -->
- <xsl:choose>
- <!-- if the user delete any links -->
- <xsl:when test="key('env-param','attachments') != '' and /root/env/param[starts-with(@name,'deleted_attachment_')]='true'">
- <xts:append select="/root">
- <attachments>
- <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </attachments>
- </xts:append>
-
- <!-- delete the old list -->
- <xts:delete select="/root/env/param[@name='attachments']"/>
-
- <!-- web64 encode the new list -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="attachments">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/attachments/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- unpack the list of links and attachments -->
- <xsl:when test="key('env-param','attachments') != ''">
- <xts:append>
- <attachments>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
- </xts:transform>
- </attachments>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
-
- <xts:append select="/root">
- <businessRules>
- <!-- browser title -->
- <browserTitle>
- <xsl:text/>
- <xsl:choose>
- <xsl:when test="key('request-param','titlePostfix') != ''">
- <xts:string id="IDS_COMBINE_TITLE">
- <xts:param name="prefix"><xsl:value-of select="key('request-param','titlePrefix')"/></xts:param>
- <xts:param name="postfix"><xsl:value-of select="key('request-param','titlePostfix')"/></xts:param>
- </xts:string>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('request-param','titlePrefix')"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text/>
- </browserTitle>
-
- <!-- description -->
- <description>
- <xsl:choose>
- <xsl:when test="key('request-param','agentStudio') = 'true' and key('request-param','burst') != 'true'" >
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_AGENT_STUDIO_INTRO"/><xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','agentStudio') = 'true' and key('request-param','burst') = 'true'" >
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_AGENT_STUDIO_INTRO_BURST"/><xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','burst') = 'true'">
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_BURST_INTRO"/><xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','subscription') = 'true'">
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_SUBSCRIPTION_INTRO"/><xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_INTRODUCTION"/><xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </description>
-
- <!-- should we show the email as attachment checkbox -->
- <allowEmailAsAttachment>
- <xsl:variable name="s" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
- <xsl:choose>
- <xsl:when test="key('request-param', 'agentStudio')='true' and not(key('request-param','hideEmailAsAttachment'))">false</xsl:when>
- <xsl:when test="key('request-param','hideEmailAsAttachment') = 'true'">false</xsl:when>
- <xsl:when test="
- not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)
- or
- (
- key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment
- and
- (
- (contains($s, 'Administrators') and $hasAdminCapability) or
- (contains($s, 'QSUsers') and $hasFullQSCapability) or
- (contains($s, 'RSUsers') and $hasFullRSCapability) or
- (contains($s, 'Consumers') and $is-named='1') or
- (contains($s, 'Anonymous') and $is-named='0') or
- (key('system-param', 'ui_groups')/group[contains($s, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])
- )
- )">
- <xsl:value-of select="'true'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'false'"/>
- </xsl:otherwise>
- </xsl:choose>
- </allowEmailAsAttachment>
- <allowLinkToReport>
- <xsl:choose>
- <xsl:when test="key('request-param','agentStudio')='true' and not(key('request-param','hideLinkToReport'))">false</xsl:when>
- <xsl:when test="key('request-param','hideLinkToReport')='false'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </allowLinkToReport>
- <allowAttachMenu>
- <xsl:variable name="checkShowParam" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
- <xsl:choose>
- <xsl:when test="key('request-param','hideAttachMenu')='false' and (not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment) or
- (contains($checkShowParam, 'Administrators') and $hasAdminCapability)) or
- (contains($checkShowParam, 'QSUsers') and $hasFullQSCapability) or
- (contains($checkShowParam, 'RSUsers') and $hasFullRSCapability) or
- (key('system-param', 'ui_groups')/group[contains($checkShowParam, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </allowAttachMenu>
- <allowAddLinksAction>
- <xsl:choose>
- <xsl:when test="key('request-param','hideAddLinks')='false'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </allowAddLinksAction>
- </businessRules>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- queryCMForOptionsInfo - If the options blob passed had recipients which referenced CM, then
- we must query for those recipients. Also if the options blob had attachments or links then
- query CM for the information need to display the UI
- ===============================================================================================
- -->
- <xts:block id="queryCMForOptionsInfo" type="exec" processor="XSLT" dependency="businessRules" condition=".[/root/*[local-name()='defaultOptions']/*[local-name()='attachments'] or /root/*[local-name()='defaultOptions']/*[local-name()='link'] or /root/*[local-name()='defaultOptions']/*[local-name()='to'] or /root/*[local-name()='defaultOptions']/*[local-name()='cc'] or /root/*[local-name()='defaultOptions']/*[local-name()='bcc']]" mandatory="false">
- <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/"
- exclude-result-prefixes="xsl send">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="recipient-search-paths" match="/root/*[local-name()='defaultOptions']/*[local-name()='to' or local-name()='cc' or local-name()='bcc']/*[local-name()='searchPath']" use="."/>
- <xsl:key name="links-search-paths" match="/root/*[local-name()='defaultOptions']/*[local-name()='attachment' or local-name()='link']/*[local-name()='item']/*[local-name()='searchPath']" use="."/>
- <xsl:key name="default-options" match="/root/*[local-name()='defaultOptions']/*" use="local-name()"/>
- <xsl:variable name="passport">
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- </xsl:variable>
-
- <xsl:template match="/">
-
- <!-- recipients -->
- <xts:sequence>
- <xsl:if test="key('default-options','to') or key('default-options','cc') or key('default-options','bcc')">
- <xts:append select="/root">
- <xsl:variable name="unique-search-paths" select="/root/*[local-name()='defaultOptions']/*[local-name()='to' or local-name()='cc' or local-name()='bcc']/*[local-name()='searchPath'][generate-id(.)=generate-id(key('recipient-search-paths',.))]"/>
- <selectedEntries>
- <!-- Make sure we add 'unknown' items in our list for every nil queryReply we got back from CM -->
- <xts:transform src="portal/emailOptions/transforms/add-unknown-entries.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <root>
- <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
- the same transforms to update the email fields and the recipients blob -->
- <xts:transform src="portal/emailOptions/transforms/gen-standard-list.xslt" processor="XSLT">
- <root>
- <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>
- <xsl:for-each select="$unique-search-paths">
- <xsl:if test=". != ''">
- <cm:query>
- <cm:search>
- <xsl:value-of select="."/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="userName"/>
- <cm:property name="iconURI"/>
- </cm:properties>
- </cm:query>
- </xsl:if>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
-
- <defaultOptions>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
- </defaultOptions>
- <action>recipients</action>
- </root>
- </xts:transform>
- <defaultOptions>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
- </defaultOptions>
- </root>
- </xts:transform>
- </selectedEntries>
- </xts:append>
- </xsl:if>
- </xts:sequence>
-
- <!-- links -->
- <xts:sequence>
- <xsl:if test="key('default-options','link') and /root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath'] != ''">
- <xts:append select="/root">
- <links>
- <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
- the same transforms to update the email fields and the recipients blob -->
- <xts:transform src="portal/emailOptions/transforms/gen-standard-list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <root>
- <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>
- <xsl:for-each select="/root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath' and .!='']">
- <cm:query>
- <cm:search>
- <xsl:value-of select="."/><xsl:value-of select="/root/system/param[@name='visible']"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="iconURI"/>
- </cm:properties>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <action>links</action>
- </root>
- </xts:transform>
- </links>
- </xts:append>
- <!-- web64 encode the list of links -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="links">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/links/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:if>
- </xts:sequence>
-
- <!-- attachments -->
- <xts:sequence>
- <xsl:if test="key('default-options','attachments') or key('default-options','eventOutput')">
- <xts:append select="/root">
- <attachments>
- <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
- the same transforms to update the email fields and the recipients blob -->
- <xts:transform src="portal/emailOptions/transforms/gen-standard-list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <root>
- <xsl:if test="key('default-options','attachments') and /root/*[local-name()='defaultOptions']/*[local-name()='attachments']/*[local-name()='item']/*[local-name()='searchPath' and not(starts-with(.,'AgentTask-'))] != ''">
- <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>
- <xsl:for-each select="/root/*[local-name()='defaultOptions']/*[local-name()='attachments']/*[local-name()='item' and ./*[local-name()='format']!='']/*[local-name()='searchPath' and .!='' and not(starts-with(.,'AgentTask-'))]">
- <cm:query>
- <cm:search>
- <xsl:value-of select="."/><xsl:value-of select="/root/system/param[@name='visible']"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="iconURI"/>
- </cm:properties>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:if>
- <action>attachments</action>
- <defaultOptions>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='attachments']"/>
- <eventOutput>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='eventOutput']"/>
- </eventOutput>
- </defaultOptions>
- <attachParam>
- <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*"/>
- </attachParam>
- </root>
- </xts:transform>
- </attachments>
- </xts:append>
- <!-- web64 encode the list of links -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="attachments">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/attachments/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
-
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- decode the agent items
- ===============================================================================================
- -->
- <xts:block id="decode_agent_definition" processor="XSLT" type="exec" nodelist="env" dependency="processResponse processRequestParams queryCMForOptionsInfo" condition=".[/root/*[local-name()='selectedEntries'] or /root/env/param[@name='addAttachment']!='']" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:if test="/root/env/param[@name = 'agent_definition_blob']">
- <xts:append select="/root">
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_seqagenttasks001',string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- updateAddedLists
- ===============================================================================================
- -->
- <xts:block id="updateAddedLists" type="exec" processor="XSLT" dependency="decode_agent_definition" condition=".[/root/*[local-name()='selectedEntries'] or /root/env/param[@name='addAttachment']!='']" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- exclude-result-prefixes="xsl send xtsext pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:serialize-xml/>
- <!-- Session variables -->
- <xsl:variable name="passport">
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- </xsl:variable>
-
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <!-- adding attachments -->
- <xsl:when test="/root/env/param[@name='addAttachment'] != ''">
- <xts:delete select="/root/attachments"/>
-
- <xts:append select="/root">
- <attachments>
- <xts:transform src="portal/emailOptions/transforms/update_entries_list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <createWeb64Param>false</createWeb64Param>
- <action>addingAttachments</action>
- <attachmentToAdd>
- <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*"/>
- <xsl:if test="not(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*[local-name()='locale'])">
- <locale/>
- </xsl:if>
- <xsl:if test="not(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*[local-name()='format'])">
- <format/>
- </xsl:if>
- <xsl:if test="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment']) and local-name()='eventOutput']">
- <eventOutput>true</eventOutput>
- </xsl:if>
- </attachmentToAdd>
-
- <xsl:if test="/root/env/param[@name='attachments'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='attachments'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- <defaultFormat><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputFormat']/*[local-name()='value']"/></defaultFormat>
- <defaultLocale><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputLocale']/*[local-name()='value']"/></defaultLocale>
- </root>
- </xts:transform>
- </attachments>
- </xts:append>
-
- <!-- web64 the list of links and attachments -->
- <xts:delete select="/root/env/param[@name='attachments']"/>
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="attachments">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/attachments/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- added links -->
- <xsl:when test="/root/env/param[@name='addingLinks']='true'">
- <xts:delete select="/root/links"/>
-
- <xts:append select="/root">
- <links>
- <xts:transform src="portal/emailOptions/transforms/update_entries_list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <createWeb64Param>false</createWeb64Param>
- <selectedEntries>
- <xts:queryNode select="/root/selectedEntries/*"/>
- </selectedEntries>
- <action>addingLinks</action>
- <xsl:if test="/root/env/param[@name='links'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='links'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- </root>
- </xts:transform>
- </links>
- </xts:append>
-
- <!-- web64 the list of links and attachments -->
- <xts:delete select="/root/env/param[@name='links']"/>
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="links">
- <passport><xsl:value-of select="$passport"/></passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/links/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- added recipients -->
- <xsl:otherwise>
- <xsl:variable name="env" select="/root/env"/>
-
- <xts:delete select="/root/env/param[@name='email_to' or @name='email_cc' or @name='email_bcc' or @name='addedRecipients']"/>
-
- <xts:append select="/root/env">
- <xts:transform src="portal/emailOptions/transforms/update_email_recipients.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <root>
- <xsl:copy-of select="$env"/>
-
- <selectedEntries>
- <xts:queryNode select="/root/selectedEntries/*"/>
- </selectedEntries>
-
- <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- </root>
- </xts:transform>
-
- <xts:transform src="portal/emailOptions/transforms/update_entries_list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <passport><xsl:value-of select="$passport"/></passport>
- <paramName>addedRecipients</paramName>
- <selectedEntries>
- <xts:queryNode select="/root/selectedEntries/*"/>
- </selectedEntries>
-
- <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- <action>addingRecipients</action>
- </root>
- </xts:transform>
- </xts:append>
-
- <!-- if the user just added recipients to the bcc, then make sure the bcc field will be visible -->
- <xsl:if test="/root/*[local-name()='selectedEntries']/*/*[local-name()='type'] = 'bcc'">
- <xts:append select="/root">
- <showBccField>true</showBccField>
- </xts:append>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
-
- </xsl:stylesheet>
- </xts:block>
-
-
- <!--
- ===============================================================================================
- genMarkup -
- ===============================================================================================
- -->
- <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="updateAddedLists queryCMForOptionsInfo businessRules processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='canceled']]" mandatory="false">
- <!-- logicsheets -->
- <!-- portal specific information -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
-
- <!-- Dialog specific logicsheets -->
- <xts:logicsheet path="portal/emailOptions/logicsheets/ui-templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
-
- <!-- Generic logicsheets -->
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.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:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:eut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/emailOptions/logicsheets/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- exclude-result-prefixes="xts xsl cm pf xtsext lyt dp df cf cp xos dlgctrl eut bus">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="business-rules" match="/root/businessRules/*" use="local-name()"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
-
- <pf:variables/>
- <pf:gen-icon/>
-
- <xsl:variable name="agentStudio" select="key('request-param','agentStudio') = 'true'"/>
- <xsl:variable name="inWizard" select="key('request-param','inWizard') = 'true'"/>
- <xsl:variable name="subscription" select="key('request-param','subscription') = 'true'"/>
- <xsl:variable name="hideInsertButton" select="key('request-param','hideInsertButton') = 'true'"/>
-
- <xsl:variable name="environmentVars" select="/root/header/bus:biBusHeader/bus:hdrSession/*[local-name() = 'environmentVars']"/>
- <xsl:variable name="user-agent1" select="$environmentVars/item[name='HTTP_USER_AGENT']/value"/>
-
- <xsl:variable name="browsername">
- <xsl:choose>
- <xsl:when test="contains($user-agent1 , 'MSIE')">ie</xsl:when> <!-- IE 4.xx and above -->
- <xsl:when test="contains($user-agent1 , 'Edge')">ie</xsl:when> <!-- Edge -->
- <xsl:when test="contains($user-agent1 , 'Safari/5') and not(contains($user-agent , 'Chrome'))">safari</xsl:when> <!-- Safari user-agent does not contain Chrome -->
- <xsl:when test="contains($user-agent1 , 'Chrome')">chrome</xsl:when> <!-- Chrome user-agent contains Safari also -->
- <xsl:when test="contains($user-agent1 , 'Mozilla/5.0')">moz</xsl:when> <!-- NS 6.xx and 7.xx -->
- <xsl:when test="contains($user-agent1 , 'Mozilla/4.')">ns4</xsl:when> <!-- NS 4.xx -->
- <xsl:when test="string-length($user-agent1) = 0">undefined</xsl:when>
- <xsl:otherwise>other</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- IE, FF and Chrome supported now for rich text editor -->
- <xsl:variable name="richEditMode">
- <xsl:choose>
- <xsl:when test="($browsername = 'ie' or $browsername = 'moz' or $browsername = 'chrome') and not(key('env-param','richEditMode'))">true</xsl:when>
- <xsl:when test="$browsername = 'ie' or $browsername = 'moz' or $browsername = 'chrome'"><xsl:value-of select="key('env-param','richEditMode')"/></xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="bccVisible">
- <xsl:choose>
- <xsl:when test="/root/showBccField = 'true'">true</xsl:when>
- <xsl:when test="key('env-param','bccVisible')!=''"><xsl:value-of select="key('env-param','bccVisible')"/></xsl:when>
- <xsl:when test="key('env-param','email_bcc')!=''">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <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>
- <xsl:element name="{key('request-param','resultNode')}" namespace="">
- <markup>
- <xts:transform name="XMLEncode">
- <!-- adds standard hidden inputs and javascript -->
- <dlgctrl:markupHelper/>
-
- <input type="hidden" name="addedRecipients" value="{key('env-param','addedRecipients')}"/>
- <input type="hidden" name="links" value="{key('env-param','links')}"/>
- <input type="hidden" name="attachments" value="{key('env-param','attachments')}"/>
- <input type="hidden" name="recipientsChanged" value="false"/>
- <input type="hidden" name="addingLinks" value="false"/>
- <input type="hidden" name="addAttachment" value=""/>
- <input type="hidden" name="richEditMode" value="{$richEditMode}"/>
- <input type="hidden" name="bccVisible" value="{$bccVisible}"/>
- <input type="hidden" name="visited_email_options" value="true"/>
- <xsl:if test="key('request-param', 'usePowerPlay8Options') = 'true'">
- <input type="hidden" name="usePowerPlay8Options" value="true"/>
- </xsl:if>
- <xsl:if test="key('request-param','burst') = 'true'">
- <input type="hidden" name="m_ro_burst" value="true"/>
- </xsl:if>
- <pf:help context="HID_DISTRIBUTION"/>
-
- <xsl:choose>
- <xsl:when test="key('request-param','headerStyle')='page'">
- <eut:header close='false' border='false' help='false'>
- <dp:image>
- <img alt="" border="0">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>icon_email_24.gif</xsl:attribute>
- </img>
- </dp:image>
- <dp:title>
- <xsl:value-of select="key('business-rules','browserTitle')"/>
- </dp:title>
- <dp:description>
- <xsl:value-of select="key('business-rules','description')"/>
- </dp:description>
- </eut:header>
- </xsl:when>
- <xsl:otherwise>
- <dp:header>
- <dp:title>
- <xsl:value-of select="key('business-rules','browserTitle')"/>
- </dp:title>
- <dp:description>
- <xsl:value-of select="key('business-rules','description')"/>
- </dp:description>
- <dp:close>
- <a href="#" onclick="controller_changeState('canceled'); controller_submitForm('cancel');">
- <dp:closeMarker/>
- </a>
- </dp:close>
- </dp:header>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$agentStudio">
- <script type="text/javascript" src="{$webRoot}/ags/dragDropHandler.js"/>
- <script type="text/javascript" src="{$webRoot}/ags/layout.js"/>
- <script type="text/javascript" src="{$webRoot}/ags/AccessibilityHandler.js"/>
- <script type="text/javascript" src="{$webRoot}/ags/RTEHelper.js"/>
- </xsl:if>
- <script type="text/javascript" src="{$webRoot}/bi/lib/ckeditor/4.17.2/ckeditor.js"></script>
- <script language="javascript">
- <xsl:choose>
- <xsl:when test="$agentStudio">
- var textRange;
-
- function insertDataItemsToRTE()
- {
- var dropText = '';// processSelectedNodes();
- dropText = processSelectedNodes_ForCKEditorRTE();
-
- if(dropText != null)
- {
- var tempDropText = dropText.toString();
- if(tempDropText != null)
- {
- tempDropText = tempDropText.replace(/\],\[/g, "][");
- CKEDITOR.instances.email_body_iframe.insertHtml(tempDropText);
- }
- }
- }
-
- function init()
- {
- document.execCommand("AutoUrlDetect", false, false);
-
- droppy.registerDropZone("email_to","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",true);
- droppy.registerDropZone("email_cc","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",true);
- droppy.registerDropZone("email_bcc","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",true);
- droppy.registerDropZone("email_subject","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",false);
- if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true')
- {
- richEditControl_init();
- }
- else
- {
- var dropZone = new DropZone("email_body","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
-
- droppy.registerDropZoneObject(dropZone);
-
- //pass the dropzone as a group to let the listener process swaps to the html body
- droppy.registerDropZoneGroup(new Array(dropZone), "<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
- }
- }
-
- function deleteLinksAndAttachments()
- {
- var foundSelectedItems = false;
- <xsl:variable name="linksCount" select="count(/root/*[local-name()='links']/*[local-name()='item'])+1"/>
-
- frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- for (var i=1; i<<xsl:value-of select="$linksCount"/>; i++)
- {
- tableName = 'linkTable_' + i;
-
- table = document.getElementById(tableName);
- if (table && table.className == 'emailItem_active')
- {
- table.className = 'hidden';
- hiddenInputName = 'deleted_link_' + i;
- document.getElementById(hiddenInputName).value = 'true';
- foundSelectedItems = true;
- }
- }
-
- <xsl:variable name="attachmentCount" select="count(/root/*[local-name()='attachments']/*[local-name()='item'])+1"/>
- for (var i=1; i<<xsl:value-of select="$attachmentCount"/>; i++)
- {
- tableName = 'attachTable_' + i;
-
- table = document.getElementById(tableName);
- if (table && table.className == 'emailItem_active')
- {
- table.className = 'hidden';
- hiddenInputName = 'deleted_attachment_' + i;
- document.getElementById(hiddenInputName).value = 'true';
- foundSelectedItems = true;
- }
-
- }
-
- return foundSelectedItems;
- }
-
- function mouseOverLinkAttach(item)
- {
- if (item.className == 'emailItem')
- {
- item.className = 'emailItem_hover';
- }
- }
-
- function mouseOutLinkAttach(item)
- {
- if (item.className == 'emailItem_hover')
- {
- item.className = 'emailItem';
- }
- }
-
- function mouseDownLinkAttach(item)
- {
- if (item.className == 'emailItem_active')
- {
- item.className = 'emailItem';
- }
- else if (item.className == 'emailItem' || item.className == 'emailItem_hover')
- {
- item.className = 'emailItem_active';
- }
- }
-
- function attach(position)
- {
- if (document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment) {
- document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment.value = position;
- }
- controller_submitForm('default');
- }
- </xsl:when>
- <xsl:otherwise>
- function init()
- {
- document.execCommand("AutoUrlDetect", false, false);
-
- if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true') {
- richEditControl_init();
- }
- if (document.<xsl:value-of select="key('request-param','formName')"/>.controller_state)
- {
- document.<xsl:value-of select="key('request-param','formName')"/>.controller_state.value = '<xsl:value-of select="xtsext:javascriptencode(key('env-param','controller_state'))"/>';
- }
-
-
- if (document.getElementById("email_to"))
- {
- document.getElementById("email_to").focus();
- }
- }
- </xsl:otherwise>
- </xsl:choose>
- function changedEmailRecipients()
- {
- <!-- update the changed flag so we know that we should regenerate the added entries blob -->
- document.<xsl:value-of select="key('request-param','formName')"/>.recipientsChanged.value = 'true';
- }
-
- function validate()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- <xsl:if test="key('request-param','burst')!='true'">
- if ( frm.email_to.value == '' && frm.email_cc.value == '' && frm.email_bcc.value == '')
- {
- alert("<xts:string id="IDS_EMAIL_OPTIONS_NO_RECIPIENTS" encode="javascript"/>");
- return false;
- }
- </xsl:if>
-
- leavingDialog();
-
- return true;
- }
-
- <!-- makes sure all the hidden inputs are properlly set before leavingt the
- email options dialog -->
- function leavingDialog()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
- <!-- we need to get the plain text body since the memopart needs both the html and plain text body -->
- if (frm.richEditMode && frm.richEditMode.value == 'true')
- {
- frm.email_body.value = CKEDITOR.instances.email_body_iframe.document.getBody().getText();
-
- if (frm.hidden_richEditBody)
- {
- // copy the contents of the edit window into a form field
- frm.hidden_richEditBody.value = richEditControl_convertToXHTML();
- }
- }
- <!-- we're in plain text mode, so make sure the hidden HTML input gets updated -->
- else
- {
- if (frm.hidden_richEditBody)
- {
- frm.hidden_richEditBody.value = replaceCarriageReturns(htmlEncode(frm.email_body.value),'<br/>');
- }
- }
- }
-
- function setFormTarget()
- {
- <xsl:choose>
- <xsl:when test="key('request-param','addEntriesPopUp')='true' and key('request-param','addEntriesPopUpTarget')!=''">
- document.<xsl:value-of select="key('request-param','formName')"/>.target = '<xsl:value-of select="key('request-param','addEntriesPopUpTarget')"/>';
- </xsl:when>
- <xsl:when test="key('request-param','addEntriesPopUp')='true'">
- document.<xsl:value-of select="key('request-param','formName')"/>.target = 'addEntriesFrame';
- </xsl:when>
- </xsl:choose>
- return;
- }
-
- function unsetFormTarget()
- {
- <xsl:if test="key('request-param','addEntriesPopUp')='true'">
- document.<xsl:value-of select="key('request-param','formName')"/>.target = '';
- </xsl:if>
- return;
- }
- <!-- convert less than and greater than to text references -->
- function htmlEncode(string)
- {
- var returnString = string.replace(/&/g, "&amp;");
- returnString = returnString.replace(/"/g, "&quot;");
- returnString = returnString.replace(/</g, "&lt;");
- returnString = returnString.replace(/>/g, "&gt;");
- return returnString;
- }
- <!-- used to replace linefeeds to </br> for the html version of the body -->
- function replaceCarriageReturns(string, replaceWith)
- {
- <!-- encode textarea string's carriage returns -->
- string = escape(string);
-
- <!--loop through string, replacing carriage return encoding with HTML break tag-->
- for(i=0; i<string.length; i++)
- {
- if(string.indexOf("%0D%0A") > -1)
- {
- <!-- Windows encodes returns as \r\n hex-->
- string=string.replace("%0D%0A",replaceWith);
- }
- else if(string.indexOf("%0A") > -1)
- {
- <!-- Unix encodes returns as \n hex-->
- string=string.replace("%0A",replaceWith);
- }
- else if(string.indexOf("%0D") > -1)
- {
- <!-- Macintosh encodes returns as \r hex -->
- string=string.replace("%0D",replaceWith);
- }
- }
-
- string=unescape(string) <!-- unescape all other encoded characters -->
-
- return string;
- }
-
-
- function changeModes()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
- if (frm.richEditMode.value == 'true')
- {
- frm.email_body.value = replaceHtmlTags(CKEDITOR.instances.email_body_iframe.document.getBody().getHtml());
- frm.richEditMode.value = 'false';
- }
- else
- {
- frm.hidden_richEditBody.value = replaceCarriageReturns(htmlEncode(frm.email_body.value),'<br/>');
- frm.richEditMode.value = 'true';
- }
-
- controller_submitForm('default');
- }
- <!--
- - handles showing/hidding the bcc text field
- - we have spans behind the bold, italic and underline since we use letters
- instead of icons for localization. Make sure we move the span when we're showing/hidding
- the bcc field
- -->
- function swapBccVisible()
- {
- if (document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value == 'false')
- {
- <!-- change the link text -->
- document.getElementById('showHideAnchor').innerHTML = '<xts:string id="IDS_EMAIL_HIDE_BCC" encode="javascript"/>';
-
- showDynamicDiv('emailBccDiv');
- document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value = 'true';
- }
- else
- {
- <!-- change the link text -->
- document.getElementById('showHideAnchor').innerHTML = '<xts:string id="IDS_EMAIL_SHOW_BCC" encode="javascript"/>';
-
- hideDynamicDiv('emailBccDiv');
-
- document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value = 'false';
- }
- }
- </script>
-
- <!-- add a hidden iframe if we must show the added recipients in a popup -->
- <xsl:if test="key('request-param','addEntriesPopUp')='true'">
- <script language="javascript">
- function show_div(div)
- {
- modalDiv = document.getElementById(div);
- modalDiv.style.display = "block";
- modalDiv.style.height = "100%";
- modalDiv.style.width = "100%";
- modalDiv.style.left = 0;
- modalDiv.style.top = 0;
- }
-
- function show_iFrame(iframe)
- {
- iFrameAddEntries = document.getElementById(iframe);
- iFrameAddEntries.style.display = "block";
- iFrameAddEntries.style.height = "70%";
- iFrameAddEntries.style.width = "85%";
- iFrameAddEntries.style.border = "1px solid";
-
- if ((document.body.clientWidth - iFrameAddEntries.scrollWidth) < 0)
- {
- iFrameAddEntries.style.left = 0;
- }
- else
- {
- iFrameAddEntries.style.left = ((document.body.clientWidth - iFrameAddEntries.scrollWidth) / 2) + document.body.scrollLeft;
- }
- }
- </script>
- <div id="makeModalDiv" style="z-index:49; display:none; position: absolute;">
- <table width="100%" height="100%">
- <tr>
- <td/>
- </tr>
- </table>
- </div>
- <iframe width="0" height="0" id="addEntriesFrame" src="../common/blank.html" name="addEntriesFrame" frameborder="0" style="display:none; z-index:50; display:block; position: absolute;"></iframe>
- </xsl:if>
-
-
- <lyt:layout style="2">
- <lyt:section>
- <xsl:variable name="inputSize">
- <xsl:choose>
- <xsl:when test="$agentStudio">50</xsl:when>
- <xsl:otherwise>55</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:if test="key('request-param','burst')!='true'">
- <!-- need to put the email to, cc, bcc and links in one table
- to get the links to right align properly -->
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <!-- email to -->
- <dp:list>
- <dp:section>
- <dp:label><label for="email_to"><xts:string id="IDS_EMAIL_OPTIONS_TO"/></label></dp:label>
- </dp:section>
- </dp:list>
-
- <!--display the "To" value as readonly text when part of a subscription -->
- <xsl:if test="$subscription">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td nowrap="nowrap">
- <dp:list>
- <dp:section>
- <xsl:value-of select="key('env-param','email_to')"/>
- </dp:section>
- </dp:list>
- </td>
- </tr>
- </table>
- </xsl:if>
-
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_to" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_to');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
- </td>
- </xsl:if>
-
- <td nowrap="nowrap">
- <input name="email_to" id="email_to" size="{$inputSize}" onchange="changedEmailRecipients();">
- <!-- make the input hidden if part of a subscription -->
- <xsl:attribute name="type">
- <xsl:choose>
- <xsl:when test="$subscription">
- <xsl:text>hidden</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>text</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="value">
- <xsl:value-of select="key('env-param','email_to')"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
-
- <!-- do not show the CC or BCC section if part of a subscription -->
- <xsl:if test="not($subscription)">
- <!-- email cc -->
- <dp:list>
- <dp:section>
- <dp:label><label for="email_cc"><xts:string id="IDS_EMAIL_OPTIONS_CC"/></label></dp:label>
- </dp:section>
- </dp:list>
-
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_cc" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_cc');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
- </td>
- </xsl:if>
-
- <td nowrap="nowrap">
- <input type="text" name="email_cc" id="email_cc" size="{$inputSize}" onchange="changedEmailRecipients();">
- <xsl:attribute name="value">
- <xsl:value-of select="key('env-param','email_cc')"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- <!-- email bcc -->
- <cf:dynamicDiv name="emailBccDiv" runTimeVisibleCheck="$bccVisible = 'true'">
- <!-- need to put all this in one table since we need the height of table for
- calculations when hiding/showing the bcc field -->
- <table id="bccEmailFieldTable" border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td>
- <xsl:if test="$agentStudio">
- <xsl:attribute name="colspan">3</xsl:attribute>
- </xsl:if>
- <dp:list>
- <dp:section>
- <dp:label><label for="email_bcc"><xts:string id="IDS_EMAIL_OPTIONS_BCC"/></label></dp:label>
- </dp:section>
- </dp:list>
- </td>
- </tr>
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_bcc" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_bcc');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
- </td>
- </xsl:if>
-
- <td nowrap="nowrap">
- <input type="text" name="email_bcc" id="email_bcc" size="{$inputSize}" onchange="changedEmailRecipients();">
- <xsl:attribute name="value">
- <xsl:value-of select="key('env-param','email_bcc')"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- </cf:dynamicDiv>
- <table border="0" cellspacing="0" cellpadding="1" width="100%">
- <tr align="right" class="formLink">
- <td nowrap="nowrap" align="right">
- <!-- select recipients -->
- <dp:link align="right">
- <a href="#" onclick="leavingDialog(); setFormTarget(); controller_doSubmit('addEntries', 'navigate', 'stack-up'); unsetFormTarget();">
- <xts:string id="IDS_EMAIL_OPTIONS_SELECT_RECIPIENTS"/>
- </a>
- </dp:link>
-   
- <!-- show/hide Bcc -->
- <dp:link align="right">
- <a id="showHideAnchor" href="#" onclick="leavingDialog(); swapBccVisible()">
- <xsl:choose>
- <xsl:when test="$bccVisible='true'"><xts:string id="IDS_EMAIL_HIDE_BCC"/></xsl:when>
- <xsl:otherwise><xts:string id="IDS_EMAIL_SHOW_BCC"/></xsl:otherwise>
- </xsl:choose>
- </a>
- </dp:link>
- </td>
- </tr>
- </table>
- </xsl:if>
- </td>
- </tr>
- </table>
- </xsl:if>
- </lyt:section>
-
- <!-- task name -->
- <lyt:section>
- <xsl:if test="$agentStudio">
- <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
- </xsl:if>
- </lyt:section>
- </lyt:layout>
-
- <lyt:layout style="1">
- <lyt:section>
- <xsl:variable name="controlsWidth">
- <xsl:choose>
- <xsl:when test="$agentStudio">650</xsl:when>
- <xsl:otherwise>680</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- subject -->
- <dp:list>
- <dp:section>
- <dp:label><label for="email_subject"><xts:string id="IDS_EMAIL_OPTIONS_SUBJECT"/></label></dp:label>
- </dp:section>
- </dp:list>
-
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_subject');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
- </td>
- </xsl:if>
-
- <td nowrap="nowrap">
- <input type="text" name="email_subject" id="email_subject" style="width:{$controlsWidth}px">
- <xsl:attribute name="value">
- <xsl:value-of select="key('env-param','email_subject')"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap">
- <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- </table>
-
- <!-- body -->
- <table border="0" cellspacing="0" cellpadding="0">
- <!-- in agent studio we have to take into account the add selected items button -->
- <xsl:attribute name="style">
- <xsl:choose>
- <xsl:when test="$agentStudio">width:<xsl:value-of select="$controlsWidth + 30"/>px</xsl:when>
- <xsl:otherwise>width:<xsl:value-of select="$controlsWidth"/>px</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <tr>
- <td style="white-space:nowrap;" class="formLabel" valign="bottom"><label for="email_body"><xts:string id="IDS_EMAIL_OPTIONS_BODY"/></label></td>
- <!-- IE, FF and Chrome supported now for rich text editor -->
- <xsl:if test="$browsername = 'ie' or $browsername = 'moz' or $browsername = 'chrome'">
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">
- <td width="100%" align="right" class="formLink" nowrap="nowrap" valign="bottom">
- <a href="#" onclick="javascript:changeModes();"><xts:string id="IDS_EMAIL_OPTIONS_PLAIN_TEXT"/></a>
- </td>
- <td valign="bottom" nowrap="nowrap">
- <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
- <img src="{$skin_images}prompt_option_to_right.gif" alt=""/>
- <img height="5" width="10" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <td width="100%" align="right" valign="bottom">
- <img src="{$skin_images}prompt_option_to_left.gif" alt=""/>
- <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- <td class="formLink" nowrap="nowrap" valign="bottom">
- <a href="#" onclick="javascript:changeModes();"><xts:string id="IDS_EMAIL_OPTIONS_HTML_TEXT"/></a>
- </td>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="$richEditMode = 'true'">
- <xsl:call-template name="richEditControls"/>
- </xsl:if>
- </xsl:if>
- </tr>
- <tr>
- <td>
- <img height="3" width="1" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="1">
- <xsl:choose>
- <xsl:when test="$agentStudio">
- <tr>
- <xsl:if test="not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_body">
- <xsl:attribute name="onclick">
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">javascript:insertDataItemsToRTE();</xsl:when>
- <xsl:otherwise>javascript:parent.dropFrame=window.name;parent.insertStartMC('email_body');</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
- </td>
- </xsl:if>
- <td nowrap="nowrap">
- <table cellspacing="0" cellpadding="0" border="0" width="{$controlsWidth}">
- <tr>
- <!-- body -->
- <td class="emailBodyTableRow">
- <xsl:call-template name="emailBody">
- <xsl:with-param name="inputSize">
- <xsl:value-of select="$controlsWidth"/>
- </xsl:with-param>
- <xsl:with-param name="richEditMode" select="$richEditMode"/>
- </xsl:call-template>
- </td>
- </tr>
- <xsl:if test="/root/*[local-name()='links']/*[local-name()='item']">
- <tr>
- <!-- links -->
- <td class="emailLinksAttachmentTableRow" width="100%">
- <xsl:for-each select="/root/*[local-name()='links']/*[local-name()='item']">
- <input type="hidden" name="deleted_link_{position()}" id="deleted_link_{position()}" value=""/>
- <table id="linkTable_{position()}" class="emailItem" height="20" cellspacing="2" cellpadding="2" border="0" style="text-decoration: underline;float:left;clear:none;cursor:pointer;cursor:hand;position:relative;" onmousedown="mouseDownLinkAttach(this)" onmouseover="mouseOverLinkAttach(this)" onmouseout="mouseOutLinkAttach(this)">
- <tr>
- <td valign="middle" align="center">
- <xsl:call-template name="gen-icon">
- <xsl:with-param name="showAction" select="false()"/>
- <xsl:with-param name="class" select="*[local-name()='objectClass']"/>
- </xsl:call-template>
- </td>
- <td valign="middle" align="center" class="formText" nowrap="nowrap">
- <xsl:value-of select="*[local-name()='displayName']"/>
- </td>
- </tr>
- </table>
- </xsl:for-each>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="/root/*[local-name()='attachments']/*[local-name()='item']">
- <tr>
- <!-- attachments -->
- <td class="emailLinksAttachmentTableRow" width="100%">
- <xsl:for-each select="/root/*[local-name()='attachments']/*[local-name()='item']">
- <input type="hidden" name="deleted_attachment_{position()}" id="deleted_attachment_{position()}" value=""/>
- <xsl:variable name="format">
- <xsl:choose>
- <xsl:when test="not(normalize-space(*[local-name()='format']))">
- <xsl:value-of select="/root/user/param[@name='format']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="*[local-name()='format']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="locale">
- <xsl:choose>
- <xsl:when test="not(normalize-space(*[local-name()='locale']))">
- <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="*[local-name()='locale']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <table id="attachTable_{position()}" border="0" cellspacing="0" cellpadding="0" class="emailItem" style="text-decoration:none;float:left;clear:none;cursor:pointer;cursor:hand;position:relative;" onmousedown="mouseDownLinkAttach(this)" onmouseover="mouseOverLinkAttach(this)" onmouseout="mouseOutLinkAttach(this)" width="40" title="{*[local-name()='defaultName']}">
- <tr>
- <td align="center">
- <img>
- <xsl:attribute name="src">
- <xsl:choose>
- <!-- use the HTML icon for the event list -->
- <xsl:when test="*[local-name()='searchPath']='eventOutput'">
- <xsl:value-of select="concat($image_root,'icon_result_html_32.gif')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$format = 'singleXLS'">
- <xsl:value-of select="concat($image_root,'icon_result_excel_single_32.gif')"/>
- </xsl:when>
- <xsl:when test="$format= 'XLS'">
- <xsl:value-of select="concat($image_root,'icon_result_excel_32.gif')"/>
- </xsl:when>
- <xsl:when test="$format = 'XLWA'">
- <xsl:value-of select="concat($image_root,'icon_result_excel_web_arch_32.gif')"/>
- </xsl:when>
- <xsl:when test="$format = 'spreadsheetML'">
- <xsl:value-of select="concat($image_root,'icon_result_excel_2007_32.gif')"/>
- </xsl:when>
- <xsl:when test="$format = 'xlsxData'">
- <xsl:value-of select="concat($image_root,'icon_result_xlsxdata_32.gif')"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- need to convert the format to lowercase for linux -->
- <xsl:variable name="convertedFormat">
- <xsl:value-of select="translate( $format, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )"/>
- </xsl:variable>
- <xsl:value-of select="concat($image_root,'icon_result_', $convertedFormat,'_32.gif')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </img>
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap" align="center" class="formText"><xsl:value-of select="*[local-name()='attachmentName']"/></td>
- </tr>
- <tr>
- <td nowrap="nowrap" align="center" class="formText">
- <xsl:choose>
- <xsl:when test="$format !='' and $locale!=''">
- <xts:string id="IDS_EMAIL_OPTIONS_FORMAT_LOCALE">
- <xts:param name="format"><xsl:value-of select="$format"/></xts:param>
- <xts:param name="locale"><xsl:value-of select="$locale"/></xts:param>
- </xts:string>
- </xsl:when>
- <xsl:otherwise> </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table>
- </xsl:for-each>
- </td>
- </tr>
- </xsl:if>
- <!-- attachment and link links -->
- <tr>
- <td>
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="formLink" width="100%" align="right">
- <xsl:if test="key('business-rules','allowAttachMenu')='true'">
- <!-- code from agent studio for the flyout -->
- <table border="0" cellpadding="0" cellspacing="0" style="cursor:hand">
- <tr>
- <td id="attachmentDropdown" height="0px" valign="bottom"/>
- <td class="formLink">
- <a href="#" onkeypress="leavingDialog(); if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="leavingDialog();removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
- <xts:string id="IDS_ADDENTRIES_ATTACHMENT_COLUMN"/>
- </a>
- </td>
- <td onkeypress="leavingDialog();if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="leavingDialog();removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
- <img border="0" title="" src="{$skin_shared_images}dropdown_arrow.gif"/>
- </td>
- </tr>
- </table>
- <script language="Javascript">
- var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', 'task_active');
- var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
- var attachmentMenu = new CMenu('attachmentDropdown1',menuStyle);
- attachmentMenu.setHTMLContainer(document.getElementById('attachmentDropdown'));
- <xsl:for-each select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*">
- <xsl:variable name="menuName">
- <xsl:choose>
- <xsl:when test="local-name()='eventOutput'"><xts:string id="IDS_EMAIL_OPTIONS_ATTACH_EVENT_OUTPUT"/></xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_ATTACH_REPORT">
- <xts:param name="obj">
- <xsl:value-of select="*[local-name()='defaultName']"/>
- </xts:param>
- </xts:string>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- new CMenuItem(attachmentMenu, "<xsl:value-of select="xtsext:javascriptencode(string($menuName))"/>","<xsl:value-of select="xtsext:javascriptencode(concat('task', position()))"/>","attach('<xsl:value-of select="position()"/>')", '', menuItemStyle, "<xsl:value-of select="xtsext:javascriptencode(string($menuName))"/>");
- </xsl:for-each>
- //The call to this is done in the onmouseup event only.
- //We cannot put in the function below. Because the function
- //below can be called by the observer.
- function removeAttachmentMenuListener() {
- document.body.getWndObserver().removeListener(attachmentMenu);
- }
-
- function showMenu(event) {
- if (attachmentMenu && attachmentMenu.isVisible()) {
- attachmentMenu.remove();
- if (document.body.getWndObserver && parent.document.body.getWndObserver) {
- document.body.getWndObserver().removeWhenDone(attachmentMenu);
- }
- } else {
- //Must always be first to be able to delete the marked observer, before it shows it.
- if (document.body.getWndObserver && parent.document.body.getWndObserver) {
- //Notify parent that mouseup occured.
- parent.document.body.getWndObserver().notify(attachmentMenu,"mouseup");
- document.body.getWndObserver().addListener(attachmentMenu, showMenu, "mouseup");
- }
- attachmentMenu.draw();
- attachmentMenu.show();
- }
- }
- function attachmentMenu_cancelBub(evt)
- {
- //get the event in a cross-browser fashion
- evt = (evt) ? evt : ((event) ? event : null);
-
- //prevent the click from proceeding to other nodes
- if (typeof evt.cancelBubble != 'undefined')
- {
- evt.cancelBubble = true;
- }
-
- if (typeof evt.stopPropagation != 'undefined')
- {
- evt.stopPropagation();
- }
- }
- </script>
- </xsl:if>
- </td>
- <td class="formLink" nowrap="nowrap">
- <xsl:if test="key('business-rules','allowAddLinksAction')='true'">
-   
- <a href="#" onclick="leavingDialog(); setFormTarget(); document.{key('request-param','formName')}.addingLinks.value='true'; controller_doSubmit('addLinks', 'navigate', 'stack-up'); unsetFormTarget();">
- <xts:string id="IDS_EMAIL_OPTIONS_SELECT_LINKS"/>
- </a>
- </xsl:if>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <tr>
- <td>
- <xsl:if test="$richEditMode = 'true'">
- <xsl:attribute name="class">emailBodyTableRow</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="emailBody">
- <xsl:with-param name="inputSize" select="$controlsWidth"/>
- <xsl:with-param name="richEditMode" select="$richEditMode"/>
- </xsl:call-template>
- </td>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- <tr>
- <td nowrap="nowrap">
- <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- </table>
- </lyt:section>
- </lyt:layout>
- <xsl:if test="(key('business-rules','allowLinkToReport')='true') or (key('business-rules','allowEmailAsAttachment')='true' or key('env-param','m_ro_emailAsAttachment')='true')">
- <lyt:layout style="1">
- <lyt:section>
- <dp:choice>
- <xsl:if test="key('business-rules','allowLinkToReport')='true'">
- <dp:section1>
- <input type="checkbox" name="m_ro_emailAsURL" id="m_ro_emailAsURL" value="true">
- <xsl:if test="key('env-param','m_ro_emailAsURL')='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </dp:section1>
- <dp:section2>
- <label for="m_ro_emailAsURL">
- <xsl:choose>
- <xsl:when test="key('request-param','objectClass')='jobDefinition'">
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINKS"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINK"/>
- </xsl:otherwise>
- </xsl:choose>
- </label>
- </dp:section2>
- </xsl:if>
- <xsl:if test="key('business-rules','allowEmailAsAttachment')='true' or key('env-param','m_ro_emailAsAttachment')='true'">
- <dp:section1>
- <input type="checkbox" name="m_ro_emailAsAttachment" id="m_ro_emailAsAttachment" value="true">
- <xsl:if test="key('env-param','m_ro_emailAsAttachment')='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </dp:section1>
- <dp:section2>
- <label for="m_ro_emailAsAttachment">
- <xsl:choose>
- <xsl:when test="key('request-param','objectClass')='jobDefinition'">
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_OUTPUTS"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_OUTPUT"/>
- </xsl:otherwise>
- </xsl:choose>
- </label>
- </dp:section2>
- </xsl:if>
- </dp:choice>
- </lyt:section>
- </lyt:layout>
- </xsl:if>
- <!-- footer -->
- <xsl:choose>
- <xsl:when test="key('request-param','displayButtons') != 'false'">
- <dp:footer>
- <xsl:choose>
- <xsl:when test="key('request-param','inWizard') = 'true'">
- <dlgctrl:wizardButtons validateFunction="validate"/>
- </xsl:when>
- <xsl:otherwise>
- <dlgctrl:okCancelButtons validateFunction="validate"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- </xsl:when>
- <xsl:otherwise>
- <dp:emptyFooter/>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="key('env-param','duplicateEntryAdded') = 'true'">
- <script language="javascript">
- window.alert("<xts:string id="IDS_DUPLICATE_ENTRY" encode="javascript"/>");
- </script>
- </xsl:if>
- <xsl:if test="not(key('env-param','visited_email_options')) and /root/selectedEntries/item/unknown='true'">
- <script language="javascript">
- alert("<xts:string id="IDS_OTHERRUN_EMAIL_WARN_UNKNOWN_RECIPIENT" encode="javascript"/>");
- </script>
- </xsl:if>
- </xts:transform>
- </markup>
- <browserTitle>
- <xsl:if test="key('business-rules','browserTitle') != ''">
- <xts:transform name="XMLEncode">
- <xsl:value-of select="key('business-rules','browserTitle')"/>
- </xts:transform>
- </xsl:if>
- </browserTitle>
- </xsl:element>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
-
- <xsl:template name="emailBody">
- <xsl:param name="inputSize"/>
- <xsl:param name="richEditMode"/>
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">
- <iframe id="email_body_iframe" src="../common/blank.html" frameborder="0" contentEditable="true" onblur="richEditControl_doEditBlur();" marginwidth="2" marginheight="2">
- <!-- for rich edit body we're using the table border and not the textarea border -->
- <xsl:attribute name="style">width:<xsl:value-of select="$inputSize - 6"/>px;height:95px;</xsl:attribute>
- </iframe>
- <input type="hidden" name="hidden_richEditBody" value="{key('env-param','hidden_richEditBody')}"/>
- <input type="hidden" name="email_body" value="{key('env-param','email_body')}"/>
- <script>
-
- CKEDITOR.replace( 'email_body_iframe', {
- height: 260,
- width: 700,
- removePlugins: 'elementspath',
- // Define the toolbar groups as it is a more accessible solution.
- toolbarGroups: [
- {"name":"clipboard", groups: [ "undo"]},
- {"name":"clipboard", groups: [ "clipboard"]},
- {"name":"basicstyles","groups":["basicstyles"]},
- {"name":"paragraph","groups":["align", "list", "indent"]},
- {"name":"insert","groups":["insert"]}
- ],
- // Remove the redundant buttons from toolbar groups defined above.
- removeButtons: 'Strike,Subscript,Superscript,Image,SpecialChar,Flash,Smiley,PageBreak,Iframe,PasteFromWord,PasteText',
- on :
- {
- instanceReady : function( ev )
- {
- ev.editor.document.on('drop',function(){
- insertDataItemsToRTE();
- CKEDITOR.instances.email_body_iframe.focus();
- });
- }
- }
- } );
-
- CKEDITOR.config.bodyId = 'editbody';
-
- CKEDITOR.on( 'dialogDefinition', function( evt ) {
- var dialog = evt.data;
- if ( dialog.name == 'table' || dialog.name == 'tableProperties') {
- // Get dialog definition.
- var def = evt.data.definition;
- def.onShow = function() {
- var select = this.getContentElement( 'info', 'selHeaders' );
- select.disable();
- }
- }
- } );
-
- </script>
- </xsl:when>
- <xsl:otherwise>
- <textarea rows="6" name="email_body" id="email_body">
- <xsl:attribute name="style">
- <xsl:choose>
- <!-- for agent studio we're using the table border and not the textarea border -->
- <xsl:when test="key('request-param','agentStudio')='true'">
- width:<xsl:value-of select="$inputSize - 6"/>px;
- </xsl:when>
- <xsl:otherwise>
- width:<xsl:value-of select="$inputSize"/>px;
- px;</xsl:otherwise>
- </xsl:choose>
- OVERFLOW:auto; PADDING: 2px;
- <xsl:if test="key('request-param','agentStudio')='true'">BORDER-WIDTH: 0px;</xsl:if>
- </xsl:attribute>
- <xsl:value-of select="key('env-param','email_body')"/>
- </textarea>
- <input type="hidden" name="hidden_richEditBody" value=""/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="richEditControls">
- <script type="text/javascript">
-
- function richEditControl_removeLinks()
- {
- <xsl:if test="not(key('system-param','allow-email-links')='true')">
- // remove all links from email_body for security reasons
- for (i=0; i < email_body_iframe.document.links.length; i++) {
- var tr = email_body_iframe.document.links[i].parentTextEdit.createTextRange();
- tr.moveToElementText(email_body_iframe.document.links[i]);
- tr.execCommand("Unlink",false);
- tr.execCommand("Unselect",false);
- i--;
- }
- </xsl:if>
- // remove all images from email_body for security reasons
- for (i=0; i < email_body_iframe.document.images.length; i++) {
- var tr = email_body_iframe.document.images[i].parentTextEdit.createTextRange();
- tr.moveToElementText(email_body_iframe.document.images[i]);
- tr.execCommand("Delete",false);
- i--;
- }
- }
-
- function richEditControl_convertToXHTML()
- {
- var element = getEditorBody();
- return richEditControl_doTree(element);
- }
-
- function getEditorBody()
- {
- var body = "";
-
- if(CKEDITOR.instances != null && CKEDITOR.instances != 'undefined'
- && CKEDITOR.instances.email_body_iframe != null && CKEDITOR.instances.email_body_iframe != 'undefined'
- && CKEDITOR.instances.email_body_iframe.document != null && CKEDITOR.instances.email_body_iframe.document != 'undefined')
- {
- var element = CKEDITOR.instances.email_body_iframe.document.getBody();
- body = document.createElementNS('http://www.w3.org/1999/xhtml', 'body');
- body.setAttribute('id', 'editbody');
- body.innerHTML = element.getHtml();
-
- }
- return body;
- }
-
- function richEditControl_doTree(element)
- {
- var node = "";
- if (element.nodeType == 1) {
- // add the start of the node
- node = "<" + element.tagName;
- for (var i = 0; i < element.attributes.length; ++i) {
- if (element.attributes[i].nodeValue != null &&
- element.attributes[i].nodeValue.length > 0 &&
- element.attributes[i].nodeName != "contentEditable") {
- node += " " + element.attributes[i].nodeName + "=\"" + htmlEncode(element.attributes[i].nodeValue) + "\"";
- }
- }
- if (element.childNodes != null && element.childNodes.length > 0) {
- node += ">";
- for (var j = 0; j < element.childNodes.length; ++j) {
- node += richEditControl_doTree(element.childNodes[j]);
- }
- node += "</" + element.tagName + ">";
- } else {
- node += "/>";
- }
- } else if (element.nodeType == 3) {
- <!-- Make sure we encode special HTML characters (&, ", <, >) -->
- node = htmlEncode(element.data);
- }
- return node;
- }
-
- function richEditControl_doEditBlur()
- {
- richEditControl_removeLinks();
- // copy the contents of the edit window into a form field
- document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
- }
- // function to initialize the script for the contents of the screen
- function richEditControl_init()
- {
- // set up the body of the Iframe
- <xsl:choose>
- <xsl:when test="key('env-param','hidden_richEditBody') != ''">
- CKEDITOR.instances.email_body_iframe.setData('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','hidden_richEditBody')))"/>');
- </xsl:when>
- <xsl:when test="key('env-param','email_body') != ''">
- <!-- encode textarea string's carriage returns -->
- emailBodyString = replaceCarriageReturns(htmlEncode('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','email_body')))"/>'),'<br/>');
- email_body_iframe.document.write("<BODY id=\"editbody\">" + emailBodyString + "</BODY>");
- </xsl:when>
- <xsl:otherwise>
- email_body_iframe.document.write("<BODY id=\"editbody\"></BODY>");
- </xsl:otherwise>
- </xsl:choose>
- // set up the drag drop for the HTML edit body too
- <xsl:if test="$agentStudio">
- var dropZone = new DropZone("editbody","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
-
- droppy.registerDropZoneObject(dropZone);
-
- //pass the group to a listener in case number of members dynamically changes
- droppy.registerDropZoneGroup(new Array(dropZone), "<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
- </xsl:if>
-
- if (document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody)
- {
- // copy the contents of the edit window into a form field
- document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
- }
- }
- </script>
- </xsl:template>
-
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- debug - special debug block for nested requests
- ===============================================================================================
- -->
- <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup processResponse returnResult" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
- exclude-result-prefixes="dbg xos">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:variable name="resultNode" select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='resultNode']"/>
- <xts:append select="/root/output/*[local-name() = 'part']/*[local-name() = 'entityBody']/*[local-name()='{$resultNode}']">
- <debugDump>
- <xts:transform name="XMLEncode">
- <dbg:dumpxml select="/root/*[local-name()!='header' and local-name()!='output' and local-name()!='system' and local-name()!='http' and local-name()!='session']">
- <dbg:title>email_options.xts</dbg:title>
- </dbg:dumpxml>
- </xts:transform>
- </debugDump>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|