Exemplo n.º 1
0
  private void fillWrappedObject(LoanedItem loanedItem) {

    this.setFromDate(DateFormat.getDefaultInstance(locale).format(loanedItem.getFromDate()));
    this.setToDate(DateFormat.getDefaultInstance(locale).format(loanedItem.getToDate()));

    Register register = loanedItem.getRegister();
    BibliographicRecord bibliographicRecord = register.getBibliographicRecord();

    this.setBiblioMainEntry(bibliographicRecord.getMainEntry());
    this.biblioPublisher = bibliographicRecord.getPublisherName();
    this.biblioPublishDate = bibliographicRecord.getPublishDate();
    this.biblioLcClass = bibliographicRecord.getLCClass();
    this.biblioDeClass = bibliographicRecord.getDEClass();
    this.biblioNlmClass = bibliographicRecord.getNLMClass();
    this.biblioCallNumber = bibliographicRecord.getCallNumber();
    this.biblioNativeCallNumber = bibliographicRecord.getNativeCallNumber();
    this.gmdType = bibliographicRecord.getGmdText();

    this.setBiblioTitle(bibliographicRecord.getTitle());
    this.setRegisterNumberType(register.getRegNo());
    this.setRetriveNoLabel(register.getRetriveNo());
    this.setVolume(register.getVolume());
    this.setSectionAddress(register.getAddress());
    this.setLocQualifier(register.getLocationQualifier());
    this.setDocumentCopy(register.getCopy());
    //         if (loanHistory.getLoanRequest() != null) {
    int loanType = loanedItem.getLoanStatus();
    if (loanType == LoanedItem.ORDINARY_LOAN) {
      this.setLoanType(MessageFactory.getInstance().getMessage("loan.ordinary").getSummary());
    } else if (loanType == LoanedItem.HOURLY_LOAN) {
      this.setLoanType(MessageFactory.getInstance().getMessage("loan.hourly").getSummary());
    }
    //         }

    LoanProfileView loanProfileView = loanedItem.getLoanProfileView();
    this.setProfileTitle(loanProfileView.getMemberTitle());
    this.setMembershipNumber(loanProfileView.getMembershipNo());
    this.loanStatus = loanedItem.getLoanStatus();
    this.lender = loanedItem.getLender().getTitle();
    this.holdingLocation = register.getLocation().getItemName();
    int interval = DateUtils.calculateDateInterval(loanedItem.getToDate(), new Date(), true) - 1;
    if (interval > 0) {
      this.setDelayDays(String.valueOf(interval));
    }
    this.setComments(loanedItem.getLoanRequest().getComments());
  }