View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.postprocessor;
17  
18  import org.kuali.rice.kew.api.action.ActionType;
19  import org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent;
20  import org.kuali.rice.kew.framework.postprocessor.AfterProcessEvent;
21  import org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent;
22  import org.kuali.rice.kew.framework.postprocessor.DeleteEvent;
23  import org.kuali.rice.kew.framework.postprocessor.DocumentLockingEvent;
24  import org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange;
25  import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange;
26  import org.kuali.rice.kew.framework.postprocessor.PostProcessor;
27  import org.kuali.rice.kew.framework.postprocessor.ProcessDocReport;
28  
29  import java.util.List;
30  
31  
32  
33  /**
34   * A simple default implementation of the PostProcessor which can be used
35   * as a superclass for post processor which don't want to implement all
36   * the methods on the interface.  Simply returns a "true"
37   * ProcessDocReport for all events exception for deletion.
38   * 
39   * @author Kuali Rice Team (rice.collab@kuali.org)
40   */
41  public class DefaultPostProcessor implements PostProcessor {
42  
43      public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {
44          return new ProcessDocReport(true, "");
45      }
46  
47      public ProcessDocReport doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) throws Exception {
48          return new ProcessDocReport(true, "");
49      }
50  
51      public ProcessDocReport doDeleteRouteHeader(DeleteEvent event) throws Exception {
52          return new ProcessDocReport(false, "");
53      }
54  
55      public ProcessDocReport doActionTaken(ActionTakenEvent event) throws Exception {
56          return new ProcessDocReport(true, "");
57      }
58  
59      public ProcessDocReport afterActionTaken(ActionType performed, ActionTakenEvent event) throws Exception {
60          return new ProcessDocReport(true, "");
61      }
62  
63      public ProcessDocReport beforeProcess(BeforeProcessEvent event) throws Exception {
64          return new ProcessDocReport(true, "");
65      }
66  
67      public ProcessDocReport afterProcess(AfterProcessEvent event) throws Exception {
68          return new ProcessDocReport(true, "");
69      }
70  
71  	public List<String> getDocumentIdsToLock(DocumentLockingEvent lockingEvent)
72  			throws Exception {
73  		return null;
74  	}
75      
76      
77  
78  }