diff --git a/src/main/java/org/nrg/xsync/components/XsyncSitePreferencesBean.java b/src/main/java/org/nrg/xsync/components/XsyncSitePreferencesBean.java index 1dc783b..2791906 100644 --- a/src/main/java/org/nrg/xsync/components/XsyncSitePreferencesBean.java +++ b/src/main/java/org/nrg/xsync/components/XsyncSitePreferencesBean.java @@ -104,6 +104,31 @@ public void setXsyncWhitelistEnabled(boolean xsyncWhitelistEnabled) { } } + @NrgPreference(defaultValue = "true") + public boolean getHttpsEnabled() { + return getBooleanValue("httpsEnabled"); + } + + public void setHttpsEnabled(boolean httpsEnabled) { + try { + set(String.valueOf(httpsEnabled), "httpsEnabled"); + } catch (InvalidPreferenceName invalidPreferenceName) { + _log.error("Invalid preference name: httpsEnabled"); + } + } + + @NrgPreference(defaultValue = "false") + public boolean getAsperaEnabled() { + return getBooleanValue("asperaEnabled"); + } + + public void setAsperaEnabled(boolean asperaEnabled) { + try { + set(String.valueOf(asperaEnabled), "asperaEnabled"); + } catch (InvalidPreferenceName invalidPreferenceName) { + _log.error("Invalid preference name: asperaEnabled"); + } + } /** * Sets the Max. Total Uncompressed File Size @@ -297,6 +322,12 @@ public void update(final XsyncSitePreferencesPojo xsyncSitePreferencesPojo) thro if (null != xsyncSitePreferencesPojo.getXsyncWhitelistEnabled()) { this.setXsyncWhitelistEnabled(xsyncSitePreferencesPojo.getXsyncWhitelistEnabled()); } + if (null != xsyncSitePreferencesPojo.getHttpsEnabled()) { + this.setHttpsEnabled(xsyncSitePreferencesPojo.getHttpsEnabled()); + } + if (null != xsyncSitePreferencesPojo.getAsperaEnabled()) { + this.setAsperaEnabled(xsyncSitePreferencesPojo.getAsperaEnabled()); + } } public XsyncSitePreferencesPojo toPojo() { @@ -305,7 +336,9 @@ public XsyncSitePreferencesPojo toPojo() { getSyncRetryInterval(), getSyncRetryCount(), getSyncMaxUncompressedZipFileSize(), - getXsyncWhitelistEnabled() + getXsyncWhitelistEnabled(), + getHttpsEnabled(), + getAsperaEnabled() ); } diff --git a/src/main/java/org/nrg/xsync/pojo/XsyncSitePreferencesPojo.java b/src/main/java/org/nrg/xsync/pojo/XsyncSitePreferencesPojo.java index ace49a5..5685faf 100644 --- a/src/main/java/org/nrg/xsync/pojo/XsyncSitePreferencesPojo.java +++ b/src/main/java/org/nrg/xsync/pojo/XsyncSitePreferencesPojo.java @@ -15,17 +15,24 @@ public XsyncSitePreferencesPojo(final String tokenRefreshInterval, final String syncRetryInterval, final String syncRetryCount, final String syncMaxUncompressedZipFileSize, - final Boolean xsyncWhitelistEnabled) { + final Boolean xsyncWhitelistEnabled, + final Boolean httpsEnabled, + final Boolean asperaEnabled) { this.tokenRefreshInterval = tokenRefreshInterval; this.syncRetryInterval = syncRetryInterval; this.syncRetryCount = syncRetryCount; this.syncMaxUncompressedZipFileSize = syncMaxUncompressedZipFileSize; this.xsyncWhitelistEnabled = xsyncWhitelistEnabled; + this.httpsEnabled = httpsEnabled; + this.asperaEnabled = asperaEnabled; + } private String tokenRefreshInterval; private String syncRetryInterval; private String syncRetryCount; private String syncMaxUncompressedZipFileSize; - private Boolean xsyncWhitelistEnabled; + private Boolean xsyncWhitelistEnabled; + private Boolean httpsEnabled; + private Boolean asperaEnabled; } diff --git a/src/main/java/org/nrg/xsync/xapi/XsyncPreferencesController.java b/src/main/java/org/nrg/xsync/xapi/XsyncPreferencesController.java index db0253f..76457f8 100644 --- a/src/main/java/org/nrg/xsync/xapi/XsyncPreferencesController.java +++ b/src/main/java/org/nrg/xsync/xapi/XsyncPreferencesController.java @@ -45,7 +45,7 @@ */ @XapiRestController -@Api(description = "XSync Preferences API") +@Api("XSync Preferences API") @SuppressWarnings("unused") public class XsyncPreferencesController extends AbstractXapiRestController { @@ -79,7 +79,6 @@ public void setPreferences(@RequestBody XsyncSitePreferencesPojo xsyncSitePrefer * * @return the preferences */ - @SuppressWarnings("deprecation") @XapiRequestMapping(value = "xsyncSitePreferences", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE }, restrictTo = AccessLevel.Admin) @ApiOperation(value = "Gets the XSync site preferences", response = XsyncSitePreferencesPojo.class) @@ -128,6 +127,34 @@ public ResponseEntity getAsperaPreferences() throws NrgServ return new ResponseEntity<>(new AsperaSitePrefsInfo(asperaSitePrefs), HttpStatus.OK); } + @XapiRequestMapping(value = "xsyncSitePreferences/httpsEnabled", method = + RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @ApiOperation(value = "Checks whether Https connection is enabled on the site level.") + @ApiResponses({ @ApiResponse(code = 200, message = "Https enabled returned."), + @ApiResponse(code = 500, message = "Unexpected error") }) + public ResponseEntity getHttpsEnabled() { + return new ResponseEntity<>(prefs.getHttpsEnabled(), HttpStatus.OK); + } + + @XapiRequestMapping(value = "xsyncSitePreferences/asperaEnabled", method = + RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @ApiOperation(value = "Checks whether Aspera is enabled on the site level.") + @ApiResponses({ @ApiResponse(code = 200, message = "Aspera enabled returned."), + @ApiResponse(code = 500, message = "Unexpected error") }) + public ResponseEntity getAsperaEnabled() { + return new ResponseEntity<>(prefs.getAsperaEnabled(), HttpStatus.OK); + } + + @XapiRequestMapping(value = "xsyncProjectPreferences/project/{projectId}/asperaEnabled", method = + RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE, restrictTo = AccessLevel.Read) + @ApiOperation(value = "Checks whether Aspera is enabled for project.") + @ApiResponses({ @ApiResponse(code = 200, message = "Aspera enabled returned."), + @ApiResponse(code = 500, message = "Unexpected error") }) + public ResponseEntity getProjectAsperaEnabled(@PathVariable("projectId") final String projectId) { + final AsperaProjectPrefsInfo prefsInfo = new AsperaProjectPrefsInfo(asperaProjectPrefs, projectId); + return new ResponseEntity<>(prefsInfo.getAsperaEnabled(), HttpStatus.OK); + } + /** * Sets the preferences. * @@ -150,7 +177,7 @@ public ResponseEntity setAsperaProjectPreferences(@PathVariable("project asperaProjectPrefs.setSshPort(projectId, asperaPrefs.getSshPort()); asperaProjectPrefs.setUdpPort(projectId, asperaPrefs.getUdpPort()); } catch (Exception exception) { - _logger.error("ERROR: Error setting preferences: " + ExceptionUtils.getFullStackTrace(exception)); + _logger.error("ERROR: Error setting preferences: {}", ExceptionUtils.getFullStackTrace(exception)); return new ResponseEntity<>("XSync preferences assignment failed ", HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<>("XSync preferences set", HttpStatus.OK); @@ -170,12 +197,12 @@ public ResponseEntity getAsperaProjectPreferences( @PathVariable("projectId") final String projectId) throws NrgServiceException { final AsperaProjectPrefsInfo prefsInfo = new AsperaProjectPrefsInfo(asperaProjectPrefs, projectId); // Get site defaults, if project settings have not been configured - if ((prefsInfo.getAsperaNodeUrl() == null || prefsInfo.getAsperaNodeUrl().length() < 1) - && (prefsInfo.getAsperaNodeUser() == null || prefsInfo.getAsperaNodeUser().length() < 1) - && (asperaSitePrefs.getAsperaNodeUrl() != null || asperaSitePrefs.getAsperaNodeUrl().length() > 0) - && (asperaSitePrefs.getAsperaNodeUser() != null || asperaSitePrefs.getAsperaNodeUser().length() > 0)) { - _logger.warn("WARNING: Project Aspera preferences not found for project " + projectId + - ". Returning site preferences instead for project preference call."); + if ((prefsInfo.getAsperaNodeUrl() == null || prefsInfo.getAsperaNodeUrl().isEmpty()) + && (prefsInfo.getAsperaNodeUser() == null || prefsInfo.getAsperaNodeUser().isEmpty()) + && (asperaSitePrefs.getAsperaNodeUrl() != null || !asperaSitePrefs.getAsperaNodeUrl().isEmpty()) + && (asperaSitePrefs.getAsperaNodeUser() != null || !asperaSitePrefs.getAsperaNodeUser().isEmpty())) { + _logger.warn("WARNING: Project Aspera preferences not found for project {}. " + + "Returning site preferences instead for project preference call.", projectId); prefsInfo.setAsperaEnabled(false); prefsInfo.setAsperaNodeUrl(asperaSitePrefs.getAsperaNodeUrl()); prefsInfo.setAsperaNodeUser(asperaSitePrefs.getAsperaNodeUser()); @@ -189,8 +216,17 @@ public ResponseEntity getAsperaProjectPreferences( return new ResponseEntity<>(prefsInfo, HttpStatus.OK); } + @XapiRequestMapping(value = "xsyncProjectPreferences/whitelistEnabled", method = + RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @ApiOperation(value = "Checks whether site whitelist is enabled on the site level.") + @ApiResponses({ @ApiResponse(code = 200, message = "Site whitelist enabled returned."), + @ApiResponse(code = 500, message = "Unexpected error") }) + public ResponseEntity getWhitelistEnabled() { + return new ResponseEntity<>(prefs.getXsyncWhitelistEnabled(), HttpStatus.OK); + } + @XapiRequestMapping(value = "xsyncSitePreferences/whitelistSites", method = RequestMethod.GET, produces = { - MediaType.APPLICATION_JSON_VALUE }, restrictTo = AccessLevel.Admin) + MediaType.APPLICATION_JSON_VALUE }, restrictTo = AccessLevel.Read) @ApiOperation(value = "Get the whitelist of sites allowed for syncing") @ApiResponses({ @ApiResponse(code = 200, message = "Xsync whitelist sites retrieved."), @ApiResponse(code = 500, message = "Unexpected error") }) diff --git a/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/admin/xsyncConnectionManager.js b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/admin/xsyncConnectionManager.js new file mode 100644 index 0000000..a9b2d7b --- /dev/null +++ b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/admin/xsyncConnectionManager.js @@ -0,0 +1,120 @@ +/* + * web: xsyncConnectionManager.js + * XNAT http://www.xnat.org + * Copyright (c) 2005-2017, Washington University School of Medicine and Howard Hughes Medical Institute + * All Rights Reserved + * + * Released under the Simplified BSD. + */ + +/*! + * Manage the backend connection by which Xsync transfers will be made. + */ + +console.log('xsyncConnectionManager.js'); + +var XNAT = getObject(XNAT || {}); +XNAT.plugin = getObject(XNAT.plugin || {}); +XNAT.plugin.xsync = getObject(XNAT.plugin.xsync || {}); + +(function(factory){ + if (typeof define === 'function' && define.amd) { + define(factory); + } + else if (typeof exports === 'object') { + module.exports = factory(); + } + else { + return factory(); + } +}(function() { + + var restUrl = XNAT.url.restUrl; + var xsyncConnectionManager; + XNAT.plugin.xsync.xsyncConnectionManager = xsyncConnectionManager = getObject(XNAT.plugin.xsync.xsyncConnectionManager || {}); + + $(document).on('change','#https-enabled', function(){ + xsyncConnectionManager.toggleHttpsEnabled($(this).val()); + }); + + $(document).on('change','#aspera-enabled', function(){ + xsyncConnectionManager.toggleAsperaEnabled($(this).val()); + }); + + xsyncConnectionManager.toggleHttpsEnabled = function(enabled) { + let inputPrefs = {}; + if (enabled === "true") { + inputPrefs['httpsEnabled'] = true; + } else { + inputPrefs['httpsEnabled'] = false; + } + + xsyncConnectionManager.postSitePreferencesUpdate(inputPrefs, 'https'); + } + + xsyncConnectionManager.toggleAsperaEnabled = function(enabled) { + let inputPrefs = {}; + if (enabled === "true") { + inputPrefs['asperaEnabled'] = true; + } else { + inputPrefs['asperaEnabled'] = false; + inputPrefs['httpsEnabled'] = true; + } + + xsyncConnectionManager.postSitePreferencesUpdate(inputPrefs, 'aspera'); + if ($('#aspera-enabled').val() === 'false') { + $("#https-enabled").parent().parent().parent().parent().addClass('disabled'); + $("#https-enabled").prop('disabled', true); + $("a[title='Aspera Server Defaults']").parent().addClass('hidden'); + } else { + $("#https-enabled").parent().parent().parent().parent().removeClass('disabled'); + $("#https-enabled").prop('disabled', false); + $("a[title='Aspera Server Defaults']").parent().removeClass('hidden'); + } + } + + xsyncConnectionManager.postSitePreferencesUpdate = function(inputPrefs, preferenceName) { + XNAT.xhr.post({ + url: restUrl('/xapi/xsyncSitePreferences/'), + async: false, + contentType: 'application/json', + data: JSON.stringify(inputPrefs), + success: function () { + console.log('Updated ' + preferenceName + ' preference.'); + XNAT.ui.banner.top(2000, 'Updated ' + preferenceName + ' enabled preference.', 'success'); + }, + fail: function (e) { + XNAT.ui.banner.top(2000, 'Could not update ' + preferenceName + ' enabled preference: ' + e.responseText, 'error'); + } + }); + } + + xsyncConnectionManager.init = function() { + XNAT.xhr.get({ + url: restUrl('/xapi/xsyncSitePreferences/'), + async: false, + success: function (data) { + let httpsEnabled = data['httpsEnabled']; + let asperaEnabled = data['asperaEnabled']; + if (httpsEnabled == true) { + $('#https-enabled').prop("checked",true); + } + if (asperaEnabled == true) { + $('#aspera-enabled').prop("checked",true); + } else { + $("#https-enabled").parent().parent().parent().parent().addClass('disabled'); + $("#https-enabled").prop('disabled', true); + $("a[title='Aspera Server Defaults']").parent().addClass('hidden'); + } + }, + fail: function (e) { + XNAT.ui.banner.top(2000, 'Could not retrieve connection information: ' + e.responseText, 'error'); + } + }); + } + + $(document).ready(function () { + xsyncConnectionManager.init(); + }) + +})); \ No newline at end of file diff --git a/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/admin/xsyncWhitelistManager.js b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/admin/xsyncWhitelistManager.js index 7a0ad1c..af2a3ed 100644 --- a/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/admin/xsyncWhitelistManager.js +++ b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/admin/xsyncWhitelistManager.js @@ -37,7 +37,7 @@ XNAT.plugin.xsync = getObject(XNAT.plugin.xsync || {}); xsyncWhitelistManager.toggleWhitelistSwitch = function(enabled) { let $whitelistTableDiv = $('div#xsync-whitelist-table'); - let inputPrefs = {} + let inputPrefs = {}; if (enabled === "true") { inputPrefs['xsyncWhitelistEnabled'] = true; $whitelistTableDiv.empty().append(xsyncWhitelistManager.table()); @@ -126,7 +126,7 @@ XNAT.plugin.xsync = getObject(XNAT.plugin.xsync || {}); form.id = 'form'; form.appendChild(spawn('div|class="warning"',{'style': {visibility: 'hidden'}, 'id': 'warning'})); - form.appendChild(createInputElement('Site Id', 'site_id_input', item.id, 'text', 'The unique identifier for the site.')); + form.appendChild(createInputElement('Site Id', 'site_id_input', item.siteId, 'text', 'The unique identifier for the site.')); form.appendChild(createInputElement('Site Name', 'site_name_input', item.siteName, 'text', 'The name given to the site so that it is clearly identifiable to users.')); form.appendChild(createInputElement('Site Url', 'site_url_input', item.siteUrl, 'text', 'The url of the site.')); let options = ['CLINICAL', 'RESEARCH', 'PUBLIC'] diff --git a/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/xsync-config.js b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/xsync-config.js index 976dd3f..ca5e7a6 100644 --- a/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/xsync-config.js +++ b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/xsync-config.js @@ -65,6 +65,9 @@ if (typeof XSYNC.credentialsConfig === 'undefined') { XSYNC.xsyncConfig.configuration.subject_assessors.sync_type = 'none'; XSYNC.xsyncConfig.configuration.imaging_sessions.sync_type = 'all'; // XSYNC.xsyncConfig.configuration.imaging_sessions.xsi_types.types_list = ['xnat:mrSessionData']; + + XSYNC.xsyncConfig.isProjectAsperaEnabled = false; + XSYNC.xsyncConfig.isSiteWideAsperaEnabled = false; }; XSYNC.xsyncConfig.initialConfig = function(){ @@ -543,12 +546,31 @@ if (typeof XSYNC.credentialsConfig === 'undefined') { function configPanel() { XNAT.xhr.get({ - url: restUrl('/xapi/xsyncSitePreferences/'), + url: restUrl('/xapi/xsyncSitePreferences/asperaEnabled/'), async: false, success: function (data) { - let enabled = data['xsyncWhitelistEnabled']; - XSYNC.xsyncConfig.isWhitelistEnabledBackend = enabled; - if (enabled == true) { + XSYNC.xsyncConfig.isSiteWideAsperaEnabled = data; + }, + fail: function (e) { + XNAT.ui.banner.top(2000, 'Could not retrieve aspera information: ' + e.responseText, 'error'); + } + }); + XNAT.xhr.get({ + url: restUrl('/xapi/xsyncProjectPreferences/project/' + XNAT.data.context.project + '/asperaEnabled/'), + async: false, + success: function (data) { + XSYNC.xsyncConfig.isProjectAsperaEnabled = data; + }, + fail: function (e) { + XNAT.ui.banner.top(2000, 'Could not retrieve aspera information: ' + e.responseText, 'error'); + } + }); + XNAT.xhr.get({ + url: restUrl('/xapi/xsyncProjectPreferences/whitelistEnabled/'), + async: false, + success: function (data) { + XSYNC.xsyncConfig.isWhitelistEnabledBackend = data; + if (XSYNC.xsyncConfig.isWhitelistEnabledBackend == true) { XNAT.xhr.get({ url: restUrl('/xapi/xsyncSitePreferences/whitelistSites/'), async: false, @@ -720,9 +742,13 @@ if (typeof XSYNC.credentialsConfig === 'undefined') { /////////////////////////// function aspera() { - return { - tag: "div.message.bold", - content: "NOTICE: Aspera transfers are now supported, if your destination site supports them. Please see project settings, in the actions menu, to configure Aspera settings." + if (XSYNC.xsyncConfig.isProjectAsperaEnabled === true && XSYNC.xsyncConfig.isSiteWideAsperaEnabled) { + return { + tag: "div.message.bold", + content: "NOTICE: Aspera transfers are now supported, if your destination site supports them. Please see project settings, in the actions menu, to configure Aspera settings." + } + } else { + return ''; } } diff --git a/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/xsync-setupProjectPreference.js b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/xsync-setupProjectPreference.js new file mode 100644 index 0000000..e856568 --- /dev/null +++ b/src/main/resources/META-INF/resources/scripts/xnat-plugins/xsyncPlugin/xsync-setupProjectPreference.js @@ -0,0 +1,75 @@ +console.log('xsync-setupProjectPreference.js'); + +var XNAT = getObject(XNAT || {}); +XNAT.plugin = getObject(XNAT.plugin || {}); +XNAT.plugin.xsync = getObject(XNAT.plugin.xsync || {}); + +(function(factory) { + if (typeof define === 'function' && define.amd) { + define(factory); + } + else if (typeof exports === 'object') { + module.exports = factory(); + } + else { + return factory(); + } +}(function() { + var restUrl = XNAT.url.restUrl; + + var xsyncProjectPreferenceManager; + XNAT.plugin.xsync.xsyncProjectPreferenceManager = xsyncProjectPreferenceManager = getObject(XNAT.plugin.xsync.xsyncProjectPreferenceManager || {}); + + $(document).on('change','#aspera-enabled', function(){ + xsyncProjectPreferenceManager.toggleEnabledElements($(this).val()); + }); + + xsyncProjectPreferenceManager.toggleEnabledElements = function(enabled) { + var $active_pane = $('#aspera-panel'); + + if (enabled === 'true') { + $active_pane.find("input[type='text']").parent().parent().removeClass('hidden'); + } else { + $active_pane.find("input[type='text']").parent().parent().addClass('hidden') + } + } + + xsyncProjectPreferenceManager.init = function() { + XNAT.xhr.get({ + url: restUrl('/xapi/xsyncSitePreferences/asperaEnabled/'), + async: false, + success: function (data) { + xsyncProjectPreferenceManager.siteWideAsperaEnabled = data; + if (xsyncProjectPreferenceManager.siteWideAsperaEnabled == true) { + $("#xsync-config").removeClass('hidden'); + } else { + $("#xsync-config").addClass('hidden'); + } + }, + fail: function (e) { + XNAT.ui.banner.top(2000, 'Could not retrieve aspera information: ' + e.responseText, 'error'); + } + }); + XNAT.xhr.get({ + url: restUrl('/xapi/xsyncProjectPreferences/project/' + XNAT.data.context.project + '/asperaEnabled/'), + async: false, + success: function (data) { + let enabled = data; + xsyncProjectPreferenceManager.isAsperaEnabled = true; + if (enabled == true) { + $('#aspera-panel').find('.switchbox.panel-switchbox').children("input").prop("checked",true); + } + xsyncProjectPreferenceManager.toggleEnabledElements($('#aspera-enabled').val()); + }, + fail: function (e) { + XNAT.ui.banner.top(2000, 'Could not retrieve aspera information: ' + e.responseText, 'error'); + } + }); + xsyncProjectPreferenceManager.toggleEnabledElements($('#aspera-enabled').val()); + } + + $(document).ready(function () { + xsyncProjectPreferenceManager.init(); + }) + +})); \ No newline at end of file diff --git a/src/main/resources/META-INF/xnat/spawner/xsync-plugin/project-settings.yaml b/src/main/resources/META-INF/xnat/spawner/xsync-plugin/project-settings.yaml index 94753f8..26d1aa4 100644 --- a/src/main/resources/META-INF/xnat/spawner/xsync-plugin/project-settings.yaml +++ b/src/main/resources/META-INF/xnat/spawner/xsync-plugin/project-settings.yaml @@ -19,13 +19,12 @@ projectSettings: name: asperaPanel label: XSync Aspera Settings method: POST - url: /xapi/xsyncProjectPreferences/project/{{XNAT.data.projectID}}/aspera + url: /xapi/xsyncProjectPreferences/project/{{XNAT.data.projectID}}/aspera contentType: application/json contents: asperaEnabled: kind: panel.input.switchbox name: asperaEnabled - value: true label: Enable Aspera Transfers? onText: Enabled offText: Disabled @@ -78,3 +77,5 @@ projectSettings: placeholder: 33001 description: > The remote server's UDP port + asperaSettingsScript: + tag: script|src="~/scripts/xnat-plugins/xsyncPlugin/xsync-setupProjectPreference.js" diff --git a/src/main/resources/META-INF/xnat/spawner/xsync-plugin/site-settings.yaml b/src/main/resources/META-INF/xnat/spawner/xsync-plugin/site-settings.yaml index 6d464f1..b9d61f5 100644 --- a/src/main/resources/META-INF/xnat/spawner/xsync-plugin/site-settings.yaml +++ b/src/main/resources/META-INF/xnat/spawner/xsync-plugin/site-settings.yaml @@ -8,11 +8,42 @@ siteSettings: tabGroups: xsyncConfig: XSync Site Level Configuration contents: + connectionManagement: + kind: tab + label: Connection Management + group: xsyncConfig + active: true + contents: + connectionManagementPanel: + kind: panel.form + name: connectionManagementPanel + label: Connection Management + footer: false + contents: + httpsEnabled: + kind: panel.input.switchbox + name: httpsEnabled + label: Enable HTTPS Transfers? + onText: Enabled + offText: Disabled + description: > + Use HTTPS for transfers? This is the default configuration. To turn off this setting, another method of transfers must be turned on. + asperaEnabled: + kind: panel.input.switchbox + name: asperaEnabled + label: Enable Aspera Transfers? + onText: Enabled + offText: Disabled + description: > + Use Aspera for transfers? This requires a valid Aspera server to receive files. + xsyncConnectionManagerScript: + tag: script|src="~/scripts/xnat-plugins/xsyncPlugin/admin/xsyncConnectionManager.js" + remoteTokenRefresh: kind: tab label: Remote Token group: xsyncConfig - active: true + active: false contents: remoteTokenRefreshPanel: kind: panel.form @@ -133,7 +164,7 @@ siteSettings: settings may be useful if one of your destination sites supports Aspera-based XSync sends and multiple projects will connect to the same Aspera server, as these will become the default settings for project connections. Please note, however, that - XSync Aspera settings must be configured and enabled for each project. + XSync Aspera settings must be configured and enabled for each project. asperaNodeUrl: kind: panel.input.text name: asperaNodeUrl