+ script_parameters.push(strProtocol);
+
+ // ===== User name (key = "user")
+ script_parameters.push(username.empty() ? "NULL" : username);
+
+ // ===== Host name (key = "host")
+ script_parameters.push(hostname.empty() ? "NULL" : hostname);
+
+
+ // ===== Remote APPLI path (key = "appli")
+ script_parameters.push(applipath.empty() ? GetenvThreadSafeAsString("APPLI") : applipath);
+
+ if(!this->_isSSL)
+ {
+ ASSERT(GetenvThreadSafe("NSHOST"));
+ ASSERT(GetenvThreadSafe("NSPORT"));
+ }
+
+ struct stat statbuf;
+ std::string appli_mode = (stat(GetenvThreadSafe("APPLI"), &statbuf) == 0 && S_ISREG(statbuf.st_mode)) ? "launcher" : "dir";
+
+ // ===== Working directory (key = "workdir")
+ script_parameters.push(workdir == "$TEMPDIR" ? "\\$TEMPDIR" : workdir);
+
+ // ===== SSL (key = "ssl")
+ script_parameters.push(this->_isSSL ? "1" : "0");
+
+ // ===== Hostname of CORBA name server (key = "nshost")
+ std::string nshost = GetenvThreadSafeAsString("NSHOST");
+ script_parameters.push(nshost.empty() ? "NULL" : nshost);
+
+ // ===== Port of CORBA name server (key = "nsport")
+ std::string nsport = GetenvThreadSafeAsString("NSPORT");
+ script_parameters.push(nsport.empty() ? "NULL" : nsport);
+
+ // ===== Remote script (key = "remote_script")
+ script_parameters.push(remoteScript.empty() ? "NONE" : remoteScript);
+
+ // ===== Naming service (key = "naming_service")
+ std::string namingService = "NONE";
+ if(this->_isSSL)
+ {
+ Engines::EmbeddedNamingService_var ns = GetEmbeddedNamingService();
+ CORBA::String_var iorNS = _orb->object_to_string(ns);
+ namingService = iorNS;
+ }
+ script_parameters.push(namingService);
+
+ // ===== APPLI mode (key = "appli_mode")
+ // $APPLI points either to an application directory, or to a salome launcher file
+ // we prepare the remote command according to the case
+ script_parameters.push(appli_mode);
+
+ command << GetCommandFromTemplate(templateName, script_parameters);