View Javadoc
1   package org.kuali.ole.ncip.service;
2   
3   
4   import org.extensiblecatalog.ncip.v2.service.*;
5   import org.kuali.ole.ncip.bo.OLENCIPConstants;
6   
7   import java.math.BigDecimal;
8   import java.util.GregorianCalendar;
9   
10  /**
11   * Created by chenchulakshmig on 8/18/15.
12   */
13  public class NCIPCheckOutItemResponseBuilder {
14  
15      public void setItemId(CheckOutItemResponseData checkOutItemResponseData, CheckOutItemInitiationData checkOutItemInitiationData, AgencyId agencyId, String identifierType) {
16          ItemId itemId = new ItemId();
17          itemId.setAgencyId(agencyId);
18          ItemIdentifierType itemIdentifierType = new ItemIdentifierType(OLENCIPConstants.SCHEME, identifierType);
19          itemId.setItemIdentifierType(itemIdentifierType);
20          itemId.setItemIdentifierValue(checkOutItemInitiationData.getItemId().getItemIdentifierValue());
21          checkOutItemResponseData.setItemId(itemId);
22      }
23  
24      public void setUserId(CheckOutItemResponseData checkOutItemResponseData, CheckOutItemInitiationData initData, AgencyId agencyId, String borrowerType) {
25          UserId userId = new UserId();
26          userId.setAgencyId(agencyId);
27          UserIdentifierType userIdentifierType = new UserIdentifierType(borrowerType, borrowerType);
28          userId.setUserIdentifierValue(initData.getUserId().getUserIdentifierValue());
29          userId.setUserIdentifierType(userIdentifierType);
30          checkOutItemResponseData.setUserId(userId);
31      }
32  
33      public void setDateDue(CheckOutItemResponseData checkOutItemResponseData, GregorianCalendar dueDate) {
34          checkOutItemResponseData.setDateDue(dueDate);
35      }
36  
37      public void setRenewalCount(CheckOutItemResponseData checkOutItemResponseData, BigDecimal renewalCount) {
38          checkOutItemResponseData.setRenewalCount(renewalCount);
39      }
40  
41  }