Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.DiaryOutlineBean


      //��������
      if(loginUser!=null && isUserInBlackList(site, loginUser)){
        msgs.add("topic", new ActionMessage("error.user_in_blacklist"));
        break;
      }
      DiaryOutlineBean diary = DiaryDAO.getDiaryOutlineByID(reply.getParentId());
      if (diary == null || diary.getSite().getId() != reply.getSid()) {
        msgs.add("reply", new ActionMessage("error.param"));
        break;
      }      
      if(diary.getLock()==1) {
        msgs.add("reply", new ActionMessage("error.diary.locked"));
        break;
      }
      // ���������д������
      DiaryReplyBean rbean = new DiaryReplyBean();
      rbean.setUser(loginUser);     
      rbean.setAuthor(super.autoFiltrate(site,reply.getAuthor()));
      if (StringUtils.isNotEmpty(reply.getAuthorURL()))
        rbean.setAuthorURL(reply.getAuthorURL());
      if (StringUtils.isNotEmpty(reply.getAuthorEmail()))
        rbean.setAuthorEmail(reply.getAuthorEmail());
      rbean.setClient(new ClientInfo(request, reply
          .getClientType()));
      String content = StringUtils.abbreviate(super.autoFiltrate(null,
          reply.getContent()), MAX_REPLY_LENGTH);
      rbean.setContent(super.filterScriptAndStyle(content));
      rbean.setDiary(diary);
      rbean.setReplyTime(new Date());
      rbean.setSite(site);
      rbean.setStatus(DiaryReplyBean.STATUS_NORMAL);
      rbean.setOwnerOnly(reply.getOwnerOnly());
      DiaryDAO.createDiaryReply(rbean);
      // �ж��Ƿ���Ҫ�ʼ�����
      if (diary.getReplyNotify() == 1) {
        String email = diary.getOwner().getContactInfo()
            .getEmail();
        if (StringUtils.isEmail(email)) {
          this.sendReplyNotify(request, rbean.getSite().getId(), rbean);
        }
      }
View Full Code Here


    if(logs!=null && logs.size()>0){
      try{
        Session ssn = getSession();
        beginTransaction()
        for(int i=0;i<logs.size();i++){
          DiaryOutlineBean log = (DiaryOutlineBean)logs.get(i);
         
          //ɾ�����ռǵ���������
          cleanupReplies(ssn, log.getId());
          //ɾ����ǩ
          TagDAO.deleteTagByRefId(log.getId(), TagBean.TYPE_DIARY);         
          //ɾ������
          FCKUploadFileDAO.deleteFilesByRef(ssn, site_id, log.getId(), DiaryBean.TYPE_DIARY);
          //ɾ���ռ�
          ssn.delete(log);
        }
        commit();
      }catch(HibernateException e){
View Full Code Here

    for(int i=0;i<replies.size();i++){
      ReplyForm rform = (ReplyForm)replies.get(i);
      DiaryReplyBean rbean = new DiaryReplyBean();
      rbean.getClient().setAddr("127.0.0.1");
     
      rbean.setDiary(new DiaryOutlineBean(((Integer)logids.get(new Integer(rform.getLogId()))).intValue()));
      rbean.setUser((UserBean)userids.get(new Integer(rform.getAuthor().getId())));
     
      rbean.getUser().getCount().incArticleReply(1);
     
      rbean.setAuthor(rform.getAuthor().getDisplayName());
View Full Code Here

      }
      if (loginUser.getStatus() != UserBean.STATUS_NORMAL) {
        msg = getMessage(request, null, "error.user_disabled");
        break;
      }
      DiaryOutlineBean log = DiaryDAO.getDiaryOutlineByID(log_id);
      if (log == null || log.getStatus() != DiaryBean.STATUS_DELETED) {
        msg = getMessage(request, null, "error.diary_not_exists");
        break;
      }
      // ֻ��վ�����Դ��������лָ��ռ�
      if (loginUser.getOwnSiteId()!=diaryForm.getSid() && !SiteBean.isSuperior(loginUser) && log.getOwner().getId()!=loginUser.getId()){
        msg = getMessage(request, null, "error.access_deny");
        break;
      }
      try {
        DiaryDAO.unDelete(log);
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.beans.DiaryOutlineBean

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.