Package com.tubeilike.entity

Examples of com.tubeilike.entity.Tube


    result.setListTube(listTube);
    return result;
  }

  public static Tube searchById(String id, boolean fullContent) {
    Tube tub = new Tube();
    try {
      System.out.println("Update from youtube : " + id);
      String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/"
          + id;
      VideoEntry videoEntry = service.getEntry(new URL(videoEntryUrl),
          VideoEntry.class);
      if (fullContent) {
        tub.transformVideoEntry(videoEntry);
      } else {
        tub.transformHalfVideoEntry(videoEntry);
      }
      tub.setViewCount(0);
      return tub;
    } catch (MalformedURLException e) {
      System.out.println("Error when searching with id : + " + id);
      e.printStackTrace();
    } catch (IOException e) {
View Full Code Here


      System.out.println("Error path.");
      response.sendRedirect("/home");
    }
    try {
      System.out.println("Detail id : " + id);
      Tube detail = TubeModel.getByTubeId(id);
      if (detail != null) {
        long count = detail.getViewCount();
        count += 1;
        detail.setViewCount(count);
        TubeModel.update(detail);
        TubeModel.closePM();
        request.setAttribute("title", detail.getTitle().getValue()
            + " - NhayCungBiBi");
        request.setAttribute("description",
            "Chuyên trang clip nhảy cùng bibi.");
        request.setAttribute(
            "keyword",
            detail.getTitle().getValue()
                + ", nhảy cùng bibi, nhaycungbibi.com, nhaycungbibi, video clip, youtube, mix clip, tubeonfire.com, tubeonfire, your clip,  sharing, camera phone, video phone, free...");
        request.setAttribute("detail", detail);
        request.setAttribute("categories", CategoryModel.all());
        request.setAttribute("url", request.getRequestURL().toString());
        request.getRequestDispatcher("/tube_detail.jsp").forward(
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public static Tube getByTubeId(String tubeId) {
    initPm();
    Tube tube = null;
    Query query = pm.newQuery(Tube.class);
    query.setFilter("tubeId=='" + tubeId + "' && status==1");
    query.setRange(0, 1);
    List<Tube> listResult = (List<Tube>) query.execute();
    if (listResult.size() > 0) {
View Full Code Here

TOP

Related Classes of com.tubeilike.entity.Tube

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.