1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2018
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- =================================================================================================================================
- email_options.xts
- view email_interface.xml for information on the API.
- =================================================================================================================================
- -->
- <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>
- <!--
- ===============================================================================================
- 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" 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>
- <!--
- ===============================================================================================
- returnResult - We're done with the email options morphlet, so return the appropriate response
- ===============================================================================================
- -->
- <xts:block id="returnResult" type="exec" processor="XSLT" dependency="processResponse" 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('env-param','m_app')='AS')
- or
- 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') != 'false'">
- <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>
- <!--
- ===============================================================================================
- businessRules - Take care off any business logic to simplify the UI generation
- ===============================================================================================
- -->
- <xts:block id="businessRules" type="exec" processor="XSLT" dependency="processResponse" 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>
- <!--
- ===============================================================================================
- updateAddedLists
- ===============================================================================================
- -->
- <xts:block id="updateAddedLists" type="exec" processor="XSLT" dependency="queryCMForOptionsInfo" 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>
- </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" 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:xts="http://developer.cognos.com/schemas/xts/"
- 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/"
- exclude-result-prefixes="xts xsl cm pf xtsext lyt dp df cf cp xos dlgctrl eut">
- <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/>
- <!-- Bidi common templates -->
- <pf:common-bidi-templates/>
- <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="richEditMode">
- <xsl:choose>
- <xsl:when test="not(key('env-param','richEditMode'))">true</xsl:when>
- <xsl:otherwise><xsl:value-of select="key('env-param','richEditMode')"/></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"/>
- <script language="javascript" src="{$webcontent}/{$app}/js/com/ibm/cognos/ps/dojo/editor/utils.js"/>
- <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"/>
- </xsl:if>
- <xsl:if test="$agentStudio">
- <script type="text/javascript" src="{$webRoot}/ags/layout.js"/>
- </xsl:if>
- <script language="javascript">
- var currentForm = document.<xsl:value-of select="key('request-param','formName')"/>;
- <xsl:choose>
- <xsl:when test="$agentStudio">
- var textRange;
- function initEditor()
- {
- 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 initEditor()
- {
- 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'))"/>';
- }
- var elemEmailTo = document.getElementById("email_to");
- if (elemEmailTo && elemEmailTo.type != "hidden" && elemEmailTo.style.display != "none" && !elemEmailTo.disabled)
- {
- elemEmailTo.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')"/>;
- <!-- Bidi STT Support -->
- var isBidiEnabled = <xsl:value-of select="boolean($isBidiEnabled='true')"/>;
- if (isBidiEnabled){
- bidi.onsubmit(frm);
- }
- <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>
- <xsl:if test="$richEditMode = 'true'">
- removeDefaultSpace();
- richEditControl_doEditBlur();
- </xsl:if>
- richEdit_leavingDialog(frm);
- return true;
- }
- 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.toString().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);
- string=string.replace(/%0A/g,replaceWith);
- string=string.replace(/\n/g,replaceWith);
- string=string.replace(/%0D/g,replaceWith);
- string=string.replace(/\r/g,replaceWith);
- string=unescape(string) <!-- unescape all other encoded characters -->
- return string;
- }
- <!-- Make sure the number of columns or rows is a positive integer (1,2,...) -->
- function validate_positiveIntegerProp(e, max)
- {
- if (e.value > max || e.value < 1 || isNaN(e.value) || parseInt(e.value, 10) != e.value)
- {
- return false;
- }
- e.value = parseInt(e.value, 10);
- return true;
- }
- <!--
- - 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%" role="presentation">
- <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" role="presentation">
- <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" role="presentation">
- <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" role="presentation">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top" role="presentation">
- <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}" stttype="email" onchange="changedEmailRecipients();">
- <!-- make the input hidden if part of a subscription -->
- <xsl:variable name="fieldType">
- <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:variable>
- <xsl:attribute name="type">
- <xsl:value-of select="$fieldType"></xsl:value-of>
- </xsl:attribute>
- <!-- BiDi Support -->
- <xsl:attribute name="value">
- <xsl:value-of select="xtsext:sttInjectUCCIntoStr(key('env-param','email_to'), 'email', boolean($isBidiEnabled='true'))"></xsl:value-of>
- </xsl:attribute>
- <xsl:call-template name="handleEmailSTT">
- <xsl:with-param name="type" select="$fieldType"></xsl:with-param>
- </xsl:call-template>
- </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" role="presentation">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top" role="presentation">
- <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" stttype="email" size="{$inputSize}" onchange="changedEmailRecipients();">
- <xsl:attribute name="value">
- <xsl:value-of select="xtsext:sttInjectUCCIntoStr(key('env-param','email_cc'),'email', boolean($isBidiEnabled='true'))"/>
- </xsl:attribute>
- <!-- BiDi Support -->
- <xsl:call-template name="handleEmailSTT">
- <xsl:with-param name="type">text</xsl:with-param>
- </xsl:call-template>
- </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" role="presentation">
- <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" role="presentation">
- <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" stttype="email" size="{$inputSize}" onchange="changedEmailRecipients();">
- <xsl:attribute name="value">
- <xsl:value-of select="xtsext:sttInjectUCCIntoStr(key('env-param','email_bcc'),'email', boolean($isBidiEnabled='true'))"/>
- </xsl:attribute>
- <!-- BiDi Support -->
- <xsl:call-template name="handleEmailSTT">
- <xsl:with-param name="type">text</xsl:with-param>
- </xsl:call-template>
- </input>
- </td>
- </tr>
- </table>
- </cf:dynamicDiv>
- <table border="0" cellspacing="0" cellpadding="1" width="100%" role="presentation">
- <tr align="right" class="formLink">
- <td nowrap="nowrap" align="right">
- <!-- select recipients -->
- <dp:link align="right">
- <a href="#" onclick="richEdit_leavingDialog(document.{key('request-param','formName')});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="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" role="presentation">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top" role="presentation">
- <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>
- <xsl:call-template name="add-bidi-onfocus-event">
- <xsl:with-param name="value" select="key('env-param','email_subject')"/>
- </xsl:call-template>
- </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" role="presentation">
- <!-- 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">
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">
- <span><xts:string id="IDS_EMAIL_OPTIONS_BODY"/></span>
- </xsl:when>
- <xsl:otherwise>
- <label for="email_body"><xts:string id="IDS_EMAIL_OPTIONS_BODY"/></label>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">
- <td width="100%" align="right" class="formLink" nowrap="nowrap" valign="bottom">
- <a href="#" onclick="javascript:richEdit_changeModes(currentForm);"><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:richEdit_changeModes(currentForm);"><xts:string id="IDS_EMAIL_OPTIONS_HTML_TEXT"/></a>
- </td>
- </xsl:otherwise>
- </xsl:choose>
- </tr>
- <tr>
- <td>
- <img height="3" width="1" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="1" role="presentation">
- <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" role="presentation">
- <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:parent.dropFrame=window.name;parent.insertStartMC('email_body_rich');</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}" role="presentation">
- <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()}" 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)" role="presentation">
- <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()}" 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']}" role="presentation">
- <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" role="presentation">
- <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" role="presentation">
- <tr>
- <td id="attachmentDropdown" height="0px" valign="bottom"/>
- <td class="formLink">
- <a href="#" onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
- <xts:string id="IDS_ADDENTRIES_ATTACHMENT_COLUMN"/>
- </a>
- </td>
- <td onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="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="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:variable name="fromReportViewer" select="key('request-param','reportViewer')='true'"/>
- <xsl:variable name="emailAsAttachmentSelectedEnv" select="key('env-param','m_ro_emailAsAttachment')='true'"/>
- <xsl:variable name="emailAsAttachmentSelectedReq" select="key('request-param','m_ro_emailAsAttachment')='true'"/>
- <xsl:variable name="emailAsAttachmentVisible" select="key('business-rules','allowEmailAsAttachment')='true'"/>
- <xsl:variable name="emailAsURLSelected" select="key('env-param','m_ro_emailAsURL')='true'"/>
- <xsl:variable name="emailAsURLVisible" select="key('business-rules','allowLinkToReport')='true'"/>
- <xsl:variable name="emailHideLinkToReport" select="key('request-param','hideLinkToReport')='true'"/>
- <xsl:if test="$emailAsURLVisible or $emailAsAttachmentVisible or $emailAsAttachmentSelectedEnv">
- <lyt:layout style="1">
- <lyt:section>
- <dp:choice>
- <xsl:if test="$emailAsURLVisible">
- <dp:section1>
- <input type="checkbox" name="m_ro_emailAsURL" id="m_ro_emailAsURL" value="true">
- <!-- Fix for COGCQ00231822 - only set m_ro_emailAsURL checked if m_ro_emailAsAttachment is not set -->
- <xsl:if test="(not($emailAsAttachmentSelectedEnv) and not($emailAsAttachmentSelectedReq)) or not($fromReportViewer) or (key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)">
- <xsl:if test="$emailAsURLSelected">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </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>
- <!-- Fix for COGCQ00231822 - set attachment as default when launching the email modal from Viewer
- and disable the checkbox when launching the email modal from Viewer Wait page so the user must add an attachment-->
- <xsl:if test="$emailAsAttachmentVisible or $emailAsAttachmentSelectedEnv or ($emailAsAttachmentSelectedReq and (not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)))">
- <dp:section1>
- <input type="checkbox" name="m_ro_emailAsAttachment" id="m_ro_emailAsAttachment" value="true">
- <xsl:if test="$emailAsAttachmentSelectedEnv or $emailAsAttachmentSelectedReq">
- <xsl:attribute name="checked">checked</xsl:attribute>
- <xsl:if test="$emailHideLinkToReport">
- <xsl:attribute name="disabled">disabled</xsl:attribute>
- </xsl:if>
- </xsl:if>
- </input>
- <xsl:if test="($emailAsAttachmentSelectedEnv or $emailAsAttachmentSelectedReq) and $emailHideLinkToReport">
- <input type="hidden" name="m_ro_emailAsAttachment" value="true"/>
- </xsl:if>
- </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>
- <!-- Handle Bidi STT for emails -->
- <xsl:template name="handleEmailSTT">
- <xsl:param name="type"/>
- <xsl:if test="$type = 'text'">
- <xsl:if test="$isBidiEnabled='true'">
- <xsl:attribute name="dir">ltr</xsl:attribute>
- <xsl:attribute name="onfocus">
- <xsl:text>bidi.onfocus(this)</xsl:text>
- </xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <!-- -->
- <xsl:template name="emailBody">
- <xsl:param name="inputSize"/>
- <xsl:param name="richEditMode"/>
- <xsl:variable name="productLocale">
- <xsl:value-of select="/root/user/param[@name='productLocale']"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">
- <link id="themeStyles" rel="stylesheet" href="{$webcontent}/../dojo16/dijit/themes/tundra/tundra.css"/>
- <link href="{$webcontent}/../dojo16/dojox/editor/plugins/resources/editorPlugins.css" type="text/css" rel="stylesheet" />
- <link href="{$webcontent}/portal/js/com/ibm/cognos/ps/dojo/editor/plugins/resources/editorPlugins.css" type="text/css" rel="stylesheet" />
- <xsl:choose>
- <xsl:when test="$isBidiEnabled = 'true'">
- <pf:dojo djConfig="parseOnLoad: true, locale: '{xtsext:mapProductLocaleForDojo($productLocale)}'">
- <require>dijit.dijit</require> <!--optimize: load dijit layer-->
- <require>com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins</require>
- <require>bidi.dojo.editor.Editor</require>
- <require>dijit.Editor</require>
- <require>dojo.parser</require> <!--scan page for widgets and instantiate them-->
- <require>bidi.dojo.editor.plugins.BidiSupport</require>
- </pf:dojo>
- </xsl:when>
- <xsl:otherwise>
- <pf:dojo djConfig="parseOnLoad: true, locale: '{xtsext:mapProductLocaleForDojo($productLocale)}'">
- <require>dijit.dijit</require> <!--optimize: load dijit layer-->
- <require>com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins</require>
- <require>dijit.Editor</require>
- <require>dojo.parser</require> <!--scan page for widgets and instantiate them-->
- </pf:dojo>
- </xsl:otherwise>
- </xsl:choose>
- <script language="JavaScript" type="text/javascript">
- var IDS_EMAIL_INVALID_INPUT_WARNING = '<xts:string id="IDS_EMAIL_INVALID_INPUT_WARNING" encode="javascript"/>';
- var IDS_EMAIL_OPTIONS_TEXT_LTR = '<xts:string id="IDS_EMAIL_OPTIONS_TEXT_LTR" encode="javascript"/>';
- var IDS_EMAIL_OPTIONS_TEXT_RTL = '<xts:string id="IDS_EMAIL_OPTIONS_TEXT_RTL" encode="javascript"/>';
- dojo.addOnLoad (
- function () {
- richEdit_initializeEditor();
- }
- );
-
- function richEditControl_removeLinks()
- {
- <xsl:if test="not(key('system-param','allow-email-links')='true')">
- // remove all links from email_body for security reasons
- var hrefs = richEdit_getIframeDocument().body.getElementsByTagName("a");
- while (hrefs && hrefs.length > 0){
- var span = richEdit_getIframeDocument().createElement("span");
- span.innerHTML = hrefs[0].innerHTML;
- dojo.place(span,hrefs[0],"replace");
- }
- </xsl:if>
- // remove all images from email_body for security reasons
- var imgs = richEdit_getIframeDocument().body.getElementsByTagName("img");
- while (imgs && imgs.length > 0){
- dojo.destroy(imgs[0]);
- }
- }
- function richEditControl_convertToXHTML()
- {
- richEditControl_removeLinks();
- var bodyStr = richEditControl_doTree(richEdit_getIframeDocument().body);
- return bodyStr;
- }
-
- function removeDefaultSpace(){
- var bodyElmDoc = richEdit_getIframeDocument() ;
- if (bodyElmDoc != null && bodyElmDoc.body != null) {
- if (dojo.isIE || dojo.isWebKit) {
- var dummy = bodyElmDoc.body.innerText ;
- // if body has blank space
- if(dummy.trim()<1) {
- bodyElmDoc.body.innerText = '';
- }
- } else {
- var dummy1 = bodyElmDoc.body.textContent ;
- if(dummy1.trim()<1) {
- bodyElmDoc.body.textContent = '';
- }
- }
- }
- }
- function richEditControl_doTree(element)
- {
- var node = "";
- if (element.nodeType == 1) {
- //this if branch is required to take out a div element that is errantly generated
- //in the text. If this is left in there, the text would be uneditable when returning to the
- //rich text editor
- if (dojo.isIE && element.id == "dijitEditorBody"){
- for (var j = 0; j < element.childNodes.length; ++j) {
- node += richEditControl_doTree(element.childNodes[j]);
- }
- return node;
- }
- // add the start of the node
- node = "<" + element.tagName;
- for (var i = 0; i < element.attributes.length; ++i) {
- //IE doesn't return any stringfy value for "style" attribute, this is a work around
- if (dojo.isIE && element.attributes[i].nodeName.toLowerCase() == "style" && element.style.cssText != "") {
- node += " style=\"" + htmlEncode(element.style.cssText) + "\"";
- } else if (element.attributes[i].nodeValue != null &&
- element.attributes[i].nodeValue.length > 0 &&
- element.attributes[i].nodeName.toLowerCase().indexOf("on") != 0 && //remove any possible event handler.
- 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()
- {
- // 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 removeUnusedAtts(root){
- if (root == null) {
- return;
- }
- if (!root.removeAttribute){
- return;
- }
- root.removeAttribute("lang");
- root.removeAttribute("dir");
-
- var rootChilds = root.children;
- if (rootChilds != null) {
- for(var i=0;i < rootChilds.length;i++){
- currentEl = rootChilds[i];
- currentEl.removeAttribute("lang");
- currentEl.removeAttribute("dir");
- }
- }
- }
- // function to initialize the script for the contents of the screen
- function richEditControl_init()
- {
- // set up the body of the Iframe
- //add a title to the iframe for a11y purposes
- var frameEl = document.getElementById("editor_dijit_iframe");
- if (frameEl != null){
- frameEl.setAttribute("title","<xts:string id="IDS_EMAIL_OPTIONS_BODY" encode="javascript"/>");
- }
- //get rid of all the useless empty lang tags in the toolbar
- var toolbarEl = document.getElementById("dijit_Toolbar_0");
- removeUnusedAtts(toolbarEl);
- var hiddenTextEl = document.getElementById("dijit._editor.RichText.value");
- if (hiddenTextEl != null){
- <!--this element is never show or displauyed in any way...but to avoid the rpt violation of an unlabelled element
- and the invariable complaint of the violation from users of the page.....set it to a hard coded value -->
- hiddenTextEl.setAttribute("aria-label","hidden");
- }
- toolbarEl.setAttribute("aria-label","<xts:string id='IDS_RITCHTEXT_TOOLBAR_COMMON' encode='javascript'/>");
-
- <xsl:choose>
- <xsl:when test="key('env-param','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 = '<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','hidden_richEditBody')))"/>';
- dijit.byId("editor_dijit").setValue('<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/>');
- //now for ie only...we need to maintain the spaces. FF does this nicely because it puts the non breaking spaces in the string but ie leaves us with
- //regular old spaces that will get ignored when rendered in the rte...so lets replace the spaces in ie with non breaking spaces and everything will be the same
- if (dojo.isIE) {
- var replacedString = emailBodyString.replace(/ /gi,"&nbsp;");
- emailBodyString = replacedString;
- }
- dijit.byId("editor_dijit").setValue(emailBodyString);
- </xsl:when>
- </xsl:choose>
- //the reason why use a onLoadDeferred function is that the iframe "body" is not accessible until the Editor got renderred.
- dijit.byId("editor_dijit").onLoadDeferred.addCallback(function(){
- //set id for iframe body, so that droppy can refer to it.
- dojo.attr(richEdit_getIframeDocument().body,"id","email_body_rich");
- // set up the drag drop for the HTML edit body too
- <xsl:if test="$agentStudio">
- var dropZone = new DropZone("email_body_rich","","",'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>
- });
- }
-
- </script>
- <xsl:choose>
- <xsl:when test="$isBidiEnabled = 'true'">
- <div id="editor_dijit" dojoType="bidi.dojo.editor.Editor" height="125">
- <!-- 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;</xsl:attribute>
- <xsl:attribute name="extraPlugins">['|',{name: 'bidi.dojo.editor.plugins.BidiSupport', command: 'bidiSupport'},'|',{name: 'com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins', command: 'insertTableWithValidation', label: '<xts:string encode="javascript" id="IDS_EMAIL_OPTIONS_INSERT_TABLE_TITLE"/>'},{name: 'com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins', command: 'modifyTableWithValidation', label: '<xts:string encode="javascript" id="IDS_EMAIL_OPTIONS_MODIFY_TABLE_TITLE"/>'}]</xsl:attribute>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <div id="editor_dijit" dojoType="dijit.Editor" height="125">
- <!-- 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;</xsl:attribute>
- <xsl:attribute name="extraPlugins">['|',{name: 'com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins', command: 'insertTableWithValidation', label: '<xts:string encode="javascript" id="IDS_EMAIL_OPTIONS_INSERT_TABLE_TITLE"/>'},{name: 'com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins', command: 'modifyTableWithValidation', label: '<xts:string encode="javascript" id="IDS_EMAIL_OPTIONS_MODIFY_TABLE_TITLE"/>'}]</xsl:attribute>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- <input type="hidden" name="hidden_richEditBody" value="{key('env-param','hidden_richEditBody')}"/>
- <input type="hidden" name="email_body" value="{key('env-param','email_body')}"/>
- </xsl:when>
- <xsl:otherwise>
- <textarea rows="6" name="email_body" id="email_body">
- <xsl:attribute name="title">
- <xts:string id="IDS_EMAIL_OPTIONS_BODY"/>
- </xsl:attribute>
- <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:call-template name="add-bidi-onfocus-event">
- <xsl:with-param name="value" select="key('env-param','email_body')"/>
- </xsl:call-template>
- <xsl:value-of select="key('env-param','email_body')"/>
- </textarea>
- <input type="hidden" name="hidden_richEditBody" value=""/>
- <script type="text/javascript">initEditor();</script>
- </xsl:otherwise>
- </xsl:choose>
- </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"/>
- <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>
|