当前位置: 首页>>代码示例>>Java>>正文


Java VetoException类代码示例

本文整理汇总了Java中org.eclipse.scout.rt.platform.exception.VetoException的典型用法代码示例。如果您正苦于以下问题:Java VetoException类的具体用法?Java VetoException怎么用?Java VetoException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VetoException类属于org.eclipse.scout.rt.platform.exception包,在下文中一共展示了VetoException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execValidate

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
protected boolean execValidate() {
  boolean noFirstName = StringUtility.isNullOrEmpty(getFirstNameField().getValue());
  boolean noLastName = StringUtility.isNullOrEmpty(getLastNameField().getValue());

  getGeneralBox().clearErrorStatus();

  if (noFirstName && noLastName) {
    getGeneralBox().addErrorStatus(TEXTS.get("MissingName"));
    getFirstNameField().requestFocus();

    throw new VetoException(TEXTS.get("MissingName"));
  }

  return true;
}
 
开发者ID:BSI-Business-Systems-Integration-AG,项目名称:trading-network,代码行数:17,代码来源:PersonForm.java

示例2: load

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public PersonFormData load(PersonFormData formData) {
  if (!ACCESS.check(new PersonReadPermission())) {
    throw new VetoException(TEXTS.get("InsufficientPrivileges"));
  }

  SQL.selectInto(SQLs.PERSON_SELECT, formData);

  String personId = formData.getPersonId();
  Account wallet = null;

  IAccountService accountService = BEANS.get(IAccountService.class);
  AccountTablePageData pageData = accountService.getAccountTableData(new SearchFilter(), personId);
  if (pageData.getRowCount() > 0) {
    AccountTableRowData firstRow = pageData.rowAt(0);
    AccountFormData accountData = accountService.load(firstRow.getAddress());
    wallet = BEANS.get(EthereumService.class).getWallet(accountData.getAddress().getValue(), accountData.getPassword().getValue());
  }

  if (null != wallet) {
    formData.getWalletAddress().setValue(wallet.getAddress());
    formData.getWalletPath().setValue(wallet.getFile().getAbsolutePath());
  }

  return formData;
}
 
开发者ID:BSI-Business-Systems-Integration-AG,项目名称:trading-network,代码行数:27,代码来源:PersonService.java

示例3: load

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public RtRankingEvent load(RtRankingEventKey key) throws ProcessingException {
  if (!ACCESS.check(new ReadRankingEventPermission())) {
    throw new VetoException(TEXTS.get("AuthorizationFailed"));
  }
  if (key == null) {
    return null;
  }

  RtRankingEvent bean = JPA.find(RtRankingEvent.class, key);

  bean.setFormulaTypeUid(RankingServerUtility.analyzeFormulaType(bean.getFormula()));
  bean.setTimePrecisionUid(FormulaUtility.decimalPlaces2timePrecision(bean.getDecimalPlaces()));

  return bean;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:RankingEventProcessService.java

示例4: load

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public ClubBean load(ClubBean bean) throws ProcessingException {
  if (!ACCESS.check(new ReadClubPermission())) {
    throw new VetoException(Texts.get("AuthorizationFailed"));
  }

  JPAUtility.select("SELECT shortcut, name, contactRunnerNr, extKey " +
      "FROM RtClub " +
      "WHERE id.clubNr = :clubNr " +
      "AND id.clientNr = :sessionClientNr " +
      "INTO :shortcut, :name, :contactRunnerNr, :extKey ", bean);

  // RT_ADDITIONAL_INFORMATION
  bean.getAddInfo().setJoinNr(bean.getClubNr());
  bean.getAddInfo().setClientNr(bean.getClientNr());
  BEANS.get(IAdditionalInformationProcessService.class).load(bean.getAddInfo());

  return bean;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:20,代码来源:ClubProcessService.java

示例5: testMandatoryVetoException

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Test(expected = VetoException.class)
public void testMandatoryVetoException() throws ProcessingException {
  runner = new RunnerTestDataProvider();

  AdditionalInformationAdministrationForm form = getForm();
  FormTestUtility.fillFormFields(form);
  form.getTypeField().setValue(AdditionalInformationTypeCodeType.IntegerCode.ID);
  form.getEntityField().setValue(EntityCodeType.RunnerCode.ID);
  form.getMandatoryField().setValue(true);
  form.getMinimumField().setValue(0d);
  form.getMaximumField().setValue(5d);
  form.doOk();

  runner.getForm().startModify();
  runner.getForm().doOk();
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:AdditionalInformationAdministrationFormTest.java

示例6: create

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public EventStartblockFormData create(EventStartblockFormData formData) throws ProcessingException {
  if (!ACCESS.check(new CreateEventStartblockPermission())) {
    throw new VetoException(Texts.get("AuthorizationFailed"));
  }

  RtEventStartblock startblock = new RtEventStartblock();
  RtEventStartblockKey key = new RtEventStartblockKey();
  key.setEventNr(formData.getEventNr());
  key.setId(formData.getStartblockUid().getValue());
  key.setClientNr(ServerSession.get().getSessionClientNr());
  startblock.setId(key);
  JPA.persist(startblock);

  formData = store(formData);

  return formData;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:19,代码来源:EventStartblockProcessService.java

示例7: loginOnline

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
  public AccountFormData loginOnline(AccountFormData formData) throws ProcessingException {
    try {
      // only create a new client nr when there is no client nr on event server
      // user may cancel setup wizard and retry
      if (formData.getClientNr() == null) {
        formData.setClientNr(ServerSession.get().getSessionClientNr());
      }

      // TODO MIG
      // OnlineServiceSoap onlineService = BEANS.get(OnlineServiceClient.class).getPortType();
//
//      LoginAccount login = new LoginAccount();
//      login.setAccountData(AccountUtility.formDataToWsdl(formData));
//      LoginAccountResponse response = onlineService.loginAccountOnline(login);
//      return AccountUtility.wsdlToFormData(response.getAccountData());
      return null;
    }
    catch (Exception e) {
      LOG.error("connection failed", e);
      throw new VetoException(TEXTS.get("GlobalServerConnectionFailure", e.getMessage()));
    }
  }
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:24,代码来源:LocalAccountService.java

示例8: handlePersistenceException

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
public static void handlePersistenceException(PersistenceException e) throws VetoException {
  if (e.getCause().getCause() instanceof SQLException) {
    SQLException sqlException = (SQLException) e.getCause().getCause();
    if (StringUtility.equalsIgnoreCase(sqlException.getSQLState(), "23505")) {
      // unique_violation
      handleDataAlreadyExistsViolation(sqlException);
    }
    else if (StringUtility.equalsIgnoreCase(sqlException.getSQLState(), "23503")) {
      // foreign_key_violation
      handleDataInUseViolation(sqlException);
    }
    else {
      LOG.error("unknown error", e);
      throw new VetoException(sqlException.getLocalizedMessage());
    }
  }
  else {
    LOG.error("unknown error", e);
    throw new VetoException(e.getLocalizedMessage());
  }
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:22,代码来源:JPAUtility.java

示例9: validateEvents

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
private Long validateEvents(EntryBean bean, ArrayList<Long> eventNrs) throws VetoException {
  Long entryClassUid = null;
  for (ParticipationBean participation : bean.getParticipations()) {
    // validate events
    // class must exist, it should not be a leg class
    if (participation.getClassUid() == null) {
      throw new VetoException(Texts.get("EntryClassOnParticipationRequiredMessage"));
    }
    if (entryClassUid == null) {
      entryClassUid = participation.getClassUid();
    }
    // in an entry, the class uid must be the same for all events (multi day)
    if (CompareUtility.notEquals(entryClassUid, participation.getClassUid())) {
      throw new VetoException(Texts.get("EntryClassSameClassForMultiDayResults"));
    }
    if (participation.getEventNr() == null) {
      throw new VetoException(TEXTS.get("EntryEventOnEventRequiredMessage"));
    }

    eventNrs.add(participation.getEventNr());
  }
  if (eventNrs.size() == 0) {
    throw new VetoException(TEXTS.get("EntryEventRequiredMessage"));
  }
  return entryClassUid;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:27,代码来源:EntryProcessService.java

示例10: execAction

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
protected void execAction() throws ProcessingException {
  ECardStationStatusForm station = ClientSession.get().getDesktop().findForm(ECardStationStatusForm.class);
  if (station != null) {
    Long eCardStationNr = station.getCurrentECardStationNr();
    ECardStationFormData formData = new ECardStationFormData();
    formData.setECardStationNr(eCardStationNr);
    formData = BEANS.get(IECardStationProcessService.class).load(formData);
    if (!StringUtility.isNullOrEmpty(formData.getPosPrinter().getValue())) {
      IPosPrinter printer = PosPrinterManager.get(formData.getPosPrinter().getValue());
      for (Long raceNr : getRaceNrColumn().getSelectedValues()) {
        SplitTimesPosPrinter.printSplitTimesReport(raceNr, printer);
      }
      return;
    }
    else if (!StringUtility.isNullOrEmpty(formData.getPrinter().getValue())) {
      SplitTimesReport.printSplitTimesReport(getRaceNrColumn().getSelectedValues().toArray(new Long[0]), formData.getPrinter().getValue());
      return;
    }
  }
  throw new VetoException(TEXTS.get("NoPrinterSetOnDownloadStation"));
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:23,代码来源:AbstractDownloadedECardsTablePage.java

示例11: create

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public FeeGroupFormData create(FeeGroupFormData formData) throws ProcessingException {
  if (!ACCESS.check(new CreateFeeGroupPermission())) {
    throw new VetoException(Texts.get("AuthorizationFailed"));
  }

  RtFeeGroupKey key = RtFeeGroupKey.create((Long) null);
  RtFeeGroup feeGroup = new RtFeeGroup();
  feeGroup.setId(key);
  JPA.persist(feeGroup);

  formData.setFeeGroupNr(feeGroup.getId().getId());
  formData = store(formData);

  return formData;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:FeeGroupProcessService.java

示例12: store

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public ClubBean store(ClubBean bean) throws ProcessingException {
  if (!ACCESS.check(new UpdateClubPermission())) {
    throw new VetoException(Texts.get("AuthorizationFailed"));
  }

  String queryString = "UPDATE RtClub C " +
      "SET shortcut = :shortcut, " +
      "name = :name, " +
      "rtRunner.id.runnerNr = :contactRunnerNr, " +
      "extKey = :extKey " +
      "WHERE C.id.clubNr = :clubNr " +
      "AND C.id.clientNr = :sessionClientNr ";

  FMilaQuery query = JPA.createQuery(queryString);
  JPAUtility.setAutoParameters(query, queryString, bean);
  query.executeUpdate();

  // RT_ADDITIONAL_INFORMATION
  bean.getAddInfo().setJoinNr(bean.getClubNr());
  bean.getAddInfo().setClientNr(bean.getClientNr());
  BEANS.get(IAdditionalInformationProcessService.class).store(bean.getAddInfo());

  return bean;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:26,代码来源:ClubProcessService.java

示例13: load

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public CurrencyFormData load(CurrencyFormData formData) throws ProcessingException {
  if (!ACCESS.check(new ReadCurrencyPermission())) {
    throw new VetoException(Texts.get("AuthorizationFailed"));
  }
  if (formData == null) {
    return null;
  }

  RtCurrency currency = JPA.find(RtCurrency.class, RtCurrencyKey.create(formData.getCurrencyUid()));
  if (currency != null) {
    formData.getExchangeRate().setValue(currency.getExchangeRate());
  }

  formData.getCodeBox().getCodeUid().setValue(formData.getCurrencyUid());
  BEANS.get(ICodeProcessService.class).loadCodeBox(formData.getCodeBox());

  return formData;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:20,代码来源:CurrencyProcessService.java

示例14: load

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public RtMap load(RtMapKey key) throws ProcessingException {
  if (!ACCESS.check(new ReadMapPermission())) {
    throw new VetoException(Texts.get("AuthorizationFailed"));
  }
  if (key == null) {
    return null;
  }

  key = RtMapKey.create(key);
  RtMap bean = JPA.find(RtMap.class, key);

  // load map
  if (bean != null) {
    bean.setMapData(BEANS.get(IFileProcessService.class).loadFile(bean.getId().getId(), NumberUtility.nvl(bean.getId().getClientNr(), ServerSession.get().getSessionClientNr()), bean.getFormat(), SERVER_MAP_DIR));
  }

  return bean;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:20,代码来源:MapProcessService.java

示例15: create

import org.eclipse.scout.rt.platform.exception.VetoException; //导入依赖的package包/类
@Override
public PunchFormData create(PunchFormData formData) throws ProcessingException {
  if (!ACCESS.check(new CreatePunchPermission())) {
    throw new VetoException(Texts.get("AuthorizationFailed"));
  }

  RtPunch punch = new RtPunch();
  RtPunchKey key = new RtPunchKey();
  key.setClientNr(ServerSession.get().getSessionClientNr());
  key.setId(formData.getPunchSession().getValue());
  key.setSortcode(formData.getSortCode().getValue());
  punch.setId(key);
  JPA.persist(punch);

  formData = store(formData);

  return formData;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:19,代码来源:PunchProcessService.java


注:本文中的org.eclipse.scout.rt.platform.exception.VetoException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。