View Javadoc
1   package org.kuali.ole.ncip.service;
2   
3   import org.extensiblecatalog.ncip.v2.service.*;
4   import org.kuali.ole.deliver.drools.CheckedInItem;
5   import org.kuali.ole.ncip.bo.OLENCIPConstants;
6   
7   /**
8    * Created by chenchulakshmig on 8/21/15.
9    */
10  public class NCIPCheckInItemResponseBuilder {
11  
12      public void setItemId(CheckInItemResponseData checkInItemResponseData, String itemBarcode, AgencyId agencyId, String identifierType) {
13          ItemId itemId = new ItemId();
14          itemId.setAgencyId(agencyId);
15          ItemIdentifierType itemIdentifierType = new ItemIdentifierType(OLENCIPConstants.SCHEME, identifierType);
16          itemId.setItemIdentifierType(itemIdentifierType);
17          itemId.setItemIdentifierValue(itemBarcode);
18          checkInItemResponseData.setItemId(itemId);
19      }
20  
21      public void setUserId(CheckInItemResponseData checkInItemResponseData, AgencyId agencyId, CheckedInItem checkedInItem) {
22          UserId userId = new UserId();
23          userId.setAgencyId(agencyId);
24          UserIdentifierType userIdentifierType = new UserIdentifierType(checkedInItem.getBorrowerType(), checkedInItem.getBorrowerType());
25          userId.setUserIdentifierValue(checkedInItem.getPatronBarcode());
26          userId.setUserIdentifierType(userIdentifierType);
27          checkInItemResponseData.setUserId(userId);
28      }
29  
30      public void setItemOptionalFields(CheckInItemResponseData checkInItemResponseData, CheckedInItem checkedInItem) {
31          ItemOptionalFields itemOptionalFields = new ItemOptionalFields();
32          BibliographicDescription bibliographicDescription = new BibliographicDescription();
33          bibliographicDescription.setAuthor(checkedInItem.getTitle());
34          bibliographicDescription.setTitle(checkedInItem.getAuthor());
35          itemOptionalFields.setBibliographicDescription(bibliographicDescription);
36          ItemDescription itemDescription = new ItemDescription();
37          itemDescription.setCallNumber(checkedInItem.getCallNumber());
38          itemOptionalFields.setItemDescription(itemDescription);
39          checkInItemResponseData.setItemOptionalFields(itemOptionalFields);
40      }
41  
42  
43  }