Exemplo n.º 1
0
  @Override
  public String create() {
    entityItem.setAnswers(answerList);

    try {
      service.evaluateClassExtension(entityItem);
      return super.create();
    } catch (ConstraintViolations e) {
      jsfService.addError(e.getMessage());
    }
    return null;
  }
Exemplo n.º 2
0
  @Override
  public String delete() {

    ClassExtension persistedItem =
        (ClassExtension)
            converter.getAsObject(
                FacesContext.getCurrentInstance(), null, jsfService.getReqParam("itemId"));

    try {
      service.deleteClassExtension(persistedItem);
      return super.delete();
    } catch (ConstraintViolations e) {
      jsfService.addError(e.getMessage());
    }
    return null;
  }
Exemplo n.º 3
0
  @Override
  public String edit() {

    Visit persistedItem =
        (Visit)
            converter.getAsObject(
                FacesContext.getCurrentInstance(), null, jsfService.getReqParam("itemId"));

    try {
      service.checkVisit(persistedItem, entityItem);
      extensionService.evaluateExtensions(entityItem);
      super.edit();

      return "pretty:visitEdit";
    } catch (AuthorizationException e) {
      jsfService.addError(e.getMessage());
    } catch (Exception e) {
      jsfService.addError(e.getMessage());
    }
    return null;
  }