Focal Point
[CLOSED] How to initialize variables when a portal is opened

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

May 13, 2015, 03:56 PM
Doug
[CLOSED] How to initialize variables when a portal is opened
Is there a way to initialize a variable, or several variables, when a specific portal is initially opened?

This needed to be done prior to the execution of any fexes, preferable in the background, and cannot be a procedures in the first / leftmost tab because we cannot guarantee what tab will open first (due to user customization).

Thanks in advance, Doug

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




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
May 14, 2015, 08:07 AM
MartinY
Hi Doug,

Maybe be using a universal_profile ?

This is the way I do it, but "HTML Header" variables cannot be used be ReportCaster (see page 307 of Security and Administration v8.009).

It can be assigned from Administration Console/Configuration/General (see page 311 of Security and Administration v8.009 for universal profile).


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
May 14, 2015, 09:06 AM
gregv
Search in this forum for IbComposer_getAllAmpersValues. There are several other functions like this one that may be of use which can be found in this doc: "Using JavaScript Code With HTML Composer Pages"



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
May 14, 2015, 09:44 AM
Doug
Unfortunately, it's not universal so the "universal_profile" would work.

And the variables are not set before the portal is accessed, thus the "IbComposer_getAllAmpersValues" isn't an option.

What I'm looking for is a "profile", or a procedure, which is executed when a portal is accessed and never again during that portal session. My initial thought was to execute a hidden, or not, procedure in the first tab only. However, there's no guarantee that the original first tab will always be their first tab if the user customizes the portal.

This may be one for the Expert Room at Summit.
May 14, 2015, 09:58 AM
gregv
I worked on a system that used site.prf (I think) to kickoff several focexecs each time the user started a new process, as I remember.
If this is along the lines you are thinking then I can do more research into what was actually done. I maintained but did not write this so it will take a little reconstruction.



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
May 14, 2015, 11:41 AM
dhagen
Why wouldn't a site or universal profile work exactly?


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
May 14, 2015, 01:14 PM
Doug
quote:
Why wouldn't a site or universal profile work exactly?
Well, The variables that I need are specific to this one portal. If I use a "universal profile", it may "step on" variables used in other portals which may be using differently. Such as: Portal One may use &BegDate as a "Fiscal Year" begin date while Portal Two may use &BegDate as a "Calendar Year" begin date, or even the current date, or any of many other situations.
May 14, 2015, 01:18 PM
CoolGuy
I'm working on an app that utilizes (currently) an HTML form with drop-downs that is placed on the left banner (could very well be page-specific) of our portal. The drop-downs are populated by separate external procedures that create an XML list of values that are valid based on the user's (that's logged in) store list filters stored in MS Active Directory. We have a user_filter.fex that pulls the store list assigned to the user logged in (via &IBIMR_user) and creates a user-specific filter file (.foc/.mas) for them if not already present, or merely ensures proper store list data is accessible to the given user. The user store list is then used in another .fex that populates another .foc/.mas file with those stores' values. The filters for the form look like the following:

-INCLUDE IBFS:/WFC/Repository/.../user_filter.fex
DEFINE FILE [filename]
ACCNO/I5=DSACCTNO;
DSACCTNAME/A40=EDIT(ACCNO)|'-'|DSNAME;
END
TABLE FILE [filename]
SUM
MAX.DSACCTNAME
BY DSACCTNO
WHERE (FISCALYEAR EQ '&FISCALYEAR');
WHERE (FISCALWEEKOFYEAR EQ &FISCALWEEKOFYEAR);
WHERE (DSDIVISION EQ &DSDIVISION);
WHERE (DSDISTRICT EQ &DSDISTRICT);
WHERE (DSBANNERGL EQ &DSBANNERGL);
WHERE (DSACCTNO   NE 0);
ON TABLE HOLD
END
-RUN
TABLE FILE HOLD
BY DSACCTNO
BY DSACCTNAME
ON TABLE PCHOLD FORMAT XML
END
-RUN


So, when a user logs in to see their portal with the pages assigned to the user group he/she belongs to, they will see that form in the left banner having been populated by the above code specific to each control. Then when the user makes his/her selections and hits submit, the selections are then passed to the BIP which in turn passes the selections to all other content. One piece of content being a hidden .fex that captures the selections and then stores them in the &IBIMR_user .foc/.mas file for later use.

Is this the kind of thing you are looking for?


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
May 14, 2015, 01:46 PM
Doug
Yes, the fex in the banner works.

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