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());
   }
 }
  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());
  }
  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;
  }
  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;
    }
  }