Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Doubt about Template Toolkit

by logangha (Acolyte)
on Jul 16, 2022 at 21:52 UTC ( [id://11145554]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Doubt about Template Toolkit
in thread Doubt about Template Toolkit

I am replying with my correct user and correcting some gramatical text errors. Hi Bod, thanks for your observations. In fact, I am doing what you stated: Using window.open, but now below url is not processed. It looks like weird characters avoid window.open command processes the URL, but I do not know what those are. I compare formed url with a url generated with a public place to do it. (http://www.blooberry.com/indexdot/html/topics/urlencoding.htm) Using previous page I converted below url (No encoding)

https://localhost:8080/ibm/console/webtop/AELView?sql=((TMX_NodeName ! += '' and TMX_NodeName = 'CTJAXM7300W' and PhysicalSlot = 1 and Physic +alPort= 3) or (TMX_NodeName != '' and TMX_NodeName= 'CTJAXM7300W' and + PhysicalPort = 0)) or (TMX_NodeName != '' and TMX_NodeName = 'CTJAXM +7300W' and PhysicalSlot = 1 and PhysicalPort = 1) or ((TMX_NodeName ! += '' and TMX_NodeName = 'TTTNXMCL05W' and PhysicalSlot = 01 and Physi +calPort = 9) or (TMX_NodeName != '' and TMX_NodeName= 'TTTNXMCL05W' +and PhysicalPort = 0)) or ((TMX_NodeName != '' and TMX_NodeName = 'TT +TNXMCL05W' and PhysicalSlot = 17 and PhysicalPort = 1) or (TMX_NodeNa +me != '' and TMX_NodeName = 'TTTNXMCL05W' and PhysicalSlot = 0 and Ph +ysicalPort = 0)) or ((TMX_NodeName != '' and TMX_NodeName = 'TTTNXMCL +O01-AGR3-06' and PhysicalSlot = 03 and PhysicalPort = 7 ) or (TMX_No +deName != '' and TMX_NodeName = 'TTTNXMCLO01-AGR3-06' and PhysicalSl +ot = 0 and PhysicalPort = 0 AND (AlertGroup IN ('ReachabilityProblem' +, 'component unreachable','ER CEth Inalcanzable') OR AlertGroup LIKE + '[Pp]ower')) ) or (TMX_NodeName = 'TTTNXMCLO01-AGR3-06' and Physical +Slot = 03 and PhysicalPort = 0) or (TMX_NodeName = 'TTTNXMCLO01-AGR3- +06' and PhysicalSlot = 0 and PhysicalPort = 0) or (TMX_NodeName != '' + and TMX_NodeName = 'TTTNXMCLO01-AGR3-06' AND PhysicalSlot = 0 and Ph +ysicalPort = 0 AND (AlertGroup IN ('ReachabilityProblem', 'component +unreachable','ER CEth Inalcanzable') OR AlertGroup LIKE '[Pp]ower')) + or ((TMX_NodeName != '' and TMX_NodeName = 'CTLNXMCUO10-DIST1-09' a +nd PhysicalSlot = 01 and PhysicalPort = 17 ) or (TMX_NodeName != '' a +nd TMX_NodeName = 'CTLNXMCUO10-DIST1-09' and PhysicalSlot = 09 and P +hysicalPort = 2 ) ) or (TMX_NodeName = 'CTLNXMCUO10-DIST1-09' and Phy +sicalSlot = 01 and PhysicalPort = 0) or (TMX_NodeName = 'CTLNXMCUO10- +DIST1-09' and PhysicalSlot = 09 and PhysicalPort = 0) or (TMX_NodeNam +e != '' and TMX_NodeName = 'CTLNXMCUO10-DIST1-09' AND PhysicalSlot = +0 and PhysicalPort = 0 AND (AlertGroup IN ('ReachabilityProblem', 'co +mponent unreachable','ER CEth Inalcanzable') OR AlertGroup LIKE '[Pp +]ower')) or ((TMX_NodeName != '' and TMX_NodeName = 'CTLNXMCU10W' and + PhysicalSlot = 0 and PhysicalPort = 1) or (TMX_NodeName != '' and TM +X_NodeName = 'CTLNXMCU10W' and PhysicalSlot = 0 and PhysicalPort = 2) + or (TMX_NodeName != '' and TMX_NodeName = 'CTLNXMCU10W' and Physical +Slot = 0 and PhysicalPort = 5) or (TMX_NodeName != '' and TMX_NodeNam +e = 'CTLNXMCU10W' and PhysicalPort = 0))&transientname=C02-2003-0263& +viewname=Default_TMX&viewtype=system&datasource=NCOMS,NCOMS2

My code generates same URL-Safe Encoding but when I process with window.open does not show anything.

https://localhost:8080/ibm/console/webtop/AELView?sql=((TMX_NodeName%2 +0!=%20''%20and%20TMX_NodeName%20=%20'CTJAXM7300W'%20and%20PhysicalSlo +t%20=%201%20and%20PhysicalPort=%203)%20or%20(TMX_NodeName%20!=%20''%2 +0and%20TMX_NodeName=%20'CTJAXM7300W'%20and%20PhysicalPort%20=%200))%2 +0or%20(TMX_NodeName%20!=%20''%20and%20TMX_NodeName%20=%20'CTJAXM7300W +'%20and%20PhysicalSlot%20=%201%20and%20PhysicalPort%20=%201)%20or%20( +(TMX_NodeName%20!=%20''%20and%20TMX_NodeName%20=%20'TTTNXMCL05W'%20an +d%20PhysicalSlot%20=%2001%20and%20PhysicalPort%20=%209)%20%20or%20(TM +X_NodeName%20!=%20''%20and%20TMX_NodeName=%20'TTTNXMCL05W'%20and%20Ph +ysicalPort%20=%200))%20or%20((TMX_NodeName%20!=%20''%20and%20TMX_Node +Name%20=%20'TTTNXMCL05W'%20and%20PhysicalSlot%20=%2017%20and%20Physic +alPort%20=%201)%20or%20(TMX_NodeName%20!=%20''%20and%20TMX_NodeName%2 +0=%20'TTTNXMCL05W'%20and%20PhysicalSlot%20=%200%20and%20PhysicalPort% +20=%200))%20or%20((TMX_NodeName%20!=%20''%20and%20TMX_NodeName%20=%20 +'TTTNXMCLO01-AGR3-06'%20%20and%20PhysicalSlot%20=%2003%20and%20Physic +alPort%20=%207%20)%20or%20(TMX_NodeName%20!=%20''%20and%20TMX_NodeNam +e%20=%20'TTTNXMCLO01-AGR3-06'%20%20and%20PhysicalSlot%20=%200%20and%2 +0PhysicalPort%20=%200%20AND%20(AlertGroup%20IN%20('ReachabilityProble +m'%2C%20'component%20unreachable'%2C'ER%20CEth%20Inalcanzable')%20OR% +20AlertGroup%20%20LIKE%20'%5BPp%5Dower'))%20)%20or%20(TMX_NodeName%20 +=%20'TTTNXMCLO01-AGR3-06'%20and%20PhysicalSlot%20=%2003%20and%20Physi +calPort%20=%200)%20or%20(TMX_NodeName%20=%20'TTTNXMCLO01-AGR3-06'%20a +nd%20PhysicalSlot%20=%200%20and%20PhysicalPort%20=%200)%20or%20(TMX_N +odeName%20!=%20''%20and%20TMX_NodeName%20=%20'TTTNXMCLO01-AGR3-06'%20 +AND%20PhysicalSlot%20=%200%20and%20PhysicalPort%20=%200%20AND%20(Aler +tGroup%20IN%20('ReachabilityProblem'%2C%20'component%20unreachable'%2 +C'ER%20CEth%20Inalcanzable')%20OR%20AlertGroup%20%20LIKE%20'%5BPp%5Do +wer'))%20or%20((TMX_NodeName%20!=%20''%20and%20TMX_NodeName%20=%20'CT +LNXMCUO10-DIST1-09'%20%20and%20PhysicalSlot%20=%2001%20and%20Physical +Port%20=%2017%20)%20or%20(TMX_NodeName%20!=%20''%20and%20TMX_NodeName +%20=%20'CTLNXMCUO10-DIST1-09'%20%20and%20PhysicalSlot%20=%2009%20and% +20PhysicalPort%20=%202%20)%20)%20or%20(TMX_NodeName%20=%20'CTLNXMCUO1 +0-DIST1-09'%20and%20PhysicalSlot%20=%2001%20and%20PhysicalPort%20=%20 +0)%20or%20(TMX_NodeName%20=%20'CTLNXMCUO10-DIST1-09'%20and%20Physical +Slot%20=%2009%20and%20PhysicalPort%20=%200)%20or%20(TMX_NodeName%20!= +%20''%20and%20TMX_NodeName%20=%20'CTLNXMCUO10-DIST1-09'%20AND%20Physi +calSlot%20=%200%20and%20PhysicalPort%20=%200%20AND%20(AlertGroup%20IN +%20('ReachabilityProblem'%2C%20'component%20unreachable'%2C'ER%20CEth +%20Inalcanzable')%20OR%20AlertGroup%20%20LIKE%20'%5BPp%5Dower'))%20or +%20((TMX_NodeName%20!=%20''%20and%20TMX_NodeName%20=%20'CTLNXMCU10W'% +20and%20PhysicalSlot%20=%200%20and%20PhysicalPort%20=%201)%20or%20(TM +X_NodeName%20!=%20''%20and%20TMX_NodeName%20=%20'CTLNXMCU10W'%20and%2 +0PhysicalSlot%20=%200%20and%20PhysicalPort%20=%202)%20or%20(TMX_NodeN +ame%20!=%20''%20and%20TMX_NodeName%20=%20'CTLNXMCU10W'%20and%20Physic +alSlot%20=%200%20and%20PhysicalPort%20=%205)%20or%20(TMX_NodeName%20! +=%20''%20and%20TMX_NodeName%20=%20'CTLNXMCU10W'%20and%20PhysicalPort% +20=%200))&transientname=C02-2003-0263&viewname=Default_TMX&viewtype=s +ystem&datasource=NCOMS%2CNCOMS2

It only works for short URL

https://localhost:8080/ibm/console/webtop/AELView?sql=Serial%3C0&trans +ientname=C02-2003-0260_SINREFERENCIA&viewname=Default_TMX&viewtype=sy +stem&datasource=NCOMS%2CNCOMS2

This is ttml file content

[%# formReference.ttml %] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <TITLE>Tivoli Netcool/OMNIbus Web GUI</TITLE> </head> <body> <form> <input type="hidden" id="preUrl" value="[% pre %]"> <input type="hidden" id="postUrl" value="[% post %]"> <select name="url" id="url" onchange="update();"> [% FOREACH url IN urls -%] <option value="[% url.value %]">[% url.key %]</option> [% END -%] </select> <input id="value" type="text" > <script type="text/javascript"> function update() { var select = document.getElementById('url'); var option = select.options[select.selectedIndex]; var preUrl = document.getElementById('preUrl').value; var postUrl = document.getElementById('postUrl').value; var newUrl = preUrl + encodeURI(option.value) + "&transientn +ame=" + option.text + postUrl; document.getElementById('value').value = newUrl; try { var newWindow = window.open(newUrl, '_blank', 'toolbar=0, +location=0,menubar=0'); } catch(ex) { document.getElementById('value').value = ex; } } update(); </script> </form> </body> </html>

What can I do in order to get this solved? or How can I figure out what (is this character/are those characters) that it does not allow to process the URL?

Replies are listed 'Best First'.
Re^4: Doubt about Template Toolkit
by logangha (Acolyte) on Jul 18, 2022 at 01:24 UTC

    At last...!!!! My solution:

    [%# formReference.ttml %] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <TITLE>Please select your option</TITLE> <STYLE type="text/css"> select{display:inline-block;} div{text-align:center; border:1px solid gray;} </STYLE> </head> </head> <body> <form> <input type="hidden" id="preUrl" value="[% pre %]"> <input type="hidden" id="postUrl" value="[% post %]"> <div> <select name="url" id="url" onchange="update();"> [% FOREACH url IN urls -%] <option value="[% url.value %]">[% url.key %]</option> [% END -%] </select> <p id="p"></p> </div> <script type="text/javascript" charset="UTF-8"> function update() { var select = document.getElementById('url'); var option = select.options[select.selectedIndex]; var preUrl = document.getElementById('preUrl').value; var postUrl = document.getElementById('postUrl').value; var newUrl = preUrl + encodeURI(option.value) + "&transient +name=" + option.text + postUrl; document.getElementById("p").textContent = "Reference selec +ted: " + option.text; try { var newWindow = window.open("", '_blank', 'toolbar=0,loc +ation=0,menubar=0'); newWindow.location.href = newUrl; } catch(ex) { document.getElementById('value').value = ex; } } update(); </script> </form> </body> </html>

    Thanks all for your valuable help. I appreciate it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145554]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-18 21:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found