Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Capture URL parameters inside FEX in PORTAL

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Capture URL parameters inside FEX in PORTAL
 Login/Join
 
Platinum Member
posted
The portal page is run from a URL. The URL has parameters passed in the query string. These parameters are not available in the fex (report) inside the portal. I will appreciate help with any technique.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8207.11
App Studio 8207
 
Posts: 146 | Registered: January 06, 2009Report This Post
Expert
posted Hide Post
Please provide an example of the URL. The parameters are definitely not available in the fex - it seems like there's nothing we can do between the BIP URL and the individual fexes...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
WFConsultant, as far as I know, parameters passed to the URL are only made available to the .fex only when its execution is invoked via WFServlet. The URL to run a Portal seems to use a RESTful-like call (wich may/may not use WFSerlvet behind the scenes) but because the target call is not really a .fex perhaps the infrastructure doesn't care or can't expose those parameters as &variables.

The only way I would attempt to achieve what you want is to create an HTML Composer page with your target report in an iframe and hidden parameters. You would use JavaScript to "read" the URL from the Portal call and parse the parameters from there, setting the appropriate HTML controls to those values and then trigger your report to be executed. Yes, this seems like a lot of work and you'll end up with an iframe within an iframe but I can't think of an easier way Frowner

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
If the URL is a Portal URL, it looks something like this:

http://my-web-server/ibi_apps/bip/portal/MyPortal


and if you add parameters, it might look like this:

http://my-web-server/ibi_apps/bip/portal/MyPortal&PARM1=haha&PARM2=crycry


Viewing the source of the page after the Portal loads, you get something like this:

<!DOCTYPE html>

<html>
	<head>
	    <title>BI Portal</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >		
		<meta http-equiv="MsThemeCompatible" content="yes">
		<meta http-equiv="ImageToolBar" content="no">
		<link type="text/css" rel="StyleSheet" href="/ibi_apps/bindows/css/bimain.css">
		<script type="text/javascript" src="/ibi_apps/bindows/js/application.js"></script>
	</head>
	<body>
		<script type="text/javascript">application.start("/ibi_apps/bindows", "/ibi_apps/tools/portal/resources/markup/wfbiportalrun.jsp?&ViewID=MyPortal&ViewName=MyPortal&ViewTitle=MyPortal&SessionTimeout=7200000")</script>
	</body>
</html>


You see this?

/ibi_apps/tools/portal/resources/markup/wfbiportalrun.jsp?&ViewID=MyPortal&ViewName=MyPortal&ViewTitle=MyPortal&SessionTimeout=7200000


You cannot retrieve something as simple as these variables: &ViewID, &ViewName and &ViewTitle - they're not available in fexes that are run within the portal, neither are they available to add via site.wfs. To me this seems ludicrous.

A fex run within the portal has a URL such as this:

http://my-web-server/ibi_apps/view.bip?BIP_REQUEST_TYPE=BIP_LAUNCH&BIP_folder=IBFS%253A%252FWFC%252FRepository%252Fdomain01%252Fstd_reports%252Fmrefolder001&BIP_item=homepage_launch.fex&WF_STYLE_HEIGHT=783&WF_STYLE_WIDTH=1914&WF_STYLE_UNITS=PIXELS&IBIWF_redirNewWindow=true&WF_STYLE=IBFS%3A%2FFILE%2FIBI_HTML_DIR%2Fjavaassist%2Fintl%2FEN%2Fcombine_templates%2FENInformationBuilders_Medium1.sty&WF_THEME=BIPCustom&BIP_CACHE=100000&BIP_rand=4718
I would love to know how homepage_launch.fex, which could contain some HTML, could determine the parameters passed by that JSP call or determine the additional parameters passed in the portal call. As far as I can tell, the fex is living within it's own world, unaware it's running within a portal.

I've wanted to determine the name or ID of the B.I. Dashboard/Portal since WebFOCUS 5.3. According to a case I opened some time ago, this functionality apparently showed up for a very short time in WF v7.7.02 and then disappeared in WF v7.7.03 (or it never worked).

I've given up asking for it.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Something like this?



I just added some JavaScript in the onInitialUpdate() to the launch .htm file that sits inside of the portal panel:

function onInitialUpdate() {
   var edit1 = document.getElementById('edit1');

   // Capture window's URL and parse parameter to be passed to the .fex
   var mainURL = parent.window.location.href;

   var comps = mainURL.split("?");
   
   // See if there are actual URL parameters
   if(comps.length > 1) {
      var params = comps[1].split("&");

      // Loop thru URL params looking for P_COUNTRY
   
      for (var i = 0; i < params.length; i++) {
         var p = params[i].split("=");

         // If P_COUNTRY is found in URL, use it as value to pass to the report
         if("P_COUNTRY" === p[0]) {
           edit1.value = p[1];
         }
      }
   }
}


The code is far from elegant but it's there to illustrate the concept. By the way, the launch page was created with HTML Composer in Dev Studio 8008.

Hope this helps.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
I should have mentioned that the main trick here is to explore the parent's window location as opposed to the one in the current iframe which actually contains a different URL resulting from an internal redirection to view.bip and other stuff IBI knows better Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
quote:
parent.window.location.href
- that is what we need! Thanks.

Now I have to work out how to capture the Portal Name and/or the variables BEFORE a report executes in a section of the Portal window - a report that normally wouldn't have any HTML around it...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
@ njsden , thank for the example. After capturing the parameters using similar JavaScript function, we have set them to hidden variables. Later, pushed the values to the reports (fex) using ‘parent.BipIframeInterface.setAllAmpersValues(name,IbComposer_getAllAmpersValues());’. Like you have said it is not ‘elegant’, but gets the work done.


WebFOCUS 8207.11
App Studio 8207
 
Posts: 146 | Registered: January 06, 2009Report This Post
Virtuoso
posted Hide Post
I'm glad to hear it helped. Now you've just given me homework as I want to research about parent.BipIframeInterface.setAllAmpersValues method Smiler

At our shop we are just in the process of upgrading to WF8 from WF77 and this whole Portal stuff is new to us. Lots to learn (and sometimes to suffer) from!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Capture URL parameters inside FEX in PORTAL

Copyright © 1996-2020 Information Builders