public void uploadAndReturn(ReturnEvent event) {

    if (event.getReturnValue() == null) return;

    String imageType = (String) event.getReturnValue();
    byte[] picture = (byte[]) event.getReturnParameters().get("picture");

    if (picture != null) {
      this.realPerson.setImage(picture);

      this.imageSource = JsfUtils.getVirtualImageUrl(picture, "realPic" + (counter++));
    }
  }
Exemplo n.º 2
0
 public void returnedContentTypeDialog(ReturnEvent event) {
   if (event.getReturnValue() == null) {
     return;
   }
   MultiMediaMaterialType materialType =
       (MultiMediaMaterialType) event.getReturnParameters().get(Constants.KEY_RETURN_FROM_DIALOG);
   multiMediaBean.getContentManagement().setMaterialType(materialType);
 }
Exemplo n.º 3
0
 public void returnedWorkGroupDialog(ReturnEvent event) {
   if (event.getReturnValue() == null) {
     return;
   }
   AbstractWorkGroup workGroup =
       (AbstractWorkGroup) event.getReturnParameters().get(Constants.KEY_RETURN_FROM_DIALOG);
   multiMediaBean.getContentManagement().setWorkGroup(workGroup);
 }
Exemplo n.º 4
0
 public void returnedDownloadAccessModuleDialog(ReturnEvent event) {
   if (event.getReturnValue() == null) {
     return;
   }
   AccessModule accessModule =
       (AccessModule) event.getReturnParameters().get(Constants.KEY_RETURN_FROM_DIALOG);
   multiMediaBean.getContentManagement().setDownLoadAccessModule(accessModule);
 }
Exemplo n.º 5
0
 public void returnFromDeleteDialog(ReturnEvent event) {
   Integer deleteConfirm = (Integer) event.getReturnValue();
   if (deleteConfirm != null && deleteConfirm == 0) {
     if (JsfUtils.resolveVariable("row") != null) {
       UserFavoriteSubjectRowData rowData =
           (UserFavoriteSubjectRowData) JsfUtils.resolveVariable("row");
       UserFavoriteSubject selectedSubject = (UserFavoriteSubject) rowData.getEntity();
       NliSdiServiceProxy.getInstance().removeUserFavoriteSubject(selectedSubject);
       subjectModel.refresh();
     }
   }
 }
Exemplo n.º 6
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());
   }
 }
Exemplo n.º 7
0
 public void returnDeleteHighVersionDialogValue(ReturnEvent event) {
   Integer deleteConfirm = (Integer) event.getReturnValue();
   if (deleteConfirm == 0) {
     try {
       addMultiMediaBean.setLargeThumbFileName("");
       multiMedia.setLargeThumbnail(null);
       multiMedia.setLargeThumbSystemic(true);
     } catch (Exception e) {
       e.printStackTrace();
       ErrorReportingUtils.getInstance().reportError(e);
     }
   }
 }
Exemplo n.º 8
0
 public void returnDeleteFulltextArchiveDialogValue(ReturnEvent event) {
   Integer deleteConfirm = (Integer) event.getReturnValue();
   if (deleteConfirm == 0) {
     try {
       addMultiMediaBean.setFulltextFileName("");
       multiMedia.setFulltextFile(null);
       multiMedia.setFulltextFileSystemic(true);
     } catch (Exception e) {
       e.printStackTrace();
       ErrorReportingUtils.getInstance().reportError(e);
     }
   }
 }
Exemplo n.º 9
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);
     }
   }
 }
Exemplo n.º 10
0
  @SuppressWarnings("unchecked")
  public void returnOptions(ReturnEvent event) {
    Object value = event.getReturnValue();
    StringBuffer buffer = new StringBuffer();
    int addedPrice = 0;
    if (value instanceof List) {
      for (CarOption option : (List<CarOption>) value) {
        addedPrice = addedPrice + option.getPrice();
        if (buffer.length() != 0) buffer.append(", ");
        buffer.append(option.getName());
      }
    }

    _options.setValue(buffer.toString());

    Integer price = (Integer) _price.getValue();
    _price.setValue(new Integer(price.intValue() + addedPrice));
  }
Exemplo n.º 11
0
 public void returnDeleteDialogValue(ReturnEvent event) {
   Integer deleteConfirm = (Integer) event.getReturnValue();
   if (deleteConfirm == 0) {
     try {
       MultiMedia multiMedia =
           CMSUtil.getMultiMedia(multiMediaBean.getContentManagement(), false, false, false);
       NliMultiMediaServiceProxy.getInstance()
           .removeContent(
               multiMediaBean.getContentManagement().getArchiveId(),
               multiMediaBean.getContentManagement().getId(),
               multiMedia.getId(),
               1,
               multiMedia.getFileContent().getFileFormate());
     } catch (Exception e) {
       e.printStackTrace();
       ErrorReportingUtils.getInstance().reportError(e);
     }
   }
 }