Focal Point
[SOLVED] Global Variable in MRE?

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

February 24, 2014, 03:00 PM
MattC
[SOLVED] Global Variable in MRE?
I am testing out using &&Variables and I have set a Global variable on my reporting server, but I run into a slight issue. On initial launch of my portal the global variable does not resolve, until I navigate to a second page in the portal.

I have a launch fex from Content(MRE) that launches an HTML (on the Reporting Server) which executes report fexes. The &&Variable is in the HTML, which is basically a URL for another application. I wanted to set these statically in the environment.

It’s like I need the Client to set the &&Variable so on initial launch it will have the value resolved.

Any thoughts?

Thanks,

Matt

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


WebFOCUS 8.1.05
February 24, 2014, 03:30 PM
John_Edwards
Jeeze Matt, that sounds like my problem. I'm on WF8 for the first time and my tricks with amper variables don't want to work. I don't see the value appear. If I get any insight I'll let you knw.



February 25, 2014, 02:38 AM
Dave
MattC,

we have a fex ( say: globvars.fex ) with content like:
-SET &&CURRENT_WEEK = 9;
-SET &&CURRENT_YEAR = 2014;

etc.
that is included in all fexi ( automatically ).


The content of that fex itself is being generated by another fex that with a daily schedule.

Generator:
Output is saved
ON TABLE SAVE AS 'APPLICATIONNAME/GLOBALS.FTM'

globvars.fex contains code:
-INCLUDE 'applicationname/globals.ftm



(yes, that works ;-)


_____________________
WF: 8.0.0.9 > going 8.2.0.5
February 25, 2014, 07:36 AM
MattC
Dave,

Thanks for the suggestion, but I don’t think your suggestion will work in this situation. The Global Variable that I am trying to get resolved is in a HTML. Basically I have 4 environments (DEV,TEST,PQA,PROD) I have a URL link in the HTML that points to an application and it has it’s 4 environments. I am trying to set the variable for each environment so when we move this HTML, the HTML will not get promoted with a bad URL for another environment.

<a style="TOP: 30PX; BORDER=0; HEIGHT: 16px; FONT-SIZE: 8pt; FONT-FAMILY: Arial; font-weight:900; WIDTH: 100PX; LEFT: 10px; POSITION: ABSOLUTE;" title="Restaurant Data Correction" onmouseover="this.style.cursor ='hand'" href="&&RDCVARIABLE" target="_blank">Data Corrections </a>  


&&RDCVARIABLE does get resolved on the second drill , but on initial launch it doesn’t. I do have an alternate solution that would probably work. It’s more effort of course thats why I was trying to get Global Variables to work as it would be a slam dunk.


WebFOCUS 8.1.05
February 25, 2014, 07:43 AM
Dave
MattC.

How about this:
Make a fex.


-SET &AHREF_LOCATION = 'HTTP://www.chouke.nl/' | &&RDCVARIABLE;

( or whatever you want as an URL build up with parameters )

-HTMLFORM BEGIN
<html>
<body>
<a href="&AHREF_LOCATION">your link here</a>
</body>
</html>
-HTMLFORM END



_____________________
WF: 8.0.0.9 > going 8.2.0.5
February 25, 2014, 08:09 AM
MattC
That is similiar to my alternate option.

This is what I created in HTML Composer which would work.

<BODY style="OVERFLOW: auto" class=IBI_PageBg maptype="0" thumbnailscale="4" elementtype="21" edaconnectionrequired="true"><SPAN style="Z-INDEX: 1; POSITION: absolute; WIDTH: 90px; HEIGHT: 20px; TOP: 80px; LEFT: 100px" id=anchor1 class=IBIfield tabIndex=1 elementtype="4"><A id=anchor2 href="javascript:OnExecute(null, 'anchor2')" autoExecute="true" requests_list="0" name="anchor2">Data Corrections</A></SPAN><INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=layoutinfo type=hidden resourcectrlids="ITEM2;IBI_THEME_CSS" name="inputhidden1"><INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibiapp_app value=matt type=hidden name="ibiapp_app"><INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibic_server value=EDASERVE type=hidden isdataserversarea="1" name="ibic_server"><xml id=focus_xmlelement><script type="text/xml"><rootxmlnode focoption="_FOC_NULL"><variables></variables><input_controls></input_controls><requests nextrequestsid="0"><request requestid="0" sourcetype="typeFex" targettype="window" targetname="_blank" ibif_ex="rdc_url.fex" activereport="0" reportcolumns="" reportrealcolumns="" ibiapp_app="matt"></request></requests><other_bound_objects></other_bound_objects></rootxmlnode></script>
  


I would have to extract the parts I need and put them into my HTMLs which are not developed in Composer.

I would also make it more dynamic and actually do a SQL call to a table where the APP URL's are stored. We do this for other appplications already, but this was kind of a unique situation where I was hoping it could be simplified by using Global Variables.


WebFOCUS 8.1.05
February 25, 2014, 08:19 AM
MattC
My IBI Technical rep will be here on site today as I have a meeting with her. Maybe I will pester her for a bit on G Variables.

I probably could have had the alternate already implemented, but curiosity is killing the cat here.


WebFOCUS 8.1.05
February 25, 2014, 10:17 AM
Francis Mariani
I don't know if things have changed in WF8, but in prior releases I have put this as a setting in site.wfs. Each environment (DEV,TEST,PQA,PROD) gets their the variable and unique value. This is achieved from the WF Client Admin Console > Configuration > Custom Settings.

Example:

DEV
# Pass the server name
CPSERV=dviappv02
<SET>CPSERV(pass)

QA
# Pass the server name
CPSERV=qaiappv05
<SET>CPSERV(pass)



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, 2014, 11:07 AM
MattC
That does still apply in WF 8 amd I was seeing it come in, I just wasn't getting it resolved in the HTML for a href.

I ended up removing it from my reporting servers and only having it in the sites in my Administration Console as you suggested.

I did get it to fully work by using this

href="!IBI.AMP.RDCVARIABLE;"  



WebFOCUS 8.1.05