Focal Point
[SOLVED] Hold a variable in session???

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

August 27, 2009, 11:53 AM
Kowens
[SOLVED] Hold a variable in session???
maybe I am going about this all wrong. I have an HTML page that I want to put a value in httpsession. I then want to pass this value to the preappend path in webfocus. Has anyone done anything similar to this? If so, how????

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


Version: 8.0.0.6
Windows platform
All output formats will probably be used.
August 28, 2009, 07:56 AM
GamP
If you have a variable on you html page that gets transported to WebFocus, then you can use that to modify your path. That would mean that the server can find your fex somewhere along the search path.
The other way to do this is to set the path from the web page. You can do that by adding the variable 'IBIAPP_app' to your form. The server will then search this app directory for your fex, and then you can do whatever needed in your fex.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
August 28, 2009, 11:27 AM
Kowens
Here is what I need to do. I have an html page that does not launch a report. It is just standalone with radio buttons. Based on the radio button selected, I want to set a global variable that will modify the preappend path. There is no output.

Has anyone done this? if so....HOW?????


Version: 8.0.0.6
Windows platform
All output formats will probably be used.
August 28, 2009, 02:12 PM
GamP
There MUST be output of some sort, otherwise you'd never be able to pick up the altered path.
What do you want to do with the altered path? Why do you need it?
The fact that the html page does not launch a report probably only means that you wish to select a certain path using these radio buttons - that do not produce output(?) - and then expect some other process to pick up these changes. Correct?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
August 28, 2009, 02:27 PM
Kowens
YES. So my company works with several financial exchanges. Each exchange has its own database with unique metadata files. So we grouped each exchange under there own folder with the .mas files.

So, by choosing a radio button on the first page, I merely want to save a value to supply the preappend when I get to the report .fex of what folder to look for the metadata.

Do you understand what I am asking?


Version: 8.0.0.6
Windows platform
All output formats will probably be used.
August 31, 2009, 11:25 AM
Darin Lee
the APP PREPEND is used two ways. It modifies the search path in the current session or you can put it in a profile (server or user). You don't want any processes messing with your server or user profiles, so that's probably out.

I don't know why you're separating the prepend statement from the actual fex that will use it. In fact, setting the path this way will have no effect for another procedure that runs separately afterward. I would just use some dialogue manager to set it in the actual procedure that will be run.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 02, 2009, 04:26 AM
<JG>
quote:
I have an html page that does not launch a report. It is just standalone with radio buttons.


I have to agree with Gamp on this,
The page must do something even if it's just trying to set up the user environment,
which is what it appears you are saying.

That means the form contained within page must be submitted to WebFOCUS.

If you want variables to live for the duration of the browser session (and not just the request)
then you must set them as being GLOBAL '&&' and IBIF_persistantamp must be set as Yes in
your WebFOCUS client configuration.

And as Darin says unless you write something to a file, either a fex called by a profile or the
profile itself any APP PREPEND will not persist.
September 02, 2009, 04:59 AM
GamP
If you include the launch of the report(s) on the page with the radio buttons (or vice versa) then your problem is solved.
You then provide a value for each radio button that the fex will interpret to decide which way to go.
Easiest thing in the webfocus world.

But if you have one page in one browser window with the radiobuttons and then another page in a second browser window to launch the report, then I would not know how to do it, unless the first (radio button) window is named. Then I think you might be able to get the value of the radiobutton from the other (named) window and propagate it to webfocus. But that seems to me to be a cumbersome detour, because in the end the value has to be ported to the webfocus environment, no matter what.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 11, 2009, 12:33 AM
TexasStingray
One Option is if you are ok with cookies. you could have you page set a cookie to the value you want. then in the custom setting get the cookie and pass it to the reporting server. then it is a simple webfocus variable and you can do what ever you want.




Scott

TexasStingray,

you gave me the solution

"One Option is if you are ok with cookies. you could have you page set a cookie to the value you want. then in the custom setting get the cookie and pass it to the reporting server. then it is a simple webfocus variable and you can do what ever you want."

Can you give me an example?


Version: 8.0.0.6
Windows platform
All output formats will probably be used.
It might be worth also looking at:

CopyWFVarToSessionVar

And

CopySessionVarToWFVar

As documented in the Security and Administration Manual:
http://documentation.informati...c/source/topic66.htm

With a little WFS Scripting logic within your site.wfs you could easily set these variables.

e.g.
<IFDEF> MYVAR
SESSION_VAR_NAME=session_MYVAR 
<call> CopyWFVarToSessionVar(MYVAR, SESSION_VAR_NAME)
<ELSE>
SESSION_VAR_NAME=session_MYVAR
WFS_VAR_NAME=MYVAR 
<call> CopySessionVarToWFVar (SESSION_VAR_NAME,WFS_VAR_NAME)
<ENDIF>
<SET> MYVAR (pass)


******* Edited to update the syntax for CopyWFVarToSessionVar since the example copied from the manual appears to not be correct. I will be following up with submitting a Doc enhancement to fix this error **********************

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


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


BY GEORGE, I THINK SHE'S GOT IT!!!!!!!

THANK YOU ALL!!!!


Version: 8.0.0.6
Windows platform
All output formats will probably be used.
Ok, apparently if the variable is passed within IBIF_params then its not parsed at the time that site.wfs is processed and the variable is not processed properly.

The following modifications to the above code resolves this issue:
1) Open the following file in an editor:
    \ibi\WebFOCUS76\client\wfc\etc\ibiendd.wfs
 
 2) Add the following to the end of the file and save the results:
  <IFDEF> PASSCAR
  SESSION_VAR_NAME=session_PASSCAR
  <call> CopyWFVarToSessionVar(PASSCAR, SESSION_VAR_NAME)
  <ENDIF>
 
 3) Log into the WF Admin Console and go to "Configuration" -> "Custom Settings"
 
 4) Enter the following code:
   #Value is stored via ibiendd.wfs and retrieved here
   SESSION_VAR_NAME=session_PASSCAR
   WFS_VAR_NAME=PASSCAR
   <call> CopySessionVarToWFVar (SESSION_VAR_NAME,WFS_VAR_NAME)
   <SET> PASSCAR (pass)
 
 5) Click "Clear Cache" or "Clear Memory Cache" within the WebFOCUS
    Administration console.
 
    Depending on your release of WebFOCUS this should put these settings into
    effect. If you are using a release of WebFOCUS prior to 7.69 you might
    also need to recycle your application server.



WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP