View Javadoc
1   package org.kuali.ole.ncip.service.impl;
2   
3   import org.kuali.ole.deliver.controller.checkout.CircUtilController;
4   import org.kuali.ole.deliver.util.DroolsResponse;
5   import org.kuali.ole.utility.OleStopWatch;
6   
7   import java.util.ArrayList;
8   import java.util.Map;
9   
10  /**
11   * Created by chenchulakshmig on 8/25/15.
12   */
13  public class NonSip2CheckoutItemServiceImpl extends CheckoutItemServiceImpl {
14  
15      @Override
16      public String prepareResponse() {
17          switch (responseFormatType) {
18              case ("XML"):
19                  response = getResponseHandler().marshalObjectToXml(getOleCheckOutItem());
20                  break;
21              case ("JSON"):
22                  response = getResponseHandler().marshalObjectToJson(getOleCheckOutItem());
23                  break;
24          }
25  
26          return response;
27      }
28  
29      @Override
30      public String getOperatorId(String operatorId) {
31          return operatorId;
32      }
33  
34      @Override
35      protected String preProcess(Map checkoutParameters) {
36          return null;
37      }
38  
39      @Override
40      protected String fireRules() {
41          OleStopWatch oleStopWatch = new OleStopWatch();
42          oleStopWatch.start();
43          ArrayList<Object> facts = new ArrayList<>();
44          facts.add(getOlePatronDocument());
45          DroolsResponse droolsResponse = new DroolsResponse();
46          facts.add(droolsResponse);
47          new CircUtilController().fireRules(facts, null, "general-checks");
48          return droolsResponse.getErrorMessage().getErrorMessage();
49      }
50  }