1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.student.common.uif.form;
18
19 import org.apache.commons.lang.StringUtils;
20 import org.kuali.rice.krad.web.form.UifFormBase;
21 import org.kuali.student.common.uif.util.GrowlIcon;
22 import org.kuali.student.common.uif.util.KSUifUtils;
23 import org.kuali.student.r2.common.dto.MetaInfo;
24 import org.kuali.student.r2.common.util.date.DateFormatters;
25 import org.kuali.student.r2.common.util.date.KSDateTimeFormatter;
26
27 import javax.servlet.http.HttpServletRequest;
28
29
30
31
32
33
34
35 public class KSUifForm extends UifFormBase {
36
37 MetaInfo meta = new MetaInfo();
38 KSDateTimeFormatter defaultFormatter = DateFormatters.COURSE_OFFERING_VIEW_HELPER_DATE_TIME_FORMATTER;
39
40 public KSUifForm() {
41 super();
42 }
43
44 public MetaInfo getMeta() {
45 return meta;
46 }
47
48 public void setMeta(MetaInfo meta) {
49 this.meta = meta;
50 }
51
52 public KSDateTimeFormatter getDefaultFormatter() {
53 return defaultFormatter;
54 }
55
56 public void setDefaultFormatter(KSDateTimeFormatter defaultFormatter) {
57 this.defaultFormatter = defaultFormatter;
58 }
59
60 public String getVersionInd(){
61 if (StringUtils.isEmpty(meta.getVersionInd())){
62 return "";
63 } else {
64 return meta.getVersionInd();
65 }
66
67 }
68
69 public String getCreateTime(){
70 if(meta.getCreateTime() == null){
71 return "";
72 } else {
73 return getDefaultFormatter().format(meta.getCreateTime());
74 }
75 }
76
77 public String getUpdateTime(){
78 if(meta.getUpdateTime() == null){
79 return "";
80 } else {
81 return getDefaultFormatter().format(meta.getUpdateTime());
82 }
83 }
84
85 public String getCreateId(){
86 if(StringUtils.isEmpty(meta.getCreateId() )){
87 return "";
88 } else {
89 return meta.getCreateId();
90 }
91
92 }
93 public String getUpdateId(){
94 if(StringUtils.isEmpty(meta.getUpdateId() )){
95 return "";
96 } else {
97 return meta.getUpdateId();
98 }
99
100 }
101
102 @Override
103 public void postBind(HttpServletRequest request) {
104
105 String growlMessage = request.getParameter("growl.message");
106 String temp = request.getParameter("growl.message.params");
107 String[] growlMessageParams;
108 if(temp!=null){
109 growlMessageParams = temp.split(",");
110 }
111 else{
112 growlMessageParams=new String[0];
113 }
114
115 if (growlMessage != null) {
116 KSUifUtils.addGrowlMessageIcon(GrowlIcon.SUCCESS, growlMessage, growlMessageParams);
117 }
118
119 super.postBind(request);
120 }
121
122 }