예제 #1
0
  public String showFile() {
    JsfUtils.storeOnPageFlow(CMSConstants.VIRTUAL_CONTENT_MANAGEMENT, contentManagementRowData);
    String manipulateMode = (String) this.getManipulateMode().getValue();
    int textTypeReturnPath = Constants.BACK_TO_MATERIAL_SEARCH_PAGE;
    String returnPath = Constants.CMS_GO_MATERIAL_SHOW_FILE;
    if (manipulateMode.equalsIgnoreCase(Constants.EDIT_MOD)) {
      returnPath = Constants.CMS_GO_EDIT_MATERIAL;
      textTypeReturnPath = Constants.BACK_TO_EDIT_MATERIAL;
    } else {
      returnPath = Constants.CMS_GO_DISPAY_MATERIAL;
      textTypeReturnPath = Constants.BACK_TO_DISPLAY_MATERIAL;
    }

    if (contentManagementRowData.getFileFormat() == MultiMediaConstants.TEXT_TYPE) {
      try {
        return CMSUtil.displayTextDigitalResource(
            (VirtualContentManagement) contentManagementRowData.getEntity(),
            contentManagementRowData.getComplementaryRecordId(),
            textTypeReturnPath);
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      JsfUtils.storeOnPageFlow(Constants.CMS_SHOW_FILE_RETURN_PATH, returnPath);
      return Constants.CMS_GO_MATERIAL_SHOW_FILE;
    }
    return null;
  }
예제 #2
0
 public MultiMediaFile getMultiMediaFile() {
   multiMediaFile = getMultiMedia().getFileContent();
   // @todo must be set in DB
   if (contentManagementRowData.isLimitedContent()) {
     multiMediaFile.setDurationFormated(
         IMUtil.convertTime(
             (int) (contentManagementRowData.getTo() - contentManagementRowData.getFrom())));
   }
   return multiMediaFile;
 }
예제 #3
0
  public String addToGallery() {
    int fileType = NewsWebUtil.findVcmType(multiMediaBean.getContentManagement());
    String fileName = contentManagementRowData.getFileName();
    if ((fileType == MultiMediaConstants.AUDIO_TYPE || fileType == MultiMediaConstants.VIDEO_TYPE)
        && !MultimediaWebUtil.isPlayable(fileType, fileName)) {
      JsfUtils.ShowMessageDialog("gallery.content.format.is.not.valid.message", 420, 150);
      return null;
    } else {
      JsfUtils.storeOnSession(Constants.GALLERY_TYPE, String.valueOf(fileType));
      JsfUtils.storeOnSession(Constants.GALLERY_VCM, contentManagementRowData.getEntity());

      String manipulateMode = (String) this.getManipulateMode().getValue();
      if (manipulateMode.equalsIgnoreCase(Constants.EDIT_MOD))
        JsfUtils.storeOnPageFlow(
            Constants.CMS_CREATE_DESCRIPTION_PATH, Constants.CMS_GO_EDIT_MATERIAL);
      else
        JsfUtils.storeOnPageFlow(
            Constants.CMS_CREATE_DESCRIPTION_PATH, Constants.CMS_GO_DISPAY_MATERIAL);
      return Constants.GALLERY_VIEW_ADD_TO;
    }
  }
예제 #4
0
 public void returnFromDeleteNewItemDialog(ReturnEvent event) {
   Integer deleteConfirm = (Integer) event.getReturnValue();
   if (deleteConfirm != null && deleteConfirm == 0) {
     NewsWebUtil.getInstance()
         .deleteDigitalFromNewItems(
             (BibliographicRecord)
                 NliUnimarcStorageServiceProxy.getInstance()
                     .findById(
                         BibliographicRecord.class,
                         (Long) JsfUtils.getFromPageFlow(Constants.RECORD_ID)),
             (VirtualContentManagement) contentManagementRowData.getEntity());
   }
 }
예제 #5
0
  public String addToNewItems() {

    String manipulateMode = (String) this.getManipulateMode().getValue();
    if (manipulateMode.equalsIgnoreCase(Constants.EDIT_MOD))
      JsfUtils.storeOnPageFlow(
          Constants.CMS_CREATE_DESCRIPTION_PATH, Constants.CMS_GO_EDIT_MATERIAL);
    else
      JsfUtils.storeOnPageFlow(
          Constants.CMS_CREATE_DESCRIPTION_PATH, Constants.CMS_GO_DISPAY_MATERIAL);

    return NewsWebUtil.getInstance()
        .addDigitalResourceToNewItems(
            (VirtualContentManagement) contentManagementRowData.getEntity());
  }
예제 #6
0
 public void returnFullTextDialogValue(ReturnEvent event) {
   Integer confirm = (Integer) event.getReturnValue();
   if (confirm == 0) {
     try {
       multiMediaBean.getContentManagement().setFullText(true);
       NliMultiMediaServiceProxy.getInstance()
           .updateVirtualContentManagement(multiMediaBean.getContentManagement(), null, false);
       contentManagementRowData.setFullText(true);
     } catch (Exception e) {
       e.printStackTrace();
       ErrorReportingUtils.getInstance().reportError(e);
     }
   }
 }
예제 #7
0
  public boolean isAddedToNewItems() {
    addedToNewItems = false;
    if (JsfUtils.getFromPageFlow(Constants.RECORD_ID) != null) {
      BibliographicRecord biblioRecord =
          (BibliographicRecord)
              NliUnimarcStorageServiceProxy.getInstance()
                  .findById(
                      BibliographicRecord.class,
                      (Long) JsfUtils.getFromPageFlow(Constants.RECORD_ID));
      if (biblioRecord != null)
        addedToNewItems =
            NewsWebUtil.getInstance()
                .isDigitalResourceAddedToNewItems(
                    biblioRecord, (VirtualContentManagement) contentManagementRowData.getEntity());
    }

    return addedToNewItems;
  }
예제 #8
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 "";
  }
예제 #9
0
  public ViewDocumentInfoBean() {
    multiMediaBean = MultiMediaBean.getInstance();
    addMultiMediaBean = AddMultiMediaBean.getInstance();
    contentManagementRowData =
        (MultiMediaContentRowData)
            JsfUtils.getFromPageFlow(CMSConstants.VIRTUAL_CONTENT_MANAGEMENT);
    biblioMaterialType = (String) JsfUtils.getFromPageFlow(Constants.BIBLIO_MATERIAL_TYPE);
    multiMediaBean.setContentManagement(
        (VirtualContentManagement) getContentManagementRowData().getEntity());
    addMultiMediaBean.setMultiMedia(getMultiMedia());
    if (multiMedia.getLargeThumbnail() != null)
      addMultiMediaBean.setLargeThumbFileName(multiMedia.getLargeThumbnail().getFileName());
    if (multiMedia.getSmallThumbnail() != null)
      addMultiMediaBean.setSmallThumbFileName(multiMedia.getSmallThumbnail().getFileName());
    if (multiMedia.getLowQualityFile() != null)
      addMultiMediaBean.setLowQualityFileName(multiMedia.getLowQualityFile().getFileName());
    if (multiMedia.getFulltextFile() != null)
      addMultiMediaBean.setFulltextFileName(multiMedia.getFulltextFile().getFileName());
    selectedContentType = contentManagementRowData.getFileFormat();
    if (contentManagementRowData.getRecordType() == MultiMediaConstants.TEMP_BIBLIO_RECORD)
      isBiblioRecord = false;

    if (contentManagementRowData.getDigitalVerNum() == null)
      contentManagementRowData.setDigitalVerNum((Float) 1f);

    ResultPage resultPage =
        NliMultiMediaServiceProxy.getInstance()
            .findBiblioRecordIdByVCMId(
                contentManagementRowData.getRecordType(),
                contentManagementRowData.getContentManagement().getId(),
                true,
                0,
                20,
                new GridFilter());
    if (resultPage != null) {
      if (!resultPage.getResult().isEmpty()) {
        complementaryRecordId = (Long) resultPage.getResult().get(0);
        complementryInfo = false;
        JsfUtils.storeOnPageFlow(CMSConstants.KEY_COMPLEMENTARY_INFO, false);
      }
    }

    JsfUtils.storeOnPageFlow(CMSConstants.KEY_COMPLEMENTARY_INFO, true);
  }
예제 #10
0
 public MultiMedia getMultiMedia() {
   multiMedia = contentManagementRowData.getMultiMedia();
   return multiMedia;
 }
예제 #11
0
 public String goContentTypeDialog() {
   JsfUtils.storeOnPageFlow(
       CMSConstants.SELECTED_CONTENT_TYPE, contentManagementRowData.getFileFormat());
   return Constants.CMS_CONTENT_TYPE_LOV;
 }
예제 #12
0
 public String downloadFile() {
   VirtualContentManagement contentManagement =
       (VirtualContentManagement) contentManagementRowData.getEntity();
   return downloadFile(contentManagementRowData);
 }
예제 #13
0
 public void goDeleteFullTextVersion(ActionEvent event) {
   multiMediaBean.getContentManagement().setFullText(false);
   contentManagementRowData.setFullText(false);
 }
예제 #14
0
 public void goDeletePrintableVersion(ActionEvent event) {
   multiMediaBean.getContentManagement().setOriginal(true);
   contentManagementRowData.setOriginal(true);
 }