Skip to content

Commit edb5a6b

Browse files
initial commit for RC integration scaffolding (#93)
* initial commit for RC integration scaffolding * adding version checking code * rearranging version checking * removing extra spaces * fixing typo
1 parent a2616af commit edb5a6b

14 files changed

+791
-30
lines changed

electron/app/js/childProcessExecutor.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright (c) 2021, Oracle and/or its affiliates.
3+
* Copyright (c) 2021, 2022, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
66
const { exec, execFile, spawn } = require('child_process');
@@ -45,7 +45,20 @@ async function executeChildProcess(currentWindow, executable, argList, env, stdo
4545
return child.exitCode;
4646
}
4747

48-
function getSpawnOptions(env, shell, detached, windowsHide) {
48+
function spawnDaemonChildProcess(executable, argList, env, extraOptions = {}, {
49+
shell = false,
50+
detached = false,
51+
windowHide = true,
52+
} = {}) {
53+
const command = workaroundNodeJsIssue38490(shell, executable, argList);
54+
const options = getSpawnOptions(env, shell, detached, windowHide, extraOptions);
55+
56+
getLogger().debug('Spawning daemon process %s with arguments %s and options %s',
57+
command.executable, command.argList, JSON.stringify(options));
58+
return spawn(command.executable, command.argList, options);
59+
}
60+
61+
function getSpawnOptions(env, shell, detached, windowsHide, extraOptions = {}) {
4962
const options = {
5063
stdio: [ 'pipe', 'pipe', 'pipe' ],
5164
shell: shell,
@@ -56,6 +69,10 @@ function getSpawnOptions(env, shell, detached, windowsHide) {
5669
if (envIsNotEmpty(env)) {
5770
options['env'] = env;
5871
}
72+
73+
for (const [key, value] of Object.entries(extraOptions)) {
74+
options[key] = value;
75+
}
5976
return options;
6077
}
6178

@@ -199,5 +216,6 @@ module.exports = {
199216
executeChildProcess,
200217
executeChildShellScript,
201218
executeFileCommand,
202-
executeScriptCommand
219+
executeScriptCommand,
220+
spawnDaemonChildProcess
203221
};

electron/app/js/ipcRendererPreload.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ contextBridge.exposeInMainWorld(
5050
'project-created',
5151
'project-opened',
5252
'project-saved',
53+
'set-wrc-backend-port',
5354
'start-add-model-file',
5455
'start-add-variable-file',
5556
'start-add-archive-file',
@@ -198,7 +199,11 @@ contextBridge.exposeInMainWorld(
198199
'k8s-delete-object',
199200
'openssl-generate-certs',
200201
'validate-k8s-namespaces-exist',
201-
'validate-wko-domain-exist'
202+
'validate-wko-domain-exist',
203+
'get-wrc-home-directory',
204+
'get-wrc-app-image',
205+
'wrc-get-home-default-value',
206+
'wrc-set-home-and-start'
202207
];
203208
return new Promise((resolve, reject) => {
204209
if (validChannels.includes(channel)) {

electron/app/js/userSettings.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const { getErrorMessage } = require('./errorUtils');
1111

1212
// eslint-disable-next-line no-unused-vars
1313
const userSettableFieldNames = [
14+
'webLogicRemoteConsoleHome',
1415
'proxy',
1516
'logging',
1617
'skipQuickstartAtStartup',
@@ -31,6 +32,7 @@ let _userSettingsFileName;
3132
// Here is an example with every possible field specified:
3233
//
3334
// {
35+
// "webLogicRemoteConsoleHome": "The path to the WebLogic Remote Console installation",
3436
// "proxy": {
3537
// "httpsProxyUrl": "The proxy to use for the application's all https outbound communication",
3638
// "bypassProxyHosts: "The value to use to set the NO_PROXY environment variable for child processes"
@@ -89,6 +91,20 @@ function applyUserSettingsFromRemote(remoteUserSettingsJson) {
8991
logger.debug('user settings saved...restart the application to pick up logger settings changes');
9092
}
9193

94+
function getWebLogicRemoteConsoleHome() {
95+
let wlRemoteConsoleHome;
96+
const userSettingsObj = _getUserSettings();
97+
if ('webLogicRemoteConsoleHome' in userSettingsObj) {
98+
wlRemoteConsoleHome = userSettingsObj['webLogicRemoteConsoleHome'];
99+
}
100+
return wlRemoteConsoleHome;
101+
}
102+
103+
function setWebLogicRemoteConsoleHome(wlRemoteConsoleHome) {
104+
const settings = _getUserSettings();
105+
settings['webLogicRemoteConsoleHome'] = wlRemoteConsoleHome;
106+
}
107+
92108
function getHttpsProxyUrl() {
93109
let httpsProxyUrl;
94110
const userSettingsObj = _getUserSettings();
@@ -413,5 +429,7 @@ module.exports = {
413429
setWindowSize,
414430
getLoggingConfiguration,
415431
getUserSettingsForRemote,
416-
saveUserSettings
432+
saveUserSettings,
433+
getWebLogicRemoteConsoleHome,
434+
setWebLogicRemoteConsoleHome
417435
};

0 commit comments

Comments
 (0)