Focal Point
Obtain current project/app folder value in Maintain or Javascript function

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9231015372

February 26, 2008, 04:22 PM
J. Erickson
Obtain current project/app folder value in Maintain or Javascript function
Is there an easy way to obtain the current app folder (or Project name) that my Maintain app is running from and either retrieve that value into a Maintain variable or retrieve it using Javascript? I've done several searches on Focal Point and on the IBI Tech Support site and have found somewhat related info but I can't quite pin down the right info or if it's possible to do.
What I would do with that value would be to assign it to IBIAPP_app in an IWCLink call to a focexec from within my Maintain app using a Javascript function. The thing is we have a dev project/app folder and a production folder for this Maintain app and I want to set IBIAPP_app depending on whether I'm running it from the dev folder during testing or running it from the production folder when it's been moved up to production. I looked at the source of my running Maintain app and saw some hiddent values, like IWCAPP, etc. but I'm not sure if any of those would contain the current app/project name. We have identically named focexecs in the Procedures folder of both the dev and prod projects/app folders but the masters in each point at a different database (dev and prod ones).

Thanks,
James


FOCUS 7.7.03
WebFOCUS 8.0.x/8.1
z/OS, Windows
February 26, 2008, 05:06 PM
Francis Mariani
This document details how to generate WebFOCUS Dialogue Manager variables from HTTP, environment and other sources.
Manipulating WebFOCUS Variables

Unfortunately, I haven't figured out how to get the app name where a program was found.

Still looking...

Regards,

Francis.


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
February 26, 2008, 05:10 PM
Francis Mariani
I think it should be as simple as passing the variable IBIAPP_app, but it appears not.


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
June 26, 2008, 12:25 PM
J. Erickson
Problem solved. I can't believe it took me this long to figure it out.

Roll Eyes

We have been using an HTML launch page to launch the Maintain application. This launch page shows the Application name, Procedure name, client path (e.g. WFServlet, ISAPI, CGI), and execution type.

All I had to do was use IWC.GetAppCgiValue("APPLICATION") to grab the value of the APPLICATION CGI variable in my Maintain code. Then I stored that value in a hidden control on my form(s). For any IWCLink calls, I would just get the value from the hidden control in the Javascript function and assign it to IBIAPP_app and then build the URL to be used with IWCLink when calling a bunch of report focexecs.

I think I had looked at GetAppCgiValue before but I was looking at WebFOCUS variables and not CGI variables. Once I looked through the source of our HTML launch page and found the right name for our Application edit box (APPLICATION), I tested GetAppCgiValue with it and got it to work.

Anyway, IWC.GetAppCgiValue and the right CGI variable did the trick. Of course this wouldn't work if we didn't use a launch page that can provide that CGI variable. But, then again, we use an HTML launch page so that we can have a specifc URL that we can go to to run this Maintain app instead of having to actually run Dev Studio just to run the Maintain app. So it all works out in the end. Big Grin


FOCUS 7.7.03
WebFOCUS 8.0.x/8.1
z/OS, Windows