View Javadoc
1   package org.kuali.ole.describe.service;
2   
3   import org.kuali.ole.ingest.action.ExceptionAction;
4   import org.kuali.ole.ingest.action.MockCreateBibAction;
5   import org.kuali.ole.ingest.action.MockUpdateItemAction;
6   import org.kuali.ole.ingest.action.OverlayAction;
7   import org.kuali.rice.krms.api.repository.action.ActionDefinition;
8   import org.kuali.rice.krms.framework.engine.Action;
9   import org.kuali.rice.krms.impl.type.ActionTypeServiceBase;
10  
11  /**
12   * Created with IntelliJ IDEA.
13   * User: ?
14   * Date: 12/18/12
15   * Time: 5:37 PM
16   * To change this template use File | Settings | File Templates.
17   */
18  public class MockCreateBibActionTypeService  extends ActionTypeServiceBase {
19  
20      private MockCreateBibAction createBibAction;
21      private MockUpdateItemAction updateItemAction;
22      private OverlayAction overlayAction;
23  
24      /**
25       *      This method invokes appropriate Bib action based on action definition's name
26       * @param actionDefinition
27       * @return Action
28       */
29      @Override
30      public Action loadAction(ActionDefinition actionDefinition) {
31          if (actionDefinition.getName().equals("createBibAction")) {
32              return getCreateBibAction();
33          } else if (actionDefinition.getName().equals("updateItemAction")){
34              return getUpdateItemAction();
35          } else if (actionDefinition.getName().equals("exceptionAction")){
36              return new ExceptionAction();
37          }else if (actionDefinition.getName().equals("overlayAction")){
38              return new OverlayAction();
39          }
40          throw new NullPointerException("No actions defined");
41      }
42  
43      public MockCreateBibAction getCreateBibAction() {
44          return createBibAction;
45      }
46  
47      public void setCreateBibAction(MockCreateBibAction createBibAction) {
48          this.createBibAction = createBibAction;
49      }
50  
51      public MockUpdateItemAction getUpdateItemAction() {
52          return updateItemAction;
53      }
54  
55      public void setUpdateItemAction(MockUpdateItemAction updateItemAction) {
56          this.updateItemAction = updateItemAction;
57      }
58  
59      public OverlayAction getOverlayAction() {
60          return overlayAction;
61      }
62  
63      public void setOverlayAction(OverlayAction overlayAction) {
64          this.overlayAction = overlayAction;
65      }
66  }