Package com.changestuffs.shared.actions.GetOffersResult

Examples of com.changestuffs.shared.actions.GetOffersResult.OffersPerProduct


    User user = userService.getCurrentUser();
    Map<String, OffersPerProduct> offersPerProduct = new HashMap<String, OffersPerProduct>();
    ArticlesOAM oam = provider.get();
    List<Offer> offers = oam.getOffers(user.getEmail());
    for (Offer offer : offers) {
      OffersPerProduct perProduct = new OffersPerProduct(
          KeyFactory.keyToString(offer.getKey()),
          KeyFactory.keyToString(offer.getProduct().getKey()),
          offer.getProduct().getName(), convertToMap(offer.getProductOffered()));
      offersPerProduct.put(perProduct.getOfferKey(), perProduct);

    }
    return new GetOffersResult(offersPerProduct);
  }
View Full Code Here


    offer.setProductOffered(new HashSet<ProductOffered>());
    offer.setUserId(userId);
    model.getTransaction().begin();
    model.persist(offer);
    model.getTransaction().commit();
    OffersPerProduct offerPerProduct = new OffersPerProduct(KeyFactory.keyToString(offer.getKey()), productId, product.getName(), new HashMap<String, String>());
    Map<String, OffersPerProduct> offers = new HashMap<String, OffersPerProduct>();
    offers.put(offerPerProduct.getOfferKey(), offerPerProduct);
    result = new GetOffersResult(offers);
    log.info("Offer created");
    return result;
  }
View Full Code Here

      productOffered.setProductName(entry.getValue());
      offers.add(productOffered);
      model.persist(productOffered);
    }
    offer.setProductOffered(offers);
    result = new UpdateOfferResult(new OffersPerProduct(offerId, KeyFactory.keyToString(offer.getProduct().getKey()), offer.getProduct().getName(), productIdNames));
    log.info("Offer updated");
    return result;
  }
View Full Code Here

TOP

Related Classes of com.changestuffs.shared.actions.GetOffersResult.OffersPerProduct

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.