1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.calendar.validation;
17
18 import java.sql.Time;
19
20 import org.apache.commons.lang.StringUtils;
21 import org.kuali.hr.time.calendar.Calendar;
22 import org.kuali.rice.kns.document.MaintenanceDocument;
23 import org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase;
24
25 public class CalendarRule extends MaintenanceDocumentRuleBase {
26 @Override
27 protected boolean processCustomRouteDocumentBusinessRules(
28 MaintenanceDocument document) {
29 boolean valid = true;
30
31 Calendar calendar = (Calendar) this.getNewBo();
32 valid = validateFLSABeginDay(calendar.getFlsaBeginDay());
33 valid = validateFLSABeginTime(calendar.getFlsaBeginTime());
34 return valid;
35 }
36
37 boolean validateFLSABeginDay(String flsaBeginDay) {
38 boolean valid = true;
39 if (StringUtils.isEmpty(flsaBeginDay)) {
40 this.putFieldError("flsaBeginDay", "error.required",
41 "FLSA Begin Day");
42 valid = false;
43 }
44 return valid;
45 }
46 boolean validateFLSABeginTime(Time flsaBeginTime) {
47 boolean valid = true;
48 if (flsaBeginTime == null) {
49 this.putFieldError("flsaBeginTime", "error.required",
50 "FLSA Begin Time");
51 valid = false;
52 }
53 return valid;
54 }
55
56 }