Focal Point
[CLOSED] Javascript Method to get WF Version

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

October 09, 2018, 09:23 AM
TexasStingray
[CLOSED] Javascript Method to get WF Version
Is there a method that IBI provides in javascript to get the current version of WebFOCUS.

This message has been edited. Last edited by: FP Mod Chuck,




Scott

Scott

I don't know about a javascript method but in a fex you can use ? GEN and it will provide that info.

EDA8100 Release * Current Software:
EDA8100 Release RELEASE = M728100D
EDA8100 Release GEN_NUM = 902
EDA8100 Release SOURCE_DATE = 07/06/2016 18:04:45
EDA8100 Release BUILD_DATE = 07/06/2016 20:30:45
EDA8100 Release INSTALLATION_DATE = 9/24/2016 16:36:26


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
Need as javascript method to be used so that the an AJAX call can create the correct URL as the URL to call a fex is different between 80x and 82x.




Scott

Not sure what version you are on, but these calls seem to give you the client version.

A bit of ajax and js to work out if the the call exists and pull the version.

8.1.04: /ibi_apps/console/wfinformationpage.jsp

8.2.04: /ibi_apps/tools/console/resources/markup/console_properties.jsp

Although, there must be a better way.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

Will either of these help?
  
-TYPE &|FOCGEN: &FOCGEN
-TYPE &|FOCREL: &FOCREL



Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
quote:
Originally posted by TexasStingray:
Need as javascript method to be used so that the an AJAX call can create the correct URL as the URL to call a fex is different between 80x and 82x.


Different? I think we're in the same boat then...
Could you elaborate on that?


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
So let me explain what I am doing. We are making call to WebFOCUS via AJAX to execute procedures and to change things on the screen mainly images that are in the repostory.
In 80xx the url looks something like this.
ibi_apps/WFServlet/views.bip?BIP_REQUEST_TYPE=BIP_RUN

In 82xx the url needs to look something like this.
ibi_apps/WFServlet/run.bip?BIP_REQUEST_TYPE=BIP_LAUNCH

As you can see
  • views.bip is being replaced with run.bip
  • BIP_RUN is being replaced with BIP_LAUNCH

So what am plainning is creating my own javascript class that will return the correct values based own what version of WebFOCUS is being used.




Scott

quote:
...in javascript to get the current version of WebFOCUS.

The following code..
-* Do something.  
-SET &RELEASE = &FOCREL;
-SET &GEN = &FOCGEN;
-* Show something to the user.  
-HTMLFORM BEGIN
<!DOCTYPE html>
<html>
<body>
<script>
 document.write("WF Gen/Release !IBI.AMP.GEN;/!IBI.AMP.RELEASE;");
</script>
</body>
</html>
-HTMLFORM END  

..results in the following browser window:
WF Gen/Release 915/M728100D  

This message has been edited. Last edited by: David Briars,
Or, how about a ajax call to see if the URL call works, the return the that URL as the base call.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

quote:
Originally posted by David Briars:
quote:
...in javascript to get the current version of WebFOCUS.

The following code..
-* Do something.  
-SET &RELEASE = &FOCREL;
-SET &GEN = &FOCGEN;
-* Show something to the user.  
-HTMLFORM BEGIN
<!DOCTYPE html>
<html>
<body>
<script>
 document.write("WF Gen/Release !IBI.AMP.GEN;/!IBI.AMP.RELEASE;");
</script>
</body>
</html>
-HTMLFORM END  

..results in the following browser window:
WF Gen/Release 915/M728100D  


And how would I call this if I do not knwo what the url should be?




Scott

quote:
Originally posted by Waz:
Or, how about a ajax call to see if the URL call works, the return the that URL as the base call.


That may me an option but there has to be a simpler way.




Scott

Techsupport time ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

Your javascript has to be started from some HTML page, which in turn needs to get started by something.

If that something is a fex that uses -HTMLFORM my.html, then you can embed a javascript assignment in that HTML that sets a global variable using !IBI.AMP.

my.html would then look something like this:
<html>
  <head>
    ...
    <script type="text/javascript">
      var ibiVersion = { gen: "!IBI.AMP.GEN;", release: "!IBI.AMP.RELEASE;" };
    </script>
    ....


And now you have a global Javascript variable with your version information.

Now that approach is hardly convenient if you need to add it to each and every HTML page, of course.

Easier is to write the output of these variables to, for example, a JSON file on a fixed location on the server (say /approot/baseapp/ibiVersion.json) and fetch that to obtain your info.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
quote:
...how would I call this...

No, the code I show isn't something you would call.

It was a simple model, of what I thought you were doing, and how you could incorporate gen/release numbers.

It sounded like you have a fex that has an -HTMLFORM.

And the JavaScript code in the -HTMLFORM calls other fexes via creating a URL.

And you need that code to create the URL back to WF dynamically based upon the release of WebFOCUS.

So, my model shows, before the -HTMLFORM you would gather the release number into an amper variable.

Then embed the amper variable in the JavaScript section.

Then your JavaScript can make decisions based upon the value of the amper, such as, the value of the URL.