Examples of Recommendation


Examples of beans.doctor.recommendation.Recommendation

        List list = findEntityList(Recommendation.class, fields);
       
        List<RecommendationDetails> res = new ArrayList<RecommendationDetails>();
        Iterator i = list.iterator();
        while(i.hasNext()) {
            Recommendation j = (Recommendation) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here

Examples of com.guokr.simbase.store.Recommendation

                for (SimBasisListener listener : listeners) {
                    listener.onVecSetAdded(key(), vkey);
                }
            }
            for (String key : recs.keySet()) {
                Recommendation rec = recs.get(key);
                String vkeySrc = rec.source.key();
                String vkeyTgt = rec.target.key();
                for (SimBasisListener listener : listeners) {
                    listener.onRecAdded(key(), vkeySrc, vkeyTgt);
                }
View Full Code Here

Examples of com.guokr.simbase.store.Recommendation

            scoring = new JensenShannonDivergence();
        }

        VectorSet source = vectorSets.get(vkeySource);
        VectorSet target = vectorSets.get(vkeyTarget);
        Recommendation rec = new Recommendation(source, target, scoring, context.getInt("maxlimits"));

        String rkey = rkey(vkeySource, vkeyTarget);
        this.recommendations.put(rkey, rec);

        source.addListener(rec);
        if (target != source) {
            target.addListener(rec);
        }

        if (source.type().equals("dense")) {
            for (int srcVecId : source.ids()) {
                rec.create(srcVecId);
                float[] vector = source.get(srcVecId);
                target.rescore(source.key(), srcVecId, vector, rec);
            }
        } else {
            for (int srcVecId : source.ids()) {
                rec.create(srcVecId);
                int[] vector = source._get(srcVecId);
                target.rescore(source.key(), srcVecId, vector, rec);
            }
        }
    }
View Full Code Here

Examples of com.springone.myrestaurants.domain.Recommendation

      List<Recommendation> recommendations = new ArrayList<Recommendation>();
      for (Recommendation r : updatedUser.getRecommendations()) {
        recommendations.add(r);
      }
      Assert.assertEquals("user should now have correct number of recommendations", 1, recommendations.size());
      Recommendation r = recommendations.get(0);
      Assert.assertEquals("recommendation should have correct rating", 3, r.getStars());
      Assert.assertEquals("recommendation should have correct comment", "Pretty Good", r.getComment());
        final Restaurant restaurant = r.getRestaurant();
        Assert.assertEquals("recommendation should have correct restaurant id", new Long(22), restaurant.getId());
      Assert.assertEquals("recommendation should have correct restaurant name", "Subway Sandwiches & Salads", restaurant.getName());
    }
View Full Code Here

Examples of com.springone.myrestaurants.domain.Recommendation

                 Model model) {
        if (result.hasErrors()) {
            model.addAttribute("recommendation", recommendationFormBean);
            return "recommendations/update";
        }
        Recommendation foundRec = findRecommendation(userId, recommendationFormBean.getId());
        foundRec.rate(recommendationFormBean.getRating(), recommendationFormBean.getComments())
        model.addAttribute("itemId", recommendationFormBean.getId());
        return "redirect:/recommendations/" + recommendationFormBean.getId();
    }
View Full Code Here

Examples of com.springone.myrestaurants.domain.Recommendation

 
    @RequestMapping(value = "/{id}", params = "form", method = RequestMethod.GET)
    public String updateForm(@PathVariable("id") Long id,
                 @ModelAttribute("currentUserAccountId") Long userId,
                 Model model) {
      Recommendation foundRec = findRecommendation(userId, id);
      RecommendationFormBean recBean = new RecommendationFormBean();
      if (foundRec != null) {
        recBean.setComments(foundRec.getComment());  
        recBean.setId(foundRec.getRelationshipId());
        recBean.setRating(foundRec.getStars());          
        recBean.setName(foundRec.getRestaurant().getName());
        recBean.setRestaurantId(foundRec.getRestaurant().getId());
      }
        model.addAttribute("recommendation", recBean);
        model.addAttribute("itemId", recBean.getId());
        return "recommendations/update";
    }
View Full Code Here

Examples of com.springone.myrestaurants.domain.Recommendation

    public String delete(@PathVariable("id") Long id,
                 @RequestParam(value = "page", required = false) Integer page,
               @RequestParam(value = "size", required = false) Integer size,
               @ModelAttribute("currentUserAccountId") Long userId,
               Model model) {
      Recommendation foundRec = findRecommendation(userId, id);
      if (foundRec != null) {
        if (foundRec.hasPersistentState()) {
          foundRec.getPersistentState().delete();
        }
      }
        model.addAttribute("page", (page == null) ? "1" : page.toString());
        model.addAttribute("size", (size == null) ? "10" : size.toString());
        return "redirect:/recommendations?page=" + ((page == null) ? "1" : page.toString()) + "&size=" + ((size == null) ? "10" : size.toString());
View Full Code Here

Examples of com.springone.myrestaurants.domain.Recommendation

  @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public String show(@PathVariable("id") Long recommendationId,
               @ModelAttribute("currentUserAccountId") Long userId,
               Model model) {
   
    Recommendation foundRec = findRecommendation(userId, recommendationId);
    RecommendationFormBean bean = new RecommendationFormBean();
    if (foundRec != null) {
      bean.setComments(foundRec.getComment());
      bean.setRating(foundRec.getStars());
            bean.setId(foundRec.getRelationshipId());
            Restaurant r = foundRec.getRestaurant();
            bean.setName(r.getName());
            bean.setRestaurantId(r.getId());
    }
    model.addAttribute("recommendation", bean);
        return "recommendations/show";
View Full Code Here

Examples of com.springone.myrestaurants.domain.Recommendation

  private Recommendation findRecommendation(Long userId,
      Long recommendationId) {
    UserAccount account = this.userAccountRepository.findUserAccount(userId);
    Iterable<Recommendation> recs = account.getRecommendations();
    Recommendation foundRec = null;
    for (Recommendation recommendation : recs) {
      if (recommendation.getRelationshipId().equals(recommendationId)) {
        foundRec = recommendation;
      }
    }
View Full Code Here

Examples of com.springone.myrestaurants.domain.Recommendation

      return "recommendations/create";
    }
    long restaurantId = recommendationFormBean.getRestaurantId();
    Restaurant restaurant = this.restaurantRepository.findRestaurant(restaurantId);
    UserAccount account = this.userAccountRepository.findUserAccount(userId);
    Recommendation recommendation = account.rate(restaurant,
        recommendationFormBean.getRating(),
        recommendationFormBean.getComments());
    model.addAttribute("recommendationId", recommendation.getRelationshipId());
    return "redirect:/recommendations/" + recommendation.getRelationshipId();
  }
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.