View Javadoc
1   package org.kuali.ole.ingest.action;
2   
3   import org.kuali.ole.ingest.krms.action.OleCheckOutAction;
4   import org.kuali.rice.krms.api.repository.action.ActionDefinition;
5   import org.kuali.rice.krms.framework.engine.Action;
6   import org.kuali.rice.krms.impl.type.ActionTypeServiceBase;
7   
8   /**
9    * Created with IntelliJ IDEA.
10   * User: ?
11   * Date: 12/18/12
12   * Time: 6:04 PM
13   * To change this template use File | Settings | File Templates.
14   */
15  public class MockOleKrmsActionTypeService extends ActionTypeServiceBase {
16  
17      private MockCreateBibAction createBibAction;
18      private MockUpdateItemAction updateItemAction;
19      //private OverlayAction overlayAction;
20      private MockDeleteReplaceAction deleteReplaceAction;
21  
22      /**
23       *      This method invokes appropriate Bib action based on action definition's name
24       * @param actionDefinition
25       * @return Action
26       */
27      @Override
28      public Action loadAction(ActionDefinition actionDefinition) {
29          String parameter = null;
30          if(actionDefinition.getName().equals("checkout")){
31              parameter= actionDefinition.getAttributes().get("checkout");
32              return  new OleCheckOutAction(parameter);
33          } else if (actionDefinition.getName().equals("createBibAction")) {
34              return getCreateBibAction();
35          } else if (actionDefinition.getName().equals("updateItemAction")){
36              return getUpdateItemAction();
37          } else if (actionDefinition.getName().equals("deleteReplaceAction")){
38              return getDeleteReplaceAction();
39          }
40          return new OleCheckOutAction(parameter);
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 MockDeleteReplaceAction getDeleteReplaceAction() {
60          return deleteReplaceAction;
61      }
62  
63      public void setDeleteReplaceAction(MockDeleteReplaceAction deleteReplaceAction) {
64          this.deleteReplaceAction = deleteReplaceAction;
65      }
66  }