Package com.din.din.webapp.beans.interfaces.wrappers

Examples of com.din.din.webapp.beans.interfaces.wrappers.RecipeItemWrapper


      throws Exception {
    super.onPreSave(entityManager, entity);
   
    // Save/update all current RecipeItems
    for(FoodItemWrapper item : foodItemSet) {
      RecipeItemWrapper recipeItemWrapper = item.getRecipeItem();
      RecipeItem recipeItem = recipeItemWrapper.getRecipeItem();
     
      recipeItem.setRecipe(entity);
      recipeItem.setFoodItemKey(item.getFoodItem().getKey());
    }   
    entity.setRecipeItems(getRecipeItemList());
View Full Code Here


  }

  private Map<Key, RecipeItem> getRecipeItemMap() {
    Map<Key, RecipeItem> recipeItemMap = new LinkedHashMap<Key, RecipeItem>();
    for(FoodItemWrapper item : foodItemSet) {
      RecipeItemWrapper recipeItemWrapper = item.getRecipeItem();
      RecipeItem recipeItem = recipeItemWrapper.getRecipeItem();
     
      if(recipeItem.getKey() != null) {
        recipeItemMap.put(recipeItem.getKey(), recipeItem);
      }
    }
View Full Code Here

 
  @Override
  protected String onSaveSuccess(Recipe entity) {
    List<RecipeItem> recipeItems = new ArrayList<RecipeItem>();
    for(FoodItemWrapper item : foodItemSet) {
      RecipeItemWrapper recipeItemWrapper = item.getRecipeItem();
      RecipeItem recipeItem = recipeItemWrapper.getRecipeItem();
     
      recipeItems.add(recipeItem);
    }
   
    entity.setRecipeItems(recipeItems);
View Full Code Here

  private boolean validateIngredientList() {
    boolean valid = true;
    if(foodItemSet != null) {
      for(FoodItemWrapper item : foodItemSet) {
        RecipeItemWrapper recipeItem = item.getRecipeItem();
        if(recipeItem == null || recipeItem.getDescription() == null || recipeItem.getDescription().trim().isEmpty()) {
          valid = false;
          item.setValid(false);
          BeanUtil.addMessageFmt(FacesMessage.SEVERITY_ERROR, "error.ingredientList", "error.ingredientList.description", item.getName());
        } else if (recipeItem.getQuantityType() == null) {
          valid = false;
          item.setValid(false);
          BeanUtil.addMessageFmt(FacesMessage.SEVERITY_ERROR, "error.ingredientList", "error.ingredientList.quantityTypeMissing", item.getName());
        } else {
          item.setValid(true);
View Full Code Here

TOP

Related Classes of com.din.din.webapp.beans.interfaces.wrappers.RecipeItemWrapper

Copyright © 2018 www.massapicom. 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.