Package com.liusoft.dlog4j.base

Examples of com.liusoft.dlog4j.base._CommentBase


   */
  public void visit_music(List songs){
    if(songs!=null && songs.size()>0){
      int[] ids = new int[songs.size()];
      for(int i=0;i<songs.size();i++){
        _BeanBase bean = (_BeanBase)songs.get(i);
        ids[i] = bean.getId();
      }
      try{
        MusicDAO.incViewCount(1, ids);
      }catch(Exception e){
        log.error("increment music's listen count failed.", e);
View Full Code Here


  public _DiaryBase diary(SiteBean site, SessionUserObject user, int log_id) {
    if (site == null || log_id < 0)
      return null;
    // ��ν��ռǵ����ݽ��л���,��������ݿ�ֱ�Ӷ�ȡ���ı�
    String text = TextCacheManager.getTextContent(DiaryBean.TYPE_DIARY, log_id);
    _DiaryBase diary = null;
    if(text==null){
      diary = DiaryDAO.getDiaryByID(log_id);
      if(diary!=null && diary.getStatus()==DiaryBean.STATUS_NORMAL){
        TextCacheManager.updateTextContent(DiaryBean.TYPE_DIARY, log_id, diary.getContent());
      }
    }
    else{
      diary = DiaryDAO.getDiaryOutlineByID(log_id);
      if(diary!=null)
        diary.setContent(text);
    }
    if (diary == null || diary.getSite().getId() != site.getId())
      return null;
    if(user!=null && diary.getOwner().getId()==user.getId())
      return diary;
    if (!CatalogDAO.canUserViewThisCatalog(diary.getCatalog(), user))
      return null;
    return diary;
  }
View Full Code Here

   */
  public _DiaryBase diary(int log_id) {
    if (log_id < 0)
      return null;
    String text = TextCacheManager.getTextContent(DiaryBean.TYPE_DIARY, log_id);
    _DiaryBase diary = null;
    if(text==null){
      diary = DiaryDAO.getDiaryByID(log_id);
      if(diary!=null && diary.getStatus()==DiaryBean.STATUS_NORMAL){
        TextCacheManager.updateTextContent(DiaryBean.TYPE_DIARY, log_id, diary.getContent());
      }
    }
    else{
      diary = DiaryDAO.getDiaryOutlineByID(log_id);
      if(diary!=null)
        diary.setContent(text);
    }
    return diary;
  }
View Full Code Here

  protected ActionForward doRotateLeft(final ActionMapping mapping,
      final ActionForm form, final HttpServletRequest request,
      final HttpServletResponse response, String s_photo_id) throws Exception  
  {
    int photo_id = Integer.parseInt(s_photo_id);
    _PhotoBase pbean = PhotoDAO.getPhotoOutlineByID(photo_id);
    if(pbean != null){
      HttpContext http_ctx = getHttpContext(mapping, form, request, response);
      rotate(http_ctx, pbean.getImageURL(), 8);
    }
    return null;
  }
View Full Code Here

  protected ActionForward doRotateRight(final ActionMapping mapping,
      final ActionForm form, final HttpServletRequest request,
      final HttpServletResponse response, String s_photo_id) throws Exception  
  {
    int photo_id = Integer.parseInt(s_photo_id);
    _PhotoBase pbean = PhotoDAO.getPhotoOutlineByID(photo_id);
    if(pbean != null){
      HttpContext http_ctx = getHttpContext(mapping, form, request, response);
      rotate(http_ctx, pbean.getImageURL(), 6);
    }
    return null;
  }
View Full Code Here

      SiteBean site = super.getSiteByID(reply.getSid());
      if (site == null) {
        msgs.add("reply", new ActionMessage("error.site_not_available"));
        break;
      }
      _ReplyBean rbean = ReplyDAO.getReply(PhotoReplyBean.class, reply
          .getReply_id());
      if (rbean!=null && rbean.getSite().getId() == site.getId()) {
        String content = StringUtils.abbreviate(super.autoFiltrate(
          null, reply.getContent()), MAX_REPLY_LENGTH);
        rbean.setContent(super.filterScriptAndStyle(content));
        rbean.setAuthor(reply.getAuthor());       
        rbean.setOwnerOnly(reply.getOwnerOnly());
        if (StringUtils.isNotEmpty(reply.getAuthorURL()))
          rbean.setAuthorURL(reply.getAuthorURL());
        if (StringUtils.isNotEmpty(reply.getAuthorEmail()))
          rbean.setAuthorEmail(reply.getAuthorEmail());
        ReplyDAO.updateReply(rbean);
      }
      break;
    }
    if (!msgs.isEmpty()) {
View Full Code Here

      SiteBean site = super.getSiteByID(reply.getSid());
      if (site == null) {
        msgs.add("reply", new ActionMessage("error.site_not_available"));
        break;
      }
      _ReplyBean rbean = ReplyDAO.getReply(DiaryReplyBean.class, reply.getReply_id());
      if (rbean!=null && rbean.getSite().getId() == site.getId()) {
        String content = StringUtils.abbreviate(super.autoFiltrate(
            null, reply.getContent()), MAX_REPLY_LENGTH);
        rbean.setContent(super.filterScriptAndStyle(content));
        rbean.setAuthor(reply.getAuthor());       
        rbean.setOwnerOnly(reply.getOwnerOnly());
        if (StringUtils.isNotEmpty(reply.getAuthorURL()))
          rbean.setAuthorURL(reply.getAuthorURL());
        if (StringUtils.isNotEmpty(reply.getAuthorEmail()))
          rbean.setAuthorEmail(reply.getAuthorEmail());
        ReplyDAO.updateReply(rbean);
      }
      break;
    }
    if (!msgs.isEmpty()) {
View Full Code Here

   * @return
   */
  public _TopicBeanBase topic(SiteBean site, SessionUserObject user, int topic_id) {
    if (site == null || topic_id < 1)
      return null;
    _TopicBeanBase topic;
    String text = TextCacheManager.getTextContent(TopicBean.TYPE_BBS, topic_id);
    if(text==null){
      topic = BBSTopicDAO.getTopicByID(topic_id);
      if(topic!=null && topic.getStatus()==TopicBean.STATUS_NORMAL){
        TextCacheManager.updateTextContent(TopicBean.TYPE_BBS, topic_id, topic.getContent());
      }
    }
    else{
      topic = BBSTopicDAO.getTopicOutlineByID(topic_id);
      if(topic!=null)
        topic.setContent(text);
    }
    if(user!=null && site.isOwner(user))
      return topic;
    if (topic != null && topic.getSite().getId() == site.getId()
        && topic.getStatus() == TopicBean.STATUS_NORMAL && topic.getForum().getStatus()==0)
      return topic;
    return null;
  }
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.base._CommentBase

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.