diff --git a/README.md b/README.md index 83165442c8a8f2bf892f53932fbe900d2ae4dd19..7847ce123eb2e183e6912448a59f3e1c9196fae9 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,25 @@ The repo properties are used when deploying build artifacts to the Maven reposit There are a lot of other useful properties you can set in **gradle.properties**, so it's worth spending a little time [reading about the various properties Gradle recognizes in this file](https://docs.gradle.org/current/userguide/build_environment.html). -### XNAT ### +### XNAT Configuration ### -You also need to do a little configuring of the XNAT build. This is a temporary requirement until we've deprecated the **InstanceSettings.xml** configuration, but is required until we complete that task. +You also need to add another initial configuration file in your home directory. Create a directory path **xnat/config** in your home directory and a file named **xnat-conf.properties** there. In this file, define the following properties: -Before building the XNAT web application, whether via Gradle or the IDE, modify **InstanceSettings.xml** to set the database properties, site URL, archive, cache, and prearchive paths, etc. If you change anything, e.g. move to a different database for some reason, you'll need to modify **InstanceSettings.xml** again and rebuild. +``` +datasource.driver=org.postgresql.Driver +datasource.url=jdbc:postgresql://localhost/<XNAT Instance Name> +datasource.username=<database username> +datasource.password=<database password> + +hibernate.dialect=org.hibernate.dialect.PostgreSQL9Dialect +hibernate.hbm2ddl.auto=update +hibernate.show_sql=false +hibernate.cache.use_second_level_cache=true +hibernate.cache.use_query_cache=true +``` + +IMPORTANT NOTE: You'll definitely want to fill in the three <placeholders> above! + ...<XNAT Instance Name>, <database username> and <database password> ## Building ## diff --git a/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml b/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml index 1e747f92fa5a65aef9790d12f7049665fdd2bed0..df70555153aa10a8e5afe6c068a3cc25802f12f9 100644 --- a/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml +++ b/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml @@ -18,22 +18,15 @@ siteId: description: "The id used to refer to this site (also used to generate database ids). The Site ID must start with a letter and contain only letters, numbers and underscores. It should be a short, one-word name or acronym which describes your site. No spaces or non-alphanumeric characters." siteDescriptionType: - kind: panel.display # make this a radio button group + kind: panel.display id: siteDescriptionType name: siteDescriptionType label: Site Description value: Select a site description option below - # onchange: # some javascript that toggles display of the elements below appropriately - -siteDescriptionOptionText: - kind: panel.input.checkbox # make this a radio button group - id: siteDescriptionOptionText - label: "Text (Markdown)" - -siteDescriptionOptionPage: - kind: panel.input.checkbox # make this a radio button group - id: siteDescriptionOptionPage - label: "Page" + before: + - "<script type=\"text/javascript\" src=\"../../scripts/xnat/admin/siteInfo.js\"></script>" + after: + - "<span style=\"position: relative; top: -15px;left: 270px;\"><input type=\"radio\" name=\"siteDescriptionType\" id=\"siteDescriptionTypePage\" value=\"Page\"> Page <input type=\"radio\" name=\"siteDescriptionType\" id=\"siteDescriptionTypeText\" value=\"Text\"> Text (Markdown)</span>" siteDescriptionPage: kind: panel.input.text @@ -179,8 +172,6 @@ siteInfo: ${siteId} ${siteUrl} ${siteDescriptionType} - ${siteDescriptionOptionText} - ${siteDescriptionOptionPage} ${siteDescriptionPage} ${siteDescriptionText} ${siteLoginLanding} @@ -535,19 +526,19 @@ notifications: name: helpContactInfo label: "Help Contact Info" emailMessageUserRegistration: - kind: panel.input.text # textarea + kind: panel.textarea id: emailMessageUserRegistration name: emailMessageUserRegistration label: "Email Message: User Registration" description: "Text of message emailed to users upon registration. Link for email validation is auto-populated." emailMessageForgotUsernameRequest: - kind: panel.textarea # textarea + kind: panel.textarea id: emailMessageForgotUsernameRequest name: emailMessageForgotUsernameRequest label: "Email Message: Forgot Username Request" description: "Text of message emailed to users upon lost username request." emailMessageForgotPasswordReset: - kind: panel.textarea # textarea + kind: panel.textarea id: emailMessageForgotPasswordReset name: emailMessageForgotPasswordReset label: "Email Message: Password Reset" @@ -617,7 +608,7 @@ themeManagement: label: Theme Management contents: themeScript: - tag: script|type=text/javascript;src=../../scripts/themeManagement.js + tag: script|type=text/javascript;src=../../scripts/xnat/admin/themeManagement.js themeStyle: tag: style element: @@ -772,7 +763,7 @@ registrationOptions: label: "Require Email Verification To Register?" value: true emailVerificationMessage: - kind: panel.input.text #textarea + kind: panel.textarea id: emailVerificationMessage name: emailVerificationMessage label: "Email Verification Message" @@ -849,7 +840,7 @@ anonymization: label: "Enable Site-wide Anonymization Script" value: true editAnonymzationScript: - kind: panel.input.text #textarea + kind: panel.textarea id: editAnonymzationScript name: editAnonymzationScript label: "Edit Anonymzation Script" @@ -873,7 +864,7 @@ seriesImportFilter: label: Filter Mode value: false seriesImportFilter: - kind: panel.input.text #textarea + kind: panel.textarea id: seriesImportFilter name: seriesImportFilter label: "Edit Series Import Filter" @@ -908,7 +899,7 @@ sessionUploadMethod: label: Enable Project Applet Script value: false appletScript: - kind: panel.input.text #textarea + kind: panel.textarea id: appletScript name: appletScript label: "Applet Script" @@ -1068,7 +1059,6 @@ adminPage: ${userLoginsSessionControls} ${passwords} ${csrf} - ${auditTrail} ${securityServices} emailServer: kind: tab diff --git a/src/main/webapp/scripts/footer.js b/src/main/webapp/scripts/footer.js index 46c5372245ab91414e00378904aaf158b7ae1d68..c0fc3fcc868f7328917523c477137584d25c6137 100644 --- a/src/main/webapp/scripts/footer.js +++ b/src/main/webapp/scripts/footer.js @@ -548,24 +548,6 @@ $(function(){ }); jq(window).load(function(){ - // adding shortcut methods to put and delete AJAX calls for clarity - jq.each(["put", "delete"], function(i, method) { - jq[method] = function(url, data, callback, type) { - if (jq.isFunction(data)) { - type = type || callback; - callback = data; - data = undefined; - } - return jq.ajax({ - url: url, - type: method, - dataType: type, - data: data, - success: callback - }); - }; - }); - // trying to make the text readable jq('[style*="font-size:8px"]').addClass('smallest_text'); jq('[style*="font-size: 8px"]').addClass('smallest_text'); diff --git a/src/main/webapp/scripts/xnat/xhr.js b/src/main/webapp/scripts/xnat/xhr.js index 9be48d60e75ab2fe758aa6e63d00df526686a6d5..20172578ab890bf49c53ee3e16ced63e0b7f9474 100755 --- a/src/main/webapp/scripts/xnat/xhr.js +++ b/src/main/webapp/scripts/xnat/xhr.js @@ -72,19 +72,36 @@ var XNAT = getObject(XNAT||{}), //extend(xhr, url); xhr.$ = getObject(xhr.$||{}); - - // Direct maps to jQuery's AJAX methods. - // Why use these instead of jQuery directly? - // For flexibility to allow XNAT's AJAX - // library to be changed in the future. - xhr.$.ajax = xhr.ajax$ = $.ajax; - xhr.$.get = xhr.get$ = $.get; - xhr.$.post = xhr.post$ = $.post; - xhr.$.getJSON = xhr.getJSON$ = $.getJSON; - xhr.$.getScript = xhr.getScript$ = $.getScript; - xhr.$.load = xhr.load$ = function(selector, url, data, success){ $$(selector).load(url, data, success); + // adding shortcut methods to put and delete AJAX calls for clarity + $.each(["put", "delete"], function(i, method) { + $[method] = function(url, data, callback, type) { + if ($.isFunction(data)) { + type = type || callback; + callback = data; + data = undefined; + } + return $.ajax({ + url: url, + type: method, + dataType: type, + data: data, + success: callback + }); + }; + }); + // Direct maps to jQuery's AJAX methods. + // Why use these instead of jQuery directly? + // For flexibility to allow XNAT's AJAX + // library to be changed in the future. + xhr.$.ajax = xhr.ajax$ = $.ajax; + xhr.$.get = xhr.get$ = $.get; + xhr.$.post = xhr.post$ = $.post; + xhr.$.put = xhr.put$ = $.put; + xhr.$.delete = xhr.delete$ = $.delete; + xhr.$.getJSON = xhr.getJSON$ = $.getJSON; + xhr.$.getScript = xhr.getScript$ = $.getScript; }; // private config object constructor