Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Front Call LaunchURL  (Read 8222 times)
Jean G.
Posts: 15


« on: December 07, 2010, 05:15:36 pm »

I have need to create and application that launches a web portal and once I am connected I need to return any error codes (if not successful) and when the user logs out of the web portal, so I can start a a download process.

I am able to built the command string and open the web portal using the followin command.

 CALL ui.Interface.frontcall("standard","launchurl",sso_url_string clipped,ret_string)

Does the launchurl return anything from the url?

Is there another way I can accomplish this?

Thanks for any help,
Jean
.
Four Js
Posts: 115


« Reply #1 on: December 07, 2010, 05:56:48 pm »

Hi Jean,

Launchurl has no return value. GDC could return a boolean if successful, not sure about GWC, but today there is no return value.

Anyway, in your case, the return value will always be "success", as it would return if the document could be open, and not if the user was able to do anything special on the opened document.

Maybe this would be a right candidate for the WebComponent: we provide a javascript API, which is a bridge between the Front-End (GWC or GDC) and the html world.
So in your case, you would need to:
  • add a small javascript library to your web portal, which would use our API
  • have your portal use this library to send feedback to your 4GL application

A big picture: GWC and GDC publish an object, named gICAPI. This object can be used in two ways:
  • via callback methods, data/focus/property is sent from 4GL to your html component
  • via public methods, data/focus request/action can be sent from your html component to your 4GL program

So the idea would be to have a small javascript function that would be called with the login status, and one when the user logs out:

Code
  1. function sendLoginFeedbackTo4GL( success ) {
  2.  if (success)
  3.  {
  4.     gICAPI.action("loginok");
  5.  } else  {
  6.     gICAPI.action("loginfailed");
  7.  }
  8. }
  9. function sendLogOutTo4GL( ) {
  10.  gICAPI.action("logout");
  11. }
  12.  

And in your 4GL:

Code
  1. INPUT BY NAME webComponent
  2.  ON ACTION loginok
  3.     ...
  4.  ON ACTION loginfailed
  5.     ...
  6.  ON ACTION logout
  7. END INPUT
  8.  

Of course this means you will have your web portal inside a 4GL application (so inside GDC if you're running GDC, and not your browser), but this is the only way I can see where you can really make a web portal interact with a 4GL application.
Jean G.
Posts: 15


« Reply #2 on: December 07, 2010, 06:20:13 pm »

Hi Pierre-Nicholas,

The web portal is a 3rd party. They did provide an api that is in html. There are input fields in the html that are needed to create the param string to login in to the web portal.

I guess my question is can I use the webcomponent to open the html to input the data and then send the string to open the web portal (essentially what I was trying to do with launchurl)? If so how would I go about doing this.

I did try to create a webcomponent for the html file, but when I would run the program nothing would come up in the window. These would be my steps.

1) Open the portal api
2) Enter data
3) pass data back to the 4gl program to create MD5 hash
4) Send the MD5 hash back to the portal api
5) Use the url and param string to login in to the portal
6) Using your scripts I can capture the login (successful/failed) and the logout
7) Depending on failure or log out take appropriate action

I have no java script experience so any suggestions are guidance would be greatly appreciated. This will be a learning experience for me.

Thanks,
Jean
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines