IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Any one got a wf function for escaping a URL?
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Master
Posted
...that they would care to share.

eg passing % as wildcard in URL needs to be replaced with %25



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 848 | Location: Airstrip One | Registered: October 06, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
John, may I ask in what context you'd like this functionality?

Is it a drill-down generated by a WebFOCUS Style-sheet declaration or by a DEFINE or COMPUTE?

One suggestion that might work, depending on how this URL is generated, is to call a JavaScript function that creates the URL, using escape() to encode the %...


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
Francis

It was building up a URL
/ibi_apps/WFServlet?IBIF_ex=report¶m=U% 
in DM. Solved the problem using STRREP but thought someone might have done something a bit more classy that would take account of other characters that might need replacing



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 848 | Location: Airstrip One | Registered: October 06, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
I would call a JS function, something like:

COMPUTE XXX/A200 = 'RunURL("/ibi_apps/WFServlet?IBIF_ex=report¶m=U%");';

...

<script type="text/javascript" language="JavaScript">
function RunURL(myURL)
{
self.location.href = escape(myURL);
}
</script>


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
Cheers Francis

I am guessing there should be something round the RunURL in the compute statement to identify the myURL as a javascript routine.

Ne est ce pas?



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 848 | Location: Airstrip One | Registered: October 06, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
I apologize that my code snippet wasn't accurate.

The whole thing would look something like this:

-SET &ECHO=ON;

TABLE FILE CAR
SUM
SALES

COMPUTE LINK1/A200 = 
  '<input type=button value="Click me" onClick="RunURL(''/ibi_apps/WFServlet?IBIF_ex=car1'',''&|param=U%'');">';

COMPUTE LINK2/A10 = 'Click me';
BY CAR

ON TABLE SET STYLE *
TYPE=DATA, COLUMN=LINK2, JAVASCRIPT=RunURL('/ibi_apps/WFServlet?IBIF_ex=car1' '&|param=U%'), $
ENDSTYLE

ON TABLE HOLD AS H001 FORMAT HTMTABLE
END
-RUN

-HTMLFORM BEGIN
<html>
<head>
<script type="text/javascript" language="JavaScript">
function RunURL(myURL, myParms)
{
alert(myURL + myParms);
self.location.href = myURL + escape(myParms);
}
</script>
</head>

<body>
!IBI.FIL.H001;
</body>
-HTMLFORM END


I've illustrated two ways of linking to the drill-down fex, one through a compute and one via a style-sheet declaration.

I hope this helps.


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Gold member
Posted Hide Post
Francis,
Cud u pls explain what "U%" and escape function does in your code?

Thanks,
Shyam L


WebFOCUS 7.6.x (PROD), WebFOCUS 7.1.x (DEV)
Unix Platform
 
Posts: 58 | Location: Bangalore | Registered: November 29, 2006Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Any one got a wf function for escaping a URL?

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.