01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.mail;
18:
19: import edu.iu.uis.eden.EdenConstants;
20: import edu.iu.uis.eden.KEWServiceLocator;
21: import edu.iu.uis.eden.actionitem.ActionItem;
22: import edu.iu.uis.eden.exception.EdenUserNotFoundException;
23: import edu.iu.uis.eden.exception.WorkflowRuntimeException;
24:
25: /**
26: * Implementation of the {@link ActionListImmediateEmailReminderService}.
27: *
28: * @author rkirkend
29: */
30: public class ActionListImmediateProcessorImpl implements
31: ActionListImmediateEmailReminderService {
32:
33: private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
34: .getLogger(ActionListImmediateProcessorImpl.class);
35:
36: public void sendReminder(ActionItem actionItem,
37: boolean doNotSendApproveNotificationEmails) {
38: if (actionItem != null) {
39: if (!actionItem.getActionRequestCd().equals(
40: EdenConstants.ACTION_REQUEST_APPROVE_REQ)
41: || !doNotSendApproveNotificationEmails) {
42: try {
43: if (LOG.isDebugEnabled()) {
44: LOG.debug("sending immediate reminder to "
45: + actionItem.getUser()
46: .getAuthenticationUserId()
47: .getAuthenticationId());
48: }
49: getActionListEmailService().sendImmediateReminder(
50: actionItem.getUser(), actionItem);
51: } catch (EdenUserNotFoundException e) {
52: throw new WorkflowRuntimeException(e);
53: }
54: }
55: }
56: }
57:
58: private ActionListEmailService getActionListEmailService() {
59: return (ActionListEmailService) KEWServiceLocator
60: .getService(KEWServiceLocator.ACTION_LIST_EMAIL_SERVICE);
61: }
62: }
|