コード例 #1
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);
     }
   }
 }
コード例 #2
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);
     }
   }
 }
コード例 #3
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);
     }
   }
 }
コード例 #4
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);
     }
   }
 }
コード例 #5
0
 public String doConfirm() {
   try {
     NliMultiMediaServiceProxy.getInstance()
         .updateVirtualContentManagement(multiMediaBean.getContentManagement(), multiMedia, false);
     Long recordId = (Long) JsfUtils.getFromPageFlow(Constants.RECORD_ID);
     if (recordId != null) {
       updateDigitalResourceIndexes(
           multiMediaBean.getContentManagement(),
           recordId,
           true,
           DigitalresourcesSchema.UPDATE_INDEX);
     }
     return goBack();
   } catch (Exception e) {
     e.printStackTrace();
     ErrorReportingUtils.getInstance().reportError(e);
     return "";
   }
 }
コード例 #6
0
  public String doSave() {

    try {

      if (StringUtils.isEmpty(membershipNumber)) {
        ErrorReportingUtils.getInstance().reportErrors("membership-number-is-missing");
        return "";
      }
      if (selectedUnitOrLib instanceof LibraryUnit
          && selectedRequestType == UserManagementDataMap.Request_type.Scholar.getValue()) {
        ErrorReportingUtils.getInstance().reportErrors("select-valid-unit-library");
        return "";
      }

      if (selectedUnitOrLib instanceof OrganizationUnit
          && selectedRequestType != UserManagementDataMap.Request_type.Scholar.getValue()) {
        ErrorReportingUtils.getInstance().reportErrors("select-valid-unit-library");
        return "";
      }

      if (this.realPerson.getProfile() == null) this.realPerson.setProfile(new ProfilePerson());

      ProfilePerson profile = this.realPerson.getProfile();
      profile.setNationality(getNationality());
      profile.setTitle(this.realPerson.getFirstName() + " " + this.realPerson.getLastName());
      profile.setMembershipNo(this.membershipNumber);

      profile.setUserType(ProfilePerson.BOTH);
      profile.setRegisterType(Byte.valueOf(JsfUtils.getFromPageFlow("registerType").toString()));
      profile.setUserName(this.userName);
      profile.setPassword(WebApplication.getInstance().encodePassword(this.password));
      profile.setEmail(this.email);
      this.realPerson.setUniqeName(this.realPerson.createPersonIdentifierKey());

      if (this.selectedRequestType == UserManagementDataMap.Request_type.SafeKeeping.getValue()) {
        service.saveRealLoanProfileRequest(this.realPerson, this.selectedUnitOrLib);
      } else if (this.selectedRequestType
          == UserManagementDataMap.Request_type.Exchange.getValue()) {
        service.saveRealExchangeProfileRequest(this.realPerson, this.selectedUnitOrLib);
      } else if (this.selectedRequestType
          == UserManagementDataMap.Request_type.Scholar.getValue()) {
        service.saveRealProberProfileRequest(this.realPerson, this.selectedUnitOrLib);
      }

      this.realPerson = service.findRealProfilePersonByProfilePersonId(profile.getId());

      NliMailDefinitionServiceProxy.getInstance()
          .sendMessage(
              this.email,
              JsfUtils.getStringFromBundle("userNamePassEmailSubject"),
              "body",
              Constants.UTF8);

      Map map = RequestContext.getCurrentInstance().getPageFlowScope();
      map.put("realPerson", this.realPerson);
      map.put("selectedUnit", this.selectedUnitOrLib);
      map.put("requestType", this.selectedRequestType);

    } catch (DuplicateMembershipNoException exp) {
      ErrorReportingUtils.getInstance()
          .reportErrors(JsfUtils.getStringFromBundle("duplicateMembershipNoException"));
      return "";
    } catch (DuplicateMemberException e) {
      ErrorReportingUtils.getInstance()
          .reportErrors(JsfUtils.getStringFromBundle("duplicateMemberException"));
      return "";
    } catch (DuplicateNationalCodeException e) {
      ErrorReportingUtils.getInstance()
          .reportErrors(JsfUtils.getStringFromBundle("duplicateNationalCodeException"));
      return "";
    } catch (DuplicateUserNameException e) {
      ErrorReportingUtils.getInstance()
          .reportErrors(JsfUtils.getStringFromBundle("duplicateUsernameException"));
      return "";
    } catch (DuplicateLoanProfileException exp) {

      return processException(exp, 0);

    } catch (DuplicateExchangeProfileException exp) {

      return processException(exp, 1);

    } catch (DuplicateProberProfileException exp) {

      return processException(exp, 2);

    } catch (Exception exp) {
      exp.printStackTrace();

      return "";
    } finally {

    }

    return goBackList();
  }