Source

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

Full commit
<!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> 
			  <input type="hidden" size="45" id=$dblQts${schemaType}.parameters.parameter[$c].schemaLink$dblQts name=$dblQts${schemaType}.parameters.parameter[$c].schemaLink$dblQts value="$!parameter.getSchemalink()"/>
			  #if ($!parameter.getCsvvalues())
			  <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>
			  #else 
			  <TD>$!parameter.getSchemalink() </TD>
			 #end	
			 <TD> <a href="#" style="outline: none;" onclick="return !showPopup('desc$c', event);">Help</a> </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>