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());
  }
Exemplo n.º 2
0
  private void fillWrappedObject(ReservedItem reservedItem) {

    this.library = reservedItem.getLoanProfileView().getLibraryName();
    this.fromDate = DateFormat.getDefaultInstance(locale).format(reservedItem.getFromDate());
    this.toDate = DateFormat.getDefaultInstance(locale).format(reservedItem.getToDate());
    if (reservedItem.getLoanStatus() == LoanConstants.RESERVE_REQUEST) {
      this.status = MessageFactory.getInstance().getMessage("reserveRequest").getSummary();
    } else if (reservedItem.getLoanStatus() == LoanConstants.CONFIRMED_RESERVE_REQUEST) {
      this.setStatus(
          MessageFactory.getInstance().getMessage("confirmedReserveRequest").getSummary());
    } else if (reservedItem.getLoanStatus() == ReservedItem.REJECTED_RESERVE_REQUEST_BY_STAFF) {
      this.setStatus(
          MessageFactory.getInstance().getMessage("rejectedReserveRequestByStaff").getSummary());
    } else if (reservedItem.getLoanStatus() == ReservedItem.SENT_TO_REPOSITORY_RESERVE_REQUEST) {
      this.setStatus(
          MessageFactory.getInstance().getMessage("sentToCreateLoanRequest").getSummary());
    } else if (reservedItem.getLoanStatus() == ReservedItem.CANCELED_RESERVE_REQUEST_BY_MEMBER) {
      this.setStatus(
          MessageFactory.getInstance().getMessage("canceledReserveRequestByMember").getSummary());
    }

    this.biblioId = reservedItem.getBiblioId();
    this.biblioTitle =
        ((BibliographicRecord)
                NliUnimarcStorageServiceProxy.getInstance()
                    .findById(BibliographicRecord.class, reservedItem.getBiblioId()))
            .getTitle();
    this.volume = reservedItem.getVolume();
    this.sectionAddress = reservedItem.getAddress();
    this.locQualifier = reservedItem.getLocQualifier();
    int intReserveType = reservedItem.getReserveType();
    if (intReserveType == ReservedItem.ONLINE_DELIVERABLE) {
      this.setReserveType(MessageFactory.getInstance().getMessage("remote.reserve").getSummary());
    } else if (intReserveType == ReservedItem.HOURLY_RESERVE) {
      this.setReserveType(MessageFactory.getInstance().getMessage("hourly.reserve").getSummary());
    } else {
      this.setReserveType(MessageFactory.getInstance().getMessage("ordinary.reserve").getSummary());
    }

    this.setProfileTitle(reservedItem.getLoanProfileView().getMemberTitle());
    this.setMembershipNumber(reservedItem.getLoanProfileView().getMembershipNo());
    this.setRequestDate(
        DateFormat.getDefaultInstance(locale).format(reservedItem.getRegisterDate()));
    this.setPriority(reservedItem.getLoanProfileView().getOverallPriority());

    this.reserveStatus = reservedItem.getLoanStatus();
  }