Skip to content

Commit

Permalink
Using configuration param nomad_helper_url
Browse files Browse the repository at this point in the history
- Apply old behaviour if nomad_helper_url is empty (reference #53)
  • Loading branch information
piotrzarzycki21 committed Apr 19, 2024
1 parent c7dc07d commit f4669cf
Showing 1 changed file with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,34 @@ package controller
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
import org.apache.royale.jewel.Snackbar;
import model.proxy.login.ProxyLogin;
import org.apache.royale.net.navigateToURL;
import org.apache.royale.net.URLRequest;

public class CommandLaunchNomadLink extends SimpleCommand
{
override public function execute(note:INotification):void
{
var mainMediator:MediatorMainContentView = facade.retrieveMediator(MediatorMainContentView.NAME) as MediatorMainContentView;
var nomadHelper:Iframe = mainMediator.view.viewNomadHelper as Iframe;
var loginProxy:ProxyLogin = facade.retrieveProxy(ProxyLogin.NAME) as ProxyLogin;
var nomadHelperUrl:String = loginProxy.config.nomad_helper_url;
var link:String = note.getBody().link;
var encodedLink:String = encodeURIComponent(link);
nomadHelper.src = "https://nomadweb.venus.startcloud.com/nomad/nomadhelper.html?link=" + encodedLink;

var appName:String = note.getBody().name;
Snackbar.show("Application " + appName + " has been opened in HCL Nomad web", 4000, null);
if (nomadHelperUrl)
{
var mainMediator:MediatorMainContentView = facade.retrieveMediator(MediatorMainContentView.NAME) as MediatorMainContentView;
var nomadHelper:Iframe = mainMediator.view.viewNomadHelper as Iframe;


var encodedLink:String = encodeURIComponent(link);
nomadHelper.src = nomadHelperUrl + "?link=" + encodedLink;

var appName:String = note.getBody().name;
Snackbar.show("Application " + appName + " has been opened in HCL Nomad web", 4000, null);
}
else
{
navigateToURL(new URLRequest(link));
}
}
}
}

0 comments on commit f4669cf

Please sign in to comment.