diff --git a/src/main/java/org/nrg/xnat/event/entities/WorkflowStatusEvent.java b/src/main/java/org/nrg/xnat/event/entities/WorkflowStatusEvent.java deleted file mode 100644 index 8a56381ebdde492b84393ba62fc46b9a144536ee..0000000000000000000000000000000000000000 --- a/src/main/java/org/nrg/xnat/event/entities/WorkflowStatusEvent.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.nrg.xnat.event.entities; - -import java.util.Map; - -import org.nrg.xdat.om.WrkWorkflowdata; -import org.nrg.xft.event.AutomationEventImplementerI; -import org.nrg.xft.event.Filterable; -import org.nrg.xft.event.StructuredEvent; -import org.nrg.xft.event.EventClass; -import org.nrg.xft.event.entities.AutomationCompletionEvent; -import org.nrg.xft.event.persist.PersistentWorkflowI; -import org.nrg.xft.security.UserI; -import org.python.google.common.collect.Maps; - -/** - * The Class WorkflowStatusEvent. - */ -@EventClass(displayName = "Workflow Status Event") -public class WorkflowStatusEvent extends StructuredEvent implements AutomationEventImplementerI { - - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = 7465778737330635218L; - - /** The workflow. */ - PersistentWorkflowI workflow; - - /** The status. */ - private String status; - - /** The justification. */ - private String justification; - - /** The automationCompletionEvent. */ - private AutomationCompletionEvent automationCompletionEvent; - - private Map<String,Object> parameterMap = Maps.newHashMap(); - - /** - * Instantiates a new workflow status event. - */ - public WorkflowStatusEvent() { - super(); - } - - /** - * Instantiates a new workflow status event. u - * - * @param workflow the workflow - */ - public WorkflowStatusEvent(PersistentWorkflowI workflow) { - this(); - this.workflow = workflow; - this.setEventId(workflow.getPipelineName()); - this.setSrcEventClass(this.getClass().getName()); - final String project = workflow.getExternalid(); - this.setExternalId(project); - this.setEntityId(workflow.getId()); - this.setEntityType(workflow.getDataType()); - this.setStatus(workflow.getStatus()); - this.setJustification(workflow.getJustification()); - final Map<String,String> eventSpecificMap = Maps.newHashMap(); - eventSpecificMap.put("status", status); - eventSpecificMap.put("justification", justification); - this.setEventSpecificFieldsAsMap(eventSpecificMap); - final WrkWorkflowdata wrkflow = (workflow instanceof WrkWorkflowdata) ? (WrkWorkflowdata)workflow : null; - if (wrkflow!=null) { - UserI user = (wrkflow.getUser()!=null) ? wrkflow.getUser() : wrkflow.getInsertUser(); - this.setUserId(user.getID()); - } - } - - /** - * Gets the workflow. - * - * @return the workflow - */ - //@Transient - public PersistentWorkflowI getWorkflow() { - return workflow; - } - - /** - * Sets the status. - * - * @param status the new status - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * Gets the status. - * - * @return the status - */ - @Filterable(initialValues = { "Complete", "Failed" }, includeValuesFromDatabase = false) - public String getStatus() { - return status; - } - - /** - * Sets the justification. - * - * @param justification the new justification - */ - public void setJustification(String justification) { - this.justification = justification; - } - - /** - * Gets the justification. - * - * @return the justification - */ - public String getJustification() { - return justification; - } - - /* (non-Javadoc) - * @see org.nrg.xft.event.AutomationEventImplementerI#setAutomationCompletionEvent(org.nrg.xft.event.entities.AutomationCompletionEvent) - */ - @Override - public void setAutomationCompletionEvent(AutomationCompletionEvent automationCompletionEvent) { - this.automationCompletionEvent = automationCompletionEvent; - } - - /* (non-Javadoc) - * @see org.nrg.xft.event.AutomationEventImplementerI#getAutomationCompletionEvent() - */ - @Override - //@Transient - public AutomationCompletionEvent getAutomationCompletionEvent() { - return automationCompletionEvent; - } - - @Override - public Map<String, Object> getParameterMap() { - return this.parameterMap; - } - - @Override - public void setParameterMap(Map<String, Object> parameterMap) { - this.parameterMap = parameterMap; - } - - @Override - public void addParameterToParameterMap(String parameter, Object value) { - this.parameterMap.put(parameter, value); - } - -} diff --git a/src/main/java/org/nrg/xnat/event/listeners/AutoRunEmailHandler.java b/src/main/java/org/nrg/xnat/event/listeners/AutoRunEmailHandler.java index ca4c48b92e8a6b192e2f2328e1576204dbd5f287..d853c63aee711bc7f7db12da812fa565dc8cf13d 100644 --- a/src/main/java/org/nrg/xnat/event/listeners/AutoRunEmailHandler.java +++ b/src/main/java/org/nrg/xnat/event/listeners/AutoRunEmailHandler.java @@ -7,8 +7,8 @@ import reactor.bus.EventBus; import reactor.fn.Consumer; import org.nrg.xdat.om.WrkWorkflowdata; +import org.nrg.xft.event.entities.WorkflowStatusEvent; import org.nrg.xft.event.persist.PersistentWorkflowUtils; -import org.nrg.xnat.event.entities.WorkflowStatusEvent; import org.springframework.stereotype.Service; import static reactor.bus.selector.Selectors.R; 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 2833b91059f5c495aa45489bb663b0a6a07c3d94..a9267f8b698a176b979302075eb00ce0813806f2 100644 --- a/src/main/java/org/nrg/xnat/event/listeners/AutomationEventScriptHandler.java +++ b/src/main/java/org/nrg/xnat/event/listeners/AutomationEventScriptHandler.java @@ -2,15 +2,10 @@ package org.nrg.xnat.event.listeners; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import reactor.bus.Event; -import reactor.bus.EventBus; -import reactor.fn.Consumer; import org.apache.commons.lang3.StringUtils; -import org.nrg.automation.entities.EventFilters; import org.nrg.automation.entities.Script; import org.nrg.automation.entities.ScriptOutput; import org.nrg.automation.entities.ScriptOutput.Status; -import org.nrg.automation.entities.ScriptTrigger; import org.nrg.automation.services.ScriptRunnerService; import org.nrg.automation.services.ScriptTriggerService; import org.nrg.automation.services.impl.hibernate.HibernateScriptTriggerService; @@ -24,8 +19,6 @@ import org.nrg.xdat.services.impl.hibernate.HibernateAutomationEventIdsService; import org.nrg.xdat.services.impl.hibernate.HibernateAutomationFiltersService; import org.nrg.xdat.services.impl.hibernate.HibernatePersistentEventService; import org.nrg.xdat.turbine.utils.AdminUtils; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.RowMapper; import org.nrg.xft.event.AutomationEventImplementerI; import org.nrg.xft.event.EventUtils; import org.nrg.xft.event.Filterable; @@ -38,12 +31,20 @@ 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; -import org.nrg.xnat.utils.WorkflowUtils; import org.nrg.xnat.services.messaging.automation.AutomatedScriptRequest; +import org.nrg.xnat.utils.WorkflowUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Service; -import static reactor.bus.selector.Selectors.type; +import reactor.bus.Event; +import reactor.bus.EventBus; +import reactor.fn.Consumer; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.sql.DataSource; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.sql.ResultSet; @@ -51,11 +52,8 @@ import java.sql.SQLException; import java.util.Arrays; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.sql.DataSource; + +import static reactor.bus.selector.Selectors.type; /** * The Class AutomatedScriptHandler. @@ -403,7 +401,7 @@ public class AutomationEventScriptHandler implements Consumer<Event<AutomationEv } catch (NrgServiceException e) { final String message = String.format("Failed running the script %s by user %s for event %s on data type %s instance %s from project %s", request.getScriptId(), - request.getUser().getLogin(), + request.getUser().getLogin(), request.getEvent(), request.getDataType(), request.getDataId(), diff --git a/src/main/java/org/nrg/xnat/event/listeners/DicomToNiftiEmailHandler.java b/src/main/java/org/nrg/xnat/event/listeners/DicomToNiftiEmailHandler.java index a2c41276fe0f11e76d261694e9403ec1c0c4755f..1e9de916a099572dfc4c38d2e0b1af9969576ff0 100644 --- a/src/main/java/org/nrg/xnat/event/listeners/DicomToNiftiEmailHandler.java +++ b/src/main/java/org/nrg/xnat/event/listeners/DicomToNiftiEmailHandler.java @@ -8,8 +8,8 @@ import reactor.fn.Consumer; import org.apache.log4j.Logger; import org.nrg.xdat.om.WrkWorkflowdata; +import org.nrg.xft.event.entities.WorkflowStatusEvent; import org.nrg.xft.event.persist.PersistentWorkflowUtils; -import org.nrg.xnat.event.entities.WorkflowStatusEvent; import org.springframework.stereotype.Service; import static reactor.bus.selector.Selectors.R; diff --git a/src/main/java/org/nrg/xnat/event/listeners/PipelineEmailHandlerAbst.java b/src/main/java/org/nrg/xnat/event/listeners/PipelineEmailHandlerAbst.java index 6468c88d7d4fd70327a7e7a6da281276d34bf5fc..ecc8b48dd42b6a3741375defc91a888fa4dfcc6d 100644 --- a/src/main/java/org/nrg/xnat/event/listeners/PipelineEmailHandlerAbst.java +++ b/src/main/java/org/nrg/xnat/event/listeners/PipelineEmailHandlerAbst.java @@ -18,7 +18,7 @@ import org.nrg.xdat.om.XnatSubjectassessordata; import org.nrg.xdat.schema.SchemaElement; import org.nrg.xdat.turbine.utils.TurbineUtils; import org.nrg.xft.db.PoolDBUtils; -import org.nrg.xnat.event.entities.WorkflowStatusEvent; +import org.nrg.xft.event.entities.WorkflowStatusEvent; import org.nrg.xnat.notifications.NotifyProjectPipelineListeners; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/nrg/xnat/event/listeners/WorkflowStatusEventHandlerAbst.java b/src/main/java/org/nrg/xnat/event/listeners/WorkflowStatusEventHandlerAbst.java index f74e60e0c8ae99d26dcb0bf84a0fe53458324b87..bef5985a974b51988cad96fb593edc52bce321e8 100644 --- a/src/main/java/org/nrg/xnat/event/listeners/WorkflowStatusEventHandlerAbst.java +++ b/src/main/java/org/nrg/xnat/event/listeners/WorkflowStatusEventHandlerAbst.java @@ -12,8 +12,8 @@ package org.nrg.xnat.event.listeners; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; +import org.nrg.xft.event.entities.WorkflowStatusEvent; import org.nrg.xft.event.persist.PersistentWorkflowUtils; -import org.nrg.xnat.event.entities.WorkflowStatusEvent; /** * @author Tim Olsen <tim@deck5consulting.com> 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 d24fc998c91f0adb9b095dc615647eacf16f0cb3..2bf635d245578acb394ce4fc6e5848bf9646a9c6 100644 --- a/src/main/java/org/nrg/xnat/helpers/prearchive/PrearcDatabase.java +++ b/src/main/java/org/nrg/xnat/helpers/prearchive/PrearcDatabase.java @@ -85,6 +85,7 @@ public final class PrearcDatabase { "}\n"; public static final Script DEFAULT_SPLIT_PETMR_SESSION_SCRIPT = new Script(SPLIT_PETMR_SESSION_ID, + "Split PET/MR script", "Default implementation of the split PET/MR session script.", "groovy", "", DEFAULT_SPLIT_PETMR_SESSION_FILTER); 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 ee9700a20a4efe9a82ef1c08cafac816ec8f8d89..929f86edf0e8725e786d06cfba63301aecc2a74d 100644 --- a/src/main/java/org/nrg/xnat/restlet/actions/AutomationBasedImporter.java +++ b/src/main/java/org/nrg/xnat/restlet/actions/AutomationBasedImporter.java @@ -52,7 +52,6 @@ import org.nrg.xdat.XDAT; import org.nrg.xdat.om.XnatExperimentdata; import org.nrg.xdat.om.XnatProjectdata; import org.nrg.xdat.om.XnatSubjectdata; -import org.nrg.xnat.event.entities.WorkflowStatusEvent; import org.nrg.xnat.event.listeners.AutomationCompletionEventListener; import org.nrg.xnat.restlet.actions.importer.ImporterHandler; import org.nrg.xnat.restlet.actions.importer.ImporterHandlerA; @@ -70,6 +69,7 @@ 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; import org.nrg.xft.event.persist.PersistentWorkflowUtils.EventRequirementAbsent; diff --git a/src/main/java/org/nrg/xnat/restlet/resources/ScriptResource.java b/src/main/java/org/nrg/xnat/restlet/resources/ScriptResource.java index 059d174c4ddbcbc19d8e4bc660e84ad4ad800922..e433a37e8e480949cc34564b11d967d5125fbeb4 100644 --- a/src/main/java/org/nrg/xnat/restlet/resources/ScriptResource.java +++ b/src/main/java/org/nrg/xnat/restlet/resources/ScriptResource.java @@ -161,6 +161,7 @@ public class ScriptResource extends AutomationResource { ArrayList<String> columns = new ArrayList<>(); columns.add("Script ID"); + columns.add("Script Label"); columns.add("Language"); columns.add("Description"); //columns.add("Version"); @@ -171,6 +172,7 @@ public class ScriptResource extends AutomationResource { final List<Script> scripts = _scriptService.getAll(); for (final Script script : scripts) { table.insertRowItems(script.getScriptId(), + script.getScriptLabel(), script.getLanguage(), script.getDescription()); //script.getScriptVersion()); diff --git a/src/main/java/org/nrg/xnat/turbine/modules/screens/XDATScreen_search_wizard2.java b/src/main/java/org/nrg/xnat/turbine/modules/screens/XDATScreen_search_wizard2.java index 6104fc3f54a5d11ae4246e5f6df67592fe8f129e..a390ac8b083caf9612419d22e5629e00dd0ae0ef 100644 --- a/src/main/java/org/nrg/xnat/turbine/modules/screens/XDATScreen_search_wizard2.java +++ b/src/main/java/org/nrg/xnat/turbine/modules/screens/XDATScreen_search_wizard2.java @@ -10,27 +10,45 @@ */ package org.nrg.xnat.turbine.modules.screens; -import java.util.Hashtable; -import java.util.Map; - import org.apache.turbine.util.RunData; import org.apache.velocity.context.Context; import org.nrg.xdat.display.ElementDisplay; +import org.nrg.xdat.schema.SchemaElement; import org.nrg.xdat.security.helpers.UserHelper; import org.nrg.xdat.turbine.modules.screens.SecureScreen; import org.nrg.xdat.turbine.utils.TurbineUtils; +import org.nrg.xft.security.UserI; + +import java.util.Hashtable; +import java.util.Map; public class XDATScreen_search_wizard2 extends SecureScreen { @Override protected void doBuildTemplate(RunData data, Context context) throws Exception { + UserI user = TurbineUtils.getUser(data); Map<String,Object> additional=new Hashtable<String,Object>(); + Map<String,Object> additionalDescriptions=new Hashtable<String,Object>(); + Map<String,Object> additionalSchemaElements=new Hashtable<String,Object>(); + Object elementZero = TurbineUtils.GetPassedParameter("ELEMENT_0", data); context.put("ELEMENT_0", TurbineUtils.GetPassedParameter("ELEMENT_0", data)); for(ElementDisplay ed : UserHelper.getUserHelperService(TurbineUtils.getUser(data)).getSearchableElementDisplaysByPluralDesc()){ - if(TurbineUtils.HasPassedParameter("super_"+ed.getElementName(), data)) - additional.put(ed.getElementName(), TurbineUtils.GetPassedParameter("super_"+ed.getElementName(), data)); + if(TurbineUtils.HasPassedParameter("super_"+ed.getElementName(), data)) { + Object superElement = TurbineUtils.GetPassedParameter("super_" + ed.getElementName(), data); + additional.put(ed.getElementName(), superElement); + additionalDescriptions.put(ed.getElementName(), UserHelper.getUserHelperService(user).getElementSecurity(ed.getElementName()).getPluralDescription()); + additionalSchemaElements.put(ed.getElementName(), UserHelper.getUserHelperService(user).getElementSecurity(ed.getElementName()).getSchemaElement()); + } } context.put("additional_types", additional); + context.put("additional_descriptions", additionalDescriptions); + context.put("additional_schema_elements", additionalSchemaElements); + + String pivotDescription = UserHelper.getUserHelperService(user).getElementSecurity(elementZero.toString()).getPluralDescription(); + context.put("pivot_description", pivotDescription); + SchemaElement pivotSchemaElement = UserHelper.getUserHelperService(user).getElementSecurity(elementZero.toString()).getSchemaElement(); + context.put("pivot_schema_element", pivotSchemaElement); + } } diff --git a/src/main/webapp/WEB-INF/views/spawner/elements.jsp b/src/main/webapp/WEB-INF/views/spawner/elements.jsp index bea671ed2573041d7d256d8de89739360fd3d41e..8ab1ef057b0b4755787074cfc5e0483481c93167 100644 --- a/src/main/webapp/WEB-INF/views/spawner/elements.jsp +++ b/src/main/webapp/WEB-INF/views/spawner/elements.jsp @@ -226,6 +226,12 @@ <input type="text" name="script-id-input" class="script-id-input" size="30" value=""> </td> </tr> + <tr> + <td><b>Script Label: </b> </td> + <td> + <input type="text" name="scriptLabel" class="scriptLabel" size="80" value=""> + </td> + </tr> <tr> <td><b>Description: </b> </td> <td><input type="text" name="script-description" class="script-description" size="80" value=""></td> diff --git a/src/main/webapp/scripts/xnat/app/eventsManager.js b/src/main/webapp/scripts/xnat/app/eventsManager.js index cf236a677d1c9707b9bb179f4dadfb103a6899e6..5320bb34a5921c51e54209bab09cbd92bd1952bf 100644 --- a/src/main/webapp/scripts/xnat/app/eventsManager.js +++ b/src/main/webapp/scripts/xnat/app/eventsManager.js @@ -51,7 +51,7 @@ $(function(){ '<dl class="header">' + '<dl>' + '<dd class="col1">Event</dd>' + - '<dd class="col2">Script ID</dd>' + + '<dd class="col2">Script</dd>' + '<dd class="col3">Description</dd>' + ((doEdit) ? '<dd class="col4"></dd>' + @@ -359,7 +359,7 @@ $(function(){ } else { forEach(scripts, function(script){ - options += '<option title="' + script['Description'] + '" value="' + script['Script ID'] + '">' + script['Script ID'] + '</option>'; + options += '<option title="' + script['Description'] + '" value="' + script['Script ID'] + '">' + script['Script ID'] + ':' + script['Script Label'] + '</option>'; eventsManager.scripts.push(script['Script ID']); }); $scriptsMenu.html(options); @@ -396,7 +396,7 @@ $(function(){ }; if (!data.event || data.event === '!' || !data.scriptId){ - xmodal.message('Missing Information','Please select an <b>Event</b> <i>and</i> <b>Script ID</b> to create an <br>Event Handler.'); + xmodal.message('Missing Information','Please select an <b>Event</b> <i>and</i> <b>Script</b> to create an <br>Event Handler.'); return false; } XNAT.app.eventsManager.eventHandlerData = data; @@ -493,7 +493,7 @@ $(function(){ '<dl class="header">' + '<dl>' + '<dd class="col1">Event</dd>' + - '<dd class="col2">Script ID</dd>' + + '<dd class="col2">Script</dd>' + '<dd class="col3">Description</dd>' + '<dd class="col4"></dd>' + '<dd class="col5"></dd>' + @@ -504,7 +504,7 @@ $(function(){ '<table id="events_manage_table" class="xnat-table" style="display:table;width:100%">' + '<thead>' + '<th>Event</th>' + - '<th>Script ID</th>' + + '<th>Script</th>' + '<th>Description</th>' + '<th></th>' + '<th></th>' + diff --git a/src/main/webapp/scripts/xnat/app/scriptEditor.js b/src/main/webapp/scripts/xnat/app/scriptEditor.js index 2de23f98855b32e5227aae370dee3190e3f2f5ea..4d82de62524e20a475789e3c225c7b35840230dc 100644 --- a/src/main/webapp/scripts/xnat/app/scriptEditor.js +++ b/src/main/webapp/scripts/xnat/app/scriptEditor.js @@ -141,6 +141,7 @@ var XNAT = getObject(XNAT||{}); $dialog.find('.editor-content').attr('id'); var data = { + scriptLabel: $dialog.find('.scriptLabel').val(), content: ace.edit(editor_id).getSession().getValue(), description: $dialog.find('.script-description').val(), scriptVersion: $dialog.find('.script-version').val(), @@ -228,6 +229,7 @@ var XNAT = getObject(XNAT||{}); $dialog.find('.id').val(json.id || ''); $dialog.find('.scriptId').val(scriptId); + $dialog.find('.scriptLabel').val(json.scriptLabel || ''); $dialog.find('.language').val(lang); $dialog.find('.timestamp').val(time); $dialog.find('.script-description').val(json.description || ''); @@ -278,6 +280,7 @@ var XNAT = getObject(XNAT||{}); //$dialog.find('.id').val(json.id || ''); $dialog.find('.scriptId').val(scriptId || ''); + $dialog.find('.scriptLabel').val(json.scriptLabel || ''); $dialog.find('.language').val(json.language || ''); $dialog.find('.timestamp').val(json.timestamp || ''); $dialog.find('.script-description').val(json.description || ''); @@ -407,6 +410,7 @@ var XNAT = getObject(XNAT||{}); xhr.getJSON(scriptURL(scriptId), function( json ){ var data = { //scriptId: json.scriptId + '_copy', + scriptLabel: json.scriptLabel, description: json.description, content: json.content, language: json.language, diff --git a/src/main/webapp/scripts/xnat/app/siteEventsManager.js b/src/main/webapp/scripts/xnat/app/siteEventsManager.js index fbf982a8942792126a888a62168885abfecd386e..98266a064c8baee50d2b71c5acb8a635c3c9bb6d 100644 --- a/src/main/webapp/scripts/xnat/app/siteEventsManager.js +++ b/src/main/webapp/scripts/xnat/app/siteEventsManager.js @@ -51,7 +51,7 @@ $(function(){ '<dl class="header">' + '<dl>' + '<dd class="col1">Event</dd>' + - '<dd class="col2">Script ID</dd>' + + '<dd class="col2">Script</dd>' + '<dd class="col3">Description</dd>' + //((doEdit) ? '<dd class="col4"></dd>' + @@ -156,7 +156,7 @@ $(function(){ '<dl class="header">' + '<dl>' + '<dd class="col1">Event</dd>' + - '<dd class="col2">Script ID</dd>' + + '<dd class="col2">Script</dd>' + '<dd class="col3">Description</dd>' + '<dd class="col4"></dd>' + '<dd class="col5"></dd>' + @@ -167,7 +167,7 @@ $(function(){ '<table id="events_manage_table" class="xnat-table" style="display:table;width:100%">' + '<thead>' + '<th>Event</th>' + - '<th>Script ID</th>' + + '<th>Script</th>' + '<th>Description</th>' + '<th></th>' + '<th></th>' + @@ -424,7 +424,7 @@ $(function(){ } else { forEach(scripts, function(script){ - options += '<option title="' + script['Description'] + '" value="' + script['Script ID'] + '">' + script['Script ID'] + '</option>'; + options += '<option title="' + script['Description'] + '" value="' + script['Script ID'] + '">' + script['Script ID'] + ':' + script['Script Label'] + '</option>'; siteEventsManager.scripts.push(script['Script ID']); }); $scriptsMenu.html(options); @@ -465,7 +465,7 @@ $(function(){ //var url = serverRoot + "/data/projects/" + window.projectScope + "/automation/events?XNAT_CSRF=$!XNAT_CSRF"; if (!data.event || data.event === '!' || !data.scriptId){ - xmodal.message('Missing Information','Please select an <b>Event</b> <i>and</i> <b>Script ID</b> to create an <br>Event Handler.'); + xmodal.message('Missing Information','Please select an <b>Event</b> <i>and</i> <b>Script</b> to create an <br>Event Handler.'); return false; } XNAT.app.siteEventsManager.eventHandlerData = data; diff --git a/src/main/webapp/xnat-templates/screens/EditScript.vm b/src/main/webapp/xnat-templates/screens/EditScript.vm index adf2bfecf14a464566b6a40bd4ad1fe679fbd093..81004d61002380c66ad411c2aeb70158ce87bed6 100755 --- a/src/main/webapp/xnat-templates/screens/EditScript.vm +++ b/src/main/webapp/xnat-templates/screens/EditScript.vm @@ -29,7 +29,8 @@ function saveScript() { // TODO: check script ID, warn and stop if blank or invalid. var url = serverRoot + "/data/automation/scripts/" + jq('#scriptId').val() + "?XNAT_CSRF=$!XNAT_CSRF"; - var data = { content: ace.edit("editor").getSession().getValue(), + var data = { scriptLabel: jq('#scriptLabel').val(), + content: ace.edit("editor").getSession().getValue(), description: jq('#description').val() }; jQuery.ajax({ type: 'PUT', @@ -67,6 +68,9 @@ <tr> <td><label for="scriptId"><strong>Script ID:</strong></label></td><td><input type="text" name="scriptId" id="scriptId" value="$!script.scriptId"/></td> </tr> + <tr> + <td><label for="scriptLabel"><strong>Script Label:</strong></label></td><td><input type="text" name="scriptLabel" id="scriptLabel" size="80" value="$!script.scriptLabel"/></td> + </tr> <tr> <td><label for="scriptVersion"><strong>Version:</strong></label></td><td><input type="text" name="scriptVersion" id="scriptVersion" size="80" value="$!script.scriptVersion" readonly/></td> </tr> diff --git a/src/main/webapp/xnat-templates/screens/Scripts.vm b/src/main/webapp/xnat-templates/screens/Scripts.vm index dacb9a5deeedb745d1820d45d68187dfd32e17a0..3737ecb0a3cfdb4bf226cfdce6689a4ab634335e 100644 --- a/src/main/webapp/xnat-templates/screens/Scripts.vm +++ b/src/main/webapp/xnat-templates/screens/Scripts.vm @@ -166,7 +166,7 @@ <td><div id="filterDiv"></div></td> </tr> <tr> - <td><label for="scriptId" class="required"><strong>Script ID:</strong><i>*</i></label></td> + <td><label for="scriptId" class="required"><strong>Script:</strong><i>*</i></label></td> <td><select id="select_scriptId" name="scriptId" class="scriptId"></select></td> </tr> <tr> @@ -239,7 +239,7 @@ <table id="events_table" class="xnat-table" style="display:none;width:100%;"> <thead> <th>Event</th> - <th>Script ID</th> + <th>Script</th> <th>Description</th> </thead> <tbody> @@ -428,6 +428,12 @@ <input type="text" name="script-id-input" class="script-id-input" size="30" value=""> </td> </tr> + <tr> + <td><b>Script Label: </b> </td> + <td> + <input type="text" name="scriptLabel" class="scriptLabel" size="80" value=""> + </td> + </tr> <tr> <td><b>Description: </b> </td> <td><input type="text" name="script-description" class="script-description" size="80" value=""></td> diff --git a/src/main/webapp/xnat-templates/screens/XDATScreen_search_wizard2.vm b/src/main/webapp/xnat-templates/screens/XDATScreen_search_wizard2.vm index 1ae137f8ad0d21c84e60ac31dc484c47a792263e..8a41e47bbe4f027bc2de8005a5e7678597e7840b 100644 --- a/src/main/webapp/xnat-templates/screens/XDATScreen_search_wizard2.vm +++ b/src/main/webapp/xnat-templates/screens/XDATScreen_search_wizard2.vm @@ -24,7 +24,7 @@ <ol class="steps"> <li class="step1"> - <h3>Pivot Data-type: $user.getElementSecurity($ELEMENT_0).getPluralDescription()</h3> + <h3>Pivot Data-type: $pivot_description</h3> <input type="hidden" name="ELEMENT_0" value="$ELEMENT_0"> </li> @@ -36,7 +36,7 @@ #foreach ($key in $additional_types.keySet()) <tr> <td> - <b>$user.getElementSecurity($key).getPluralDescription()</b> + <b>$additional_descriptions.get($key)</b> </td> <td nowrap> $additional_types.get($key) @@ -68,24 +68,24 @@ <div id="super_search" class="yui-navset" style="max-width:800px !important;margin-top:30px;margin-left:-40px;"> <ul class="yui-nav" style=""> <li class="selected"> - <a href="#$ELEMENT_0"><em>$user.getElementSecurity($ELEMENT_0).getPluralDescription()</em></a> + <a href="#$ELEMENT_0"><em>$pivot_description</em></a> </li> - #foreach ($key in $additional_types.keySet()) + #foreach ($key in $additional_descriptions.keySet()) #if(!$key.equals($ELEMENT_0)) <li> - <a href="#$key"><em>$user.getElementSecurity($key).getPluralDescription()</em></a> + <a href="#$key"><em>$additional_descriptions.get($key)</em></a> </li> #end #end </ul> <div class="yui-content"> <div id="$ELEMENT_0"> - <p>#xdatSearchElement($user.getElementSecurity($ELEMENT_0).getSchemaElement() 3)</p> + <p>#xdatSearchElement($pivot_schema_element 3)</p> </div> - #foreach ($key in $additional_types.keySet()) + #foreach ($key in $additional_schema_elements.keySet()) #if(!$key.equals($ELEMENT_0)) <div id="$key"> - <p>#xdatSearchElement($user.getElementSecurity($key).getSchemaElement() 3)</p> + <p>#xdatSearchElement($additional_schema_elements.get($key) 3)</p> </div> #end #end diff --git a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_manage.vm b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_manage.vm index 8d2f168f1486998b9a27deb0d1a67cf0bdf18c3e..3a5baba505003b4c6561756c89c28084ecb4b7b3 100644 --- a/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_manage.vm +++ b/src/main/webapp/xnat-templates/screens/xnat_projectData/xnat_projectData_summary_manage.vm @@ -173,7 +173,7 @@ <td><div id="filterDiv"></div></td> </tr> <tr> - <td><label for="scriptId" class="required"><strong>Script ID:</strong><i>*</i></label></td> + <td><label for="scriptId" class="required"><strong>Script:</strong><i>*</i></label></td> <td><select id="select_scriptId" name="scriptId" class="scriptId"></select></td> </tr> <tr> @@ -480,7 +480,7 @@ <table id="events_table" class="xnat-table" style="display:none;width:100%;"> <thead> <th>Event</th> - <th>Script ID</th> + <th>Script</th> <th>Description</th> </thead> <tbody>