Examples of Rating


Examples of org.mage.plugins.rating.results.Rating

  protected synchronized void generateNext() {
    notify();
  }
 
  public void reportResult(Card card1, Card card2) {
    results.add(new Rating(card1.getName(), card2.getName()));
    removeCard(mageCard1);
    removeCard(mageCard2);
    frame.validate();
    if (results.size() == 10) {
      ResultHandler.getInstance().save(results);
View Full Code Here

Examples of org.neo4j.cineasts.domain.Rating

        model.addAttribute("id", movieId);
        if (movie != null) {
            model.addAttribute("movie", movie);
            final int stars = movie.getStars();
            model.addAttribute("stars", stars);
            Rating rating = null;
            if (user!=null) rating = movie.getRelationshipTo(user, Rating.class, "RATED");
            if (rating == null) rating = new Rating().rate(stars,null);
            model.addAttribute("userRating",rating);
        }
        return "/movies/show";
    }
View Full Code Here

Examples of org.ops4j.pax.exam.sample2.model.Rating

        em.persist(user);
        return user;
    }

    public Rating rate(User user, Movie movie, int stars, String comment) {
        Rating rating = new Rating();
        rating.setUser(user);
        rating.setMovie(movie);
        rating.setStars(stars);
        rating.setComment(comment);
        em.persist(rating);
        return rating;
    }
View Full Code Here

Examples of org.rometools.feed.module.mediarss.types.Rating

            ArrayList values = new ArrayList();
           
            for (int i = 0; (ratings != null) && (i < ratings.size()); i++) {
                try {
                    Element rat = (Element) ratings.get(i);
                    values.add(new Rating(rat.getAttributeValue("scheme"),
                            rat.getText()));
                } catch (Exception ex) {
                    LOG.log(Level.WARNING, "Exception parsing rating tag.", ex);
                }
            }
           
            md.setRatings((Rating[]) values.toArray(new Rating[values.size()]));
        }
        // text
        {
            List texts = e.getChildren("text", getNS());
            ArrayList values = new ArrayList();
           
            for (int i = 0; (texts != null) && (i < texts.size()); i++) {
                try {
                    Element text = (Element) texts.get(i);
                    Time start = (text.getAttributeValue("start") == null)
                    ? null : new Time(text.getAttributeValue("start"));
                    Time end = (text.getAttributeValue("end") == null) ? null
                            : new Time(text.getAttributeValue(
                            "end"));
                    values.add(new Text(text.getAttributeValue("type"),
                            text.getTextTrim(), start, end));
                } catch (Exception ex) {
                    LOG.log(Level.WARNING, "Exception parsing text tag.", ex);
                }
            }
           
            md.setText((Text[]) values.toArray(new Text[values.size()]));
        }
        // thumbnails
        {
            List thumbnails = e.getChildren("thumbnail", getNS());
            ArrayList values = new ArrayList();
           
            for (int i = 0; (thumbnails != null) && (i < thumbnails.size());
            i++) {
                try {
                    Element thumb = (Element) thumbnails.get(i);
                    Time t = (thumb.getAttributeValue("time") == null) ? null
                            : new Time(thumb.getAttributeValue(
                            "time"));
                    Integer width = (thumb.getAttributeValue("width") == null)
                    ? null : new Integer(thumb.getAttributeValue("width"));
                    Integer height = (thumb.getAttributeValue("height") == null)
                    ? null : new Integer(thumb.getAttributeValue("height"));
                    values.add(new Thumbnail(
                            new URI(thumb.getAttributeValue("url")), width,
                            height, t));
                } catch (Exception ex) {
                    LOG.log(Level.WARNING, "Exception parsing thumbnail tag.",
                            ex);
                }
            }
           
            md.setThumbnail((Thumbnail[]) values.toArray(
                    new Thumbnail[values.size()]));
        }
        // title
        {
            Element title = e.getChild("title", getNS());
           
            if (title != null) {
                md.setTitle(title.getText());
                md.setTitleType(title.getAttributeValue("type"));
            }
        }
        // restrictions
        {
            List restrictions = e.getChildren("restriction", getNS());
            ArrayList values = new ArrayList();
           
            for (int i = 0; i < restrictions.size(); i++) {
                Element r = (Element) restrictions.get(i);
                Restriction.Type type = null;
               
                if (r.getAttributeValue("type").equalsIgnoreCase("uri")) {
                    type = Restriction.Type.URI;
                } else if (r.getAttributeValue("type").equalsIgnoreCase("country")) {
                    type = Restriction.Type.COUNTRY;
                }
               
                Restriction.Relationship relationship = null;
               
                if (r.getAttributeValue("relationship").equalsIgnoreCase("allow")) {
                    relationship = Restriction.Relationship.ALLOW;
                } else if (r.getAttributeValue("relationship").equalsIgnoreCase("deny")) {
                    relationship = Restriction.Relationship.DENY;
                }
               
                Restriction value = new Restriction(relationship, type,
                        r.getTextTrim());
                values.add(value);
            }
           
            md.setRestrictions((Restriction[]) values.toArray(
                    new Restriction[values.size()]));
        }
        // handle adult
        {
            Element adult = e.getChild("adult", getNS());
           
            if ((adult != null) && (md.getRatings().length == 0)) {
                Rating[] r = new Rating[1];
               
                if (adult.getTextTrim().equals("true")) {
                    r[0] = new Rating("urn:simple", "adult");
                } else {
                    r[0] = new Rating("urn:simple", "nonadult");
                }
               
                md.setRatings(r);
            }
        }
View Full Code Here

Examples of org.springframework.social.alfresco.api.entities.Rating

    {
        Map<String, String> vars = new HashMap<String, String>();
        vars.put(TemplateParams.NETWORK, network);
        vars.put(TemplateParams.NODE, node);

        Rating _like = new Rating();
        _like.setId(Rating.LIKES);
        _like.setMyRating(like);

        String response = getRestTemplate().postForObject(NODE_RATINGS_URL, new HttpEntity<Rating>(_like, headers), String.class, vars);
        log.debug("rateNode: " + response);
        Response<Rating> r = mapper.readValue(response, entryResponseType(Rating.class));
        return r.getEntry();
View Full Code Here

Examples of org.springframework.springfaces.traveladvisor.domain.Rating

  @Value("#{review}")
  private ReviewDetails review;

  public Double getValue() {
    Rating rating = review.getRating();
    return (rating == null ? null : (double) rating.ordinal());
  }
View Full Code Here

Examples of pojo.Rating

  }

  // get info of a rating by id
  public Rating getInfoRating(int id) {
    logger.debug("getInfoRating start");
    Rating sp = null;
    Session session = HibernateUtil.getSessionFactory().openSession();
    try {
      sp = (Rating) session.get(Rating.class, id);
      logger.debug("getInfoRating success");
    } catch (HibernateException ex) {
View Full Code Here

Examples of pojo.Rating

  // delete a rating by id
  public boolean delRating(int id) {
    logger.debug("delRating start");
    Session session = HibernateUtil.getSessionFactory().openSession();
    Rating u = (Rating) session.get(Rating.class, id);

    Transaction transaction = null;
    try {
      transaction = session.beginTransaction();
      session.delete(u);
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.