1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.businessobject.defaultvalue;
17
18 import java.util.Collection;
19
20 import org.apache.log4j.Logger;
21 import org.kuali.ole.fp.businessobject.MessageOfTheDay;
22 import org.kuali.ole.sys.context.SpringContext;
23 import org.kuali.rice.krad.service.BusinessObjectService;
24 import org.kuali.rice.krad.valuefinder.ValueFinder;
25
26 public class MessageOfTheDayFinder implements ValueFinder {
27
28
29
30 @Override
31 public String getValue() {
32 try {
33 Collection<MessageOfTheDay> collection = SpringContext.getBean(BusinessObjectService.class).findAll(MessageOfTheDay.class);
34 if (collection != null && !collection.isEmpty()) {
35 return collection.iterator().next().getFinancialSystemMessageOfTheDayText();
36 }
37 } catch ( Exception ex ) {
38 Logger.getLogger(getClass()).error("Unable to retrieve the message of the day",ex);
39 }
40 return "unable to retrieve message of the day";
41 }
42
43 }