From edfd2f50e36ef04cbdda9fabcdf9c7f824311713 Mon Sep 17 00:00:00 2001 From: "Mark M. Florida" <mflorida@gmail.com> Date: Thu, 19 May 2016 16:01:01 -0500 Subject: [PATCH] Getting everything synched up. --- README.md | 20 +- build.gradle | 27 +- .../nrg/xapi/model/event/EventClassInfo.java | 2 +- .../nrg/xapi/rest/event/EventHandlerApi.java | 13 +- .../rest/notifications/NotificationsApi.java | 283 +++++++++++++++++- .../nrg/xapi/rest/settings/SiteConfigApi.java | 11 +- .../xnat/configuration/ApplicationConfig.java | 2 +- .../nrg/xnat/configuration/ReactorConfig.java | 6 +- .../entities/ScriptLaunchRequestEvent.java | 10 +- .../AutomationCompletionEventListener.java | 3 +- .../AutomationEventScriptHandler.java | 42 ++- .../helpers/prearchive/PrearcDatabase.java | 37 ++- .../initialization/XnatWebAppInitializer.java | 2 + .../actions/AutomationBasedImporter.java | 16 +- .../extensions/ProjectPermissionsFilter.java | 8 +- .../ProjectPipelineListResource.java | 119 +++++--- .../resources/ScriptTriggerResource.java | 6 +- .../restlet/resources/files/DIRResource.java | 2 +- .../security/XnatExpiredPasswordFilter.java | 14 +- .../org/nrg/xnat/services/XnatAppInfo.java | 2 +- .../turbine/modules/actions/AddProject.java | 5 +- .../actions/DownloadSessionsAction2.java | 13 +- .../modules/actions/ModifyProject.java | 6 +- .../xnat/turbine/modules/screens/Login.java | 2 +- .../xnat/turbine/utils/ArcSpecManager.java | 171 +++-------- .../xnat/entities/xnat-entity-packages.txt | 4 +- .../META-INF/xnat/init_security_000.sql | 60 ---- .../xnat-feature-definition.properties | 7 - src/main/resources/log4j.properties | 13 + src/main/webapp/WEB-INF/tags/page/xnat.tag | 15 +- .../webapp/WEB-INF/tags/spawner/layout.tag | 15 +- src/main/webapp/images/dab_files/xdat.js | 43 --- src/main/webapp/scripts/footer.js | 18 -- .../scripts/project/projResourceMgmt.js | 2 +- .../uploaders/AutomationBasedUploader.js | 59 ++-- src/main/webapp/scripts/xdat.js | 45 +-- .../webapp/scripts/xnat/app/eventsManager.js | 140 +-------- .../scripts/xnat/app/siteEventsManager.js | 239 ++------------- src/main/webapp/scripts/xnat/app/siteSetup.js | 14 +- src/main/webapp/scripts/xnat/spawner.js | 6 + src/main/webapp/setup/index.jsp | 8 +- .../navigations/XNATQuickSearch.vm | 62 ++-- .../xnat-templates/screens/DownloadApplet.vm | 6 +- .../screens/LaunchUploadApplet.vm | 2 - .../xnat-templates/screens/UploadApplet.vm | 3 +- .../screens/XDATScreen_admin_options.vm | 2 - .../project/widgets/project_summary_status.vm | 2 +- .../screens/topBar/Help/Default.vm | 2 +- .../screens/topBar/Upload/Default.vm | 11 +- .../xnat_projectData_summary_details.vm | 2 +- .../xnat_projectData_summary_management.vm | 1 + .../xnat_projectData_summary_status.vm | 2 +- .../xnat_projectData_summary_tabs.vm | 20 +- 53 files changed, 739 insertions(+), 886 deletions(-) diff --git a/README.md b/README.md index 83165442..7847ce12 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/build.gradle b/build.gradle index 7822995b..107eecba 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ def vXnat = '1.7.0-SNAPSHOT' def vXnatPipeline = vXnat def vSpring = '4.2.5.RELEASE' def vSpringSecurity = '4.0.4.RELEASE' -def vSwagger = '2.3.1' +def vSwagger = '2.4.0' def vHibernate = '4.3.11.Final' def vEhcache = '2.6.11' def vJackson = '2.6.5' @@ -18,11 +18,13 @@ def vGroovy = '2.4.6' def vJython = '2.7.0' group 'org.nrg.xnat' +version = vXnat buildscript { repositories { mavenLocal() jcenter() + mavenCentral() maven { url "https://plugins.gradle.org/m2/" } @@ -38,7 +40,7 @@ buildscript { dependencies { classpath "com.bmuschko:gradle-cargo-plugin:2.2.2" classpath "com.bmuschko:gradle-tomcat-plugin:2.2.4" - classpath "gradle.plugin.com.zoltu.gradle.plugin:git-versioning:2.0.19" + classpath "gradle.plugin.com.palantir.gradle.gitversion:gradle-git-version:0.5.1" } } @@ -49,7 +51,7 @@ apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'com.bmuschko.tomcat' apply plugin: 'com.bmuschko.cargo' -apply plugin: "com.zoltu.git-versioning" +apply plugin: "com.palantir.git-version" apply plugin: 'idea' apply plugin: 'eclipse' @@ -140,22 +142,27 @@ if (JavaVersion.current().isJava8Compatible()) { } // Pulls in the Jenkins BUILD_NUMBER environment variable if available. -def buildNumber = hasProperty("BUILD_NUMBER") ? getProperty("BUILD_NUMBER") : "Manual" def buildDate = new Date() +def buildNumber = hasProperty("BUILD_NUMBER") ? getProperty("BUILD_NUMBER") : "Manual" +def revision = gitVersion().replace("${version}-", "") jar { manifest { - attributes 'Build-Number': buildNumber, + attributes 'Application-Name': 'XNAT', 'Build-Date': buildDate, - 'Application-Name': 'XNAT' + 'Build-Number': buildNumber, + 'Implementation-Sha': revision, + 'Implementation-Version': version } } war { manifest { - attributes 'Build-Number': buildNumber, + attributes 'Application-Name': 'XNAT', 'Build-Date': buildDate, - 'Application-Name': 'XNAT' + 'Build-Number': buildNumber, + 'Implementation-Sha': revision, + 'Implementation-Version': version } } @@ -270,7 +277,7 @@ configurations { dependencies { // NRG dependencies first. compile "org.nrg.xnat:spawner:${vXnat}" - compile("org.nrg.xnat:xnat-data-models:${vXnat}"){ + compile("org.nrg.xnat:xnat-data-models:${vXnat}") { transitive = false } compile "org.nrg.xdat:core:${vXnat}" @@ -418,7 +425,7 @@ dependencies { "org.apache.tomcat.embed:tomcat-embed-jasper:${vTomcat}" cargo "org.codehaus.cargo:cargo-core-uberjar:${vCargo}", - "org.codehaus.cargo:cargo-ant:${vCargo}" + "org.codehaus.cargo:cargo-ant:${vCargo}" testCompile "junit:junit:${vJunit}" testCompile "org.springframework:spring-test:${vSpring}" diff --git a/src/main/java/org/nrg/xapi/model/event/EventClassInfo.java b/src/main/java/org/nrg/xapi/model/event/EventClassInfo.java index bce9f8ff..df793bb8 100644 --- a/src/main/java/org/nrg/xapi/model/event/EventClassInfo.java +++ b/src/main/java/org/nrg/xapi/model/event/EventClassInfo.java @@ -6,7 +6,7 @@ import com.google.common.collect.Lists; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.nrg.xft.event.EventClass; +import org.nrg.framework.event.EventClass; import org.python.google.common.collect.Maps; import org.springframework.core.annotation.AnnotationUtils; diff --git a/src/main/java/org/nrg/xapi/rest/event/EventHandlerApi.java b/src/main/java/org/nrg/xapi/rest/event/EventHandlerApi.java index a8358580..94d72a07 100644 --- a/src/main/java/org/nrg/xapi/rest/event/EventHandlerApi.java +++ b/src/main/java/org/nrg/xapi/rest/event/EventHandlerApi.java @@ -6,7 +6,14 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import javassist.Modifier; + +import org.nrg.automation.event.AutomationEventImplementerI; +import org.nrg.automation.event.entities.AutomationEventIds; +import org.nrg.automation.event.entities.AutomationFilters; +import org.nrg.automation.services.impl.hibernate.HibernateAutomationEventIdsService; +import org.nrg.automation.services.impl.hibernate.HibernateAutomationFiltersService; import org.nrg.framework.annotations.XapiRestController; +import org.nrg.framework.event.Filterable; import org.nrg.framework.utilities.Reflection; import org.nrg.xapi.model.event.EventClassInfo; import org.nrg.xdat.XDAT; @@ -15,12 +22,6 @@ import org.nrg.xdat.om.base.auto.AutoXnatProjectdata; import org.nrg.xdat.security.XDATUser; import org.nrg.xdat.security.helpers.Permissions; import org.nrg.xdat.security.helpers.Roles; -import org.nrg.xdat.services.impl.hibernate.HibernateAutomationEventIdsService; -import org.nrg.xdat.services.impl.hibernate.HibernateAutomationFiltersService; -import org.nrg.xft.event.AutomationEventImplementerI; -import org.nrg.xft.event.Filterable; -import org.nrg.xft.event.entities.AutomationEventIds; -import org.nrg.xft.event.entities.AutomationFilters; import org.nrg.xft.security.UserI; import org.nrg.xnat.event.conf.EventPackages; import org.slf4j.Logger; diff --git a/src/main/java/org/nrg/xapi/rest/notifications/NotificationsApi.java b/src/main/java/org/nrg/xapi/rest/notifications/NotificationsApi.java index 45ccf624..71cd31ba 100644 --- a/src/main/java/org/nrg/xapi/rest/notifications/NotificationsApi.java +++ b/src/main/java/org/nrg/xapi/rest/notifications/NotificationsApi.java @@ -4,7 +4,16 @@ import io.swagger.annotations.*; import org.apache.commons.lang3.StringUtils; import org.nrg.framework.annotations.XapiRestController; import org.nrg.framework.exceptions.NrgServiceError; +import org.nrg.framework.exceptions.NrgServiceException; import org.nrg.framework.exceptions.NrgServiceRuntimeException; +import org.nrg.mail.api.NotificationType; +import org.nrg.notify.api.CategoryScope; +import org.nrg.notify.api.SubscriberType; +import org.nrg.notify.entities.*; +import org.nrg.notify.exceptions.DuplicateDefinitionException; +import org.nrg.notify.exceptions.DuplicateSubscriberException; +import org.nrg.notify.services.NotificationService; +import org.nrg.xdat.XDAT; import org.nrg.xdat.preferences.SiteConfigPreferences; import org.nrg.xdat.rest.AbstractXnatRestApi; import org.slf4j.Logger; @@ -19,9 +28,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import javax.inject.Inject; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; +import java.util.*; @Api(description = "XNAT Notifications management API") @XapiRestController @@ -251,6 +258,205 @@ public class NotificationsApi extends AbstractXnatRestApi { return getSmtpServerProperties(); } + @ApiOperation(value = "Sets the email message for contacting help.", notes = "Sets the email message that people should receive when contacting help.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Help email message successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the help email message."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/help"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Void> setHelpContactInfo(@ApiParam(value = "The email message for contacting help.", required = true) @RequestParam final String message) { + _siteConfigPrefs.setHelpContactInfo(message); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets the email message for user registration.", notes = "Sets the email message that people should receive when they register. Link for email validation is auto-populated.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "User registration email message successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the user registration email message."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/registration"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setEmailMessageUserRegistration(@ApiParam(value = "The email message for user registration.", required = true) @RequestParam final String message) { + _siteConfigPrefs.setEmailMessageUserRegistration(message); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets the email message for forgot username.", notes = "Sets the email message that people should receive when they click that they forgot their username.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Forgot username email message successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the forgot username email message."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/forgotusername"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setEmailMessageForgotUsernameRequest(@ApiParam(value = "The email message for forgot username.", required = true) @RequestParam final String message) { + _siteConfigPrefs.setEmailMessageForgotUsernameRequest(message); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets the email message for password reset.", notes = "Sets the email message that people should receive when they click to reset their password. Link for password reset is auto-populated.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Password reset message successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the password reset message."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/passwordreset"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setEmailMessageForgotPasswordReset(@ApiParam(value = "The email message for password reset.", required = true) @RequestParam final String message) { + _siteConfigPrefs.setEmailMessageForgotPasswordReset(message); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Returns the email message for contacting help.", notes = "This returns the email message that people should receive when contacting help.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for contacting help successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for contacting help."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/help"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getHelpContactInfo() { + return new ResponseEntity<>(_siteConfigPrefs.getHelpContactInfo(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns the email message for user registration.", notes = "This returns the email message that people should receive when they register. Link for email validation is auto-populated.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for user registration successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for user registration."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/registration"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getEmailMessageUserRegistration() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailMessageUserRegistration(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns the email message for forgot username.", notes = "This returns the email message that people should receive when they click that they forgot their username.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for forgot username successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for forgot username."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/forgotusername"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getEmailMessageForgotUsernameRequest() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailMessageForgotUsernameRequest(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns the email message for password reset.", notes = "This returns the email message that people should receive when they click to reset their password. Link for password reset is auto-populated.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for password reset successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for password reset."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"messages/passwordreset"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getEmailMessageForgotPasswordReset() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailMessageForgotPasswordReset(), HttpStatus.OK); + } + + @ApiOperation(value = "Sets whether admins should be notified of user registration.", notes = "Sets whether admins should be notified of user registration.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Whether admins should be notified of user registration successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set whether admins should be notified of user registration."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/registration"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Void> setNotifyAdminUserRegistration(@ApiParam(value = "Whether admins should be notified of user registration successfully set.", required = true) @RequestParam final boolean notify) { + _siteConfigPrefs.setNotifyAdminUserRegistration(notify); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets whether admins should be notified of pipeline processing submit.", notes = "Sets whether admins should be notified of pipeline processing submit.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Whether admins should be notified of pipeline processing submit successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set whether admins should be notified of pipeline processing submit."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/pipeline"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setNotifyAdminPipelineEmails(@ApiParam(value = "Whether admins should be notified of pipeline processing submit successfully set.", required = true) @RequestParam final boolean notify) { + _siteConfigPrefs.setNotifyAdminPipelineEmails(notify); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets whether admins should be notified of project access requests.", notes = "Sets whether admins should be notified of project access requests.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Whether admins should be notified of project access requests successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set whether admins should be notified of project access requests."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/par"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setNotifyAdminProjectAccessRequest(@ApiParam(value = "Whether admins should be notified of project access requests successfully set.", required = true) @RequestParam final boolean notify) { + _siteConfigPrefs.setNotifyAdminProjectAccessRequest(notify); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets whether admins should be notified of session transfer.", notes = "Sets whether admins should be notified of session transfer by user.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Whether admins should be notified of session transfer successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set whether admins should be notified of session transfer."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/transfer"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setNotifyAdminSessionTransfer(@ApiParam(value = "Whether admins should be notified of session transfer successfully set.", required = true) @RequestParam final boolean notify) { + _siteConfigPrefs.setNotifyAdminSessionTransfer(notify); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Returns whether admins should be notified of user registration.", notes = "This returns whether admins should be notified of user registration.", response = Boolean.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for contacting help successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for contacting help."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/registration"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<Boolean> getNotifyAdminUserRegistration() { + return new ResponseEntity<>(_siteConfigPrefs.getNotifyAdminUserRegistration(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns whether admins should be notified of pipeline processing submit.", notes = "This returns whether admins should be notified of pipeline processing submit.", response = Boolean.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for user registration successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for user registration."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/pipeline"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<Boolean> getNotifyAdminPipelineEmails() { + return new ResponseEntity<>(_siteConfigPrefs.getNotifyAdminPipelineEmails(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns whether admins should be notified of project access requests.", notes = "This returns whether admins should be notified of project access requests.", response = Boolean.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for forgot username successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for forgot username."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/par"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<Boolean> getNotifyAdminProjectAccessRequest() { + return new ResponseEntity<>(_siteConfigPrefs.getNotifyAdminProjectAccessRequest(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns whether admins should be notified of session transfer.", notes = "This returns whether admins should be notified of session transfer.", response = Boolean.class) + @ApiResponses({@ApiResponse(code = 200, message = "Email message for password reset successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get email message for password reset."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"notify/transfer"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<Boolean> getNotifyAdminSessionTransfer() { + return new ResponseEntity<>(_siteConfigPrefs.getNotifyAdminSessionTransfer(), HttpStatus.OK); + } + + @ApiOperation(value = "Sets whether non-users should be able to subscribe to notifications.", notes = "Sets whether non-users should be able to subscribe to notifications.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Whether non-users should be able to subscribe to notifications."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set whether non-users should be able to subscribe to notifications."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"allow/nonusersubscribers/{setting}"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setEmailAllowNonuserSubscribers(@ApiParam(value = "Whether non-users should be able to subscribe to notifications.", required = true) @PathVariable final boolean setting) { + _siteConfigPrefs.setEmailAllowNonuserSubscribers(setting); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Returns whether non-users should be able to subscribe to notifications.", notes = "This returns whether non-users should be able to subscribe to notifications.", response = Boolean.class) + @ApiResponses({@ApiResponse(code = 200, message = "Whether non-users should be able to subscribe to notifications successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get whether non-users should be able to subscribe to notifications."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"allow/nonusersubscribers"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<Boolean> getEmailAllowNonuserSubscribers() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailAllowNonuserSubscribers(), HttpStatus.OK); + } + + @ApiOperation(value = "Sets the email addresses for error notifications.", notes = "Sets the email addresses that should be subscribed to error notifications.", response = Properties.class) + @ApiResponses({@ApiResponse(code = 200, message = "Error subscribers successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the error subscribers."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/error"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Void> setErrorSubscribers(@ApiParam(value = "The values to set for email addresses for error notifications.", required = true) @RequestParam final String subscribers) { + setSubscribersForNotificationType(NotificationType.Error, subscribers); + _siteConfigPrefs.setEmailRecipientErrorMessages(subscribers); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets the email addresses for issue notifications.", notes = "Sets the email addresses that should be subscribed to issue notifications.", response = Properties.class) + @ApiResponses({@ApiResponse(code = 200, message = "Issue subscribers successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the issue subscribers."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/issue"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setIssueSubscribers(@ApiParam(value = "The values to set for email addresses for issue notifications.", required = true) @RequestParam final String subscribers) { + setSubscribersForNotificationType(NotificationType.Issue, subscribers); + _siteConfigPrefs.setEmailRecipientIssueReports(subscribers); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets the email addresses for new user notifications.", notes = "Sets the email addresses that should be subscribed to new user notifications.", response = Properties.class) + @ApiResponses({@ApiResponse(code = 200, message = "New user subscribers successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the new user subscribers."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/newuser"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setNewUserSubscribers(@ApiParam(value = "The values to set for email addresses for new user notifications.", required = true) @RequestParam final String subscribers) { + setSubscribersForNotificationType(NotificationType.NewUser, subscribers); + _siteConfigPrefs.setEmailRecipientNewUserAlert(subscribers); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Sets the email addresses for update notifications.", notes = "Sets the email addresses that should be subscribed to update notifications.", response = Properties.class) + @ApiResponses({@ApiResponse(code = 200, message = "Update subscribers successfully set."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to set the update subscribers."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/update"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.POST}) + public ResponseEntity<Properties> setUpdateSubscribers(@ApiParam(value = "The values to set for email addresses for update notifications.", required = true) @RequestParam final String subscribers) { + setSubscribersForNotificationType(NotificationType.Update, subscribers); + _siteConfigPrefs.setEmailRecipientUpdate(subscribers); + return new ResponseEntity<>(HttpStatus.OK); + } + + @ApiOperation(value = "Returns list of email addresses subscribed to error notifications.", notes = "This returns a list of all the email addresses that are subscribed to receive error notifications.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Error notification subscribers successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get subscribers for email notifications."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/error"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getErrorSubscribers() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailRecipientErrorMessages(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns list of email addresses subscribed to issue notifications.", notes = "This returns a list of all the email addresses that are subscribed to receive issue notifications.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Issue notification subscribers successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get subscribers for email notifications."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/issue"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getIssueSubscribers() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailRecipientIssueReports(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns list of email addresses subscribed to new user notifications.", notes = "This returns a list of all the email addresses that are subscribed to receive new user notifications.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "New user notification subscribers successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get subscribers for email notifications."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/newuser"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getNewUserSubscribers() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailRecipientNewUserAlert(), HttpStatus.OK); + } + + @ApiOperation(value = "Returns list of email addresses subscribed to update notifications.", notes = "This returns a list of all the email addresses that are subscribed to receive update notifications.", response = String.class) + @ApiResponses({@ApiResponse(code = 200, message = "Update notification subscribers successfully returned."), @ApiResponse(code = 401, message = "Must be authenticated to access the XNAT REST API."), @ApiResponse(code = 403, message = "Not authorized to get subscribers for email notifications."), @ApiResponse(code = 500, message = "Unexpected error")}) + @RequestMapping(value = {"subscribers/update"}, produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET}) + public ResponseEntity<String> getUpdateSubscribers() { + return new ResponseEntity<>(_siteConfigPrefs.getEmailRecipientUpdate(), HttpStatus.OK); + } + private void setSmtp() { Map<String, String> smtp = new HashMap<>(); smtp.put("host", StringUtils.defaultIfBlank(_javaMailSender.getHost(), "localhost")); @@ -351,6 +557,74 @@ public class NotificationsApi extends AbstractXnatRestApi { } } + private void setSubscribersForNotificationType(NotificationType notificationType, final String subscribersString){ + List<String> subscribers = Arrays.asList(subscribersString.split("\\s*,\\s*")); + Category category = _notificationService.getCategoryService().getCategoryByScopeAndEvent(CategoryScope.Site, notificationType.id()); + if(category==null) { + category = _notificationService.getCategoryService().newEntity(); + category.setScope(CategoryScope.Site); + category.setEvent(notificationType.id()); + XDAT.getNotificationService().getCategoryService().create(category); + } + for(String subscriber : subscribers){ + try { + Subscriber subscriberObject = _notificationService.getSubscriberService().getSubscriberByName(subscriber); + + if(subscriberObject==null){ + subscriberObject = _notificationService.getSubscriberService().createSubscriber(subscriber, subscriber); + XDAT.getNotificationService().getSubscriberService().create(subscriberObject); + } + + Definition definition1 = _notificationService.getDefinitionService().getDefinitionForCategoryAndEntity(category,1L); + if(definition1==null) { + definition1 = _notificationService.createDefinition(CategoryScope.Site, notificationType.id(), 1L); + XDAT.getNotificationService().getDefinitionService().create(definition1); + } + + Channel channel1 = _notificationService.getChannelService().getChannel("htmlMail"); + if(channel1==null) { + _notificationService.getChannelService().createChannel("htmlMail", "text/html"); + } + + Map<Subscriber, Subscription> subscriberMapOfSubscriptions = _notificationService.getSubscriptionService().getSubscriberMapOfSubscriptionsForDefinition(definition1); + for (Map.Entry<Subscriber, Subscription> entry : subscriberMapOfSubscriptions.entrySet()) { + //Remove all existing subscriptions that match this definition since we are replacing the old list with the new one. + Subscriber tempSubscriber = entry.getKey(); + Subscription tempSubscription = entry.getValue(); + tempSubscriber.removeSubscription(tempSubscription); + } + Subscription subscription = _notificationService.subscribe(subscriberObject, SubscriberType.User, definition1, channel1); + + } catch (DuplicateSubscriberException e) { + _log.error("You tried to subscribe someone who was already subscribed",e); + } catch (DuplicateDefinitionException e) { + _log.error("Multiple definitions for this scope, event, and entity exist.",e); + } catch (NrgServiceException e) { + _log.error("Error setting email addresses for error notifications.",e); + } + } + } + +// private List<String> getSubscribersForNotificationType(NotificationType notificationType){ +// List<String> subscriberEmails = new ArrayList<String>(); +// Category category = _notificationService.getCategoryService().newEntity(); +// category.setScope(CategoryScope.Site); +// category.setEvent(notificationType.id()); +// Definition definition1 = null; +// try { +// definition1 = _notificationService.getDefinitionService().getDefinitionForCategoryAndEntity(category,1L); +// List<Subscription> subscriptions = definition1.getSubscriptions(); +// for(Subscription subscription : subscriptions){ +// for(String email : subscription.getSubscriber().getEmailList()){ +// subscriberEmails.add(email); +// } +// } +// } catch (DuplicateDefinitionException e) { +// _log.error("Multiple definitions for this scope, event, and entity exist.",e); +// } +// return subscriberEmails; +// } + private static final Logger _log = LoggerFactory.getLogger(NotificationsApi.class); private static final String NOT_SET = "NotSet"; @@ -359,4 +633,7 @@ public class NotificationsApi extends AbstractXnatRestApi { @Inject private JavaMailSenderImpl _javaMailSender; + + @Inject + private NotificationService _notificationService; } diff --git a/src/main/java/org/nrg/xapi/rest/settings/SiteConfigApi.java b/src/main/java/org/nrg/xapi/rest/settings/SiteConfigApi.java index 6d38437d..f04aac76 100644 --- a/src/main/java/org/nrg/xapi/rest/settings/SiteConfigApi.java +++ b/src/main/java/org/nrg/xapi/rest/settings/SiteConfigApi.java @@ -116,17 +116,20 @@ public class SiteConfigApi extends AbstractXnatRestApi { return new ResponseEntity<>(status); } - if (_log.isDebugEnabled()) { + if (_log.isInfoEnabled()) { final StringBuilder message = new StringBuilder("User ").append(getSessionUser().getUsername()).append(" is setting the values for the following properties:\n"); for (final String name : properties.keySet()) { message.append(" * ").append(name).append(": ").append(properties.get(name)).append("\n"); } - _log.debug(message.toString()); + _log.info(message.toString()); } for (final String name : properties.keySet()) { try { _preferences.set(properties.get(name), name); + if (_log.isInfoEnabled()) { + _log.info("Set property {} to value: {}", name, properties.get(name)); + } } catch (InvalidPreferenceName invalidPreferenceName) { _log.error("Got an invalid preference name error for the preference: " + name + ", which is weird because the site configuration is not strict"); } @@ -148,8 +151,8 @@ public class SiteConfigApi extends AbstractXnatRestApi { return new ResponseEntity<>(status); } - if (_log.isDebugEnabled()) { - _log.debug("User {} is setting the value of the site configuration property {} to: {}", getSessionUser().getUsername(), property, value); + if (_log.isInfoEnabled()) { + _log.info("User {} is setting the value of the site configuration property {} to: {}", getSessionUser().getUsername(), property, value); } try { diff --git a/src/main/java/org/nrg/xnat/configuration/ApplicationConfig.java b/src/main/java/org/nrg/xnat/configuration/ApplicationConfig.java index 74b582bf..bf0ce3f6 100644 --- a/src/main/java/org/nrg/xnat/configuration/ApplicationConfig.java +++ b/src/main/java/org/nrg/xnat/configuration/ApplicationConfig.java @@ -30,7 +30,7 @@ import java.util.List; "org.nrg.prefs.repositories", "org.nrg.xdat.daos", "org.nrg.xdat.services.impl.hibernate", "org.nrg.xft.daos", "org.nrg.xft.event.listeners", "org.nrg.xft.services", "org.nrg.xnat.configuration", "org.nrg.xnat.daos", "org.nrg.xnat.event.listeners", "org.nrg.xnat.helpers.merge", "org.nrg.xnat.initialization.tasks", - "org.nrg.xnat.services.impl.hibernate", "org.nrg.xnat.spawner.repositories"}) + "org.nrg.xnat.services.impl.hibernate", "org.nrg.xnat.spawner.repositories", "org.nrg.automation.daos"}) @Import({FeaturesConfig.class, ReactorConfig.class}) @ImportResource("WEB-INF/conf/mq-context.xml") public class ApplicationConfig { diff --git a/src/main/java/org/nrg/xnat/configuration/ReactorConfig.java b/src/main/java/org/nrg/xnat/configuration/ReactorConfig.java index f1581c29..27138d6c 100755 --- a/src/main/java/org/nrg/xnat/configuration/ReactorConfig.java +++ b/src/main/java/org/nrg/xnat/configuration/ReactorConfig.java @@ -1,6 +1,6 @@ package org.nrg.xnat.configuration; -import org.nrg.xft.event.XftEventService; +import org.nrg.framework.services.NrgEventService; import org.nrg.xft.event.listeners.XftItemEventListener; import org.nrg.xnat.event.conf.EventPackages; import org.springframework.context.annotation.Bean; @@ -17,8 +17,8 @@ import java.util.HashSet; @Configuration public class ReactorConfig { @Bean - public XftEventService xftEventService() { - return new XftEventService(); + public NrgEventService xftEventService() { + return new NrgEventService(); } @Bean diff --git a/src/main/java/org/nrg/xnat/event/entities/ScriptLaunchRequestEvent.java b/src/main/java/org/nrg/xnat/event/entities/ScriptLaunchRequestEvent.java index ecaae576..ff474487 100644 --- a/src/main/java/org/nrg/xnat/event/entities/ScriptLaunchRequestEvent.java +++ b/src/main/java/org/nrg/xnat/event/entities/ScriptLaunchRequestEvent.java @@ -6,11 +6,11 @@ import javax.persistence.Entity; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.Transient; -import org.nrg.xft.event.AutomationEventImplementerI; -import org.nrg.xft.event.EventClass; -import org.nrg.xft.event.entities.AutomationCompletionEvent; -import org.nrg.xft.event.entities.PersistentEvent; -import org.nrg.xft.event.persist.PersistentEventImplementerI; +import org.nrg.automation.event.AutomationEventImplementerI; +import org.nrg.automation.event.entities.AutomationCompletionEvent; +import org.nrg.automation.event.entities.PersistentEvent; +import org.nrg.framework.event.EventClass; +import org.nrg.framework.event.persist.PersistentEventImplementerI; /** * The Class AutomationLaunchRequestEvent. diff --git a/src/main/java/org/nrg/xnat/event/listeners/AutomationCompletionEventListener.java b/src/main/java/org/nrg/xnat/event/listeners/AutomationCompletionEventListener.java index 0741edfd..ceb1ba91 100644 --- a/src/main/java/org/nrg/xnat/event/listeners/AutomationCompletionEventListener.java +++ b/src/main/java/org/nrg/xnat/event/listeners/AutomationCompletionEventListener.java @@ -4,8 +4,9 @@ import com.google.common.collect.Lists; import reactor.bus.Event; import reactor.bus.EventBus; import reactor.fn.Consumer; + +import org.nrg.automation.event.entities.AutomationCompletionEvent; import org.nrg.xdat.XDAT; -import org.nrg.xft.event.entities.AutomationCompletionEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/nrg/xnat/event/listeners/AutomationEventScriptHandler.java b/src/main/java/org/nrg/xnat/event/listeners/AutomationEventScriptHandler.java index ea599485..af07d88f 100644 --- a/src/main/java/org/nrg/xnat/event/listeners/AutomationEventScriptHandler.java +++ b/src/main/java/org/nrg/xnat/event/listeners/AutomationEventScriptHandler.java @@ -7,27 +7,28 @@ import org.hibernate.exception.ConstraintViolationException; import org.nrg.automation.entities.Script; import org.nrg.automation.entities.ScriptOutput; import org.nrg.automation.entities.ScriptOutput.Status; +import org.nrg.automation.event.AutomationEventImplementerI; +import org.nrg.automation.event.entities.AutomationCompletionEvent; +import org.nrg.automation.event.entities.AutomationEventIds; +import org.nrg.automation.event.entities.AutomationFilters; +import org.nrg.automation.event.entities.PersistentEvent; +import org.nrg.automation.services.AutomationEventIdsService; +import org.nrg.automation.services.AutomationFiltersService; +import org.nrg.automation.services.PersistentEventService; import org.nrg.automation.services.ScriptRunnerService; import org.nrg.automation.services.ScriptTriggerService; import org.nrg.automation.services.impl.hibernate.HibernateScriptTriggerService; import org.nrg.framework.constants.Scope; +import org.nrg.framework.event.Filterable; +import org.nrg.framework.event.persist.PersistentEventImplementerI; import org.nrg.framework.exceptions.NrgServiceException; +import org.nrg.framework.services.NrgEventService; +import org.nrg.xdat.XDAT; import org.nrg.xdat.security.helpers.Users; import org.nrg.xdat.security.user.exceptions.UserInitException; import org.nrg.xdat.security.user.exceptions.UserNotFoundException; -import org.nrg.xdat.services.AutomationEventIdsService; -import org.nrg.xdat.services.AutomationFiltersService; -import org.nrg.xdat.services.PersistentEventService; import org.nrg.xdat.turbine.utils.AdminUtils; -import org.nrg.xft.event.AutomationEventImplementerI; import org.nrg.xft.event.EventUtils; -import org.nrg.xft.event.Filterable; -import org.nrg.xft.event.XftEventService; -import org.nrg.xft.event.entities.AutomationCompletionEvent; -import org.nrg.xft.event.entities.AutomationEventIds; -import org.nrg.xft.event.entities.AutomationFilters; -import org.nrg.xft.event.entities.PersistentEvent; -import org.nrg.xft.event.persist.PersistentEventImplementerI; import org.nrg.xft.event.persist.PersistentWorkflowI; import org.nrg.xft.event.persist.PersistentWorkflowUtils; import org.nrg.xft.security.UserI; @@ -75,6 +76,12 @@ public class AutomationEventScriptHandler implements Consumer<Event<AutomationEv @Autowired @Lazy private ScriptRunnerService _service; + + /** + * The _eventService. + */ + @Autowired + private NrgEventService _eventService; /** * The _script trigger service. @@ -322,15 +329,18 @@ public class AutomationEventScriptHandler implements Consumer<Event<AutomationEv logger.error("Script launch exception", e1); } } - if (automationCompletionEvent != null && automationCompletionEvent.getScriptOutputs().size() > 0) { - XftEventService eventService = XftEventService.getService(); - if (eventService != null) { + if (automationCompletionEvent != null) { + if (_eventService != null) { automationCompletionEvent.setEventCompletionTime(System.currentTimeMillis()); - eventService.triggerEvent(automationCompletionEvent); + _eventService.triggerEvent(automationCompletionEvent); List<String> notifyList = automationCompletionEvent.getNotificationList(); if (notifyList != null && !notifyList.isEmpty()) { + final String scriptOut = + (automationCompletionEvent.getScriptOutputs() != null && automationCompletionEvent.getScriptOutputs().size() > 0) ? + scriptOutputToHtmlString(automationCompletionEvent.getScriptOutputs()) : + "<h3>No output was returned from the script run</h3>"; final String EMAIL_SUBJECT = "Automation Results"; - AdminUtils.sendUserHTMLEmail(EMAIL_SUBJECT, scriptOutputToHtmlString(automationCompletionEvent.getScriptOutputs()), false, notifyList.toArray(new String[0])); + AdminUtils.sendUserHTMLEmail(EMAIL_SUBJECT, scriptOut, false, notifyList.toArray(new String[0])); } } } diff --git a/src/main/java/org/nrg/xnat/helpers/prearchive/PrearcDatabase.java b/src/main/java/org/nrg/xnat/helpers/prearchive/PrearcDatabase.java index 3e8b0f91..1b359a7e 100644 --- a/src/main/java/org/nrg/xnat/helpers/prearchive/PrearcDatabase.java +++ b/src/main/java/org/nrg/xnat/helpers/prearchive/PrearcDatabase.java @@ -21,6 +21,8 @@ import org.nrg.config.exceptions.ConfigServiceException; import org.nrg.dicomtools.filters.DicomFilterService; import org.nrg.dicomtools.filters.SeriesImportFilter; import org.nrg.framework.constants.PrearchiveCode; +import org.nrg.framework.exceptions.NrgServiceError; +import org.nrg.framework.exceptions.NrgServiceRuntimeException; import org.nrg.framework.services.SerializerService; import org.nrg.status.ListenerUtils; import org.nrg.status.StatusListenerI; @@ -31,7 +33,6 @@ import org.nrg.xdat.bean.XnatPetsessiondataBean; import org.nrg.xdat.model.XnatImagescandataI; import org.nrg.xdat.model.XnatPetscandataI; import org.nrg.xdat.om.XnatExperimentdata; -import org.nrg.xdat.preferences.InitializerSiteConfiguration; import org.nrg.xdat.preferences.SiteConfigPreferences; import org.nrg.xft.db.PoolDBUtils; import org.nrg.xft.exception.DBPoolException; @@ -42,8 +43,6 @@ import org.nrg.xnat.helpers.prearchive.PrearcUtils.PrearcStatus; import org.nrg.xnat.restlet.XNATApplication; import org.nrg.xnat.restlet.actions.PrearcImporterA.PrearcSession; import org.nrg.xnat.restlet.services.Archiver; -import org.nrg.xnat.turbine.utils.ArcSpecManager; - import org.nrg.xnat.utils.XnatUserProvider; import org.restlet.data.Status; import org.slf4j.Logger; @@ -538,7 +537,7 @@ public final class PrearcDatabase { PrearcDatabase.addSession(sessionData); - PrearcUtils.log(sessionData, new Exception(String.format("Moved from %1s to %2s", proj, destination))); + PrearcUtils.log(sessionData, new Exception(String.format("Moved from %1$s to %2$s", proj, destination))); } catch (SyncFailedException e) { logger.error("Session sync operation failed", e); throw new IllegalStateException(e.getMessage()); @@ -848,21 +847,33 @@ public final class PrearcDatabase { } private static Set<String> getPrearchiveFolderTimestamps() { - Set<String> timestamps = new HashSet<>(); + final Set<String> timestamps = new HashSet<>(); timestamps.add("0"); // there must be at least one element in the list - File baseDir = new File(prearcPath); - File[] dirs = baseDir.listFiles(FileSystemSessionTrawler.hiddenAndDatabaseFileFilter); - for (File dir : dirs) { - timestamps.add(dir.getName()); - String[] prearchives = dir.list(); - timestamps.addAll(Arrays.asList(prearchives)); + final File baseDir = new File(prearcPath); + if (!baseDir.exists()) { + final boolean success = baseDir.mkdirs(); + if (!success) { + throw new NrgServiceRuntimeException(NrgServiceError.Unknown, "Couldn't create the base prearchive folder in " + baseDir.getPath()); + } + // One thing we know: if we had to create this folder, there ain't anything in it. + return timestamps; + } + final File[] dirs = baseDir.listFiles(FileSystemSessionTrawler.hiddenAndDatabaseFileFilter); + if (dirs != null) { + for (final File dir : dirs) { + timestamps.add(dir.getName()); + final String[] prearchives = dir.list(); + if (prearchives != null) { + timestamps.addAll(Arrays.asList(prearchives)); + } + } } return timestamps; } private static void deleteUnusedPrearchiveEntries(Set<String> timestamps) throws Exception { - StringBuilder sb = new StringBuilder(); - for (String timestamp : timestamps) { + final StringBuilder sb = new StringBuilder(); + for (final String timestamp : timestamps) { sb.append("'").append(timestamp.replaceAll("'", "''")).append("'").append(','); } final String usedSessionTimestamps = sb.deleteCharAt(sb.length() - 1).toString(); diff --git a/src/main/java/org/nrg/xnat/initialization/XnatWebAppInitializer.java b/src/main/java/org/nrg/xnat/initialization/XnatWebAppInitializer.java index 20466e40..78901edc 100644 --- a/src/main/java/org/nrg/xnat/initialization/XnatWebAppInitializer.java +++ b/src/main/java/org/nrg/xnat/initialization/XnatWebAppInitializer.java @@ -14,6 +14,7 @@ import org.nrg.xnat.configuration.ApplicationConfig; import org.nrg.xnat.restlet.servlet.XNATRestletServlet; import org.nrg.xnat.restlet.util.UpdateExpirationCookie; import org.nrg.xnat.security.XnatSessionEventPublisher; +import org.nrg.xnat.servlet.ArchiveServlet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; @@ -60,6 +61,7 @@ public class XnatWebAppInitializer extends AbstractAnnotationConfigDispatcherSer addServlet(XDATAjaxServlet.class, 3, "/ajax/*", "/servlet/XDATAjaxServlet", "/servlet/AjaxServlet"); addServlet(AxisServlet.class, 4, "/servlet/AxisServlet", "*.jws", "/services/*"); addServlet(AdminServlet.class, 5, "/servlet/AdminServlet"); + addServlet(ArchiveServlet.class, 6, "/archive/*"); } @Override diff --git a/src/main/java/org/nrg/xnat/restlet/actions/AutomationBasedImporter.java b/src/main/java/org/nrg/xnat/restlet/actions/AutomationBasedImporter.java index b4f92dd0..f6091054 100644 --- a/src/main/java/org/nrg/xnat/restlet/actions/AutomationBasedImporter.java +++ b/src/main/java/org/nrg/xnat/restlet/actions/AutomationBasedImporter.java @@ -46,9 +46,13 @@ import org.nrg.action.ClientException; import org.nrg.action.ServerException; import org.nrg.automation.entities.ScriptOutput; import org.nrg.automation.entities.ScriptOutput.Status; +import org.nrg.automation.event.AutomationEventImplementerI; +import org.nrg.automation.event.entities.AutomationCompletionEvent; import org.nrg.automation.entities.ScriptTrigger; import org.nrg.automation.services.ScriptTriggerService; import org.nrg.framework.constants.Scope; +import org.nrg.framework.event.Filterable; +import org.nrg.framework.services.NrgEventService; import org.nrg.xdat.XDAT; import org.nrg.xdat.om.XnatExperimentdata; import org.nrg.xdat.om.XnatProjectdata; @@ -62,14 +66,10 @@ import org.nrg.xnat.turbine.utils.ArcSpecManager; import java.util.zip.ZipOutputStream; -import org.nrg.xft.event.AutomationEventImplementerI; import org.nrg.xft.event.EventMetaI; import org.nrg.xft.event.EventUtils; import org.nrg.xft.event.EventUtils.CATEGORY; import org.nrg.xft.event.EventUtils.TYPE; -import org.nrg.xft.event.XftEventService; -import org.nrg.xft.event.Filterable; -import org.nrg.xft.event.entities.AutomationCompletionEvent; import org.nrg.xft.event.entities.WorkflowStatusEvent; import org.nrg.xft.event.persist.PersistentWorkflowI; import org.nrg.xft.event.persist.PersistentWorkflowUtils; @@ -102,7 +102,7 @@ public class AutomationBasedImporter extends ImporterHandlerA implements Callabl // results"; /** The Constant TIMEOUT_SECONDS. */ - private static final int TIMEOUT_SECONDS = 900; + private static final int TIMEOUT_SECONDS = 600; /** The logger. */ static Logger logger = Logger.getLogger(AutomationBasedImporter.class); @@ -644,7 +644,7 @@ public class AutomationBasedImporter extends ImporterHandlerA implements Callabl automationCompletionEvent.addNotificationEmailAddr(user.getEmail()); } automationEvent.setAutomationCompletionEvent(automationCompletionEvent); - XftEventService eventService = XftEventService.getService(); + final NrgEventService eventService = XDAT.getContextService().getBean(NrgEventService.class); if (eventService == null) { returnList.add("ERROR: Could retrieve event service"); return; @@ -703,8 +703,10 @@ public class AutomationBasedImporter extends ImporterHandlerA implements Callabl } } } - returnList.add("<br><b>FINISHED PROCESSING"); + } else { + returnList.add("<br><b>No output was returned from the script</b>"); } + returnList.add("<br><b>FINISHED PROCESSING"); } diff --git a/src/main/java/org/nrg/xnat/restlet/projectResource/extensions/ProjectPermissionsFilter.java b/src/main/java/org/nrg/xnat/restlet/projectResource/extensions/ProjectPermissionsFilter.java index ed2d4db2..65e1d848 100644 --- a/src/main/java/org/nrg/xnat/restlet/projectResource/extensions/ProjectPermissionsFilter.java +++ b/src/main/java/org/nrg/xnat/restlet/projectResource/extensions/ProjectPermissionsFilter.java @@ -1,7 +1,5 @@ package org.nrg.xnat.restlet.projectResource.extensions; -import java.util.Hashtable; - import org.nrg.xdat.security.helpers.Groups; import org.nrg.xft.XFTTable; import org.nrg.xnat.restlet.resources.ProjectResource; @@ -10,6 +8,8 @@ import org.nrg.xnat.restlet.resources.SecureResource.FilteredResourceHandlerI; import org.restlet.resource.Representation; import org.restlet.resource.Variant; +import java.util.Hashtable; + @SuppressWarnings("unused") public class ProjectPermissionsFilter implements FilteredResourceHandlerI{ @@ -23,9 +23,9 @@ public class ProjectPermissionsFilter implements FilteredResourceHandlerI{ ProjectResource projResource=(ProjectResource)resource; StringBuilder builder=new StringBuilder(); if(Groups.isMember(resource.user,"ALL_DATA_ADMIN")){ - builder.append(String.format("SELECT DISTINCT element_name FROM xdat_element_access xea JOIN xdat_field_mapping_set xfms ON xea.xdat_element_access_id=xfms.permissions_allow_set_xdat_elem_xdat_element_access_id JOIN xdat_field_mapping xfm ON xfms.xdat_field_mapping_set_id=xfm.xdat_field_mapping_set_xdat_field_mapping_set_id WHERE create_element=1 AND field_value='%1s' and field !=''", projResource.getProjectId())); + builder.append(String.format("SELECT DISTINCT element_name FROM xdat_element_access xea JOIN xdat_field_mapping_set xfms ON xea.xdat_element_access_id=xfms.permissions_allow_set_xdat_elem_xdat_element_access_id JOIN xdat_field_mapping xfm ON xfms.xdat_field_mapping_set_id=xfm.xdat_field_mapping_set_xdat_field_mapping_set_id WHERE create_element=1 AND field_value='%1$s' and field !=''", projResource.getProjectId())); }else{ - builder.append(String.format("SELECT DISTINCT element_name FROM xdat_user_groupID map JOIN xdat_userGroup gp ON map.groupid=gp.id JOIN xdat_element_access xea ON gp.xdat_usergroup_id=xea.xdat_usergroup_xdat_usergroup_id JOIN xdat_field_mapping_set xfms ON xea.xdat_element_access_id=xfms.permissions_allow_set_xdat_elem_xdat_element_access_id JOIN xdat_field_mapping xfm ON xfms.xdat_field_mapping_set_id=xfm.xdat_field_mapping_set_xdat_field_mapping_set_id WHERE map.groups_groupid_xdat_user_xdat_user_id=%1s AND create_element=1 AND field_value='%2s' and field !=''",resource.user.getID(),projResource.getProjectId())); + builder.append(String.format("SELECT DISTINCT element_name FROM xdat_user_groupID map JOIN xdat_userGroup gp ON map.groupid=gp.id JOIN xdat_element_access xea ON gp.xdat_usergroup_id=xea.xdat_usergroup_xdat_usergroup_id JOIN xdat_field_mapping_set xfms ON xea.xdat_element_access_id=xfms.permissions_allow_set_xdat_elem_xdat_element_access_id JOIN xdat_field_mapping xfm ON xfms.xdat_field_mapping_set_id=xfm.xdat_field_mapping_set_xdat_field_mapping_set_id WHERE map.groups_groupid_xdat_user_xdat_user_id=%1$s AND create_element=1 AND field_value='%2$s' and field !=''",resource.user.getID(),projResource.getProjectId())); } return resource.representTable(XFTTable.Execute(builder.toString(), resource.user.getDBName(), resource.userName), resource.overrideVariant(variant), new Hashtable<String,Object>()) ; diff --git a/src/main/java/org/nrg/xnat/restlet/resources/ProjectPipelineListResource.java b/src/main/java/org/nrg/xnat/restlet/resources/ProjectPipelineListResource.java index 648d4e21..08dc5bac 100644 --- a/src/main/java/org/nrg/xnat/restlet/resources/ProjectPipelineListResource.java +++ b/src/main/java/org/nrg/xnat/restlet/resources/ProjectPipelineListResource.java @@ -13,7 +13,6 @@ package org.nrg.xnat.restlet.resources; import org.nrg.pipeline.PipelineRepositoryManager; import org.nrg.xdat.om.ArcProject; -import org.nrg.xdat.om.PipePipelinerepository; import org.nrg.xdat.om.XnatProjectdata; import org.nrg.xdat.security.helpers.Permissions; import org.nrg.xft.XFTTable; @@ -29,21 +28,21 @@ import org.restlet.resource.Variant; public class ProjectPipelineListResource extends SecureResource { XnatProjectdata proj = null; String pID = null; - - - + + + public ProjectPipelineListResource(Context context, Request request, Response response) { super(context, request, response); this.getVariants().add(new Variant(MediaType.APPLICATION_JSON)); this.getVariants().add(new Variant(MediaType.TEXT_XML)); - + pID= (String)getParameter(request,"PROJECT_ID"); if(pID!=null){ proj = XnatProjectdata.getProjectByIDorAlias(pID, user, false); } } - - + + @Override public boolean allowGet() { return true; @@ -53,7 +52,7 @@ public class ProjectPipelineListResource extends SecureResource { public boolean allowDelete() { return true; } - + public void handleDelete() { //Remove the Pipeline identified by the path for the project and the datatype if (proj != null) { @@ -63,85 +62,109 @@ public class ProjectPipelineListResource extends SecureResource { datatype = this.getQueryVariable("datatype"); if (pathToPipeline != null && datatype != null) { pathToPipeline = pathToPipeline.trim(); - datatype = datatype.trim(); - - boolean isUserAuthorized = false; - try { - isUserAuthorized = Permissions.canDelete(user, proj); - } catch (Exception e) { - e.printStackTrace(); - getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, "Encountered exception " + e.getMessage()); - return; - } - + datatype=datatype.trim(); + boolean isUserAuthorized = isUserAuthorized(); if (isUserAuthorized) { try { ArcProject arcProject = ArcSpecManager.GetFreshInstance().getProjectArc(proj.getId()); boolean success = PipelineRepositoryManager.GetInstance().delete(arcProject, pathToPipeline, datatype, user); if (!success) { getLogger().log(getLogger().getLevel(), "Couldnt delete the pipeline " + pathToPipeline + " for the project " + proj.getId()); - getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, " Couldn't successfully save Project Specification"); + getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, " Couldnt succesfully save Project Specification" ); return; - } else { + }else { ArcSpecManager.Reset(); - returnDefaultRepresentation(); + getResponse().setEntity(getRepresentation(getVariants().get(0))); + Representation selectedRepresentation = getResponse().getEntity(); + if (getRequest().getConditions().hasSome()) { + final Status status = getRequest().getConditions() + .getStatus(getRequest().getMethod(), + selectedRepresentation); + + if (status != null) { + getResponse().setStatus(status); + getResponse().setEntity(null); + } + } //Send a 200 OK message back //getResponse().setStatus(Status.SUCCESS_OK,"Pipeline has been removed from project " + _project.getId()); } - } catch (Exception e) { + }catch(Exception e) { e.printStackTrace(); getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, "Encountered exception " + e.getMessage()); } - } else { - getResponse().setStatus(Status.CLIENT_ERROR_FORBIDDEN, "User unauthorized to remove pipeline from project"); + }else { + getResponse().setStatus(Status.CLIENT_ERROR_FORBIDDEN, "User unauthroized to remove pipeline from project"); } - } else { - getResponse().setStatus(Status.CLIENT_ERROR_EXPECTATION_FAILED, "Expecting path and datatype as query parameters"); } + }else { + getResponse().setStatus(Status.CLIENT_ERROR_EXPECTATION_FAILED, "Expecting path and datatype as query parameters"); } } - - @Override - public Representation getRepresentation(Variant variant) { - boolean isUserAuthorized; + + + + + private boolean isUserAuthorized() { + boolean isUserAuthorized = false; try { - isUserAuthorized = Permissions.canRead(user, proj); - } catch (Exception e) { + isUserAuthorized = Permissions.canDelete(user,proj); + }catch(Exception e) { e.printStackTrace(); - getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, "Encountered exception " + e.getMessage()); - return null; + getResponse().setStatus(Status.SERVER_ERROR_INTERNAL); } + return isUserAuthorized; + } + + @Override + public Representation getRepresentation(Variant variant) { + //Document xmldoc = null; + boolean isUserAuthorized = isUserAuthorized(); + ArcProject arcProject = ArcSpecManager.GetFreshInstance().getProjectArc(proj.getId()); + String comment = "existing"; if (isUserAuthorized) { - ArcProject arcProject = ArcSpecManager.GetFreshInstance().getProjectArc(proj.getId()); - boolean additional = this.isQueryVariableTrue("additional"); + boolean additional=this.isQueryVariableTrue("additional"); //Check to see if the Project already has an entry in the ArcSpec. //If yes, then return that entry. If not then construct a new ArcProject element and insert an attribute to say that it's an already existing //entry or not try { - if (additional) { - PipePipelinerepository repository = PipelineRepositoryManager.GetInstance(); - arcProject = arcProject == null ? repository.createNewArcProject(proj) : repository.getAdditionalPipelines(proj); - } else { - getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, "No archive spec entry for project " + proj.getId()); + if (arcProject == null) { // No Project pipelines set in the archive specification + if (additional) { + arcProject = PipelineRepositoryManager.GetInstance().createNewArcProject(proj); + comment = "new"; + }else { + getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, "No archive spec entry for project " + proj.getId()); + } + }else { + if (additional) { //Return all the pipelines that are applicable to the project but not selected + arcProject = PipelineRepositoryManager.GetInstance().getAdditionalPipelines(proj); + comment = "additional"; + }else { + //XFTItem hack = arcProject.getCurrentDBVersion(true); + //arcProject.setItem(hack); + } } - } catch(Exception e) { + //xmldoc = arcProject.toXML(); + //Comment commentNode = xmldoc.createComment(comment); + //xmldoc.appendChild(commentNode); + }catch(Exception e) { e.printStackTrace(); getResponse().setStatus(Status.SERVER_ERROR_INTERNAL); } MediaType mt = overrideVariant(variant); if (mt.equals(MediaType.TEXT_XML)) { - return representItem(arcProject.getItem(), mt, null, false, true); - } else if (mt.equals(MediaType.APPLICATION_JSON)) { + return representItem(arcProject.getItem(), mt, null,false, true); + }else if (mt.equals(MediaType.APPLICATION_JSON)) { XFTTable table = PipelineRepositoryManager.GetInstance().toTable(arcProject); return representTable(table, mt,null); - } else { + }else { return null; } - } else { + }else { getResponse().setStatus(Status.CLIENT_ERROR_FORBIDDEN); } return null; } -} +} \ No newline at end of file diff --git a/src/main/java/org/nrg/xnat/restlet/resources/ScriptTriggerResource.java b/src/main/java/org/nrg/xnat/restlet/resources/ScriptTriggerResource.java index 16cde120..7a511d8d 100644 --- a/src/main/java/org/nrg/xnat/restlet/resources/ScriptTriggerResource.java +++ b/src/main/java/org/nrg/xnat/restlet/resources/ScriptTriggerResource.java @@ -86,17 +86,17 @@ public class ScriptTriggerResource extends AutomationResource { } } + final Method method = request.getMethod(); + if (StringUtils.isNotBlank(projectId)) { validateProjectAccess(projectId); setProjectId(projectId); - } else if (!Roles.isSiteAdmin(user)) { + } else if (!Roles.isSiteAdmin(user) && !method.equals(Method.GET)) { final String message = "User " + user.getLogin() + " attempted to access forbidden script trigger resource at the site level."; _log.warn(message); throw new ResourceException(Status.CLIENT_ERROR_FORBIDDEN, message); } - final Method method = request.getMethod(); - // You can't delete a trigger that you can't find. if (method.equals(Method.DELETE) && _trigger == null) { if (hasEvent) { diff --git a/src/main/java/org/nrg/xnat/restlet/resources/files/DIRResource.java b/src/main/java/org/nrg/xnat/restlet/resources/files/DIRResource.java index a3608199..f93495f5 100644 --- a/src/main/java/org/nrg/xnat/restlet/resources/files/DIRResource.java +++ b/src/main/java/org/nrg/xnat/restlet/resources/files/DIRResource.java @@ -210,7 +210,7 @@ public class DIRResource extends SecureResource { final String rel=(session_dir.toURI().relativize(f.toURI())).getPath(); final String qs=(f.isDirectory())?qsParams:""; - row[3]=String.format("/data/experiments/%1s/DIR/%2s%3s", new Object[]{expt.getId(),rel,qs}); + row[3]=String.format("/data/experiments/%1$s/DIR/%2$s%3$s",expt.getId(),rel,qs); table.rows().add(row); } diff --git a/src/main/java/org/nrg/xnat/security/XnatExpiredPasswordFilter.java b/src/main/java/org/nrg/xnat/security/XnatExpiredPasswordFilter.java index 94b242ea..86f24801 100644 --- a/src/main/java/org/nrg/xnat/security/XnatExpiredPasswordFilter.java +++ b/src/main/java/org/nrg/xnat/security/XnatExpiredPasswordFilter.java @@ -24,10 +24,7 @@ import org.nrg.xdat.services.XdatUserAuthService; import org.nrg.xdat.turbine.utils.TurbineUtils; import org.nrg.xft.security.UserI; import org.nrg.xnat.turbine.utils.ArcSpecManager; -import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; import org.springframework.context.annotation.Lazy; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; @@ -52,7 +49,7 @@ import java.util.Date; import java.util.List; @SuppressWarnings({"SqlDialectInspection", "SqlNoDataSourceInspection"}) -public class XnatExpiredPasswordFilter extends GenericFilterBean implements ApplicationContextAware { +public class XnatExpiredPasswordFilter extends GenericFilterBean { private String changePasswordPath = ""; private String changePasswordDestination = ""; private String logoutDestination = ""; @@ -257,14 +254,6 @@ public class XnatExpiredPasswordFilter extends GenericFilterBean implements Appl this.passwordExpirationDirtied = passwordExpirationDirtied; } - /** - * {@inheritDoc} - */ - @Override - public void setApplicationContext(final ApplicationContext context) throws BeansException { - _context = context; - } - private boolean checkForExpiredPassword(final UserI user) { return checkForExpiredPassword(user.getUsername()); } @@ -359,6 +348,5 @@ public class XnatExpiredPasswordFilter extends GenericFilterBean implements Appl @Inject private DataSource _dataSource; - private ApplicationContext _context; private AliasTokenService _aliasTokenService; } diff --git a/src/main/java/org/nrg/xnat/services/XnatAppInfo.java b/src/main/java/org/nrg/xnat/services/XnatAppInfo.java index 2b6326ca..e6f2fd79 100644 --- a/src/main/java/org/nrg/xnat/services/XnatAppInfo.java +++ b/src/main/java/org/nrg/xnat/services/XnatAppInfo.java @@ -84,7 +84,7 @@ public class XnatAppInfo { * @return The primary system properties. */ public Properties getSystemProperties() { - return new Properties(_properties); + return (Properties)_properties.clone(); } /** diff --git a/src/main/java/org/nrg/xnat/turbine/modules/actions/AddProject.java b/src/main/java/org/nrg/xnat/turbine/modules/actions/AddProject.java index 4bf7e853..6dc72acc 100755 --- a/src/main/java/org/nrg/xnat/turbine/modules/actions/AddProject.java +++ b/src/main/java/org/nrg/xnat/turbine/modules/actions/AddProject.java @@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.turbine.modules.ScreenLoader; import org.apache.turbine.util.RunData; import org.apache.velocity.context.Context; +import org.nrg.framework.services.NrgEventService; import org.nrg.xdat.XDAT; import org.nrg.xdat.om.ArcProject; import org.nrg.xdat.om.XnatProjectdata; @@ -31,7 +32,6 @@ import org.nrg.xft.XFTItem; import org.nrg.xft.db.PoolDBUtils; import org.nrg.xft.event.EventMetaI; import org.nrg.xft.event.EventUtils; -import org.nrg.xft.event.XftEventService; import org.nrg.xft.event.XftItemEvent; import org.nrg.xft.event.persist.PersistentWorkflowI; import org.nrg.xft.event.persist.PersistentWorkflowUtils; @@ -167,7 +167,8 @@ public class AddProject extends SecureAction { WorkflowUtils.complete(wrk, c); UserHelper.setUserHelper(data.getRequest(),user); - XftEventService.getService().triggerEvent(new XftItemEvent(XnatProjectdata.SCHEMA_ELEMENT_NAME, postSave.getId(), XftItemEvent.UPDATE)); + final NrgEventService eventService = XDAT.getContextService().getBean(NrgEventService.class); + eventService.triggerEvent(new XftItemEvent(XnatProjectdata.SCHEMA_ELEMENT_NAME, postSave.getId(), XftItemEvent.UPDATE)); } catch (Exception e) { WorkflowUtils.fail(wrk, c); throw e; diff --git a/src/main/java/org/nrg/xnat/turbine/modules/actions/DownloadSessionsAction2.java b/src/main/java/org/nrg/xnat/turbine/modules/actions/DownloadSessionsAction2.java index 18190b74..5beb22d7 100644 --- a/src/main/java/org/nrg/xnat/turbine/modules/actions/DownloadSessionsAction2.java +++ b/src/main/java/org/nrg/xnat/turbine/modules/actions/DownloadSessionsAction2.java @@ -13,12 +13,14 @@ package org.nrg.xnat.turbine.modules.actions; import org.apache.commons.lang3.StringUtils; import org.apache.turbine.util.RunData; import org.apache.velocity.context.Context; +import org.nrg.xdat.XDAT; import org.nrg.xdat.bean.CatCatalogBean; import org.nrg.xdat.bean.CatEntryBean; +import org.nrg.xdat.security.helpers.Users; import org.nrg.xdat.turbine.modules.actions.SecureAction; import org.nrg.xdat.turbine.utils.TurbineUtils; import org.nrg.xft.XFTTable; -import org.nrg.xnat.utils.UserUtils; +import org.nrg.xft.security.UserI; import java.io.File; import java.io.FileWriter; @@ -66,9 +68,10 @@ public class DownloadSessionsAction2 extends SecureAction { server +="/"; } - List<String> l=new ArrayList<String>(); + List<String> l= new ArrayList<>(); CatCatalogBean cat = new CatCatalogBean(); - + + final UserI userDetails = XDAT.getUserDetails(); for(String session : session_ids){ CatCatalogBean sessionCatalog = new CatCatalogBean(); sessionCatalog.setId(session); @@ -76,7 +79,7 @@ public class DownloadSessionsAction2 extends SecureAction { // narrow down the range of scan types to only the ones relevant to this session if (requestScanTypes != null && requestScanTypes.length > 0) { String query = "SELECT id FROM xnat_imagescandata WHERE image_session_id = '" + session + "' AND " + getTypeClause(requestScanTypes); - XFTTable table = XFTTable.Execute(query, TurbineUtils.getUser(data).getDBName(), TurbineUtils.getUser(data).getLogin()); + XFTTable table = XFTTable.Execute(query, userDetails.getDBName(), userDetails.getLogin()); List<String> sessionScans = table.convertColumnToArrayList("id"); if (sessionScans != null && sessionScans.size() > 0) { CatCatalogBean scansCatalog = new CatCatalogBean(); @@ -150,7 +153,7 @@ public class DownloadSessionsAction2 extends SecureAction { } String id = Calendar.getInstance().getTimeInMillis() + ""; - File f = org.nrg.xdat.security.helpers.Users.getUserCacheFile(TurbineUtils.getUser(data),"catalogs/" + id + ".xml"); + File f = Users.getUserCacheFile(userDetails, "catalogs", id + ".xml"); boolean mkdirs = f.getParentFile().mkdirs(); diff --git a/src/main/java/org/nrg/xnat/turbine/modules/actions/ModifyProject.java b/src/main/java/org/nrg/xnat/turbine/modules/actions/ModifyProject.java index d4f03a9e..b33fd567 100755 --- a/src/main/java/org/nrg/xnat/turbine/modules/actions/ModifyProject.java +++ b/src/main/java/org/nrg/xnat/turbine/modules/actions/ModifyProject.java @@ -12,6 +12,8 @@ package org.nrg.xnat.turbine.modules.actions; import org.apache.turbine.util.RunData; import org.apache.velocity.context.Context; +import org.nrg.framework.services.NrgEventService; +import org.nrg.xdat.XDAT; import org.nrg.xdat.model.XnatInvestigatordataI; import org.nrg.xdat.model.XnatProjectdataAliasI; import org.nrg.xdat.om.XnatProjectdata; @@ -27,7 +29,6 @@ import org.nrg.xft.XFTItem; import org.nrg.xft.db.PoolDBUtils; import org.nrg.xft.event.XftItemEvent; import org.nrg.xft.event.EventMetaI; -import org.nrg.xft.event.XftEventService; import org.nrg.xft.event.EventUtils; import org.nrg.xft.event.persist.PersistentWorkflowI; import org.nrg.xft.event.persist.PersistentWorkflowUtils; @@ -130,7 +131,8 @@ public class ModifyProject extends SecureAction { WorkflowUtils.complete(wrk, c); Users.clearCache(user); - XftEventService.getService().triggerEvent(new XftItemEvent(XnatProjectdata.SCHEMA_ELEMENT_NAME, postSave.getId(), XftItemEvent.UPDATE)); + final NrgEventService eventService = XDAT.getContextService().getBean(NrgEventService.class); + eventService.triggerEvent(new XftItemEvent(XnatProjectdata.SCHEMA_ELEMENT_NAME, postSave.getId(), XftItemEvent.UPDATE)); } catch (SecurityException e) { logger.error("Security exception triggered by user '" + user.getLogin() + "': " + e.getMessage(), e); handleException(data, project.getItem(), e, TurbineUtils.EDIT_ITEM); diff --git a/src/main/java/org/nrg/xnat/turbine/modules/screens/Login.java b/src/main/java/org/nrg/xnat/turbine/modules/screens/Login.java index 3a6ad2c4..d4f3f543 100644 --- a/src/main/java/org/nrg/xnat/turbine/modules/screens/Login.java +++ b/src/main/java/org/nrg/xnat/turbine/modules/screens/Login.java @@ -17,7 +17,7 @@ import org.nrg.xdat.XDAT; import org.nrg.xdat.services.ThemeService; public class Login extends org.nrg.xdat.turbine.modules.screens.Login { - public final static Logger logger = Logger.getLogger(XDATScreen_themes.class); + public final static Logger logger = Logger.getLogger(Login.class); @Override protected void doBuildTemplate(RunData data, Context c) throws Exception { ThemeService themeService = XDAT.getThemeService(); diff --git a/src/main/java/org/nrg/xnat/turbine/utils/ArcSpecManager.java b/src/main/java/org/nrg/xnat/turbine/utils/ArcSpecManager.java index 77aa4293..35fffe55 100644 --- a/src/main/java/org/nrg/xnat/turbine/utils/ArcSpecManager.java +++ b/src/main/java/org/nrg/xnat/turbine/utils/ArcSpecManager.java @@ -57,130 +57,6 @@ public class ArcSpecManager { logger.info("Initializing ArcSpec..."); arcSpec = GetFreshInstance(); -// if (arcSpec!=null){ -// -// if (arcSpec.getSiteAdminEmail()!=null && !arcSpec.getSiteAdminEmail().equals("")){ -// XFT.SetAdminEmail(arcSpec.getSiteAdminEmail()); -// }else{ -// arcSpec.setSiteAdminEmail(XDAT.getSiteConfigPreferences().getAdminEmail()); -// } -// -// if (arcSpec.getSiteUrl()!=null && !arcSpec.getSiteUrl().equals("")){ -// XFT.SetSiteURL(arcSpec.getSiteUrl()); -// }else{ -// arcSpec.setSiteUrl(XDAT.getSiteConfigPreferences().getSiteUrl()); -// } -// -// if (arcSpec.getSiteId()!=null && !arcSpec.getSiteId().equals("")){ -// XFT.SetSiteID(arcSpec.getSiteId()); -// }else{ -// arcSpec.setSiteId(""); -// } -// -// if (arcSpec.getSmtpHost()!=null && !arcSpec.getSmtpHost().equals("")){ -// XFT.SetAdminEmailHost(arcSpec.getSmtpHost()); -// }else{ -// arcSpec.setSmtpHost(XFT.GetAdminEmailHost()); -// } -// -// if (arcSpec.getEnableNewRegistrations()!=null){ -// XFT.SetUserRegistration(arcSpec.getEnableNewRegistrations().toString()); -// }else{ -// arcSpec.setEnableNewRegistrations(XDAT.getSiteConfigPreferences().getUserRegistration()); -// } -// -// if (arcSpec.getRequireLogin()!=null){ -// XFT.SetRequireLogin(arcSpec.getRequireLogin().toString()); -// }else{ -// arcSpec.setRequireLogin(XDAT.getSiteConfigPreferences().getRequireLogin()); -// } -// -// if (arcSpec.getGlobalpaths()!=null && arcSpec.getGlobalpaths().getPipelinepath()!=null){ -// XFT.SetPipelinePath(arcSpec.getGlobalpaths().getPipelinepath()); -// }else{ -// if (arcSpec.getGlobalpaths()!=null){ -// arcSpec.getGlobalpaths().setPipelinepath(XDAT.getSiteConfigPreferences().getAdminEmail()); -// } -// } -// -// if (arcSpec.getGlobalpaths()!=null && arcSpec.getGlobalpaths().getArchivepath()!=null){ -// XFT.SetArchiveRootPath(arcSpec.getGlobalpaths().getArchivepath()); -// }else{ -// if (arcSpec.getGlobalpaths()!=null && XFT.GetArchiveRootPath()!=null){ -// arcSpec.getGlobalpaths().setArchivepath(XFT.GetArchiveRootPath()); -// } -// } -// -// if (arcSpec.getGlobalpaths()!=null && arcSpec.getGlobalpaths().getCachepath()!=null){ -// XFT.SetCachePath(arcSpec.getGlobalpaths().getCachepath()); -// }else{ -// if (arcSpec.getGlobalpaths()!=null && XDAT.getSiteConfigPreferences().getCachePath()!=null){ -// arcSpec.getGlobalpaths().setCachepath(XDAT.getSiteConfigPreferences().getCachePath()); -// } -// } -// -// if (arcSpec.getGlobalpaths()!=null && arcSpec.getGlobalpaths().getFtppath()!=null){ -// XFT.setFtpPath(arcSpec.getGlobalpaths().getFtppath()); -// }else{ -// if (arcSpec.getGlobalpaths()!=null && XFT.getFtpPath()!=null){ -// arcSpec.getGlobalpaths().setFtppath(XFT.getFtpPath()); -// } -// } -// -// if (arcSpec.getGlobalpaths()!=null && arcSpec.getGlobalpaths().getBuildpath()!=null){ -// XFT.setFtpPath(arcSpec.getGlobalpaths().getBuildpath()); -// }else{ -// if (arcSpec.getGlobalpaths()!=null && XFT.getBuildPath()!=null){ -// arcSpec.getGlobalpaths().setBuildpath(XFT.getBuildPath()); -// } -// } -// -// if (arcSpec.getGlobalpaths()!=null && arcSpec.getGlobalpaths().getPrearchivepath()!=null){ -// XFT.SetPrearchivePath(arcSpec.getGlobalpaths().getPrearchivepath()); -// }else{ -// if (arcSpec.getGlobalpaths()!=null && XFT.GetPrearchivePath()!=null){ -// arcSpec.getGlobalpaths().setPrearchivepath(XFT.GetPrearchivePath()); -// } -// } -// -// -// //set email defaults -// if (arcSpec.getEmailspecifications_newUserRegistration()==null){ -// arcSpec.setEmailspecifications_newUserRegistration(true); -// } -// if (arcSpec.getEmailspecifications_pageEmail()==null){ -// arcSpec.setEmailspecifications_pageEmail(true); -// } -// if (arcSpec.getEmailspecifications_pipeline()==null){ -// arcSpec.setEmailspecifications_pipeline(true); -// } -// if (arcSpec.getEmailspecifications_projectAccess()==null){ -// arcSpec.setEmailspecifications_projectAccess(true); -// } -// if (arcSpec.getEmailspecifications_transfer()==null){ -// arcSpec.setEmailspecifications_transfer(true); -// } -// //end email defaults -// -// if (arcSpec.getEmailspecifications_newUserRegistration()!=null){ -// AdminUtils.SetNewUserRegistrationsEmail(arcSpec.getEmailspecifications_newUserRegistration()); -// } -// -// if (arcSpec.getEmailspecifications_pageEmail()!=null){ -// AdminUtils.SetPageEmail(arcSpec.getEmailspecifications_pageEmail()); -// } -// -// if (arcSpec.getDcm_appletLink()==null){ -// arcSpec.setDcm_appletLink(Boolean.TRUE); -// } -// -// if (arcSpec.getEnableCsrfToken()!=null){ -// XFT.SetEnableCsrfToken(arcSpec.getEnableCsrfToken().toString()); -// }else{ -// arcSpec.setEnableCsrfToken(XDAT.getSiteConfigPreferences().getEnableCsrfToken()); -// } -// } - try { if (arcSpec!=null){ String cachePath = arcSpec.getGlobalCachePath(); @@ -220,56 +96,103 @@ public class ArcSpecManager { arcSpec = new ArcArchivespecification(user); final SiteConfigPreferences preferences = XDAT.getSiteConfigPreferences(); if (StringUtils.isNotBlank(preferences.getAdminEmail())) { + if (logger.isInfoEnabled()) { + logger.info("Setting site admin email to: {}", preferences.getAdminEmail()); + } arcSpec.setSiteAdminEmail(preferences.getAdminEmail()); } if (StringUtils.isNotBlank(preferences.getSiteId())) { + if (logger.isInfoEnabled()) { + logger.info("Setting site ID to: {}", preferences.getSiteId()); + } arcSpec.setSiteId(preferences.getSiteId()); } if (StringUtils.isNotBlank(preferences.getSiteUrl())) { + if (logger.isInfoEnabled()) { + logger.info("Setting site URL to: {}", preferences.getSiteUrl()); + } arcSpec.setSiteUrl(preferences.getSiteUrl()); } final Map<String, String> smtpServer = preferences.getSmtpServer(); if (smtpServer != null && smtpServer.containsKey("host")) { + if (logger.isInfoEnabled()) { + logger.info("Setting SMTP host to: {}", smtpServer.get("host")); + } arcSpec.setSmtpHost(smtpServer.get("host")); } + if (logger.isInfoEnabled()) { + logger.info("Setting enable new registrations to: {}", preferences.getUserRegistration()); + } arcSpec.setEnableNewRegistrations(preferences.getUserRegistration()); + if (logger.isInfoEnabled()) { + logger.info("Setting reguire login to: {}", preferences.getRequireLogin()); + } arcSpec.setRequireLogin(preferences.getRequireLogin()); if (StringUtils.isNotBlank(preferences.getPipelinePath())) { + if (logger.isInfoEnabled()) { + logger.info("Setting pipeline path to: {}", preferences.getPipelinePath()); + } arcSpec.setProperty("globalPaths/pipelinePath", preferences.getPipelinePath()); } if (StringUtils.isNotBlank(preferences.getArchivePath())) { + if (logger.isInfoEnabled()) { + logger.info("Setting archive path to: {}", preferences.getArchivePath()); + } arcSpec.setProperty("globalPaths/archivePath", preferences.getArchivePath()); } if (StringUtils.isNotBlank(preferences.getPrearchivePath())) { + if (logger.isInfoEnabled()) { + logger.info("Setting prearchive path to: {}", preferences.getPrearchivePath()); + } arcSpec.setProperty("globalPaths/prearchivePath", preferences.getPrearchivePath()); } if (StringUtils.isNotBlank(preferences.getCachePath())) { + if (logger.isInfoEnabled()) { + logger.info("Setting cache path to: {}", preferences.getCachePath()); + } arcSpec.setProperty("globalPaths/cachePath", preferences.getCachePath()); } if (StringUtils.isNotBlank(preferences.getFtpPath())) { + if (logger.isInfoEnabled()) { + logger.info("Setting FTP path to: {}", preferences.getFtpPath()); + } arcSpec.setProperty("globalPaths/ftpPath", preferences.getFtpPath()); } if (StringUtils.isNotBlank(preferences.getBuildPath())) { + if (logger.isInfoEnabled()) { + logger.info("Setting build path to: {}", preferences.getBuildPath()); + } arcSpec.setProperty("globalPaths/buildPath", preferences.getBuildPath()); } + if (logger.isInfoEnabled()) { + logger.info("Setting enable CSRF token to: {}", preferences.getEnableCsrfToken()); + } arcSpec.setEnableCsrfToken(preferences.getEnableCsrfToken()); + if (logger.isInfoEnabled()) { + // logger.info("Saving arcspec: {}", displayArcSpec(arcSpec)); + logger.info("Saving arcspec"); + } save(arcSpec, user, EventUtils.newEventInstance(EventUtils.CATEGORY.SIDE_ADMIN, EventUtils.TYPE.PROCESS, "Initialized archive specifications.")); return arcSpec; } +// private static String displayArcSpec(final ArcArchivespecification arcSpec) { +// return "TBD."; +// } + public static boolean allowTransferEmail(){ return GetInstance().getEmailspecifications_transfer(); } diff --git a/src/main/resources/META-INF/xnat/entities/xnat-entity-packages.txt b/src/main/resources/META-INF/xnat/entities/xnat-entity-packages.txt index 91c8dacd..8c57423a 100644 --- a/src/main/resources/META-INF/xnat/entities/xnat-entity-packages.txt +++ b/src/main/resources/META-INF/xnat/entities/xnat-entity-packages.txt @@ -7,6 +7,8 @@ org.nrg.prefs.entities org.nrg.xdat.entities org.nrg.xft.entities org.nrg.xft.event.entities +org.nrg.automation.event.entities +org.nrg.framework.event.entities org.nrg.xnat.entities org.nrg.xnat.event.entities -org.nrg.xnat.spawner.entities +org.nrg.xnat.spawner.entities \ No newline at end of file diff --git a/src/main/resources/META-INF/xnat/init_security_000.sql b/src/main/resources/META-INF/xnat/init_security_000.sql index 73f40c71..9b435299 100644 --- a/src/main/resources/META-INF/xnat/init_security_000.sql +++ b/src/main/resources/META-INF/xnat/init_security_000.sql @@ -1098,8 +1098,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:55.993',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,36) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,36,'xnat:mrSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',36,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:55.998',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,37) INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,secureaccess,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('sometimes','XDATScreen_upload_scans_xnat_imageSessionData','Upload','edit','Up.gif',4,37,'xnat:mrSessionData',37,'Upload Scans') @@ -1178,8 +1176,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.142',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,50) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,50,'xnat:ctSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',50,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.149',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,51) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,51,'xnat:ctSessionData',51,'Download XML') @@ -1218,8 +1214,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.203',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,57) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,57,'xnat:usSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',57,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.208',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,58) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,58,'xnat:usSessionData',58,'Download XML') @@ -1258,8 +1252,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.249',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,64) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,64,'xnat:crSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',64,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.253',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,65) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,65,'xnat:crSessionData',65,'Download XML') @@ -1298,8 +1290,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.299',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,71) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,71,'xnat:epsSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',71,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.304',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,72) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,72,'xnat:epsSessionData',72,'Download XML') @@ -1338,8 +1328,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.360',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,78) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,78,'xnat:hdSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',78,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.365',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,79) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,79,'xnat:hdSessionData',79,'Download XML') @@ -1378,8 +1366,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.425',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,85) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,85,'xnat:ecgSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',85,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.430',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,86) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,86,'xnat:ecgSessionData',86,'Download XML') @@ -1418,8 +1404,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.482',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,92) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,92,'xnat:ioSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',92,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.486',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,93) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,93,'xnat:ioSessionData',93,'Download XML') @@ -1458,8 +1442,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.539',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,99) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,99,'xnat:mgSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',99,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.545',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,100) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,100,'xnat:mgSessionData',100,'Download XML') @@ -1498,8 +1480,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.592',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,106) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,106,'xnat:dxSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',106,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.596',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,107) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,107,'xnat:dxSessionData',107,'Download XML') @@ -1538,8 +1518,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.644',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,113) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,113,'xnat:nmSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',113,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.648',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,114) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,114,'xnat:nmSessionData',114,'Download XML') @@ -1578,8 +1556,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.704',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,120) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,120,'xnat:srSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',120,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.710',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,121) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,121,'xnat:srSessionData',121,'Download XML') @@ -1618,8 +1594,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.767',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,127) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,127,'xnat:gmvSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',127,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.771',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,128) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,128,'xnat:gmvSessionData',128,'Download XML') @@ -1658,8 +1632,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.821',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,134) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,134,'xnat:gmSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',134,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.825',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,135) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,135,'xnat:gmSessionData',135,'Download XML') @@ -1698,8 +1670,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.873',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,141) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,141,'xnat:esvSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',141,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.879',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,142) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,142,'xnat:esvSessionData',142,'Download XML') @@ -1738,8 +1708,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.936',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,148) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,148,'xnat:esSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',148,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.940',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,149) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,149,'xnat:esSessionData',149,'Download XML') @@ -1778,8 +1746,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:56.996',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,155) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,155,'xnat:dx3DCraniofacialSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',155,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.004',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,156) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,156,'xnat:dx3DCraniofacialSessionData',156,'Download XML') @@ -1818,8 +1784,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.061',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,162) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,162,'xnat:xa3DSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',162,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.066',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,163) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,163,'xnat:xa3DSessionData',163,'Download XML') @@ -1858,8 +1822,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.122',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,169) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,169,'xnat:rfSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',169,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.127',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,170) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,170,'xnat:rfSessionData',170,'Download XML') @@ -1898,8 +1860,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.188',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,176) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,176,'xnat:xaSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',176,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.195',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,177) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,177,'xnat:xaSessionData',177,'Download XML') @@ -1938,8 +1898,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.268',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,183) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,183,'xnat:smSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',183,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.276',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,184) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,184,'xnat:smSessionData',184,'Download XML') @@ -1978,8 +1936,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.334',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,190) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,190,'xnat:xcSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',190,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.340',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,191) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,191,'xnat:xcSessionData',191,'Download XML') @@ -2018,8 +1974,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.406',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,197) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,197,'xnat:xcvSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',197,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.412',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,198) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,198,'xnat:xcvSessionData',198,'Download XML') @@ -2058,8 +2012,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.475',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,204) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,204,'xnat:opSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',204,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.481',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,205) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,205,'xnat:opSessionData',205,'Download XML') @@ -2098,8 +2050,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.546',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,211) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,211,'xnat:optSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',211,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.552',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,212) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,212,'xnat:optSessionData',212,'Download XML') @@ -2138,8 +2088,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.610',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,218) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,218,'xnat:rtSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',218,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.617',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,219) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,219,'xnat:rtSessionData',219,'Download XML') @@ -2178,8 +2126,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.676',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,225) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,225,'xnat:megSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',225,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.683',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,226) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,226,'xnat:megSessionData',226,'Download XML') @@ -2218,8 +2164,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.732',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,232) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,232,'xnat:eegSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',232,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.740',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,233) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,233,'xnat:eegSessionData',233,'Download XML') @@ -2258,8 +2202,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.797',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,239) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,239,'xnat:otherDicomSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',239,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.802',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,240) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,240,'xnat:otherDicomSessionData',240,'Download XML') @@ -2298,8 +2240,6 @@ INSERT INTO xdat_element_action_type (popup,element_action_name,secureaccess,ima INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.851',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,246) -INSERT INTO xdat_element_action_type (popup,element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,parameterstring,xdat_element_action_type_id,display_name) VALUES ('always','Viewer','View','v.gif',3,246,'xnat:petSessionData','/popup_params/width=320,height=420,status=yes,resizable=yes,scrollbars=yes,toolbar=yes',246,'View Images') - INSERT INTO xdat_element_action_type_meta_data (status,activation_date,modified,row_last_modified,insert_date,xft_version,shareable,meta_data_id) VALUES ('active','2013-09-25 18:31:57.856',0,'2013-09-25 18:31:52.129','2013-09-25 18:31:52.129','1',1,247) INSERT INTO xdat_element_action_type (element_action_name,grouping,image,sequence,element_action_type_info,element_actions_element_action__element_name,xdat_element_action_type_id,display_name) VALUES ('xml_file','Download','save.gif',7,247,'xnat:petSessionData',247,'Download XML') diff --git a/src/main/resources/config/features/xnat-feature-definition.properties b/src/main/resources/config/features/xnat-feature-definition.properties index 47eafd96..98989b4d 100644 --- a/src/main/resources/config/features/xnat-feature-definition.properties +++ b/src/main/resources/config/features/xnat-feature-definition.properties @@ -10,13 +10,6 @@ org.nrg.Feature.upload_scans.name=Upload Additional Scans org.nrg.Feature.upload_scans.element_action_name=XDATScreen_upload_scans_xnat_imageSessionData org.nrg.Feature.upload_scans.description=Allows users to use to upload additional scans to an existing image session via 'Upload Scans'. -org.nrg.Feature=classic_viewer -org.nrg.Feature.classic_viewer.key=classic_viewer -org.nrg.Feature.classic_viewer.name=Classic Image Viewer -org.nrg.Feature.classic_viewer.element_action_name=Viewer -org.nrg.Feature.classic_viewer.OnByDefault=true -org.nrg.Feature.classic_viewer.description=Allows users to use to the classic XNAT image viewer (applet). - org.nrg.Feature=tagged_upload org.nrg.Feature.tagged_upload.key=tagged_upload org.nrg.Feature.tagged_upload.name=MR Tagged Upload diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index 283396ac..29280576 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -78,6 +78,9 @@ log4j.additivity.org.nrg.xnat.remote=false log4j.category.org.nrg.xnat.helpers.prearchive=WARN, prearchive log4j.additivity.org.nrg.xnat.helpers.prearchive=false +log4j.category.org.nrg.xapi=INFO, xapi +log4j.additivity.org.nrg.xapi=false + # SETTING AccessLogger Log to INFO will log all site access log4j.category.org.nrg.xdat.turbine.utils.AccessLogger=INFO, access log4j.additivity.org.nrg.xdat.turbine.utils.AccessLogger=false @@ -231,6 +234,16 @@ log4j.appender.xdat.layout=org.apache.log4j.PatternLayout log4j.appender.xdat.layout.conversionPattern=%d [%t] %-5p %c - %m%n log4j.appender.xdat.append=true +# +# XAPI +# +log4j.appender.xapi=org.apache.log4j.DailyRollingFileAppender +log4j.appender.xapi.DatePattern='.'yyy-MM-dd +log4j.appender.xapi.file=${xnat.home}/logs/xapi.log +log4j.appender.xapi.layout=org.apache.log4j.PatternLayout +log4j.appender.xapi.layout.conversionPattern=%d [%t] %-5p %c - %m%n +log4j.appender.xapi.append=true + # # Restlets # diff --git a/src/main/webapp/WEB-INF/tags/page/xnat.tag b/src/main/webapp/WEB-INF/tags/page/xnat.tag index a2c8cbe1..58f74b34 100644 --- a/src/main/webapp/WEB-INF/tags/page/xnat.tag +++ b/src/main/webapp/WEB-INF/tags/page/xnat.tag @@ -285,7 +285,16 @@ ${bodyTop} <ul> <!-- Sequence: 10 --> <!-- Upload/Default --> - <li><a href="${SITE_ROOT}/app/template/LaunchUploadApplet.vm">Images</a></li> + <li><a href="${SITE_ROOT}/app/template/UploadOptions.vm">Images</a> + <ul> + <!-- Sequence: 10 --> + <!-- Images --> + <li><a href="${SITE_ROOT}/app/template/LaunchUploadApplet.vm">Upload Applet</a></li> + <li><a href="${SITE_ROOT}/app/template/UploadAssistantPage.vm">Upload Assistant</a></li> + <li><a href="${SITE_ROOT}/app/template/CompressedUploaderPage.vm">Compressed Uploader</a></li> + <li><a href="${SITE_ROOT}/app/template/DICOMSCPPage.vm">DICOM SCP</a></li> + </ul> + </li> <li><a href="${SITE_ROOT}/app/template/XMLUpload.vm">XML</a></li> <li><a href="${SITE_ROOT}/app/template/XDATScreen_uploadCSV.vm">Spreadsheet</a></li> <li><a href="${SITE_ROOT}/app/template/XDATScreen_prearchives.vm">Go to prearchive</a></li> @@ -336,7 +345,7 @@ ${bodyTop} <!-- Sequence: 10 --> <!-- Home/Default --> <li><a href="${SITE_ROOT}/app/template/ReportIssue.vm">Report a Problem</a></li> - <li><a href="http://wiki.xnat.org/display/XNAT16/Home" target="_blank">Documentation</a></li> + <li><a href="http://wiki.xnat.org" target="_blank">Documentation</a></li> </ul> </li> </ul> @@ -507,7 +516,7 @@ ${bodyTop} li$.find('ul.subnav').each(function(){ var sub$ = $(this); var offsetL = sub$.closest('ul').outerWidth(); - sub$.css({ 'left': offsetL + -25 }) + sub$.css({ 'left': offsetL + -37 }) }); if (body$.hasClass('applet')) { coverApplet(li$.find('> ul')); diff --git a/src/main/webapp/WEB-INF/tags/spawner/layout.tag b/src/main/webapp/WEB-INF/tags/spawner/layout.tag index e4e5e62c..b7875977 100644 --- a/src/main/webapp/WEB-INF/tags/spawner/layout.tag +++ b/src/main/webapp/WEB-INF/tags/spawner/layout.tag @@ -326,7 +326,16 @@ <ul> <!-- Sequence: 10 --> <!-- Upload/Default --> - <li><a href="/app/template/LaunchUploadApplet.vm">Images</a></li> + <li><a href="/app/template/UploadOptions.vm">Images</a> + <ul> + <!-- Sequence: 10 --> + <!-- Images --> + <li><a href="/app/template/LaunchUploadApplet.vm">Upload Applet</a></li> + <li><a href="/app/template/UploadAssistantPage.vm">Upload Assistant</a></li> + <li><a href="/app/template/CompressedUploaderPage.vm">Compressed Uploader</a></li> + <li><a href="/app/template/DICOMSCPPage.vm">DICOM SCP</a></li> + </ul> + </li> <li><a href="/app/template/XMLUpload.vm">XML</a></li> <li><a href="/app/template/XDATScreen_uploadCSV.vm">Spreadsheet</a></li> <li><a href="/app/template/XDATScreen_prearchives.vm">Go to prearchive</a></li> @@ -370,7 +379,7 @@ <!-- Sequence: 10 --> <!-- Home/Default --> <li><a href="/app/template/ReportIssue.vm">Report a Problem</a></li> - <li><a href="http://wiki.xnat.org/display/XNAT16/Home" target="_blank">Documentation</a></li> + <li><a href="http://wiki.xnat.org" target="_blank">Documentation</a></li> </ul> </li> </ul> @@ -535,7 +544,7 @@ li$.find('ul.subnav').each(function () { var sub$ = $(this); var offsetL = sub$.closest('ul').outerWidth(); - sub$.css({'left': offsetL + -25}) + sub$.css({'left': offsetL + -37}) }); if (body$.hasClass('applet')) { coverApplet(li$.find('> ul')); diff --git a/src/main/webapp/images/dab_files/xdat.js b/src/main/webapp/images/dab_files/xdat.js index 9fd25394..cf3c8d86 100644 --- a/src/main/webapp/images/dab_files/xdat.js +++ b/src/main/webapp/images/dab_files/xdat.js @@ -70,18 +70,6 @@ function popup(mylink, windowname) } -function popupViewer(mylink, windowname) -{ - if (! window.focus)return true; - var href; - if (typeof(mylink) == 'string') - href=mylink; - else - href=mylink.href; - window.open(href, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - return false; -} - function IsNumeric(sText) { var ValidChars = "0123456789."; @@ -167,37 +155,6 @@ function edit(exptId,displayElement,searchField) return false; } -//SHOW ITEM IMAGE VIEWER -function viewer(sessionId) -{ - if (! window.focus)return true; - var link = serverRoot+ "/app/action/ShowViewerAction/popup/true"; - link = link + "/search_element/xnat:mrSessionData/search_field/xnat:mrSessionData.ID/search_value/" + sessionId.toString(); - window.open(link, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - return false; -} - -//SHOW ITEM IMAGE VIEWER WITH PRESET DEFUALT EXPERIMENT -function view(sessionId,exptCode) { - if (exptCode==''){ - viewer(sessionId); - } - else { - var link = serverRoot+ "/app/action/ShowViewerAction/popup/true"; - link = link + "/search_element/xnat:mrSessionData/search_field/xnat:mrSessionData.ID/search_value/" + sessionId.toString() + "/startDisplayWith/" + exptCode.toString(); - window.open(link, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - } - return false; -} - -//SHOW ITEM IMAGE VIEWER FOR SUBJECT -function viewPart(part_id) { - var link = serverRoot+ "/app/action/ShowViewerAction/popup/true"; - link = link + "/skipq/true/id/" + part_id.toString(); - window.open(link, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - return false; -} - //SHOW EMAIL SCREEN function email(toAddress) { diff --git a/src/main/webapp/scripts/footer.js b/src/main/webapp/scripts/footer.js index 46c53722..c0fc3fcc 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/project/projResourceMgmt.js b/src/main/webapp/scripts/project/projResourceMgmt.js index 43ce30ea..16f13e86 100644 --- a/src/main/webapp/scripts/project/projResourceMgmt.js +++ b/src/main/webapp/scripts/project/projResourceMgmt.js @@ -155,7 +155,7 @@ XNAT.app.pResources={ if (scriptToRun == XNAT.app.pResources.scripts[i]["Script ID"]) { var eventData = { event: ("Uploaded " + props.name), scriptId: scriptToRun, - eventClass: "org.nrg.xnat.event.entities.WorkflowStatusEvent", + eventClass: "org.nrg.xft.event.entities.WorkflowStatusEvent", filters: { "status":["Complete"] }, description: "Run " + scriptToRun + " upon " + props.name + " upload." }; var eventHandlerAjax = $.ajax({ diff --git a/src/main/webapp/scripts/uploaders/AutomationBasedUploader.js b/src/main/webapp/scripts/uploaders/AutomationBasedUploader.js index 93c8bcd6..77fc0314 100644 --- a/src/main/webapp/scripts/uploaders/AutomationBasedUploader.js +++ b/src/main/webapp/scripts/uploaders/AutomationBasedUploader.js @@ -233,14 +233,14 @@ XNAT.app.abu.getAutomationHandlers = function(){ XNAT.app.abu.showScanLinks(); }); sitewideHandlerAjax.fail( function( data, textStatus, jqXHR ) { - console.log("GetAutomationHandlers error -" + error); XNAT.app.abu.abuConfigs.hideLinks(); + console.log("GetAutomationHandlers result - ", jqXHR); }); }); initializeBuildAjax.fail( function( data, textStatus, jqXHR ) { - console.log("GetAutomationHandlers error -" + error); XNAT.app.abu.abuConfigs.hideLinks(); + console.log("GetAutomationHandlers result - ", jqXHR); }); } @@ -300,33 +300,40 @@ XNAT.app.abu.initUploaderConfig = function(){ } else { XNAT.app.abu.uploaderConfig = []; } - var uploaderSiteConfigAjax = $.ajax({ - type : "GET", - url:serverRoot+'/data/config/automation_uploader/configuration?contents=true', - cache: false, - async: false, - context: this, - dataType: 'json' - }); - uploaderSiteConfigAjax.done( function( data, textStatus, jqXHR ) { - if (typeof data !== 'undefined' && $.isArray(data) && data.length>0) { - // Configurations must have trigger IDs (remove old-style (pre XNAT 1.7) configurations) - for (var i = data.length -1; i >= 0 ; i--) { - var triggerId = data[i].eventTriggerId; - if (typeof triggerId == 'undefined' || triggerId.length<1) { - data.splice(i,1); - } - } - Array.prototype.push.apply(XNAT.app.abu.uploaderConfig,data); - } - }); - uploaderConfigAjax.fail( function( data, textStatus, error ) { - // Do nothing, for now - }); + XNAT.app.abu.initUploaderSiteConfig(); }); uploaderConfigAjax.fail( function( data, textStatus, error ) { XNAT.app.abu.uploaderConfig = []; + XNAT.app.abu.initUploaderSiteConfig(); + }); + +} + +XNAT.app.abu.initUploaderSiteConfig = function(){ + + var uploaderSiteConfigAjax = $.ajax({ + type : "GET", + url:serverRoot+'/data/config/automation_uploader/configuration?contents=true', + cache: false, + async: false, + context: this, + dataType: 'json' + }); + uploaderSiteConfigAjax.done( function( data, textStatus, jqXHR ) { + if (typeof data !== 'undefined' && $.isArray(data) && data.length>0) { + // Configurations must have trigger IDs (remove old-style (pre XNAT 1.7) configurations) + for (var i = data.length -1; i >= 0 ; i--) { + var triggerId = data[i].eventTriggerId; + if (typeof triggerId == 'undefined' || triggerId.length<1) { + data.splice(i,1); + } + } + Array.prototype.push.apply(XNAT.app.abu.uploaderConfig,data); + } + }); + uploaderSiteConfigAjax.fail( function( data, textStatus, error ) { + console.log("Get site uploader configuration result - ", error); }); } @@ -1075,7 +1082,7 @@ XNAT.app.abu.saveUploaderConfiguration=function(configTriggerId, configEvent, sc var isFound = false; for (var i=0; i<XNAT.app.abu.uploaderConfig.length; i++) { var config = XNAT.app.abu.uploaderConfig[i]; - if (config.event == newConfigObj.event && config.eventScope == newConfigObj.eventScope) { + if (config.eventTriggerId == newConfigObj.eventTriggerId && config.eventScope == newConfigObj.eventScope) { isFound = true; if (!(JSON.stringify(XNAT.app.abu.uploaderConfig[i]) == JSON.stringify(newConfigObj))) {; XNAT.app.abu.uploaderConfig[i] = newConfigObj; diff --git a/src/main/webapp/scripts/xdat.js b/src/main/webapp/scripts/xdat.js index 4d1e0260..d20c630a 100755 --- a/src/main/webapp/scripts/xdat.js +++ b/src/main/webapp/scripts/xdat.js @@ -73,18 +73,6 @@ function popup(mylink, windowname) } -function popupViewer(mylink, windowname) -{ - if (! window.focus)return true; - var href; - if (typeof(mylink) == 'string') - href=mylink; - else - href=mylink.href; - window.open(href, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - return false; -} - function IsNumeric(sText) { var ValidChars = "0123456789."; @@ -193,37 +181,6 @@ function edit(exptId,displayElement,searchField) return false; } -//SHOW ITEM IMAGE VIEWER -function viewer(sessionId) -{ - if (! window.focus)return true; - var link = serverRoot+ "/app/action/ShowViewerAction/popup/true"; - link = link + "/search_element/xnat:mrSessionData/search_field/xnat:mrSessionData.ID/search_value/" + sessionId.toString(); - window.open(link, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - return false; -} - -//SHOW ITEM IMAGE VIEWER WITH PRESET DEFUALT EXPERIMENT -function view(sessionId,exptCode) { - if (exptCode==''){ - viewer(sessionId); - } - else { - var link = serverRoot+ "/app/action/ShowViewerAction/popup/true"; - link = link + "/search_element/xnat:mrSessionData/search_field/xnat:mrSessionData.ID/search_value/" + sessionId.toString() + "/startDisplayWith/" + exptCode.toString(); - window.open(link, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - } - return false; -} - -//SHOW ITEM IMAGE VIEWER FOR SUBJECT -function viewPart(part_id) { - var link = serverRoot+ "/app/action/ShowViewerAction/popup/true"; - link = link + "/skipq/true/id/" + part_id.toString(); - window.open(link, '', 'width=320,height=420,status=yes,resizable=yes,scrollbars=no'); - return false; -} - //SHOW EMAIL SCREEN function email(toAddress) { @@ -1029,4 +986,4 @@ XNAT.utils.unescapeXML=function(unsafe) { .replace(/'/g, "'") .replace(///g, "/"); return ''; -} \ No newline at end of file +} diff --git a/src/main/webapp/scripts/xnat/app/eventsManager.js b/src/main/webapp/scripts/xnat/app/eventsManager.js index 5320bb34..4b8f09e6 100644 --- a/src/main/webapp/scripts/xnat/app/eventsManager.js +++ b/src/main/webapp/scripts/xnat/app/eventsManager.js @@ -150,57 +150,6 @@ $(function(){ populateEventsMenu(); } -/* - url: XNAT.url.restUrl('/data/automation/events'), - success: function( response ){ - - var _events = (response.ResultSet) ? response.ResultSet.Result || [] : [], - availableEvents = [], - $eventsMenu = $('#select_event'), - options = '<option></option>'; - - if (!_events.length){ - options += '<option value="!" disabled>(no events defined)</option>'; - //$eventsMenu.prop('disabled',true); - hasEvents = false; - } - else { - forEach(_events, function(event){ - - var _id = event['event_id'], - _label = event['event_label']; - - if (eventsManager.handlers.indexOf(_id) === -1){ - // only add unused events to the menu - options += '<option value="' + _id + '">' + _label +'</option>'; - // store available (unused) events - availableEvents.push(_id); - } - // store list of all events - eventsManager.events.push(_id); - }); - - if (!availableEvents.length){ - options = '<option value="!" disabled>(no available events)</option>'; - } - hasEvents = true; - } - - $eventsMenu.html(options); - - }, - error: function( request, status, error ){ - xmodal.message('Error', 'An error occurred retrieving system events: [' + status + '] ' + error); - }, - complete: function(){ - // render the events table stuff after the - // request to get the events - if (!handlersRendered){ - initEventsTable(false); - } - } - }); -*/ } function getEventClassDisplayValueFromHandlers(_handlers, eventHandler){ @@ -308,11 +257,6 @@ $(function(){ break; } } -/* - $(".customButton").click(function(event){ - customInputToggle(event.target); - }); -*/ $(".customButton").each(function(){ var eventObject = $._data(this, 'events'); if (typeof eventObject == 'undefined' || typeof eventObject.click == 'undefined') { @@ -432,35 +376,6 @@ $(function(){ } }); }); - - /* - xhr.put({ - url: '/data/projects/' + window.projectScope + '/automation/handlers?XNAT_CSRF=' + window.csrfToken, - data: data, - dataType: "json", - success: function(){ - xmodal.message('Success', 'Your event handler was successfully added.', 'OK', { - action: function(){ - initEventsTable(false); - if ($("#events_manage_table").length>0) { - initEventsTable(true); - } - xmodal.closeAll($(xmodal.dialog.open),$('#xmodal-manage-events')); - // Trigger automation uploader to reload handlers - XNAT.app.abu.getAutomationHandlers(); - } - } - ); - }, - error: function( request, status, error ){ - xmodal.message('Error', 'An error occurred: [' + status + '] ' + error, 'Close', { - action: function(){ - xmodal.closeAll($(xmodal.dialog.open),$('#xmodal-manage-events')); - } - }); - } - }); - */ } @@ -500,19 +415,6 @@ $(function(){ '</dl>' + '</dl>' + '</div>' - /* - '<table id="events_manage_table" class="xnat-table" style="display:table;width:100%">' + - '<thead>' + - '<th>Event</th>' + - '<th>Script</th>' + - '<th>Description</th>' + - '<th></th>' + - '<th></th>' + - '</thead>' + - '<tbody>' + - '</tbody>' + - '</table>' - */ ); initEventsTable(true); $("#events_manage_table").on('click', 'button.delete-handler', function(){ @@ -528,37 +430,7 @@ $(function(){ function addEventHandler(){ initEventsMenu(); -/* - //var getEvents = initEventsMenu(); - - //getEvents.done(function(){ - xmodal.open({ - title: 'Add Event Handler', - template: $('#addEventHandler'), - width: 500, - height: 300, - overflow: true, - beforeShow: function(obj){ - //chosenInit(obj.$modal.find('select.event, select.scriptId'), null, 300); - //obj.$modal.find('select.event, select.scriptId').chosen({ - // width: '300px', - // disable_search_threshold: 6 - //}); - }, - buttons: { - save: { - label: 'Save', - isDefault: true, - close: false, - action: doAddEventHandler - }, - close: { - label: 'Cancel' - } - } - }); - //}); -*/ + } function doDeleteTrigger(triggerId){ @@ -571,19 +443,19 @@ $(function(){ success: function(){ var configScope; if (typeof XNAT.app.abu.uploaderConfig !== 'undefined') { - for (var i=0; i<XNAT.app.abu.uploaderConfig.length; i++) { + for (var i=XNAT.app.abu.uploaderConfig.length -1; i >= 0; i--) { var thisConfig = XNAT.app.abu.uploaderConfig[i]; if (typeof thisConfig == 'undefined') { continue; } if (thisConfig.eventTriggerId == triggerId) { configScope = thisConfig.eventScope; - XNAT.app.abu.uploaderConfig.splice(0,1); + XNAT.app.abu.uploaderConfig.splice(i,1); } } - } - if (typeof configScope !== 'undefined') { - XNAT.app.abu.putUploaderConfiguration(configScope,false); + if (typeof configScope !== 'undefined') { + XNAT.app.abu.putUploaderConfiguration(configScope,false); + } } xmodal.message('Success', 'The event handler was successfully deleted.', 'OK', { action: function(){ diff --git a/src/main/webapp/scripts/xnat/app/siteEventsManager.js b/src/main/webapp/scripts/xnat/app/siteEventsManager.js index 98266a06..488e2eb2 100644 --- a/src/main/webapp/scripts/xnat/app/siteEventsManager.js +++ b/src/main/webapp/scripts/xnat/app/siteEventsManager.js @@ -62,25 +62,6 @@ $(function(){ forEach(_handlers, function(eventHandler){ var _event_id = eventHandler['event']; siteEventsManager.handlers.push(_event_id); - /* - eventRows += '<tr class="highlight">' + - '<td class="event-id">' + _event_id + '</td>' + - '<td class="script-id">' + eventHandler.scriptId + '</td>' + - '<td class="description">' + eventHandler.description + '</td>' + - ((doEdit) ? - '<td style="text-align: center;">' + - '<a href="javascript:" class="delete-handler" ' + - 'data-event="' + _event_id + '" ' + - 'data-handler="' + eventHandler.triggerId + '" title="Delete handler for event ' + _event_id + '">delete</a>' + - '</td>' + - '<td style="text-align: center;">' + - '<a href="javascript:" class="configure-uploader-handler" ' + - 'data-event="' + _event_id + '" ' + - 'data-handler="' + eventHandler.event + '" title="Configure uploader for event handler ' + _event_id + '">configure uploader</a>' + - '</td>' - : '' ) + - '</tr>'; - */ eventRows += '<dl class="item">' + '<dd class="col1">' + _event_id + '</dd>' + '<dd class="col2">' + eventHandler.scriptId + '</dd>' + @@ -105,12 +86,6 @@ $(function(){ //$((doEdit) ? events_manage_table : $events_table).find('tbody').html(eventRows); $((doEdit) ? events_manage_table : $events_table).html(eventRows); $((doEdit) ? events_manage_table : $events_table).show(); - $("#events_table").on('click', 'button.delete-handler', function(){ - deleteEventHandler($(this).data('handler'), $(this).data('event')) - }); - $("#events_table").on('click', 'button.configure-uploader-handler', function(){ - XNAT.app.abu.configureUploaderForEventHandler($(this).data('handler'), $(this).data('event'), 'site') - }); } else { $no_event_handlers.show(); @@ -163,19 +138,7 @@ $(function(){ '</dl>' + '</dl>' + '</div>' - /* - '<table id="events_manage_table" class="xnat-table" style="display:table;width:100%">' + - '<thead>' + - '<th>Event</th>' + - '<th>Script</th>' + - '<th>Description</th>' + - '<th></th>' + - '<th></th>' + - '</thead>' + - '<tbody>' + - '</tbody>' + - '</table>' - */ + ); initHandlersTable(true); $("#events_manage_table").on('click', 'button.delete-handler', function(){ @@ -213,58 +176,6 @@ $(function(){ populateEventsMenu(); } - /* - return xhr.getJSON({ - url: XNAT.url.restUrl('/data/automation/events'), - success: function( response ){ - - var _events = (response.ResultSet) ? response.ResultSet.Result || [] : [], - availableEvents = [], - $eventsMenu = $('#select_event'), - options = '<option></option>'; - - if (!_events.length){ - options += '<option value="!" disabled>(no events defined)</option>'; - //$eventsMenu.prop('disabled',true); - hasEvents = false; - } - else { - forEach(_events, function(event){ - - var _id = event['event_id'], - _label = event['event_label']; - - if (siteEventsManager.handlers.indexOf(_id) === -1){ - // only add unused events to the menu - options += '<option value="' + _id + '">' + _label +'</option>'; - // store available (unused) events - availableEvents.push(_id); - } - // store list of all events - siteEventsManager.events.push(_id); - }); - - if (!availableEvents.length){ - options = '<option value="!" disabled>(no available events)</option>'; - } - hasEvents = true; - } - - $eventsMenu.html(options); - - }, - error: function( request, status, error ){ - xmodal.message('Error', 'An error occurred retrieving system events: [' + status + '] ' + error); - }, - complete: function(){ - // render the events table stuff after the - // request to get the events - //if (!handlersRendered){ - // initHandlersTable(); - //} - } - }); - */ } @@ -373,11 +284,6 @@ $(function(){ break; } } -/* - $(".customButton").click(function(event){ - customInputToggle(event.target); - }); -*/ $(".customButton").each(function(){ var eventObject = $._data(this, 'events'); if (typeof eventObject == 'undefined' || typeof eventObject.click == 'undefined') { @@ -502,127 +408,37 @@ $(function(){ }); }); - /* - xhr.put({ - url: XNAT.url.restUrl('/data/automation/handlers?XNAT_CSRF=' + window.csrfToken, null, false), - data: data, - dataType: "json", - success: function(e){ - initHandlersTable(false); - if ($("#events_manage_table").length>0) { - initHandlersTable(true); - } - xmodal.message('Success', 'The event handler was successfully added.', 'OK', { - action: function(){ - xmodal.closeAll($(xmodal.dialog.open),$('#xmodal-manage-events')); - } - }); - // Trigger automation uploader to reload handlers - if (typeof(XNAT.app.abu.uploaderConfig)==='undefined') { - XNAT.app.abu.initUploaderConfig(); - } - XNAT.app.abu.removeUploaderConfiguration(this.event,'site'); - XNAT.app.abu.getAutomationHandlers(); - }, - error: function( request, status, error ){ - xmodal.message('Error', 'An error occurred: [' + status + '] ' + error, 'Close', { - action: function(){ - xmodal.closeAll($(xmodal.dialog.open),$('#xmodal-manage-events')); - } - }); - } - }); - */ } function addEventHandler(){ initEventsMenu(); -/* - xmodal.loading.open(); - initScriptsMenu(). - //done(initEventsMenu(). - done(function(){ - initEventsMenu(); - xmodal.loading.close(); - xmodal.open({ - title: 'Add Event Handler', - template: $('#addEventHandler'), - width: 500, - height: 300, - overflow: true, - esc: false, - enter: false, - beforeShow: function(obj){ - var $menus = obj.$modal.find('select.event, select.scriptId'); - $menus.trigger('chosen:updated'); - //chosenInit($menus, null, 300); - $menus.chosen({ - width: '300px', - disable_search_threshold: 6 - }); - }, - buttons: { - save: { - label: 'Save', - isDefault: true, - close: false, - action: doAddEventHandler - }, - close: { - label: 'Cancel' - } - } - }); - } - ) -*/ - /* - done(initEventsMenu(). - done(function(){ - xmodal.loading.close(); - xmodal.open({ - title: 'Add Event Handler', - template: $('#addEventHandler'), - width: 500, - height: 300, - overflow: true, - esc: false, - enter: false, - beforeShow: function(obj){ - var $menus = obj.$modal.find('select.event, select.scriptId'); - $menus.trigger('chosen:updated'); - //chosenInit($menus, null, 300); - $menus.chosen({ - width: '300px', - disable_search_threshold: 6 - }); - }, - buttons: { - save: { - label: 'Save', - isDefault: true, - close: false, - action: doAddEventHandler - }, - close: { - label: 'Cancel' - } - } - }); - } - ) - ); - */ } - function doDeleteHandler( handlerId ){ - var url = serverRoot+'/data/automation/triggers/' + handlerId + "?XNAT_CSRF=" + window.csrfToken; + function doDeleteHandler( triggerId ){ + var url = serverRoot+'/data/automation/triggers/' + triggerId + "?XNAT_CSRF=" + window.csrfToken; if (window.jsdebug) console.log(url); - xhr.delete({ - //type: 'DELETE', + //xhr.delete({ + jQuery.ajax({ + type: 'DELETE', url: url, - //cache: false, + cache: false, success: function(){ + var configScope; + if (typeof XNAT.app.abu.uploaderConfig !== 'undefined') { + for (var i=XNAT.app.abu.uploaderConfig.length -1; i >= 0; i--) { + var thisConfig = XNAT.app.abu.uploaderConfig[i]; + if (typeof thisConfig == 'undefined') { + continue; + } + if (thisConfig.eventTriggerId == triggerId) { + configScope = thisConfig.eventScope; + XNAT.app.abu.uploaderConfig.splice(i,1); + } + } + if (typeof configScope !== 'undefined') { + XNAT.app.abu.putUploaderConfiguration(configScope,false); + } + } xmodal.message('Success', 'The event handler was successfully deleted.', 'OK', { action: function(){ initHandlersTable(); @@ -640,17 +456,17 @@ $(function(){ }); } - function deleteEventHandler( handlerId, event ){ + function deleteEventHandler( triggerId, event ){ xmodal.confirm({ title: 'Delete Event Handler?', - content: 'Are you sure you want to delete the handler: <br><br><b>' + handlerId + '</b>?<br><br>Only the Event Handler will be deleted. The associated Script will still be available for use.', + content: 'Are you sure you want to delete the handler: <br><br><b>' + triggerId + '</b>?<br><br>Only the Event Handler will be deleted. The associated Script will still be available for use.', width: 560, height: 220, okLabel: 'Delete', okClose: false, // don't close yet cancelLabel: 'Cancel', okAction: function(){ - doDeleteHandler(handlerId); + doDeleteHandler(triggerId); }, cancelAction: function(){ xmodal.message('Delete event handler cancelled', 'The event handler was not deleted.', 'Close'); @@ -662,6 +478,9 @@ $(function(){ $events_table.on('click', 'button.delete-handler', function(){ deleteEventHandler($(this).data('handler'), $(this).data('event')); }); + $events_table.on('click', 'button.configure-uploader-handler', function(){ + XNAT.app.abu.configureUploaderForEventHandler($(this).data('handler'), $(this).data('event'), 'site') + }); // *javascript* event handler for adding an XNAT event handler (got it?) $add_event_handler.on('click', addEventHandler); diff --git a/src/main/webapp/scripts/xnat/app/siteSetup.js b/src/main/webapp/scripts/xnat/app/siteSetup.js index e14b12b3..45915b9f 100644 --- a/src/main/webapp/scripts/xnat/app/siteSetup.js +++ b/src/main/webapp/scripts/xnat/app/siteSetup.js @@ -94,8 +94,9 @@ var XNAT = getObject(XNAT); e.preventDefault(); var $forms = $(this).find('form'); + $forms.addClass('json silent'); - var loader = xmodal.loading.open('#multi-save'); + xmodal.loading.open('#multi-save'); // reset success count on new submission multiform.success = 0; @@ -109,7 +110,7 @@ var XNAT = getObject(XNAT); // submit ALL enclosed forms $forms.each(function(){ - var $form = $(this).addClass('json silent'); + var $form = $(this); XNAT.xhr.form($form, { contentType: 'application/json', validate: function(){ @@ -137,7 +138,7 @@ var XNAT = getObject(XNAT); multiform.errors++; //don't show a dialog for each individual form //if (!$form.hasClass('silent')) { - xmodal.message('Error','Please enter values for the required items and re-submit the form.'); + // xmodal.message('Error','Please enter values for the required items and re-submit the form.'); //} } @@ -165,12 +166,12 @@ var XNAT = getObject(XNAT); // multiform.errors = $forms.filter('.error').length; - function initialize(a, b, c){ - + function initialize(){ XNAT.xhr.postJSON({ url: XNAT.url.rootUrl('/xapi/siteConfig/batch'), data: JSON.stringify({initialized:true}), success: function(){ + xmodal.loading.close('#multi-save'); xmodal.message({ title: false, esc: false, @@ -183,6 +184,7 @@ var XNAT = getObject(XNAT); }); } }).fail(function(e, txt, jQxhr){ + xmodal.loading.close('#multi-save'); xmodal.message({ title: 'Error', content: [ @@ -191,8 +193,6 @@ var XNAT = getObject(XNAT); txt ].join(': <br>') }) - }).always(function(){ - xmodal.loading.close(loader.$modal); }); } diff --git a/src/main/webapp/scripts/xnat/spawner.js b/src/main/webapp/scripts/xnat/spawner.js index be902f8a..4e1968c4 100644 --- a/src/main/webapp/scripts/xnat/spawner.js +++ b/src/main/webapp/scripts/xnat/spawner.js @@ -69,6 +69,12 @@ var XNAT = getObject(XNAT); if (prop.config.href) { prop.config.href = setRoot(prop.config.href) } + if (prop.config.src) { + prop.config.src = setRoot(prop.config.src) + } + if (prop.config.action) { + prop.config.action = setRoot(prop.config.action) + } // do a raw spawn() if 'kind' is 'element' // or if there's a tag property diff --git a/src/main/webapp/setup/index.jsp b/src/main/webapp/setup/index.jsp index 81b2d475..daff6dd0 100644 --- a/src/main/webapp/setup/index.jsp +++ b/src/main/webapp/setup/index.jsp @@ -2,11 +2,7 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="pg" tagdir="/WEB-INF/tags/page" %> -<c:set var="HEADBOTTOM"> - <script src="<c:url value="/scripts/xnat/app/siteSetup.js"/>"></script> -</c:set> - -<pg:xnat page="setup" title="XNAT Setup" headBottom="${HEADBOTTOM}"> +<pg:xnat page="setup" title="XNAT Setup"> <div id="page-body"> <div class="pad"> @@ -70,7 +66,7 @@ <h2 class="pull-left">XNAT Site Setup</h2> <div class="hidden message pull-left"> The settings below need to be configured before this XNAT system - can be used. Please set the properties below and submit the form continue. + can be used. Please set the properties below and submit the form to continue. </div> <div class="clearfix"></div> </header> diff --git a/src/main/webapp/xnat-templates/navigations/XNATQuickSearch.vm b/src/main/webapp/xnat-templates/navigations/XNATQuickSearch.vm index b1dd7ac2..8ca2b170 100755 --- a/src/main/webapp/xnat-templates/navigations/XNATQuickSearch.vm +++ b/src/main/webapp/xnat-templates/navigations/XNATQuickSearch.vm @@ -68,27 +68,47 @@ function submitQuickSearch(){ <button type="button" id="search_btn" class="btn2" onclick="submitQuickSearch();">Go</button> #if($turbineUtils.toBoolean($siteConfig.getProperty("UI.allow-advanced-search","true"))) - <script> - $('#searchValue').each(function(){ - this.value = this.value || 'search'; - $(this).focus(function(){ - $(this).removeClass('clean'); - if (!this.value || this.value === 'search'){ - this.value = ''; - } - }) - }); - $('#stored-searches').on('change', function(){ - if (this.value){ - window.location.href = this.value; - } - }).chosen({ - width: '150px', - disable_search_threshold: 9, - inherit_select_classes: true, - placeholder_text_single: 'Stored Searches', - search_contains: true - }); + <script> + + (function(){ + + $('#searchValue').each(function(){ + this.value = this.value || 'search'; + $(this).focus(function(){ + $(this).removeClass('clean'); + if (!this.value || this.value === 'search'){ + this.value = ''; + } + }) + }); + + var storedSearchMenu = $('#stored-searches'); + + XNAT.xhr.getJSON(XNAT.url.rootUrl('/data/search/saved'), function(data){ + + storedSearchMenu.find('optgroup.stored-search-list') + .empty() + .append(data.ResultSet.Result.map(function(opt){ + var val = serverRoot + '/app/template/Search.vm/node/ss.' + opt.id; + return '<option value="' + val + '">' + opt.brief_description + '</option>' + }).join('')); + + storedSearchMenu.on('change', function(){ + window.location.href = this.value + }); + + storedSearchMenu.chosen({ + width: '150px', + disable_search_threshold: 9, + inherit_select_classes: true, + placeholder_text_single: 'Stored Searches', + search_contains: true + }); + + }); + + })(); + </script> ## <button type="button" id="advanced_btn" class="btn2" onclick="advancedSearch();">Advanced</button> #end diff --git a/src/main/webapp/xnat-templates/screens/DownloadApplet.vm b/src/main/webapp/xnat-templates/screens/DownloadApplet.vm index 3b43223b..3514fc9e 100644 --- a/src/main/webapp/xnat-templates/screens/DownloadApplet.vm +++ b/src/main/webapp/xnat-templates/screens/DownloadApplet.vm @@ -1,9 +1,13 @@ +#* @vtlvariable name="appletPath" type="java.lang.String" *# +#* @vtlvariable name="catalogXML" type="java.lang.String" *# +#* @vtlvariable name="jsessionid" type="java.lang.String" *# <!-- BEGIN: plugin-resources/webapp/xnat-templates/screens/DownloadApplet.vm --> <h2>Download Images</h2> <table border="0" > <tr bgcolor="white"> <td style="border-style:none;" valign="top" align="left" colspan="2"> - <applet code="org.nrg.xnat.fileManager.DownloaderApplet" codebase="$appletPath" archive="file-downloader-1.6.5.jar, xdat-beans-1.6.5.jar, nrgutil-2.0.0.jar, commons-lang-2.6.jar, log4j-1.2.17.jar" width="500" height="500"> + <applet code="org.nrg.xnat.fileManager.DownloaderApplet" codebase="$appletPath" width="500" height="500" + archive="file-downloader__V1.7.0-SNAPSHOT.jar, commons-configuration__V1.5.jar, commons-collections__V3.2.1.jar, commons-logging__V1.1.1.jar, commons-lang__V2.6.jar, commons-lang3__V3.4.jar, core__V1.7.0-SNAPSHOT.jar, framework__V1.7.0-SNAPSHOT.jar, log4j__V1.2.17.jar, slf4j-api__V1.7.7.jar, slf4j-log4j12__V1.7.7.jar, guava__V19.0.jar, reflections__V0.9.10.jar, xnat-data-models__V1.7.0-SNAPSHOT.jar"> <param name="session0" value="$catalogXML"> <param name="jsessionid" value="$jsessionid"> </applet> diff --git a/src/main/webapp/xnat-templates/screens/LaunchUploadApplet.vm b/src/main/webapp/xnat-templates/screens/LaunchUploadApplet.vm index b41ea47f..b0d56362 100644 --- a/src/main/webapp/xnat-templates/screens/LaunchUploadApplet.vm +++ b/src/main/webapp/xnat-templates/screens/LaunchUploadApplet.vm @@ -125,8 +125,6 @@ </div> <!-- end of hideIfProtocol --> <div id="forProtocolContent" style="display:none"></div> - <p style="width:500px;margin:20px 0;">Looking for other ways to upload images? <a href="$link.setPage("AlternateImageUpload.vm")">Click here.</a></p> - </form> <script type="text/javascript"> diff --git a/src/main/webapp/xnat-templates/screens/UploadApplet.vm b/src/main/webapp/xnat-templates/screens/UploadApplet.vm index 4f786b36..b74ab4ca 100644 --- a/src/main/webapp/xnat-templates/screens/UploadApplet.vm +++ b/src/main/webapp/xnat-templates/screens/UploadApplet.vm @@ -53,7 +53,8 @@ function loadApplet() { - var attributes = { code: 'org.nrg.upload.ui.UploadAssistantApplet', codebase: '$content.getURI("applet/")', width: 800, height: 500, /* class: 'upload_applet', */ archive: 'UploadAssistant-1.6.5.jar, DicomEdit-4.0.0.jar, DicomUtils-1.3.1.jar, dicomtools-1.6.5.jar, config-1.6.5.jar, framework-1.6.5.jar, antlr-runtime-3.5.2.jar, commons-codec-1.5.jar, commons-lang-2.6.jar, dcm4che-core-2.0.25.jar, dicom-xnat-sop-1.6.5.jar, dicom-xnat-util-1.6.5.jar, ecat-edit-0.2.0.jar, ecat-io-0.1.0.jar, guava-18.0.jar, java-uuid-generator-3.1.3.jar, javax.inject-1.jar, jcalendar-1.4.jar, joda-time-2.1.jar, json-20140107.jar, log4j-1.2.17.jar, nrgutil-2.0.0.jar, slf4j-api-1.7.7.jar, slf4j-log4j12-1.7.7.jar, wizard-1.1.jar, jackson-annotations-2.5.2.jar, jackson-core-2.5.2.jar, jackson-databind-2.5.2.jar' }; + var attributes = { code: 'org.nrg.xnat.upload.ui.UploadAssistantApplet', codebase: '$content.getURI("applet/")', width: 800, height: 500, /* class: 'upload_applet', */ archive: 'upload-assistant__V1.7.0-SNAPSHOT.jar, DicomEdit__V4.0.0.jar, DicomUtils__V1.3.1.jar, antlr-runtime__V3.5.2.jar, commons-codec__V1.10.jar, commons-lang3__V3.4.jar, commons-lang__V2.6.jar, config__V1.7.0-SNAPSHOT.jar, dcm4che-core__V2.0.25.jar, dicom-xnat-sop__V1.7.0-20160210.212402-3.jar, dicom-xnat-util__V1.7.0-20160210.212409-3.jar, dicomtools__V1.7.0-SNAPSHOT.jar, ecat-edit__V0.2.0.jar, ecat-io__V0.1.0.jar, framework__V1.7.0-SNAPSHOT.jar, guava__V19.0.jar, jackson-annotations__V2.6.5.jar, jackson-core__V2.6.5.jar, jackson-databind__V2.6.5.jar, java-uuid-generator__V3.1.3.jar, javax.inject__V1.jar, jcalendar__V1.4.jar, joda-time__V2.1.jar, json__V20151123.jar, log4j__V1.2.17.jar, nrgutil__V1.1.0.jar, slf4j-api__V1.7.7.jar, slf4j-log4j12__V1.7.7.jar, wizard__V1.1.jar' } + var parameters = { 'xnat-url': '$!arc.getSiteUrl()', 'xnat-admin-email': '$!arc.getSiteAdminEmail()', 'xnat-description': '$!arc.getSiteId()', 'n-upload-threads': '4', 'fixed-size-streaming': 'true', 'java_arguments': '-Djnlp.packEnabled=true', 'jsessionid': '$jsessionid'}; parameters['window-name'] = this.window.name; diff --git a/src/main/webapp/xnat-templates/screens/XDATScreen_admin_options.vm b/src/main/webapp/xnat-templates/screens/XDATScreen_admin_options.vm index 027d238b..45aee6d7 100644 --- a/src/main/webapp/xnat-templates/screens/XDATScreen_admin_options.vm +++ b/src/main/webapp/xnat-templates/screens/XDATScreen_admin_options.vm @@ -53,8 +53,6 @@ $!template.setLayoutTemplate("DefaultExptList.vm") <a href="$link.setPage("XDATScreen_add_xnat_projectData.vm")">Create $displayManager.getSingularDisplayNameForProject()</a> - <a href="$link.setPage("XDATScreen_themes.vm")">Manage Themes</a> - #addGlobalCustomScreens("admin/options") </div> diff --git a/src/main/webapp/xnat-templates/screens/project/widgets/project_summary_status.vm b/src/main/webapp/xnat-templates/screens/project/widgets/project_summary_status.vm index e0dc1fd1..d0643ad3 100644 --- a/src/main/webapp/xnat-templates/screens/project/widgets/project_summary_status.vm +++ b/src/main/webapp/xnat-templates/screens/project/widgets/project_summary_status.vm @@ -16,7 +16,7 @@ #if($other == 0) <DIV class="containerItem" style="color:grey">$other Other Experiments</DIV> #end -#if($data.getSession().getAttribute("userHelper").canCreate($project)) +#if($data.getSession().getAttribute("userHelper").isOwner($project.getId()) || $turbineUtils.isSiteAdmin($user)) <BR><A ID="button5" href="$link.setAction("XDATActionRouter").addPathInfo("xdataction","protocols").addPathInfo( "search_element","xnat:projectData").addPathInfo("search_field","xnat:projectData.ID").addPathInfo( "search_value","$!{project.getId()}").addPathInfo("popup","$!popup")">Manage Custom Variables</A> diff --git a/src/main/webapp/xnat-templates/screens/topBar/Help/Default.vm b/src/main/webapp/xnat-templates/screens/topBar/Help/Default.vm index 8b11f4e7..e3d9a9ff 100644 --- a/src/main/webapp/xnat-templates/screens/topBar/Help/Default.vm +++ b/src/main/webapp/xnat-templates/screens/topBar/Help/Default.vm @@ -1,4 +1,4 @@ <!-- Sequence: 10 --> <!-- Home/Default --> <li><a href="$link.setPage("ReportIssue.vm")">Report a Problem</a></li> - <li><a href="http://wiki.xnat.org/display/XNAT16/Home" target="_blank">Documentation</a></li> + <li><a href="http://wiki.xnat.org" target="_blank">Documentation</a></li> diff --git a/src/main/webapp/xnat-templates/screens/topBar/Upload/Default.vm b/src/main/webapp/xnat-templates/screens/topBar/Upload/Default.vm index ce743b31..012965a5 100644 --- a/src/main/webapp/xnat-templates/screens/topBar/Upload/Default.vm +++ b/src/main/webapp/xnat-templates/screens/topBar/Upload/Default.vm @@ -1,6 +1,15 @@ <!-- Sequence: 10 --> <!-- Upload/Default --> - <li><a href="$link.setPage("LaunchUploadApplet.vm")">Images</a></li> + <li><a href="$link.setPage("UploadOptions.vm")">Images</a> + <ul> + <!-- Sequence: 10 --> + <!-- Images --> + <li><a href="$link.setPage("LaunchUploadApplet.vm")">Upload Applet</a></li> + <li><a href="$link.setPage("UploadAssistantPage.vm")">Upload Assistant</a></li> + <li><a href="$link.setPage("CompressedUploaderPage.vm")">Compressed Uploader</a></li> + <li><a href="$link.setPage("DICOMSCPPage.vm")">DICOM SCP</a></li> + </ul> + </li> <li><a href="$link.setPage("XMLUpload.vm")">XML</a></li> <li><a href="$link.setPage("XDATScreen_uploadCSV.vm")">Spreadsheet</a></li> <li><a href="$link.setPage("XDATScreen_prearchives.vm")">Go to prearchive</a></li> diff --git a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_details.vm b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_details.vm index caccbb40..be2031d6 100644 --- a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_details.vm +++ b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_details.vm @@ -48,7 +48,7 @@ </tr> #end </table> -#if($data.getSession().getAttribute("userHelper").canCreate($project)) +#if($data.getSession().getAttribute("userHelper").isOwner($project.getId()) || $turbineUtils.isSiteAdmin($user)) <BR><A ID="button1" href="$link.setAction("XDATActionRouter").addPathInfo("xdataction","edit").addPathInfo( "search_element","xnat:projectData").addPathInfo("search_field","xnat:projectData.ID").addPathInfo( "search_value","$!{project.getId()}").addPathInfo("popup","$!popup")">Edit Details</A> diff --git a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_management.vm b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_management.vm index 7e8f2d91..b6807c98 100644 --- a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_management.vm +++ b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_management.vm @@ -101,6 +101,7 @@ </script> </td> </tr> + </table> <script language="javascript"> function summaryUserTabChange(obj){ diff --git a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_status.vm b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_status.vm index 17cccd68..c8c1e896 100644 --- a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_status.vm +++ b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_status.vm @@ -7,7 +7,7 @@ "userHelper").getBrowseableElementDisplay($key).getSchemaElement().getPluralDescription()</DIV> #end -#if($data.getSession().getAttribute("userHelper").canCreate($project)) +#if($data.getSession().getAttribute("userHelper").isOwner($project.getId()) || $turbineUtils.isSiteAdmin($user)) <BR><A ID="button5" href="$link.setAction("XDATActionRouter").addPathInfo("xdataction","protocols").addPathInfo( "search_element","xnat:projectData").addPathInfo("search_field","xnat:projectData.ID").addPathInfo( "search_value","$!{project.getId()}").addPathInfo("popup","$!popup")">Manage Custom Variables</A> diff --git a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_tabs.vm b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_tabs.vm index b734819a..615e7cdb 100644 --- a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_tabs.vm +++ b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_tabs.vm @@ -5,12 +5,10 @@ <li class="selected"><a href="#tab1"><em>Details</em></a></li> #set($canReadSubjects=$data.getSession().getAttribute("userHelper").canRead( "xnat:subjectData/project","$project.getId()")) - #if($canReadSubjects) - #if($data.getSession().getAttribute("userHelper").canDelete($project)) + #if($data.getSession().getAttribute("userHelper").isOwner($project.getId()) || $turbineUtils.isSiteAdmin($user)) <li><a href="#tab3"><em>Access</em></a></li> <li><a href="#othermgmt"><em>Manage</em></a></li> <li><a href="#tab4"><em>Pipelines</em></a></li> - #end #end #foreach($tab in $tabs) <li><a href="#$tab.getProperty("divName")"><em>$tab.getProperty("title") @@ -23,8 +21,7 @@ <p>#parse($turbineUtils.getTemplateName("_summary_details","xnat:projectData",$project.getId()))</p> </div> - #if($canReadSubjects) - #if($data.getSession().getAttribute("userHelper").canCreate($project)) + #if($data.getSession().getAttribute("userHelper").isOwner($project.getId()) || $turbineUtils.isSiteAdmin($user)) <div id="tab3"> <p>#parse($turbineUtils.getTemplateName( "_summary_management","xnat:projectData",$project.getId()))</p> @@ -37,7 +34,6 @@ <p>#parse($turbineUtils.getTemplateName( "_summary_pipeline","xnat:projectData",$project.getId()))</p> </div> - #end #end #foreach($tab in $tabs) <div id="$tab.getProperty("divName")"> @@ -60,14 +56,10 @@ window.summaryTabView = new YAHOO.widget.TabView('projectSummary'); var oButton1 = new YAHOO.widget.Button("button1"); var oButton2 = new YAHOO.widget.Button("button2"); - #if($canReadSubjects) - #if($data.getSession().getAttribute("userHelper").canDelete($project)) - var oButton3 = new YAHOO.widget.Button("button3"); - #end - #if($data.getSession().getAttribute("userHelper").canCreate($project)) - var oButton4 = new YAHOO.widget.Button("button4"); - var oButton5 = new YAHOO.widget.Button("button5"); - #end + #if($data.getSession().getAttribute("userHelper").isOwner($project.getId()) || $turbineUtils.isSiteAdmin($user)) + var oButton3 = new YAHOO.widget.Button("button3"); + var oButton4 = new YAHOO.widget.Button("button4"); + var oButton5 = new YAHOO.widget.Button("button5"); #end -- GitLab