Package hirondelle.web4j.model

Examples of hirondelle.web4j.model.ModelFromRequest.build()


 
  /** Ensure user input can create a {@link Rating}.  */
  protected void validateUserInput() {
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fRating = builder.build(Rating.class, RATING_ID, null, FISH_RATING, CHIPS_RATING, PRICE_RATING, LOCATION_RATING, SERVICE_RATING, BEER_RATING, null);
    }
    catch (ModelCtorException ex){
      addError(ex);
    }
  }
View Full Code Here


  }
 
  protected void validateUserInput() {
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fResto = builder.build(Resto.class, RESTO_ID, NAME, LOCATION, PRICE, COMMENT);
    }
    catch (ModelCtorException ex){
      addError(ex);
    }   
  }
View Full Code Here

  /** Ensure user input can build a {@link Member}.  */
  protected void validateUserInput() {
    fLogger.fine("Validating user input.");
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fMember = builder.build(Member.class, MEMBER_ID, NAME, IS_ACTIVE, DISPOSITION);
      fLogger.fine("New Member: " + fMember);
    }
    catch (ModelCtorException ex){
      fLogger.fine("User input cannot create a Member.");
      addError(ex);
View Full Code Here

  /**Ensure user input can create an {@link Image} object.  */
  @Override protected void validateUserInput() throws AppException {
    extractFileUploadFields();
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fImage = builder.build(
        Image.class, DESCRIPTION,
        SafeText.from(fFileItem.getName()),
        SafeText.from(fFileItem.getContentType()),
        fFileItem.getSize()
      );
View Full Code Here

  /** Ensure user input can build an {@link Rsvp}. */
  protected void validateUserInput() throws AppException {
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fRsvp = builder.build(Rsvp.class, VISIT_ID, MEMBER_ID, null, RESPONSE);
      if (fRsvp.getResponse() == null) {
        // this is not actually exercised, since the selection is coerced to 'false' by
        // RequestParser.
        addError("Please make a Yes/No selection");
      }
View Full Code Here

 
  /** Ensure the user has a made a Yes/No selection.   */
  protected void validateUserInput() throws AppException {
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fRsvp = builder.build(Rsvp.class, VISIT_ID, MEMBER_ID, null, RESPONSE);
      //defensive only - this should never occur :
      if ( fRsvp.getResponse() == null ) {
        addError("Please make a selection.");
      }
    }
View Full Code Here

 
  /** Ensure user input can build a {@link SupportedLocale}. */
  protected void validateUserInput() {
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fSupportedLocale = builder.build(SupportedLocale.class, SUPPORTED_LOCALE_ID, SHORT_FORM, DESCRIPTION);
    }
    catch (ModelCtorException ex){
      addError(ex);
    }   
  }
View Full Code Here

   since there is no 'blank' value in the <tt>SELECT</tt> control.
  */
  protected void validateUserInput() throws AppException {
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fCriteria = builder.build(RestoSearchCriteria.class, STARTS_WITH, MIN_PRICE, MAX_PRICE, ORDER_BY, REVERSE_SORT);
    }
    catch (ModelCtorException ex){
      addError(ex);
    }
  }
View Full Code Here

  protected void validateUserInput() {
    //here, there is no explicit user input; hidden form params are used
    //to pass in data instead.
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fBaseText = builder.build(BaseText.class, ID, BASE_TEXT, IS_CODER_KEY);
    }
    catch (ModelCtorException ex){
      addError(ex);
    }   
  }
View Full Code Here

 
  /** Ensure user input can create a {@link Translation}. */
  protected void validateUserInput() {
    try {
      ModelFromRequest builder = new ModelFromRequest(getRequestParser());
      fTranslation = builder.build(Translation.class, getParent().getBaseText(), fetchLocale(), TRANSLATION, getParent().getId(), LOCALE_ID);
    }
    catch (ModelCtorException ex){
      addError(ex);
    }   
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.