Commits

Mohana Ramaratnam committed 4c907e1 Merge

Commit after merge with nrg

Comments (0)

Files changed (48)

plugin-resources/project-skeletons/xnat/src/schemas/xnat/display/xnat_projectData_display.xml

 	</DisplayField>
 	<DisplayField id="NAME_CSV" header="Title" visible="true" searchable="true">
 		<DisplayFieldElement name="Field1" schema-element="xnat:projectData/name"/>
+		<HTML-Link>
+			<Property name="HREF" value="@WEBAPPapp/action/DisplayItemAction/search_value/@Field1/search_element/xnat:projectData/search_field/xnat:projectData.ID">
+				<InsertValue id="Field1" field="ID"/>
+			</Property>
+			<Property name="ONCLICK" value="return rpt('@Field1','xnat:projectData','xnat:projectData.ID');">
+				<InsertValue id="Field1" field="ID"/>
+			</Property>
+		</HTML-Link>
 	</DisplayField>
 	<DisplayField id="DESCRIPTION" header="Description" visible="true" searchable="true">
 		<DisplayFieldElement name="Field1" schema-element="xnat:projectData/description"/>

plugin-resources/project-skeletons/xnat/src/schemas/xnat/xnat.xsd

 					</xs:element>
 					<xs:element name="educationDesc" type="xs:string" minOccurs="0"/>
 					<xs:element name="race" type="xs:string" minOccurs="0"/>
+					<xs:element name="race2" type="xs:string" minOccurs="0"/>
+					<xs:element name="race3" type="xs:string" minOccurs="0"/>
+					<xs:element name="race4" type="xs:string" minOccurs="0"/>
+					<xs:element name="race5" type="xs:string" minOccurs="0"/>
+					<xs:element name="race6" type="xs:string" minOccurs="0"/>
 					<xs:element name="ethnicity" type="xs:string" minOccurs="0"/>
 					<xs:element name="weight" minOccurs="0">
 						<xs:complexType>
 					<xs:element name="start_time_injection" type="xs:dateTime" minOccurs="0"/>
 					<xs:element name="blood_glucose" type="xs:float" minOccurs="0"/>
 					<xs:element name="blood_glucose_units" type="xs:string" minOccurs="0"/>
+					<xs:element name="blood_glucose_collection_time" type="xs:dateTime" minOccurs="0"/>
 				</xs:sequence>
 			</xs:extension>
 		</xs:complexContent>

plugin-resources/repository/dcm/jars/DicomUtils-1.0.jar

Binary file modified.

plugin-resources/repository/xdat/jars/xdat-1.jar

Binary file modified.

plugin-resources/webapp/xdat-templates/macros/TurbineMacros.vm

     #end
 #end
 
-
 #macro (xdatPKDisplay $name $item)
 	<input id="$name" type="hidden" name="$name" value="$item.getStringProperty($name)"/>
 	$item.getProperty($name)
 	#end
 #end
 
+#macro (xdatBooleanCheckbox $name $item $vr)
+#if ($vr)
+	#if($vr.getField($name))
+		<font color="red">&#8658</font>
+	#end
+#end
+	#set($value = $!item.getBooleanProperty($name))
+
+	## The hidden box is necessary to submit a "false" value if the checkbox is unchecked
+	## If the checkbox is checked, its true value will override the hidden's "false" value
+	<input type="checkbox" name="$name" value="1" #if($value) CHECKED #end />
+	<input type="hidden" name="$name" value="0" />`
+#end
+
 #macro (xdatBooleanRadio $name $item $defaultValue $vr)
 #if ($vr)
 	#if($vr.getField($name))
 	#end
 #end
 
+#macro (xdatBooleanRadioYesNoWithoutDefault $name $item $vr)
+#if ($vr)
+	#if($vr.getField($name))
+		<font color="red">&#8658</font>
+	#end
+#end
+	#set($value = "$!item.getBooleanProperty($name)")
+
+	#if ($value == "true")
+	<input type="radio" name="$name" value="1" CHECKED/>&nbsp;yes
+	<input type="radio" name="$name" value="0"/>&nbsp;no
+	#elseif ($value == "false")
+	<input type="radio" name="$name" value="1"/>&nbsp;yes
+	<input type="radio" name="$name" value="0" CHECKED/>&nbsp;no
+	#else
+	<input type="radio" name="$name" value="1"/>&nbsp;yes
+	<input type="radio" name="$name" value="0"/>&nbsp;no
+	#end
+#end
+
+#macro (xdatRadioButtonGroup $name $item $possibleValues $vr)
+#if ($vr)
+	#if($vr.getField($name))
+		<font color="red">&#8658</font>
+	#end
+#end
+	#if($item.isPKField($name) && (!$vr.getField($name)))
+		<input ID="$name" type="hidden" name="$name" value="$item.getProperty($name)"/>
+		$item.getProperty($name)
+	#else
+		#if ($possibleValues.size()==0)
+			<input ID="$name" type="text" name="$name" value="$item.getProperty($name)"/>
+		#else
+			#foreach ($pValue in $possibleValues)
+			<input type="radio" name="$name" VALUE="$pValue" #if($pValue.equals($item.getProperty($name))) CHECKED #end />&nbsp;$pValue
+			#end
+		#end
+	#end
+#end
 
 #macro (xdatComboBox $name $item $settings_alias $vr)
  #if ($vr)
 	#end
 #end
 
+#macro (xdatSimpleSelectBox $name $item $possibleValues $vr)
+#if ($vr)
+	#if($vr.getField($name))
+		<font color="red">&#8658</font>
+	#end
+#end
+	#if($item.isPKField($name) && (!$vr.getField($name)))
+		<input ID="$name" type="hidden" name="$name" value="$item.getProperty($name)"/>
+		$item.getProperty($name)
+	#else
+		#if ($possibleValues.size()==0)
+			<input ID="$name" type="text" name="$name" value="$item.getProperty($name)"/>
+		#else
+			<SELECT ID="$name" name="$name">
+				<OPTION VALUE="">(SELECT)</OPTION>
+				#foreach ($pValue in $possibleValues)
+				<OPTION VALUE="$pValue" #if($pValue.equals($item.getProperty($name))) SELECTED #end>$pValue</OPTION>
+				#end
+			</SELECT>
+		#end
+	#end
+#end
+
 #macro (xdatDateBox $name $item $vr $years)
  #if ($vr)
 	  #if($vr.getField($name))
  <!-- no object found -->
  #end
 #end
+
+#macro(escapeHTML $s)
+$!turbineUtils.escapeHTML($s)
+#end
+ 
+#macro(escapeJS $s)
+$!turbineUtils.escapeJS($s)
+#end

plugin-resources/webapp/xdat-templates/screens/Login.vm

         <font face="$ui.sansSerifFonts">
         #foreach($key in $data.getParameters().getKeys())
         	#if ($key!="action" && $key!="template" &&$key!="password" &&$key!="username" &&$key!="exception")
-        	<input type="hidden" name="$key" value="$turbineUtils.escapeHTML($data.getParameters().getString($key))">	
+        	<input type="hidden" name="$key" value="$!turbineUtils.escapeHTML($!data.getParameters().getString($key))">		
         	#end
         #end
           <input type="submit" value="Login">

plugin-resources/webapp/xdat-templates/screens/Register.vm

 <form name="form2" id="registerForm" method="post" action="$link.setAction("XDATRegisterUser")" onSubmit="return XNAT.app.register.validateForm();">
 		#foreach($key in $data.getParameters().getKeys())
         	#if ($key!="action" && $key!="template" &&$key!="password" &&$key!="phone" &&$key!="comments" &&!$key.startsWith("xdat:user") &&$key!="username" &&$key!="exception")
-   		<input type="hidden" name="$key" value="$turbineUtils.escapeHTML($data.getParameters().getString($key))">	
+   		<input type="hidden" name="$key" value="$!turbineUtils.escapeHTML($!data.getParameters().getString($key))">	
         	#end
         #end
   <table valign="top" align="center">

plugin-resources/webapp/xnat-templates/screens/ConfirmRegistration.vm

   </table>
         #foreach($key in $data.getParameters().getKeys())
         	#if ($key!="action" && $key!="template" &&$key!="password" &&!$key.startsWith("xdat:user") &&$key!="username" &&$key!="exception")
-        		<input type="hidden" name="$key" value="$turbineUtils.escapeHTML($data.getParameters().getString($key))">	
+        		<input type="hidden" name="$key" value="$!turbineUtils.escapeHTML($!data.getParameters().getString($key))">	
         	#end
         #end
 </form>

plugin-resources/webapp/xnat-templates/screens/DICOMUploadApplet.vm

+<script type="text/javascript" src="$content.getURI("scripts/java/deployJava.js")"></script>
+<script type="text/javascript">
+// The upload applet requires at least Java 1.5 (because of the wizard library).
+// We use Java's deployJava.js (http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html)
+// to ensure that a supported version of the JRE exists on the client.
+// Use an anonymous function to prevent global scope
+(function() {
+    SUPPORTED_JRE_VERSIONS = ["1.5", "1.6", "1.7"];
+    
+    function hasSupport(versions) {
+        for (var i=0; i < versions.length; i++) {
+            if (deployJava.versionCheck(versions[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    if (!hasSupport(SUPPORTED_JRE_VERSIONS)) {
+        alert("Applet will not work without supported JRE version.  Requires one of " + SUPPORTED_JRE_VERSIONS.join(", "));
+    }
+})();
+</script>
+
 <APPLET CODE="org.nrg.upload.ui.UploadAssistantApplet"
   CODEBASE="$content.getURI("applet/")"
   ARCHIVE="UploadAssistant-0.1-SNAPSHOT.jar,wizard-0.998.2-SNAPSHOT.jar,json-20080701.jar,DicomUtils-1.0.jar,DicomEdit-1.2-SNAPSHOT.jar,dcm4che-core-2.0.22-SNAPSHOT.jar,dcm4che-net-2.0.22-SNAPSHOT.jar,log4j-1.2.15.jar,slf4j-api-1.5.2.jar,slf4j-log4j12-1.5.2.jar,antlr-runtime-3.2.jar,stringtemplate-3.2.jar,ecat-io-0.1-SNAPSHOT.jar,ecat-edit-0.1-SNAPSHOT.jar"

plugin-resources/webapp/xnat-templates/screens/ForgotLogin.vm

   </table>
         #foreach($key in $data.getParameters().getKeys())
         	#if ($key!="action" && $key!="template" &&$key!="password" &&!$key.startsWith("xdat:user") &&$key!="username" &&$key!="exception")
-        	<input type="hidden" name="$key" value="$turbineUtils.escapeHTML($data.getParameters().getString($key))">	
+        	<input type="hidden" name="$key" value="$!turbineUtils.escapeHTML($!data.getParameters().getString($key))">	
         	#end
         #end
 </form>

plugin-resources/webapp/xnat-templates/screens/PipelineScreen_add_project_pipeline.vm

-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
-
-<style type="text/css">
- .popup {
-  position: absolute;
-  visibility: hidden;
-  background-color: #FDD;
-  layer-background-color: #FDD;
-  width: 200;
-  border-left: 1px solid black;
-  border-top: 1px solid black;
-  border-bottom: 3px solid black;
-  border-right: 3px solid black;
-  padding: 3px;
-  z-index: 10;
- }
-</style>
-
-    <script type="text/javascript"><!--
-
-function getStyleObject(objectId) {
-    // cross-browser function to get an objects style object given its id
-    if(document.getElementById && document.getElementById(objectId)) {
-	// W3C DOM
-	return document.getElementById(objectId).style;
-    } else if (document.all && document.all(objectId)) {
-	// MSIE 4 DOM
-	return document.all(objectId).style;
-    } else if (document.layers && document.layers[objectId]) {
-	// NN 4 DOM.. note: this wont find nested layers
-	return document.layers[objectId];
-    } else {
-	return false;
-    }
-} // getStyleObject
-
-
-function changeObjectVisibility(objectId, newVisibility) {
-    // get a reference to the cross-browser style object and make sure the object exists
-    var styleObject = getStyleObject(objectId);
-    if(styleObject) {
-	styleObject.visibility = newVisibility;
-	return true;
-    } else {
-	// we couldn't find the object, so we can't change its visibility
-	return false;
-    }
-} // changeObjectVisibility
-
-function moveObject(objectId, newXCoordinate, newYCoordinate) {
-    // get a reference to the cross-browser style object and make sure the object exists
-    var styleObject = getStyleObject(objectId);
-    if(styleObject) {
-	styleObject.left = newXCoordinate;
-	styleObject.top = newYCoordinate;
-	return true;
-    } else {
-	// we could not find the object, so we cannot very well move it
-	return false;
-    }
-} // moveObject
-
-
-var xOffset = 5;
-var yOffset = -5;
-
-function showPopup (targetObjectId, eventObj) {
-    if(eventObj) {
-	// hide any currently-visible popups
-	hideCurrentPopup();
-	// stop event from bubbling up any farther
-	eventObj.cancelBubble = true;
-	// move popup div to current cursor position 
-	// (add scrollTop to account for scrolling for IE)
-	var newXCoordinate = (eventObj.pageX)?eventObj.pageX + xOffset:eventObj.x + xOffset + ((document.body.scrollLeft)?document.body.scrollLeft:0);
-	var newYCoordinate = (eventObj.pageY)?eventObj.pageY + yOffset:eventObj.y + yOffset + ((document.body.scrollTop)?document.body.scrollTop:0);
-	moveObject(targetObjectId, newXCoordinate, newYCoordinate);
-	// and make it visible
-	if( changeObjectVisibility(targetObjectId, 'visible') ) {
-	    // if we successfully showed the popup
-	    // store its Id on a globally-accessible object
-	    window.currentlyVisiblePopup = targetObjectId;
-	    return true;
-	} else {
-	    // we could not show the popup, boo hoo!
-	    return false;
-	}
-    } else {
-	// there was no event object, so we wont be able to position anything, so give up
-	return false;
-    }
-} // showPopup
-
-function hideCurrentPopup() {
-    // note: we have stored the currently-visible popup on the global object window.currentlyVisiblePopup
-    if(window.currentlyVisiblePopup) {
-	changeObjectVisibility(window.currentlyVisiblePopup, 'hidden');
-	window.currentlyVisiblePopup = false;
-    }
-} // hideCurrentPopup
-
-
-  --></script>
-
-$data.setLayoutTemplate("Popup.vm")
-$page.setTitle("Modify Pipeline")
-$page.setLinkColor($ui.alink)
-$page.setVlinkColor($ui.vlink)
-#if ($data.message)
-<font color="red" size="3">$data.message</font>
-#end
-<p>
-<form ID="form1" name="form1" method="post" action="$link.setAction("ManagePipeline")">
-#if($vr)
-	<font color="red">Invalid parameters:<BR>$vr.toHTML()</font>
-<HR>
-#end
-
-
-#set ($schemaType = $newpipeline.getSchemaElementName())
-#set ($dblQts='"')
-#set ($sizeOfTextBox = 45)
-
-$newpipeline.getDescription() 
-
-<br/>
-<br/>
-
-#set ($checked="")
-#if ($isAutoArchive)
-#set ($checked="checked")
-#end
-
-<TABLE width="100%">
-	<TR>
-		<TD colspan="2" align="left"><b>Pipeline setup</b></TD>
-	</TR>
-	<TR>
-		<TD><b>Is this pipeline to be launched automatically while archiving?</b></TD>
-		<TD> <input type="checkbox"  name="auto_archive" $checked/> </TD>
-	</TR>
-
-<input type="hidden"  id=$dblQts${schemaType}.stepId$dblQts name=$dblQts${schemaType}.stepId$dblQts value="$newpipeline.getName()"/></TD>
-<input type="hidden"   id=$dblQts${schemaType}.displayText$dblQts name=$dblQts${schemaType}.displayText$dblQts value="$newpipeline.getDisplaytext()"/>
-<input type="hidden"  id=$dblQts${schemaType}.name$dblQts name=$dblQts${schemaType}.name$dblQts value="$newpipeline.getName()"/>
-<input type="hidden"  id=$dblQts${schemaType}.location$dblQts name=$dblQts${schemaType}.location$dblQts value="$newpipeline.getLocation()"/>
-<input type="hidden"  id=$dblQts${schemaType}.customwebpage$dblQts name=$dblQts${schemaType}.customwebpage$dblQts value="$!newpipeline.getCustomwebpage()"/>
-<input type="hidden"  id=$dblQts${schemaType}.description$dblQts name=$dblQts${schemaType}.description$dblQts value='$!newpipeline.getDescription()'/>
-
-
-	#set ($parameters =$newpipeline.getParameters_parameter())
-	#if ($parameters.size() > 0)
-	<TR>
-	   <TD><b>Project specific pipeline parameters:</b></TD>
-	   <TD>&nbsp;</td>	
-	</TR>
-	<TR>
-	   <TD colspan="2" align="left">Note: Parameters that take multiple values should be comma-separated</TD>
-	</TR>
-	<TR>
-		<TD colspan="2" align="left"> 
-		    <TABLE>
-			<TR>
-			  <TH>Name</TH> <TH colspan="2" align="center"> Values</TH> 
-			</TR>
-			#set ($c = 0)
-			#foreach ($parameter in $parameters)
-			<TR>
-			  <TD><input type="hidden"  id=$dblQts${schemaType}.parameters.parameter[$c].name$dblQts name=$dblQts${schemaType}.parameters.parameter[$c].name$dblQts value="$parameter.getName()"/><font size="-1">$parameter.getName()</font>
-			</TD> 
-			   <td>	
-			  <input type="hidden" size="45" id=$dblQts${schemaType}.parameters.parameter[$c].schemaLink$dblQts name=$dblQts${schemaType}.parameters.parameter[$c].schemaLink$dblQts value="$!parameter.getSchemalink()"/>
-			  </td>
-			  <TD><input type="text" size="45" id=$dblQts${schemaType}.parameters.parameter[$c].csvValues$dblQts  name=$dblQts${schemaType}.parameters.parameter[$c].csvValues$dblQts value="$!parameter.getCsvvalues()"/></TD>
-			</tr>
-		<input type="hidden" id=$dblQts${schemaType}.parameters.parameter[$c].description$dblQts name=$dblQts${schemaType}.parameters.parameter[$c].description$dblQts value="$!parameter.getDescription()"/>
-	#set ($c = $c + 1)
-			#end
-		    </TABLE>
-		</TD>
-	</TR>
-	#set ($c = 0)
-	#foreach ($parameter in $parameters)
-
-	<div class=popup onclick="event.cancelBubble = true;" id=desc$c>
-	  <p><b>$parameter.getName(): </b>$!parameter.getDescription() </p>
-
-	  <a href="#" onclick="hideCurrentPopup(); return false;">Close</a>
-	</div>
-	#set ($c = $c + 1)
-			#end
-	#else 
-	<TR>
-		<TD colspan="2" align="left">There are no paramaters to set for this pipeline. Click on Submit button to add this pipeline to your project</TD>
-	</TR>
- 
-	#end
-	<TR>
-		<TD colspan="2" align="center"><input type="button" ONCLICK="javascript:window.close();" value="Close"/>&nbsp;&nbsp;&nbsp;<input type="submit"  name="eventSubmit_doAddprojectpipeline" value="Submit"/></TD>
-	</TR>
-
-
-
-<input type="hidden" name="search_element" value="xnat:projectData"/>
-<input type="hidden" name="search_field" value="xnat:projectData.ID"/>
-<input type="hidden" name="search_value" value="$project"/>
-<input type="hidden" name="project" value="$project"/>
-<input type="hidden" name="pipeline_path" value="$pipeline_path"/>
-<input type="hidden" name="dataType" value="$dataType"/>
-<input type="hidden" name="schemaType" value="$schemaType"/>
-<input type="hidden" name="edit" value="$edit"/>
-<input type="hidden" name="destination" value="JS_Parent_Return.vm"/>
-
-</TABLE>
-</form>
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+<style type="text/css">
+ .popup {
+  position: absolute;
+  visibility: hidden;
+  background-color: #FDD;
+  layer-background-color: #FDD;
+  width: 200;
+  border-left: 1px solid black;
+  border-top: 1px solid black;
+  border-bottom: 3px solid black;
+  border-right: 3px solid black;
+  padding: 3px;
+  z-index: 10;
+ }
+</style>
+
+    <script type="text/javascript"><!--
+
+function getStyleObject(objectId) {
+    // cross-browser function to get an objects style object given its id
+    if(document.getElementById && document.getElementById(objectId)) {
+	// W3C DOM
+	return document.getElementById(objectId).style;
+    } else if (document.all && document.all(objectId)) {
+	// MSIE 4 DOM
+	return document.all(objectId).style;
+    } else if (document.layers && document.layers[objectId]) {
+	// NN 4 DOM.. note: this wont find nested layers
+	return document.layers[objectId];
+    } else {
+	return false;
+    }
+} // getStyleObject
+
+
+function changeObjectVisibility(objectId, newVisibility) {
+    // get a reference to the cross-browser style object and make sure the object exists
+    var styleObject = getStyleObject(objectId);
+    if(styleObject) {
+	styleObject.visibility = newVisibility;
+	return true;
+    } else {
+	// we couldn't find the object, so we can't change its visibility
+	return false;
+    }
+} // changeObjectVisibility
+
+function moveObject(objectId, newXCoordinate, newYCoordinate) {
+    // get a reference to the cross-browser style object and make sure the object exists
+    var styleObject = getStyleObject(objectId);
+    if(styleObject) {
+	styleObject.left = newXCoordinate;
+	styleObject.top = newYCoordinate;
+	return true;
+    } else {
+	// we could not find the object, so we cannot very well move it
+	return false;
+    }
+} // moveObject
+
+
+var xOffset = 5;
+var yOffset = -5;
+
+function showPopup (targetObjectId, eventObj) {
+    if(eventObj) {
+	// hide any currently-visible popups
+	hideCurrentPopup();
+	// stop event from bubbling up any farther
+	eventObj.cancelBubble = true;
+	// move popup div to current cursor position 
+	// (add scrollTop to account for scrolling for IE)
+	var newXCoordinate = (eventObj.pageX)?eventObj.pageX + xOffset:eventObj.x + xOffset + ((document.body.scrollLeft)?document.body.scrollLeft:0);
+	var newYCoordinate = (eventObj.pageY)?eventObj.pageY + yOffset:eventObj.y + yOffset + ((document.body.scrollTop)?document.body.scrollTop:0);
+	moveObject(targetObjectId, newXCoordinate, newYCoordinate);
+	// and make it visible
+	if( changeObjectVisibility(targetObjectId, 'visible') ) {
+	    // if we successfully showed the popup
+	    // store its Id on a globally-accessible object
+	    window.currentlyVisiblePopup = targetObjectId;
+	    return true;
+	} else {
+	    // we could not show the popup, boo hoo!
+	    return false;
+	}
+    } else {
+	// there was no event object, so we wont be able to position anything, so give up
+	return false;
+    }
+} // showPopup
+
+function hideCurrentPopup() {
+    // note: we have stored the currently-visible popup on the global object window.currentlyVisiblePopup
+    if(window.currentlyVisiblePopup) {
+	changeObjectVisibility(window.currentlyVisiblePopup, 'hidden');
+	window.currentlyVisiblePopup = false;
+    }
+} // hideCurrentPopup
+
+
+  --></script>
+
+$data.setLayoutTemplate("Popup.vm")
+$page.setTitle("Modify Pipeline")
+$page.setLinkColor($ui.alink)
+$page.setVlinkColor($ui.vlink)
+#if ($data.message)
+<font color="red" size="3">$data.message</font>
+#end
+<p>
+<form ID="form1" name="form1" method="post" action="$link.setAction("ManagePipeline")">
+#if($vr)
+	<font color="red">Invalid parameters:<BR>$vr.toHTML()</font>
+<HR>
+#end
+
+
+#set ($schemaType = $newpipeline.getSchemaElementName())
+#set ($dblQts='"')
+#set ($sizeOfTextBox = 45)
+
+$newpipeline.getDescription() 
+
+<br/>
+<br/>
+
+#set ($checked="")
+#if ($isAutoArchive)
+#set ($checked="checked")
+#end
+
+<TABLE width="100%">
+	<TR>
+		<TD colspan="2" align="left"><b>Pipeline setup</b></TD>
+	</TR>
+	<TR>
+		<TD><b>Is this pipeline to be launched automatically while archiving?</b></TD>
+		<TD> <input type="checkbox"  name="auto_archive" $checked/> </TD>
+	</TR>
+
+<input type="hidden"  id=$dblQts${schemaType}.stepId$dblQts name=$dblQts${schemaType}.stepId$dblQts value="$newpipeline.getName()"/></TD>
+<input type="hidden"   id=$dblQts${schemaType}.displayText$dblQts name=$dblQts${schemaType}.displayText$dblQts value="$newpipeline.getDisplaytext()"/>
+<input type="hidden"  id=$dblQts${schemaType}.name$dblQts name=$dblQts${schemaType}.name$dblQts value="$newpipeline.getName()"/>
+<input type="hidden"  id=$dblQts${schemaType}.location$dblQts name=$dblQts${schemaType}.location$dblQts value="$newpipeline.getLocation()"/>
+<input type="hidden"  id=$dblQts${schemaType}.customwebpage$dblQts name=$dblQts${schemaType}.customwebpage$dblQts value="$!newpipeline.getCustomwebpage()"/>
+<input type="hidden"  id=$dblQts${schemaType}.description$dblQts name=$dblQts${schemaType}.description$dblQts value='$!newpipeline.getDescription()'/>
+
+
+	#set ($parameters =$newpipeline.getParameters_parameter())
+	#if ($parameters.size() > 0)
+	<TR>
+	   <TD><b>Project specific pipeline parameters:</b></TD>
+	   <TD>&nbsp;</td>	
+	</TR>
+	<TR>
+	   <TD colspan="2" align="left">Note: Parameters that take multiple values should be comma-separated</TD>
+	</TR>
+	<TR>
+		<TD colspan="2" align="left"> 
+		    <TABLE>
+			<TR>
+			  <TH>Name</TH> <TH colspan="2" align="center"> Values</TH> 
+			</TR>
+			#set ($c = 0)
+			#foreach ($parameter in $parameters)
+			<TR>
+			  <TD><input type="hidden"  id=$dblQts${schemaType}.parameters.parameter[$c].name$dblQts name=$dblQts${schemaType}.parameters.parameter[$c].name$dblQts value="$parameter.getName()"/><font size="-1">$parameter.getName()</font>
+			</TD> 
+			   <td>	
+			  <input type="hidden" size="45" id=$dblQts${schemaType}.parameters.parameter[$c].schemaLink$dblQts name=$dblQts${schemaType}.parameters.parameter[$c].schemaLink$dblQts value="$!parameter.getSchemalink()"/>
+			  </td>
+			  <TD><input type="text" size="45" id=$dblQts${schemaType}.parameters.parameter[$c].csvValues$dblQts  name=$dblQts${schemaType}.parameters.parameter[$c].csvValues$dblQts value="$!parameter.getCsvvalues()"/></TD>
+			</tr>
+		<input type="hidden" id=$dblQts${schemaType}.parameters.parameter[$c].description$dblQts name=$dblQts${schemaType}.parameters.parameter[$c].description$dblQts value="$!parameter.getDescription()"/>
+	#set ($c = $c + 1)
+			#end
+		    </TABLE>
+		</TD>
+	</TR>
+	#set ($c = 0)
+	#foreach ($parameter in $parameters)
+
+	<div class=popup onclick="event.cancelBubble = true;" id=desc$c>
+	  <p><b>$parameter.getName(): </b>$!parameter.getDescription() </p>
+
+	  <a href="#" onclick="hideCurrentPopup(); return false;">Close</a>
+	</div>
+	#set ($c = $c + 1)
+			#end
+	#else 
+	<TR>
+		<TD colspan="2" align="left">There are no paramaters to set for this pipeline. Click on Submit button to add this pipeline to your project</TD>
+	</TR>
+ 
+	#end
+	<TR>
+		<TD colspan="2" align="center"><input type="button" ONCLICK="javascript:window.close();" value="Close"/>&nbsp;&nbsp;&nbsp;<input type="submit"  name="eventSubmit_doAddprojectpipeline" value="Submit"/></TD>
+	</TR>
+
+
+
+<input type="hidden" name="search_element" value="xnat:projectData"/>
+<input type="hidden" name="search_field" value="xnat:projectData.ID"/>
+<input type="hidden" name="search_value" value="$project"/>
+<input type="hidden" name="project" value="$project"/>
+<input type="hidden" name="pipeline_path" value="$pipeline_path"/>
+<input type="hidden" name="dataType" value="$dataType"/>
+<input type="hidden" name="schemaType" value="$schemaType"/>
+<input type="hidden" name="edit" value="$edit"/>
+<input type="hidden" name="destination" value="JS_Parent_Return.vm"/>
+
+</TABLE>
+</form>
+

plugin-resources/webapp/xnat-templates/screens/login_box.vm

       <td align ="left">
         <font face="$ui.sansSerifFonts">
         #foreach($key in $data.getParameters().getKeys())
-        	#if ($key!="action" && $key!="template" &&$key!="password" &&!$key.startsWith("xdat:user") &&$key!="username" &&$key!="exception" &&$key!="username" &&$key!="exception")
-        		<input type="hidden" name="$key" value="$turbineUtils.escapeHTML($data.getParameters().getString($key))">	
-        	#end
+          	#if ($key!="action" && $key!="template" &&$key!="password" &&!$key.startsWith("xdat:user") &&$key!="username" &&$key!="exception" &&$key!="username" &&$key!="exception")
+            		<input type="hidden" name="$key" value="$!turbineUtils.escapeHTML($!data.getParameters().getString($key))">	
+          	#end
         #end
           <input type="submit" value="Login">
         </font>
       </td>
     </tr>
    </table>
-</form>
+</form>

plugin-resources/webapp/xnat-templates/screens/login_row.vm

         <font face="$ui.sansSerifFonts">
         #foreach($key in $data.getParameters().getKeys())
         	#if ($key!="action" && $key!="template" &&$key!="password" &&$key!="username" &&$key!="exception")
-        	<input type="hidden" name="$key" value="$turbineUtils.escapeHTML($data.getParameters().getString($key))">	
+        	<input type="hidden" name="$key" value="$!turbineUtils.escapeHTML($!data.getParameters().getString($key))">	
         	#end
         #end
           <input type="submit" value="Login">
       </td>
     </tr>
    </table>
-</form>
+</form>

plugin-resources/webapp/xnat-templates/screens/register_box.vm

         <input type="hidden" name="xdat:user.primary_password.encrypt" value="true">
         #foreach($key in $data.getParameters().getKeys())
         	#if ($key!="action" && $key!="template" &&$key!="password" &&!$key.startsWith("xdat:user") &&$key!="username" &&$key!="exception")
-        		<input type="hidden" name="$key" value="$turbineUtils.escapeHTML($data.getParameters().getString($key))">	
+        		<input type="hidden" name="$key" value="$!turbineUtils.escapeHTML($!data.getParameters().getString($key))">	
         	#end
         #end
-              </form>
+              </form>

plugin-resources/webapp/xnat-templates/screens/xnat_mrSessionData/edit/scans.vm

 	  #foreach($scani in [0..$TOP_SCAN])
     #set($scan=$om.getSortedScans().get($scani))
     var tempScan = window.classMapping.newInstance("$!scan.getXSIType()");
-    tempScan.setProperty("ID","$!scan.getId()");
-    tempScan.setProperty("type","$!scan.getType()");
-    tempScan.setProperty("quality","$!scan.getQuality()");
-    tempScan.setProperty("note","$!scan.getNote()");
-    tempScan.setProperty("series_description","$!scan.getSeriesDescription()");
-    tempScan.setProperty("parameters/scanTime","$!scan.getParameters_scantime()");
-		    tempScan.setProperty("parameters/imageType","$!scan.getParameters_imagetype()");
-		    tempScan.setProperty("parameters/scanSequence","$!scan.getParameters_scansequence()");
-		    tempScan.setProperty("parameters/seqVariant","$!scan.getParameters_seqvariant()");
-		    tempScan.setProperty("parameters/scanOptions","$!scan.getParameters_scanoptions()");
-		    tempScan.setProperty("parameters/acqType","$!scan.getParameters_acqtype()");
-		    tempScan.setProperty("frames","$!scan.getFrames()");
-		    tempScan.setProperty("parameters/flip","$!scan.getParameters_flip()");
+    tempScan.setProperty("ID","$!turbineUtils.escapeJS($!scan.getId())"); 
+    tempScan.setProperty("type","$!turbineUtils.escapeJS($!scan.getType())");
+    tempScan.setProperty("quality","$!turbineUtils.escapeJS($!scan.getQuality())");
+    tempScan.setProperty("note","$!turbineUtils.escapeJS($!scan.getNote())");
+    tempScan.setProperty("series_description","$!turbineUtils.escapeJS($!scan.getSeriesDescription())");
+    tempScan.setProperty("parameters/scanTime","$!turbineUtils.escapeJS($!scan.getParameters_scantime())");
+		    tempScan.setProperty("parameters/imageType","$!turbineUtils.escapeJS($!scan.getParameters_imagetype())");
+		    tempScan.setProperty("parameters/scanSequence","$!turbineUtils.escapeJS($!scan.getParameters_scansequence())");
+		    tempScan.setProperty("parameters/seqVariant","$!turbineUtils.escapeJS($!scan.getParameters_seqvariant())");
+		    tempScan.setProperty("parameters/scanOptions","$!turbineUtils.escapeJS($!scan.getParameters_scanoptions())");
+		    tempScan.setProperty("parameters/acqType","$!turbineUtils.escapeJS($!scan.getParameters_acqtype())");
+		    tempScan.setProperty("frames","$!turbineUtils.escapeJS($!scan.getFrames())");
+		    tempScan.setProperty("parameters/flip","$!turbineUtils.escapeJS($!scan.getParameters_flip())");
     tempScan.stats="$!scanprops.get($scani).get("files") files, $!scanprops.get($scani).get("size") MB";
     tempScan.setProperty("xnat_imageScanData_id","$!scan.getProperty('xnat_imagescandata_id')");
     window.scanSet.scans.push(tempScan);
       }
    #end
   #end
-  
+   
   window.scanSet.onLoad.subscribe(function(obj){
     var listing=new scanListingEditor("scan_tbody",this);
     listing.render();

plugin-resources/webapp/xnat-templates/screens/xnat_petSessionData/xnat_petSessionData_keyFields.vm

 						#if($!item.getProperty("xnat:petSessionData/start_time_scan"))
 							<TR><TH align="left">Emission Scan Time</TH><TD>$!item.getProperty("xnat:petSessionData/start_time_scan")</TD></TR>
 							#end
+						
+						#if($!item.getProperty("xnat:petSessionData/blood_glucose"))
+							<TR><TH align="left">Blood Glucose Level</TH>
+								<TD>
+									$!item.getProperty("xnat:petSessionData/blood_glucose")&nbsp;
+									$!item.getProperty("xnat:petSessionData/blood_glucose_units")
+								</TD>
+							</TR>
+							#end
+						#if($!item.getProperty("xnat:petSessionData/blood_glucose_collection_time"))
+							<TR><TH align="left">Blood Glucose Collection Time</TH><TD>$!item.getProperty("xnat:petSessionData/blood_glucose_collection_time")</TD></TR>
+							#end
     </table>
    </span>
   </TD>

plugin-resources/webapp/xnat-templates/screens/xnat_subjectAssessorData/upload/xnat_subjectAssessorData_projSubj.vm

  <tr>
   <td align="left" colspan="3"><div style="color:red" id="subj_msg"></div></td>
  </tr>
- <tr>
-  <th align="left">Session</th>
-  <td><input type="text" id="$!item.getXSIType()/label" name="$!item.getXSIType()/label" value="$!item.getProperty("label")"  onkeyup="this.value=fixSessionID(this.value);verifyExptId(this);if(this.validated==false)confirmValues(false);" onblur="confirmValues(false);"/></td>
-  <td id="label_msg"></td>
- </tr>
+#parse($turbineUtils.getTemplateName("_session.vm",$om.getXSIType(),$project,"upload"))
 		<script type="text/javascript" LANGUAGE="javascript" src="$content.getURI('scripts/subjectAssessorData/proj_subj_selector.js')"></SCRIPT>
 <script type="text/javascript">
 var elementName="$!item.getXSIType()";

plugin-resources/webapp/xnat-templates/screens/xnat_subjectAssessorData/upload/xnat_subjectAssessorData_session.vm

+ <tr>
+  <th align="left">Session</th>
+  <td><input type="text" id="$!item.getXSIType()/label" name="$!item.getXSIType()/label" value="$!item.getProperty("label")"  onkeyup="this.value=fixSessionID(this.value);verifyExptId(this);if(this.validated==false)confirmValues(false);" onblur="confirmValues(false);"/></td>
+  <td id="label_msg"></td>
+ </tr>

plugin-resources/webapp/xnat-templates/screens/xnat_subjectData/xnat_subjectData_edit_keyFields.vm

 <DIV class="edit_header1">Demographics</DIV><BR>
 <table>
 	#parse("/screens/xnat_subjectData/xnat_subjectData_edit_core_demographics.vm")
-	#parse("/screens/xnat_subjectData/xnat_subjectData_edit_addtl_demographics.vm")
+	#parse($turbineUtils.getTemplateName("_edit_addtl_demographics","xnat:subjectData",$project))
 </table>
 		<script type="text/javascript">
 		function validateKeyFields(){

plugin-resources/webapp/xnat/applet/DicomUtils-1.0.jar

Binary file modified.

plugin-resources/webapp/xnat/java/org/nrg/pipeline/utils/FileUtils.java

-/* 
- *	Copyright Washington University in St Louis 2006
- *	All rights reserved
- * 	
- * 	@author Mohana Ramaratnam (Email: mramarat@wustl.edu)
-
-*/
-
-package org.nrg.pipeline.utils;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.nrg.pipeline.xmlbeans.PipelineDocument;
-import org.nrg.xdat.om.ArcProject;
-import org.nrg.xft.XFT;
-import org.nrg.xnat.turbine.utils.ArcSpecManager;
-
-public class FileUtils {
-	
-	public static PipelineDocument GetDocument(String pathToPipelineXmlFile) throws Exception {
-        if (!pathToPipelineXmlFile.endsWith(".xml")) pathToPipelineXmlFile += ".xml";
-        File xmlFile = new File(pathToPipelineXmlFile); 
-        //Bind the instance to the generated XMLBeans types.
-        ArrayList errors = new ArrayList();
-        XmlOptions xopt = new XmlOptions();
-        xopt.setErrorListener(errors);
-         XmlObject xo = XmlObject.Factory.parse(xmlFile, xopt);
-         if (errors.size() != 0) {
-             throw new XmlException(errors.toArray().toString());
-         }
-         //String err = XMLBeansUtils.validateAndGetErrors(xo);
-         //if (err != null) {
-          //   throw new XmlException("Invalid XML " + xmlFile + "\n" + errors);
-        //}
-        if (!(xo instanceof PipelineDocument)) {
-            throw new Exception("Invalid XML file supplied " + pathToPipelineXmlFile + " ==> Expecting a pipeline document");
-        }
-        PipelineDocument pipelineDoc = (PipelineDocument)xo; 
-        //String error = XMLBeansUtils.validateAndGetErrors(pipelineDoc);
-        //if (error != null) {
-          //  throw new XmlException("Invalid XML " + pathToPipelineXmlFile + "\n" + errors);
-        //}
-        return pipelineDoc;
-}
-
-	
-    public static  String getMaxMatching(String file1, String file2, String scanId1, String scanId2) {
-        String rtn = null;
-        if (file1 == null || file2 == null || scanId1 == null || scanId2 == null) return null;
-        int index = 0; 
-        while (true) {
-            if (file2.charAt(index) != file1.charAt(index)) 
-                break;
-            index++;
-        }
-        rtn = file1.substring(0,index);
-        if (scanId1.charAt(0) == scanId2.charAt(0)) {
-            if (rtn.endsWith("."+scanId1.charAt(0))) {
-                rtn = rtn.substring(0, rtn.length()-2);
-            }
-        }
-        System.out.println("Max Matching is " + rtn);
-        int slash = rtn.lastIndexOf(File.separator);
-        if (slash != -1) {
-            rtn = rtn.substring(slash+1,rtn.length());
-        }
-        
-        if (rtn.endsWith(".")) rtn = rtn.substring(0,rtn.length()-1);
-        
-        System.out.println("Returnning formatted " + rtn);
-        return rtn;
-    }
-    
-    public static String getName(String path) {
-        String rtn = path;
-        int indexOfLastSlash = path.lastIndexOf(File.separator);
-        if (indexOfLastSlash != -1) {
-            rtn = path.substring(indexOfLastSlash + 1);
-        }
-        return rtn;
-    }
-    
-	public static String getBuildDir(String project,  boolean postfixTimestamp) {
-		ArcProject arcProject = ArcSpecManager.GetInstance().getProjectArc(project);
-		String buildPath = XFT.GetPipelinePath()  ;
-		if (arcProject != null) {
-			buildPath = arcProject.getPaths().getBuildpath();
-		}
-		if (postfixTimestamp) {
-			Calendar cal = Calendar.getInstance();
-		    SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd_HHmmss");
-		    String s = formatter.format(cal.getTime());
-			buildPath += s + "/" ;
-		}
-		return buildPath;
-	}
-	
-
-    
-}
+/*
+ *	Copyright Washington University in St Louis 2006
+ *	All rights reserved
+ *
+ * 	@author Mohana Ramaratnam (Email: mramarat@wustl.edu)
+
+*/
+
+package org.nrg.pipeline.utils;
+
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
+import org.nrg.pipeline.xmlbeans.PipelineDocument;
+import org.nrg.xdat.om.ArcProject;
+import org.nrg.xft.XFT;
+import org.nrg.xnat.turbine.utils.ArcSpecManager;
+
+public class FileUtils {
+
+	public static PipelineDocument GetDocument(String pathToPipelineXmlFile) throws Exception {
+        if (!pathToPipelineXmlFile.endsWith(".xml")) pathToPipelineXmlFile += ".xml";
+        File xmlFile = new File(pathToPipelineXmlFile);
+        //Bind the instance to the generated XMLBeans types.
+        ArrayList errors = new ArrayList();
+        XmlOptions xopt = new XmlOptions();
+        xopt.setErrorListener(errors);
+         XmlObject xo = XmlObject.Factory.parse(xmlFile, xopt);
+         if (errors.size() != 0) {
+             throw new XmlException(errors.toArray().toString());
+         }
+         //String err = XMLBeansUtils.validateAndGetErrors(xo);
+         //if (err != null) {
+          //   throw new XmlException("Invalid XML " + xmlFile + "\n" + errors);
+        //}
+        if (!(xo instanceof PipelineDocument)) {
+            throw new Exception("Invalid XML file supplied " + pathToPipelineXmlFile + " ==> Expecting a pipeline document");
+        }
+        PipelineDocument pipelineDoc = (PipelineDocument)xo;
+        //String error = XMLBeansUtils.validateAndGetErrors(pipelineDoc);
+        //if (error != null) {
+          //  throw new XmlException("Invalid XML " + pathToPipelineXmlFile + "\n" + errors);
+        //}
+        return pipelineDoc;
+}
+
+
+    public static  String getMaxMatching(String file1, String file2, String scanId1, String scanId2) {
+        String rtn = null;
+        if (file1 == null || file2 == null || scanId1 == null || scanId2 == null) return null;
+        int index = 0;
+        while (true) {
+            if (file2.charAt(index) != file1.charAt(index))
+                break;
+            index++;
+        }
+        rtn = file1.substring(0,index);
+        if (scanId1.charAt(0) == scanId2.charAt(0)) {
+            if (rtn.endsWith("."+scanId1.charAt(0))) {
+                rtn = rtn.substring(0, rtn.length()-2);
+            }
+        }
+        System.out.println("Max Matching is " + rtn);
+        int slash = rtn.lastIndexOf(File.separator);
+        if (slash != -1) {
+            rtn = rtn.substring(slash+1,rtn.length());
+        }
+
+        if (rtn.endsWith(".")) rtn = rtn.substring(0,rtn.length()-1);
+
+        System.out.println("Returnning formatted " + rtn);
+        return rtn;
+    }
+
+    public static String getName(String path) {
+        String rtn = path;
+        int indexOfLastSlash = path.lastIndexOf(File.separator);
+        if (indexOfLastSlash != -1) {
+            rtn = path.substring(indexOfLastSlash + 1);
+        }
+        return rtn;
+    }
+
+	public static String getBuildDir(String project,  boolean postfixTimestamp) {
+		ArcProject arcProject = ArcSpecManager.GetInstance().getProjectArc(project);
+		String buildPath = XFT.GetPipelinePath()  ;
+		if (arcProject != null) {
+			buildPath = arcProject.getPaths().getBuildpath();
+		}
+		if (postfixTimestamp) {
+			Calendar cal = Calendar.getInstance();
+		    SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd_HHmmss");
+		    String s = formatter.format(cal.getTime());
+			buildPath += s + "/" ;
+		}
+		return buildPath;
+	}
+
+
+
+}

plugin-resources/webapp/xnat/java/org/nrg/xdat/om/base/BaseXnatExperimentdata.java

 import java.net.URI;
 import java.net.URISyntaxException;
 import java.sql.SQLException;
+import java.text.DateFormat;
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.Date;
 import java.util.Enumeration;
         return null;
     }
 
-
+	public String getFreeFormDate(String dateParam){
+		try{
+			Date now = Calendar.getInstance().getTime();
+			DateFormat dateFormat = new SimpleDateFormat(dateParam);
+			String dateStr = dateFormat.format(now); 
+			return dateStr;
+		} catch (Exception e1) {logger.error(e1);return null;}
+	}
 
     Hashtable fieldsByName = null;
     public Hashtable getFieldsByName(){
     		if(newLabel==null)newLabel = this.getLabel();
     		if(newLabel==null)newLabel = this.getId();
     		
-    		File newSessionDir = new File(new File(newProject.getRootArchivePath(),newProject.getCurrentArc()),newLabel);
+    		final File newSessionDir = new File(new File(newProject.getRootArchivePath(),newProject.getCurrentArc()),newLabel);
     		
     		String current_label=this.getLabel();
     		if(current_label==null)current_label=this.getId();
         				existingSessionDir=uri.substring(0,lastIndex);
         			}else{
         				//outside session_dir
-        				newSessionDir = new File(newSessionDir,"RESOURCES");
-        				newSessionDir = new File(newSessionDir,"RESOURCES/"+abstRes.getXnatAbstractresourceId());
-        				int lastSlash=uri.lastIndexOf("/");
-        				if(uri.lastIndexOf("\\")>lastSlash){
-        					lastSlash=uri.lastIndexOf("\\");
-        				}
-        				existingSessionDir=uri.substring(0,lastSlash);
+//        				newSessionDir = new File(newSessionDir,"RESOURCES");
+//        				newSessionDir = new File(newSessionDir,"RESOURCES/"+abstRes.getXnatAbstractresourceId());
+//        				int lastSlash=uri.lastIndexOf("/");
+//        				if(uri.lastIndexOf("\\")>lastSlash){
+//        					lastSlash=uri.lastIndexOf("\\");
+//        				}
+//        				existingSessionDir=uri.substring(0,lastSlash);
+        				//don't attempt to move sessions which are outside of the Session Directory.
+        				throw new Exception("Non-standard file location for file(s):" + uri);
         			}
         			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
     			}else{
 		
 		if(newLabel==null)return;
 		
-		File newSessionDir = new File(new File(proj.getRootArchivePath(),proj.getCurrentArc()),newLabel);
+		final File newSessionDir = new File(new File(proj.getRootArchivePath(),proj.getCurrentArc()),newLabel);
 		
 		String current_label=this.getLabel();
 		if(current_label==null)current_label=this.getId();
     				existingSessionDir=uri.substring(0,lastIndex);
     			}else{
     				//outside session_dir
-    				newSessionDir = new File(newSessionDir,"RESOURCES");
-    				newSessionDir = new File(newSessionDir,"RESOURCES/"+abstRes.getXnatAbstractresourceId());
-    				int lastSlash=uri.lastIndexOf("/");
-    				if(uri.lastIndexOf("\\")>lastSlash){
-    					lastSlash=uri.lastIndexOf("\\");
-    				}
-    				existingSessionDir=uri.substring(0,lastSlash);
+//    				newSessionDir = new File(newSessionDir,"RESOURCES");
+//    				newSessionDir = new File(newSessionDir,"RESOURCES/"+abstRes.getXnatAbstractresourceId());
+//    				int lastSlash=uri.lastIndexOf("/");
+//    				if(uri.lastIndexOf("\\")>lastSlash){
+//    					lastSlash=uri.lastIndexOf("\\");
+//    				}
+//    				existingSessionDir=uri.substring(0,lastSlash);
+    				//don't attempt to move sessions which are outside of the Session Directory.
+    				throw new Exception("Non-standard file location for file(s):" + uri);
     			}
     			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
 			}else{

plugin-resources/webapp/xnat/java/org/nrg/xdat/om/base/BaseXnatImagesessiondata.java

     		if(newLabel==null)newLabel = this.getLabel();
     		if(newLabel==null)newLabel = this.getId();
     		
-    		File newSessionDir = new File(new File(newProject.getRootArchivePath(),newProject.getCurrentArc()),newLabel);
+    		final File newSessionDir = new File(new File(newProject.getRootArchivePath(),newProject.getCurrentArc()),newLabel);
     		
     		String current_label=this.getLabel();
     		if(current_label==null)current_label=this.getId();
             				existingSessionDir=uri.substring(0,lastIndex);
             			}else{
             				//outside session_dir
-            				newSessionDir = new File(new File(newSessionDir,"SCANS"),scan.getId());
-            				int lastSlash=uri.lastIndexOf("/");
-            				if(uri.lastIndexOf("\\")>lastSlash){
-            					lastSlash=uri.lastIndexOf("\\");
-            				}
-            				existingSessionDir=uri.substring(0,lastSlash);
+//            				newSessionDir = new File(new File(newSessionDir,"SCANS"),scan.getId());
+//            				int lastSlash=uri.lastIndexOf("/");
+//            				if(uri.lastIndexOf("\\")>lastSlash){
+//            					lastSlash=uri.lastIndexOf("\\");
+//            				}
+//            				existingSessionDir=uri.substring(0,lastSlash);
+            				//don't attempt to move sessions which are outside of the Session Directory.
+            				throw new Exception("Non-standard file location for file(s):" + uri);
             			}
             			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
         			}else{
             				existingSessionDir=uri.substring(0,lastIndex);
             			}else{
             				//outside session_dir
-            				newSessionDir = new File(new File(newSessionDir,"PROCESSED"),recon.getId());
-            				int lastSlash=uri.lastIndexOf("/");
-            				if(uri.lastIndexOf("\\")>lastSlash){
-            					lastSlash=uri.lastIndexOf("\\");
-            				}
-            				existingSessionDir=uri.substring(0,lastSlash);
+//            				newSessionDir = new File(new File(newSessionDir,"PROCESSED"),recon.getId());
+//            				int lastSlash=uri.lastIndexOf("/");
+//            				if(uri.lastIndexOf("\\")>lastSlash){
+//            					lastSlash=uri.lastIndexOf("\\");
+//            				}
+//            				existingSessionDir=uri.substring(0,lastSlash);
+            				//don't attempt to move sessions which are outside of the Session Directory.
+            				throw new Exception("Non-standard file location for file(s):" + uri);
             			}
             			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
         			}else{
             				existingSessionDir=uri.substring(0,lastIndex);
             			}else{
             				//outside session_dir
-            				newSessionDir = new File(new File(newSessionDir,"ASSESSORS"),assessor.getId());
-            				int lastSlash=uri.lastIndexOf("/");
-            				if(uri.lastIndexOf("\\")>lastSlash){
-            					lastSlash=uri.lastIndexOf("\\");
-            				}
-            				existingSessionDir=uri.substring(0,lastSlash);
+//            				newSessionDir = new File(new File(newSessionDir,"ASSESSORS"),assessor.getId());
+//            				int lastSlash=uri.lastIndexOf("/");
+//            				if(uri.lastIndexOf("\\")>lastSlash){
+//            					lastSlash=uri.lastIndexOf("\\");
+//            				}
+//            				existingSessionDir=uri.substring(0,lastSlash);
+            				//don't attempt to move sessions which are outside of the Session Directory.
+            				throw new Exception("Non-standard file location for file(s):" + uri);
             			}
             			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
         			}else{
     		
     		if(newLabel==null)return;
     		
-    		File newSessionDir = new File(new File(proj.getRootArchivePath(),proj.getCurrentArc()),newLabel);
+    		final File newSessionDir = new File(new File(proj.getRootArchivePath(),proj.getCurrentArc()),newLabel);
     		
     		String current_label=this.getLabel();
     		if(current_label==null)current_label=this.getId();
             					lastIndex+=1+this.getId().length();
             				}
         				}
+        				
         				String existingSessionDir=null;
         				if(lastIndex>-1){
             				//in session_dir
             				existingSessionDir=uri.substring(0,lastIndex);
             			}else{
             				//outside session_dir
-            				newSessionDir = new File(new File(newSessionDir,"SCANS"),scan.getId());
-            				int lastSlash=uri.lastIndexOf("/");
-            				if(uri.lastIndexOf("\\")>lastSlash){
-            					lastSlash=uri.lastIndexOf("\\");
-            				}
-            				existingSessionDir=uri.substring(0,lastSlash);
+//            				newSessionDir = new File(new File(newSessionDir,"SCANS"),scan.getId());
+//            				int lastSlash=uri.lastIndexOf("/");
+//            				if(uri.lastIndexOf("\\")>lastSlash){
+//            					lastSlash=uri.lastIndexOf("\\");
+//            				}
+//            				existingSessionDir=uri.substring(0,lastSlash);
+            				//don't attempt to move sessions which are outside of the Session Directory.
+            				throw new Exception("Non-standard file location for file(s):" + uri);
             			}
             			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
         			}else{
             				existingSessionDir=uri.substring(0,lastIndex);
             			}else{
             				//outside session_dir
-            				newSessionDir = new File(new File(newSessionDir,"PROCESSED"),recon.getId());
-            				int lastSlash=uri.lastIndexOf("/");
-            				if(uri.lastIndexOf("\\")>lastSlash){
-            					lastSlash=uri.lastIndexOf("\\");
-            				}
-            				existingSessionDir=uri.substring(0,lastSlash);
+//            				newSessionDir = new File(new File(newSessionDir,"PROCESSED"),recon.getId());
+//            				int lastSlash=uri.lastIndexOf("/");
+//            				if(uri.lastIndexOf("\\")>lastSlash){
+//            					lastSlash=uri.lastIndexOf("\\");
+//            				}
+//            				existingSessionDir=uri.substring(0,lastSlash);
+            				//don't attempt to move sessions which are outside of the Session Directory.
+            				throw new Exception("Non-standard file location for file(s):" + uri);
             			}
             			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
         			}else{
             				existingSessionDir=uri.substring(0,lastIndex);
             			}else{
             				//outside session_dir
-            				newSessionDir = new File(new File(newSessionDir,"ASSESSORS"),assessor.getId());
-            				int lastSlash=uri.lastIndexOf("/");
-            				if(uri.lastIndexOf("\\")>lastSlash){
-            					lastSlash=uri.lastIndexOf("\\");
-            				}
-            				existingSessionDir=uri.substring(0,lastSlash);
+//            				newSessionDir = new File(new File(newSessionDir,"ASSESSORS"),assessor.getId());
+//            				int lastSlash=uri.lastIndexOf("/");
+//            				if(uri.lastIndexOf("\\")>lastSlash){
+//            					lastSlash=uri.lastIndexOf("\\");
+//            				}
+//            				existingSessionDir=uri.substring(0,lastSlash);
+            				//don't attempt to move sessions which are outside of the Session Directory.
+            				throw new Exception("Non-standard file location for file(s):" + uri);
             			}
             			abstRes.moveTo(newSessionDir,existingSessionDir,existingRootPath,user);
         			}else{

plugin-resources/webapp/xnat/java/org/nrg/xdat/om/base/BaseXnatProjectdata.java

         	cc.addClause("xnat:subjectData/sharing/share/project", this.getId());
         	_participants= XnatSubjectdata.getXnatSubjectdatasByField(cc, user, false);
     	}
-    	
+
     	return _participants;
     }
 
         	cc.addClause("xnat:experimentData/sharing/share/project", this.getId());
         	_experiments= XnatExperimentdata.getXnatExperimentdatasByField(cc, user, false);
     	}
-    	
+
     	return _experiments;
     }
 
     	return typed;
     }
 
-    
+
     Hashtable<String,XnatProjectdataField> fieldsByName = null;
     public Hashtable getFieldsByName(){
         if (fieldsByName == null){
 
 
     public ArrayList<String> getOwners() throws Exception{
-        final XFTTable table2 = XFTTable.Execute("SELECT DISTINCT email FROM xdat_element_access ea LEFT JOIN xdat_field_mapping_set fms ON ea.xdat_element_access_id=fms.permissions_allow_set_xdat_elem_xdat_element_access_id LEFT JOIN xdat_field_mapping fm ON fms.xdat_field_mapping_set_id=fm.xdat_field_mapping_set_xdat_field_mapping_set_id LEFT JOIN xdat_user u ON ea.xdat_user_xdat_user_id=u.xdat_user_id WHERE read_element=1 AND delete_element=1 AND login !='guest' AND element_name='xnat:subjectData' AND field_value='" + getId() +  "' ORDER BY email;", getDBName(), null);
+        final XFTTable table2 = XFTTable.Execute("SELECT DISTINCT email FROM xdat_element_access ea LEFT JOIN xdat_field_mapping_set fms ON ea.xdat_element_access_id=fms.permissions_allow_set_xdat_elem_xdat_element_access_id LEFT JOIN xdat_field_mapping fm ON fms.xdat_field_mapping_set_id=fm.xdat_field_mapping_set_xdat_field_mapping_set_id LEFT JOIN xdat_userGroup ug ON ea.xdat_usergroup_xdat_usergroup_id=ug.xdat_usergroup_id LEFT JOIN xdat_user_groupid map ON ug.id=map.groupid LEFT JOIN xdat_user u ON map.groups_groupid_xdat_user_xdat_user_id=u.xdat_user_id  WHERE read_element=1 AND delete_element=1 AND login !='guest' AND element_name='xnat:subjectData' AND field_value='" + getId() +  "' ORDER BY email;", getDBName(), null);
         return table2.convertColumnToArrayList("email");
     }
 
     public ArrayList<String> getMembers() throws Exception{
-    	final XFTTable table1 = XFTTable.Execute("SELECT DISTINCT email FROM xdat_element_access ea LEFT JOIN xdat_field_mapping_set fms ON ea.xdat_element_access_id=fms.permissions_allow_set_xdat_elem_xdat_element_access_id LEFT JOIN xdat_field_mapping fm ON fms.xdat_field_mapping_set_id=fm.xdat_field_mapping_set_xdat_field_mapping_set_id LEFT JOIN xdat_user u ON ea.xdat_user_xdat_user_id=u.xdat_user_id WHERE edit_element=1 AND login !='guest' AND element_name='xnat:subjectData' AND field_value='" + getId() +  "' ORDER BY email;", getDBName(), null);
+    	final XFTTable table1 = XFTTable.Execute("SELECT DISTINCT email FROM xdat_element_access ea LEFT JOIN xdat_field_mapping_set fms ON ea.xdat_element_access_id=fms.permissions_allow_set_xdat_elem_xdat_element_access_id LEFT JOIN xdat_field_mapping fm ON fms.xdat_field_mapping_set_id=fm.xdat_field_mapping_set_xdat_field_mapping_set_id LEFT JOIN xdat_userGroup ug ON ea.xdat_usergroup_xdat_usergroup_id=ug.xdat_usergroup_id LEFT JOIN xdat_user_groupid map ON ug.id=map.groupid LEFT JOIN xdat_user u ON map.groups_groupid_xdat_user_xdat_user_id=u.xdat_user_id  WHERE edit_element=1 AND login !='guest' AND element_name='xnat:subjectData' AND field_value='" + getId() +  "' ORDER BY email;", getDBName(), null);
         return table1.convertColumnToArrayList("email");
     }
 
     public ArrayList<String> getCollaborators() throws Exception{
-    	final XFTTable table2 = XFTTable.Execute("SELECT DISTINCT email FROM xdat_element_access ea LEFT JOIN xdat_field_mapping_set fms ON ea.xdat_element_access_id=fms.permissions_allow_set_xdat_elem_xdat_element_access_id LEFT JOIN xdat_field_mapping fm ON fms.xdat_field_mapping_set_id=fm.xdat_field_mapping_set_xdat_field_mapping_set_id LEFT JOIN xdat_user u ON ea.xdat_user_xdat_user_id=u.xdat_user_id WHERE read_element=1 AND edit_element=0 AND login !='guest' AND element_name='xnat:subjectData' AND field_value='" + getId() +  "' ORDER BY email;", getDBName(), null);
+    	final XFTTable table2 = XFTTable.Execute("SELECT DISTINCT email FROM xdat_element_access ea LEFT JOIN xdat_field_mapping_set fms ON ea.xdat_element_access_id=fms.permissions_allow_set_xdat_elem_xdat_element_access_id LEFT JOIN xdat_field_mapping fm ON fms.xdat_field_mapping_set_id=fm.xdat_field_mapping_set_xdat_field_mapping_set_id LEFT JOIN xdat_userGroup ug ON ea.xdat_usergroup_xdat_usergroup_id=ug.xdat_usergroup_id LEFT JOIN xdat_user_groupid map ON ug.id=map.groupid LEFT JOIN xdat_user u ON map.groups_groupid_xdat_user_xdat_user_id=u.xdat_user_id  WHERE read_element=1 AND edit_element=0 AND login !='guest' AND element_name='xnat:subjectData' AND field_value='" + getId() +  "' ORDER BY email;", getDBName(), null);
         return table2.convertColumnToArrayList("email");
     }
 //
         final ArcProject arcProj = this.getArcSpecification();
 
 		if (arcProj==null) return "arc001";
-		
+
         path = arcProj.getCurrentArc();
         if (path==null || path.equals("")){
             path="arc001";
         {
             try {
 				if (es.isSecure() && (es.getSchemaElement().getGenericXFTElement().instanceOf("xnat:subjectData") || es.getSchemaElement().getGenericXFTElement().instanceOf("xnat:experimentData"))){
-					
+
 				    es.initPSF(es.getElementName() + "/project");
 				    es.initPSF(es.getElementName() + "/sharing/share/project");
 				}else{
 		} catch (Exception e1) {
             logger.error("",e1);
 		}
-		
+
         //init members
         ArrayList member = XdatUsergroup.getXdatUsergroupsByField(XdatUsergroup.SCHEMA_ELEMENT_NAME +".ID", this.getId() + "_" + MEMBER_GROUP, this.getUser(), true);
 
 		} catch (Exception e2) {
             logger.error("",e2);
 		}
-		
+
         if (XFT.VERBOSE)System.out.println("Group init() MEMBER: " + (Calendar.getInstance().getTimeInMillis()-startTime) + "ms");
 
         //init collaborators
 		} catch (Exception e2) {
             logger.error("",e2);
 		}
-		
+
         if (XFT.VERBOSE)System.out.println("Group init(): " + (Calendar.getInstance().getTimeInMillis()-startTime) + "ms");
     }
 
 
         return null;
     }
-    
+
 
     public ArrayList<XdatStoredSearch> getBundles(){
     	ArrayList<XdatStoredSearch> searches = XdatStoredSearch.GetSearches("xdat:stored_search/tag", this.getId(), true);
-    	
+
     	Hashtable<String,Long> counts=this.getExperimentCountByXSIType();
-    	
+
     	boolean matched=false;
     	for(XdatStoredSearch xss:searches){
     		if(xss.getRootElementName().equalsIgnoreCase("xnat:subjectData")){
     			break;
     		}
     	}
-    	
+
     	if(!matched){
     		XnatAbstractprotocol protocol = this.getProtocolByDataType("xnat:subjectData");
     		XdatStoredSearch xss=null;
     		xss.setId("@xnat:subjectData");
     		searches.add(xss);
     	}
-    	
+
     	for(String key:counts.keySet()){
     		matched=false;
         	for(XdatStoredSearch xss:searches){
         			break;
         		}
         	}
-        	
+
         	if(!matched){
         		XnatAbstractprotocol protocol = this.getProtocolByDataType(key);
         		XdatStoredSearch xss=null;
         		searches.add(xss);
         	}
     	}
-    	
+
         return searches;
     }
-    
+
 
 
     public XdatStoredSearch getDefaultSearch(String elementName){
             xss=this.getDefaultSearch(elementName,this.getId()+"_"+elementName);
 
 			xss.setId(this.getId()+"_"+elementName);
-			
+
 			ElementSecurity es=ElementSecurity.GetElementSecurity(elementName);
-			
+
 			if(es!=null)
 				xss.setBriefDescription(es.getPluralDescription());
 			else{
 			}
 			xss.setSecure(false);
 			xss.setAllowDiffColumns(false);
-			xss.setTag(this.getId()); 
-            
+			xss.setTag(this.getId());
+
             UserI user = this.getUser();
-            
+
             XnatAbstractprotocol protocol = this.getProtocolByDataType(elementName);
     		if(protocol!=null){
     			if(protocol instanceof XnatDatatypeprotocol)
     	                if (field.getType().equals("custom"))
     	                {
     	                    fieldID=((XnatDatatypeprotocol)protocol).getDatatypeSchemaElement().getSQLName().toUpperCase() + "_FIELD_MAP="+field.getName().toLowerCase();
-    	                    
+
     	                }else{
     	                    try {
     	                        SchemaElement se=SchemaElement.GetElement(((XnatDatatypeprotocol)protocol).getDataType());
-    	                        
+
     	                        try {
     	                            DisplayField df=se.getDisplayFieldForXMLPath(field.getXmlpath());
     	                            if (df!=null){
     	                        logger.error("",e);
     	                    }
     	                }
-    	                    
+
     	                if (fieldID!=null){
     	                    xsf.setFieldId(fieldID);
 
                     }
                 }
             }
-            
+
         } catch (Exception e) {
             logger.error("",e);
         }
 //                    try {
 //                        XdatStoredSearch xss = protocol.getDefaultSearch((XnatProjectdata)this);
 //
-//                        
+//
 //                        xss.save(this.getUser(), true, true);
 //
 //
 //                        //XdatStoredSearch.GetPreLoadedSearches().add(xss);
 //                        modified=true;
-//                        
+//
 //                        final String[] groups = {getId() + "_" + OWNER_GROUP,getId() + "_" + MEMBER_GROUP,getId() + "_" + COLLABORATOR_GROUP};
 //
 //                        for(int i=0;i<groups.length;i++){
             if (projectAccess==1){
 
                 query = "SELECT read_element FROM xdat_element_access ea LEFT JOIN xdat_field_mapping_set fms ON ea.xdat_element_access_id=fms.permissions_allow_set_xdat_elem_xdat_element_access_id LEFT JOIN xdat_user u ON ea.xdat_user_xdat_user_id=u.xdat_user_id LEFT JOIN xdat_field_mapping fm ON fms.xdat_field_mapping_set_id=fm.xdat_field_mapping_set_xdat_field_mapping_set_id WHERE login='guest' AND element_name!='xnat:projectData' AND field_value='" + getId() +  "';";
-  
+
                 Integer subjectAccess = (Integer)PoolDBUtils.ReturnStatisticQuery(query, "read_element", getDBName(), null);
                 if (subjectAccess!=null)
                 {
                         guest = new XDATUser("guest");
                     }
                     ArrayList<ElementSecurity> securedElements = ElementSecurity.GetSecureElements();
-                    
+
                     if (accessibility.equals("public"))
                     {
                         //public
                         guest.setPermissions("xnat:projectData", "xnat:projectData/ID", this.getId(), false, true, false, false, true,true);
-                        
+
                         for (ElementSecurity es: securedElements)
                         {
                         	if (es.hasField(es.getElementName() + "/project") && es.hasField(es.getElementName() + "/sharing/share/project")){
         group.setId(getId() + "_" + OWNER_GROUP);
         group.setDisplayname("Owners");
         group.setTag(getId());
-        
+
         UserGroup ownerG=UserGroupManager.GetGroup(group.getId());
         if(ownerG==null){
         	group.save(this.getUser(), true, true);
                 ((XDATUser)user).getGroups().put(group.getId(),ug);
 
                 this.addGroupMember(this.getId() + "_" + OWNER_GROUP, (XDATUser)user, (XDATUser)user);
-            } 
+            }
         }
 
         return super.save(user, overrideSecurity, allowItemRemoval);
 
         }
     }
-    
+
     public void initNewProject(XDATUser user,boolean allowDataDeletion,boolean allowMatchingID) throws Exception{
     	if (this.getId()==null){
             String secondaryID = this.getSecondaryId();
             if (secondaryID==null){
-                
+
                 throw new Exception("Please define a project abbreviation.");
             }else{
                 setId(secondaryID);
-                
+
                 XFTItem db=getCurrentDBVersion();
                 if (db!=null){
                 	String msg="Project '" + getId() + "' already exists.";
                 	throw new Exception(msg);
                 }
             }
-        }else{          
+        }else{
         	if(!allowMatchingID){
                 XFTItem db=getCurrentDBVersion();
                 if (db!=null){
                 }
         	}
         }
-    	
+
     	if(this.getSecondaryId()==null){
     		this.setSecondaryId(this.getId());
     	}
-    	
+
     	if(this.getName()==null){
     		this.setName(this.getId());
     	}
 
     	if(this.getStudyprotocol().size()>0){
         	Hashtable<String,ElementSecurity> ess = ElementSecurity.GetElementSecurities();
-            
+
             int index = 0;
             for (XnatAbstractprotocol  protocol:this.getStudyprotocol()){
                 if(protocol.getProperty("data-type")==null){
                                 logger.error("",e);
                             }
                         }
-                        
+
                         getItem().removeChild("xnat:projectData/studyProtocol", getItem().getChildItems("xnat:projectData/studyProtocol").indexOf(protocol));
                 	}
                 }else{