Package com.tubeonfire.entity

Examples of com.tubeonfire.entity.Channel


    tube.setTags(TagHelper.youTag(tube.getTitle() + " "
        + tube.getDescription()));
    tube.setOtherTags(TagHelper.getOtherTag(tube.getTags()));
    tube.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
    if (ChannelModel.getById(tube.getChannelId()) == null) {
      Channel channel = new Channel();
      channel.setId(tube.getChannelId());
      channel.setTitle(tube.getChannelName());
      channel.setDescription(tube.getChannelName());
      channel.setDoc(Calendar.getInstance().getTime());
      channel.setUpdated(Calendar.getInstance().getTime());
      channel.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
      channel.setStatus(1);
      ChannelModel.insert(channel);
    }
    return tube;
  }
View Full Code Here


      try {
        page = Integer.parseInt((String) req.getParameter("page"));
      } catch (Exception e) {
        page = 1;
      }
      Channel obj = ChannelModel.getById(id);
      if (obj != null) {
        TubeSearchModel model = new TubeSearchModel();
        model.setPage(page);
        model.prepareTubeByChannel(obj.getId());
        req.setAttribute("model", model);
        req.setAttribute("obj", obj);
        req.setAttribute("url", req.getRequestURL().toString());
        req.getRequestDispatcher("/channel.jsp").forward(req, resp);
      } else {
View Full Code Here

          + tube.getDescription()));
    }
    tube.setOtherTags(TagHelper.getOtherTag(tube.getTags()));
    tube.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
    if (ChannelModel.getById(tube.getChannelId()) == null) {
      Channel channel = new Channel();
      channel.setId(tube.getChannelId());
      channel.setTitle(tube.getChannelName());
      channel.setDescription(tube.getChannelName());
      channel.setDoc(Calendar.getInstance().getTime());
      channel.setUpdated(Calendar.getInstance().getTime());
      channel.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
      channel.setStatus(1);
      ChannelModel.insert(channel);
    }
    return tube;
  }
View Full Code Here

  public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws IOException, ServletException {
    try {
      HttpSession session = req.getSession();
      String id = req.getParameter("id");
      Channel obj = ChannelModel.getById(id);
      if (obj != null) {
        session.setAttribute("obj", obj);
        req.getRequestDispatcher("/admin/form_channel.jsp").forward(
            req, resp);
      } else {
View Full Code Here

  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    try {
      HttpSession session = req.getSession();
      String id = req.getParameter("id");
      Channel obj = ChannelModel.getById(id);
      if (obj != null) {
        ChannelValidate.checkForm(req, obj);
        obj.setUpdated(Calendar.getInstance().getTime());
        ChannelModel.insert(obj);
        session.setAttribute("success", "Action success !");
        resp.sendRedirect("/admin/channel/edit?id=" + id);
      } else {
        session.setAttribute("error",
View Full Code Here

    tube.setTags(TagHelper.youTag(tube.getTitle() + " "
        + tube.getDescription()));
    tube.setOtherTags(TagHelper.getOtherTag(tube.getTags()));
    tube.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
    if (ChannelModel.getById(tube.getChannelId()) == null) {
      Channel channel = new Channel();
      channel.setId(tube.getChannelId());
      channel.setTitle(tube.getChannelName());
      channel.setDescription(tube.getChannelName());
      channel.setDoc(Calendar.getInstance().getTime());
      channel.setUpdated(Calendar.getInstance().getTime());
      channel.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
      channel.setStatus(1);
      ChannelModel.insert(channel);
    }
    return tube;
  }
View Full Code Here

  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    String action = request.getParameter("action");
    if (action != null && action.equals("delete")) {
      String id = request.getParameter("id");
      Channel obj = ChannelModel.getById(id);
      if (obj != null) {
        ChannelModel.delete(obj);
      }
    } else if (action != null && action.equals("bump")) {
      String id = request.getParameter("id");
      Channel obj = ChannelModel.getById(id);
      if (obj != null) {
        obj.setBumpPoint(Calendar.getInstance().getTimeInMillis());
        ChannelModel.insert(obj);       
      }
    }
  }
View Full Code Here

          + tube.getDescription()));
    }
    tube.setOtherTags(TagHelper.getOtherTag(tube.getTags()));
    tube.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
    if (ChannelModel.getById(tube.getChannelId()) == null) {
      Channel channel = new Channel();
      channel.setId(tube.getChannelId());
      channel.setTitle(tube.getChannelName());
      channel.setDescription(tube.getChannelName());
      channel.setDoc(Calendar.getInstance().getTime());
      channel.setUpdated(Calendar.getInstance().getTime());
      channel.setBumpPoint(Calendar.getInstance().getTimeInMillis() / 1000);
      channel.setStatus(1);
      ChannelModel.insert(channel);
    }
    return tube;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public static Channel getById(String id) {
    try {
      init();
      Channel obj = new Channel();
      String prefix = cachePrefix + "id_" + id;
      if (cache != null && cache.containsKey(prefix)) {
        obj = (Channel) cache.get(prefix);
      } else {
        try {
View Full Code Here

  @SuppressWarnings("unchecked")
  public static Channel getById(String id) {
    try {
      init();
      Channel obj = new Channel();
      String prefix = cachePrefix + "id_" + id;
      if (cache != null && cache.containsKey(prefix)) {
        obj = (Channel) cache.get(prefix);
      } else {
        try {
View Full Code Here

TOP

Related Classes of com.tubeonfire.entity.Channel

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.