anchor.diff:  		View Clinical Reports<br />
   	
   		
  -		<bean:define id="selectedItemsId" name="kmDataSetForm" property="selectedItems" />
  +		<!-- bean:define id="selectedItemsId" name="kmDataSetForm" property="selectedItems" />  -->
  +		<s:set var="selectedItemsId" value="kmForm.selectedItems" />
  +		
   		<% 
  -		String[] selectedGroups = (String[])selectedItemsId; 
  -		List selectedGrpList = Arrays.asList(selectedGroups);
  +		//Shan: why do we need this
  +		//String[] selectedGroups = (String[])selectedItemsId; 
  +		//List selectedGrpList = Arrays.asList(selectedGroups);
   		%>
   
   		<!--check what type of plot it is as to display the correct link text-->
  -		<logic:equal name="kmDataSetForm" property="plotType" value="GE_KM_PLOT">		
  -			<%
  -			if ( selectedGrpList != null && selectedGrpList.contains("Up-Regulated") ) {
  -			%>
  -				<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Upregulating Samples</a>
  -			<%
  -			}
  -			if ( selectedGrpList != null && selectedGrpList.contains("Down-Regulated") ) {
  -			%>
  +		<!--  logic:equal name="kmDataSetForm" property="plotType" value="GE_KM_PLOT">	-->
  +		<s:if test="kmForm.plotType.equals('GE_KM_PLOT')">	
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Up-Regulated')">
  +				<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>
  +				Upregulating Samples</a>
  +			</s:if>
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Down-Regulated')">
   		 		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Downregulating samples</a>
  -			<%
  -			}
  -			%>
  -			<!--  
  -			<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Upregulating Samples</a>
  -		 	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Downregulating samples</a>
  -			-->
  -		</logic:equal>
  -		<logic:equal name="kmDataSetForm" property="plotType" value="COPY_NUM_KM_PLOT">		
  -			<%
  -			if ( selectedGrpList != null && selectedGrpList.contains("Up-Regulated") ) {
  -			%>
  +			</s:if>
  +			
  +		</s:if>
  +		<s:if test="kmForm.plotType.equals('COPY_NUM_KM_PLOT')">	
  +			
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Up-Regulated')">
   				<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Samples with Amplification</a>
  -			<%
  -			}
  -			if ( selectedGrpList != null && selectedGrpList.contains("Down-Regulated") ) {
  -			%>
  +			</s:if>
  +			
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Down-Regulated')">
   		 		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Samples with Deletion</a>
  -			<%
  -			}
  -			%>
  -			<!--  
  -			<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Samples with Amplification</a>
  -		 	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Samples with Deletion</a>
  -			-->
  -		</logic:equal>
  -		<logic:notEqual name="kmDataSetForm" property="plotType" value="SAMPLE_KM_PLOT">
  -			<%
  -			if ( selectedGrpList != null && selectedGrpList.contains("Intermediate") ) {
  -			%>
  +			</s:if>
  +			
  +		</s:if>
  +		
  +		<s:if test="!kmForm.plotType.equals('SAMPLE_KM_PLOT')">
  +			
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Intermediate')">
   				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=inter',700,500,'clinicalPlots');"/>Intermediate Samples</a>
  -			<%
  -			}
  -			%>
  -			<!--  
  -			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=inter',700,500,'clinicalPlots');"/>Intermediate Samples</a>
  -			-->		
  -		</logic:notEqual>
  -		<logic:equal name="kmDataSetForm" property="plotType" value="SAMPLE_KM_PLOT">
  +			</s:if>
  +				
  +		</s:if>
  +		
  +		<s:if test="kmForm.plotType.equals('SAMPLE_KM_PLOT')">
   			<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=list1',700,500,'clinicalPlots');return false;"/><bean:write name="kmDataSetForm" property="storedData.samplePlot1Label" /></a>
  -			<logic:notEqual name="kmDataSetForm" property="storedData.samplePlot2Label" value="none">
  -				<a style="margin-left:20px" href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=list2',700,500,'clinicalPlots');return false;"/><bean:write name="kmDataSetForm" property="storedData.samplePlot2Label" /></a>
  -			</logic:notEqual>
  -		</logic:equal>
  +			
  +			<s:if test="!kmForm.storedData.samplePlot2Label.equals('none')">
  +				<a style="margin-left:20px" href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=list2',700,500,'clinicalPlots');return false;"/>
  +				<!-- bean:write name="kmDataSetForm" property="storedData.samplePlot2Label" />  -->
  +				<s:property value="kmForm.storedData.samplePlot2Label" />
  +				</a>
  +			</s:if>
  +		</s:if>
   		
   		<!-- Statistical Data  STARTS HERE --></p>
   		<fieldset class="gray" style="text-align:left">
   		<legend class="red">Statistical	Report:</legend>
   		<table class="graphTable" border="0" cellpadding="2" cellspacing="0">
  -			<logic:present name="kmDataSetForm" property="geneOrCytoband">
  +			<s:if test="kmForm.geneOrCytoband != null && kmForm.geneOrCytoband.length() > 0">
   				<tr>
   					<td colspan="2" id="reportBold">
  -					<bean:write name="kmDataSetForm" property="geneOrCytoband" /></td>
  -				</tr>
  -			</logic:present>
  -			<logic:present name="kmDataSetForm" property="selectedReporter">
  +						<s:property value="kmForm.geneOrCytoband" />
  +					</td>
  +				</tr>
  +			</s:if>
  +			<s:if test="kmForm.selectedReporter != null && kmForm.selectedReporter.length() > 0">
   				<!--Show the selected Reporter -->
   				<tr>
  -					<td colspan="2" id="reportBold">Reporter: <bean:write
  -						name="kmDataSetForm" property="selectedReporter" /></td>
  -				</tr>
  -			</logic:present>
  +					<td colspan="2" id="reportBold">Reporter: <s:property value="kmForm.selectedReporter" />
  +						</td>
  +				</tr>
  +			</s:if>
   			<tr>
   				<td colspan="2">&nbsp;</td>
   			</tr>
  
positive.code: L--%>
  
  <%@page contentType="text/html"%>
  <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
  <%@taglib uri='/WEB-INF/caintegrator-graphing.tld' prefix='graphing' %>
  <%@ taglib uri="/WEB-INF/rembrandt.tld" prefix="app" %>
  <%@ page import="java.util.*" %>
  <%@ page import="gov.nih.nci.rembrandt.util.*" %>
  
  <div><html:errors /> <%
     String km = "kmplotGE";
     String ta = "Simple_KM_sample_plot";
     if(  ((request.getParameter("plot") != null) && 
           (request.getParameter("plot").equalsIgnoreCase("kapMaiPlotGE")))
             || 
          ((request.getParameter("plot") == null) && 
           (request.getParameter("plotType").equalsIgnoreCase("GE_KM_PLOT"))) ){
           km = "kmplotGE";
           ta = "Simple_KM_gene_expression_plot";
     }
     else if(  ((request.getParameter("plot") != null) && 
           (request.getParameter("plot").equalsIgnoreCase("kapMaiPlotCN")))
             || 
          ((request.getParameter("plot") == null) && 
           (request.getParameter("plotType").equalsIgnoreCase("COPY_NUM_KM_PLOT"))) ){
          km = "kmplotCN";
          ta = "Simple_KM_copy_number_plot";
     }
     else if(  ((request.getParameter("plot") != null) && 
           (request.getParameter("plot").equalsIgnoreCase("kapMaiPlotGE")))
             || 
          ((request.getParameter("plot") == null) && 
           (request.getParameter("plotType").equalsIgnoreCase("SAMPLE_KM_PLOT"))) ){//HACK FOR NOW
           km = "kmplotGE";
           ta = "Simple_KM_sample_plot";
     }
  	
  	String baselineGroup = request.getParameter("baselineGroup")!=null ? (String)request.getParameter("baselineGroup") : "";
  	baselineGroup = MoreStringUtils.cleanJavascriptAndSpecialChars(MoreStringUtils.specialCharacters, baselineGroup);
  %><app:cshelp topic="<%=ta%>" /><br clear="all"/>
     
  </div>
  
  <html:form action="/kmGraph.do?method=redrawKMPlot">
  	<input type="hidden" name="baselineGroup" value="<%=baselineGroup%>"/>
  	<html:hidden property="geneOrCytoband" />
  	<html:hidden property="plotType" />
  	
  	<logic:notEqual name="kmDataSetForm" property="plotType" value="SAMPLE_KM_PLOT">
  	<div>
  	<% if(baselineGroup.length()>0)	{	%>
  		<b>Constrained to group: <%=baselineGroup%></b><br/><br/>
  
negative.code: 			<tr>
  				<td colspan="2" id="reportBold">Number of samples in group:</td>
  			</tr>
      		<s:if test="kmForm.storedData.upSampleCount > 0">
  				<tr>
  					<td>
  					<s:property value="kmForm.upOrAmplified" />:</td>
  					<td>
  					<s:property value="kmForm.storedData.upSampleCount" />
  					upOrAmplified
  					</td>
  				</tr>
  			</s:if>
  			<s:if test="kmForm.storedData.downSampleCount > 0">
  				<tr>
  					<td>
  					<s:property value="kmForm.storedData.downOrDeleted" />:</td>
  					<td>
  					<s:property value="kmForm.storedData.downSampleCount" />
  					</td>
  				</tr>
  			</s:if>
  			<s:if test="kmForm.storedData.intSampleCount > 0">
  				<tr>
  					<td>Intermediate:</td>
  					<td>
  					<s:property value="kmForm.storedData.intSampleCount" />
  					</td>
  				</tr>
  			</s:if>
  			<s:if test="kmForm.storedData.sampleList1Count > 0">
  				<tr>
  					<td>
  					<s:property value="kmForm.storedData.samplePlot1Label" />
  					</td>
  					<td>
  					<s:property value="kmForm.storedData.sampleList1Count" />
  					</td>
  				</tr>
  			</s:if>
  			<s:if test="kmForm.storedData.sampleList2Count > 0">
  				<tr>
  					<td>
  					<s:property value="kmForm.storedData.samplePlot2Label" />
  					</td>
  					<td>
  					<s:property value="kmForm.storedData.sampleList2Count" />
  					</td>
  				</tr>
  			</s:if>
  			<tr>
  				<td colspan="2">
  				<hr width="100%" size="1" color="black" />
  