001 package com.bea.medrec.beans;
002
003 import java.util.ArrayList;
004 import java.util.Collection;
005 import javax.servlet.http.HttpServletRequest;
006 import org.apache.struts.action.ActionErrors;
007 import org.apache.struts.action.ActionMapping;
008
009 /**
010 * <p>Form bean for the
011 * </p>
012 *
013 * @author Copyright (c) 2006 by BEA Systems. All Rights Reserved.
014 */
015 public class DiagnosticsBean extends BaseBean {
016
017 ArrayList<Object> logTypes = new ArrayList<Object>();
018 ArrayList<Object> timeSpans = new ArrayList<Object>();
019 ArrayList<Object> msgSeverities = new ArrayList<Object>();
020 String logType = "";
021 String searchCriteria = "";
022 String timeSpan = "";
023 String msgSeverity = "";
024
025 public DiagnosticsBean() { }
026
027 public class OptionType { // inner bean for represention option items
028 private String label = null;
029 private String value = null;
030
031 public OptionType(String label, String value) {
032 this.label = label;
033 this.value = value;
034 }
035
036 public String getOptionLabel() {
037 return label;
038 }
039
040 public String getOptionValue() {
041 return value;
042 }
043 } // end inner class
044
045 // getters
046 public Collection getLogTypes() {
047 return logTypes;
048 }
049
050 public String getLogType() {
051 return logType;
052 }
053
054 public String getSearchCriteria() {
055 return searchCriteria;
056 }
057
058 public String getTimeSpan() {
059 return timeSpan;
060 }
061
062 public Collection getTimeSpans() {
063 return timeSpans;
064 }
065
066 public String getMsgSeverity() {
067 return msgSeverity;
068 }
069
070 public Collection getMsgSeverities() {
071 return msgSeverities;
072 }
073
074 // setters
075 public void setLogType(String logType) {
076 this.logType = logType;
077 }
078
079 public void setSearchCriteria(String searchCriteria) {
080 this.searchCriteria = searchCriteria;
081 }
082
083 public void setTimeSpan(String timeSpan) {
084 this.timeSpan = timeSpan;
085 }
086
087 public void setMsgSeverity(String msgSeverity) {
088 this.msgSeverity = msgSeverity;
089 }
090
091 public void addLogType(String label, String value) {
092 logTypes.add(new OptionType(label, value));
093 }
094
095 /* public void addTimeSpan(LabelValueBean label) {
096 timeSpans.add(label);
097 }
098 */
099
100 public void addTimeSpan(String label, String value) {
101 timeSpans.add(new OptionType(label, value));
102 }
103
104 public void addMsgSeverity(String label, String value) {
105 msgSeverities.add(new OptionType(label, value));
106 }
107
108 /**
109 * <p>Validate registration.</p>
110 *
111 * @param mapping
112 * @param request
113 * @return ActionErrors
114 */
115 public ActionErrors validate(ActionMapping mapping,
116 HttpServletRequest request) {
117 return super.validate(mapping, request);
118 }
119
120 public String toString() {
121 StringBuffer str = new StringBuffer();
122 str.append("Diagnostic[LogType: "+logType);
123 str.append(" | MsgSeverity: "+msgSeverity);
124 str.append(" | TimeSpan (hrs): "+timeSpan);
125 str.append(" | Search Criteria: "+searchCriteria);
126 str.append("]");
127
128 return str.toString();
129 }
130
131 }
|