package gov.nih.nci.cananolab.ui.study;

/**
 * This class sets up the submit a new study page and submits a new study.
 *
 * @author houyh
 */
import gov.nih.nci.cananolab.ui.core.BaseAnnotationAction;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class StudyAction extends BaseAnnotationAction {
	// logger
	// private static Logger logger = Logger.getLogger(StudyAction.class);

	public ActionForward input(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("inputForm");
	}
	
	public ActionForward setupNew(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.getInputForward();
	}

	public ActionForward studyInfo(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("studyInfoForm");
	}

	public ActionForward sampleInfo(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("sampleInfoForm");
	}

	public ActionForward searchSample(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("sampleSearchResult");
	}
	
	public ActionForward animalInfo(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("animalInfoForm");
	}
	
	public ActionForward treatmentInfo(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("treatmentInfoForm");
	}
	
	public ActionForward characterization(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("characterizationForm");
	}
	
	public ActionForward protocol(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("protocolForm");
	}
	
	public ActionForward publication(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("publicationForm");
	}
	
}

@@ -915,32 +915,85 @@
 ows Exception %7B%0A
+%09%09request.setAttribute(%22pageTitle%22, %22Submit Study%22);%0A
 %09%09return mapping
@@ -1043,20 +1043,20 @@
 rd study
-Info
+Edit
 (ActionM
@@ -1163,32 +1163,85 @@
 ows Exception %7B%0A
+%09%09request.setAttribute(%22pageTitle%22, %22Update Study%22);%0A
 %09%09return mapping
@@ -1259,24 +1259,20 @@
 d(%22study
-InfoForm
+Edit
 %22);%0A%09%7D%0A%0A
@@ -1299,20 +1299,23 @@
 d sample
-Info
+Summary
 (ActionM
@@ -1466,24 +1466,23 @@
 (%22sample
-InfoForm
+Summary
 %22);%0A%09%7D%0A%0A
@@ -1508,19 +1508,16 @@
 rd s
-earchS
 ample
+Add
 (Act
@@ -1676,28 +1676,18 @@
 mple
-SearchResult
+Add
 %22);%0A%09%7D%0A
-%09
 %0A%09pu
@@ -1711,20 +1711,23 @@
 d animal
-Info
+Summary
 (ActionM
@@ -1878,24 +1878,23 @@
 (%22animal
-InfoForm
+Summary
 %22);%0A%09%7D%0A%09
@@ -1916,29 +1916,27 @@
 Forward 
-treatmentInfo
+charSummary
 (ActionM
@@ -2085,25 +2085,19 @@
 rd(%22
-treatmentInfoForm
+charSummary
 %22);%0A
@@ -2127,28 +2127,20 @@
 ard char
-acterization
+Edit
 (ActionM
@@ -2293,24 +2293,12 @@
 char
-acterizationForm
+Edit
 %22);%0A
@@ -2332,16 +2332,23 @@
 protocol
+Summary
 (ActionM
@@ -2501,20 +2501,23 @@
 protocol
-Form
+Summary
 %22);%0A%09%7D%0A%09
@@ -2550,16 +2550,23 @@
 lication
+Summary
 (ActionM
@@ -2722,20 +2722,23 @@
 lication
-Form
+Summary
 %22);%0A%09%7D%0A%09

Update study wire frame.