Пример #1
0
  public String getCreateComplementaryInfo() {
    try {
      if (isBiblioRecord) {
        BibliographicRecord biblioRecord =
            CMSUtil.createNewBibliographic(contentManagementRowData.getTitle());
        biblioRecord.setWorkGroup(getMultiMedia().getGroup());
        biblioRecord.setAccessModule(getMultiMedia().getModule());

        biblioRecord =
            (BibliographicRecord)
                NliUnimarcStorageServiceProxy.getInstance().saveRecord(biblioRecord);
        getMultiMedia().setRecordId(biblioRecord.getId());
        getMultiMedia().setRecordType(MultiMediaConstants.BIBLIO_RECORD);
      } else {
        TempBibliographicRecord tmpBiblioRecord =
            CMSUtil.createNewTempBibliographic(contentManagementRowData.getTitle());
        tmpBiblioRecord.setWorkGroup(getMultiMedia().getGroup());
        tmpBiblioRecord.setAccessModule(getMultiMedia().getModule());

        tmpBiblioRecord =
            (TempBibliographicRecord)
                NliUnimarcStorageServiceProxy.getInstance().saveRecord(tmpBiblioRecord);
        getMultiMedia().setRecordId(tmpBiblioRecord.getId());
        getMultiMedia().setRecordType(MultiMediaConstants.TEMP_BIBLIO_RECORD);
      }
      getMultiMedia().setComplementryInfo(true);
      getMultiMedia().setLcc(contentManagementRowData.getContentManagement().getLcc());
      getMultiMedia().setLccCode(contentManagementRowData.getContentManagement().getLccCode());
      NliMultiMediaServiceProxy.getInstance()
          .saveContent(
              getMultiMedia(),
              contentManagementRowData.getContentManagement(),
              false,
              true,
              false,
              0);
      contentManagementRowData.setHasCompelementaryInfo(true);
      this.complementryInfo = true;
      JsfUtils.storeOnPageFlow(CMSConstants.KEY_COMPLEMENTARY_INFO, true);
      JsfUtils.ShowMessageDialog("complementary_record_created", 300, 130);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return "";
  }
Пример #2
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());
  }