Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.ForumBean


    List forums = (List)req.getAttribute(FORUMS);
    if(forums == null && site!=null){
      forums = site.getForums();
      Iterator iter = forums.iterator();
      while(iter.hasNext()){
        ForumBean fbean = (ForumBean)iter.next();
        if (fbean.getStatus() == ForumBean.STATUS_HIDDEN
            && (user == null || !site.isOwner(user)))
          iter.remove();
      }
      req.setAttribute(FORUMS, forums);
    }
View Full Code Here


   * @return
   */
  public ForumBean forum(SiteBean site, int forum_id) {
    if (site == null || forum_id < 1)
      return null;
    ForumBean forum = BBSForumDAO.getForumByID(forum_id);
    if (forum != null && forum.getSite().getId() == site.getId())
      return forum;
    return null;
  }
View Full Code Here

  public static void createForum(ForumBean obj, int pos, boolean up)
      throws CapacityExceedException {
    Session ssn = getSession();
    int order_value = 1;
    if (pos > 0) {
      ForumBean friend = (ForumBean) ssn.get(ForumBean.class,
          new Integer(pos));
      order_value = friend.getSortOrder();
    }
    obj.setSortOrder(order_value - (up ? 1 : 0));
    try {
      beginTransaction();
      ssn.save(obj);
View Full Code Here

      //��������
      if(isUserInBlackList(site, loginUser)){
        msgs.add("topic", new ActionMessage("error.user_in_blacklist"));
        break;
      }
      ForumBean forum = BBSForumDAO.getForumByID(log.getForum());
      if (forum == null || forum.getSite().getId() != site.getId()
          || !forum.canCreateOrUpdateTopic(loginUser)) {
        msgs.add("topic", new ActionMessage("error.forum_not_available",
            new Integer(log.getForum())));
        break;
      }     
     
View Full Code Here

  protected ActionForward doUpdateForum(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    BBSForumForm forum = (BBSForumForm)form;
    super.validateClientId(request, forum);
    ForumBean fbean = BBSForumDAO.getForumByID(forum.getId());
    if(fbean!=null){
      if(StringUtils.isNotEmpty(forum.getName())&&!StringUtils.equals(fbean.getName(),forum.getName())){
        fbean.setName(forum.getName());
      }
      if(StringUtils.isNotEmpty(forum.getDesc())&&!StringUtils.equals(fbean.getDesc(),forum.getDesc())){
        fbean.setDesc(forum.getDesc());
      }
      if(fbean.getStatus()!=forum.getStatus()){
        int s = forum.getStatus();
        if(s==ForumBean.STATUS_NORMAL||s==ForumBean.STATUS_HIDDEN||s==ForumBean.STATUS_LOCKED)
          fbean.setStatus(forum.getStatus());
      }
      //�����������
      if(forum.getCatalog()>0){
        if(fbean.getCatalog()==null)
          fbean.setCatalog(new TypeBean(forum.getCatalog()));
        else if(fbean.getCatalog().getId()!=forum.getCatalog())
          fbean.setCatalog(new TypeBean(forum.getCatalog()));           
      }
      else if(fbean.getCatalog()!=null){
        fbean.setCatalog(null);
      }
     
      BBSForumDAO.flush();
    }
    return super.makeForward(mapping.findForward("forums"), forum.getSid());
View Full Code Here

      msgs.add("name", new ActionMessage("error.forum_name_empty"));
    }
    else{     
      super.validateClientId(request, forum);
      SiteBean site = super.getSiteBean(request);
      ForumBean fbean = new ForumBean();
      fbean.setName(forum.getName());
      if(!StringUtils.isEmpty(forum.getDesc()))
        fbean.setDesc(forum.getDesc());
      fbean.setCreateTime(new Date());
      fbean.setSite(site);
      int s = forum.getStatus();
      if(s==ForumBean.STATUS_NORMAL||s==ForumBean.STATUS_HIDDEN||s==ForumBean.STATUS_LOCKED)
        fbean.setStatus(forum.getStatus());
      else
        fbean.setStatus(ForumBean.STATUS_NORMAL);
      if(forum.getCatalog()>0){
        fbean.setCatalog(new TypeBean(forum.getCatalog()));
      }
      BBSForumDAO.createForum(fbean, forum.getId(), forum.getDirection()==1);
    }
    if(!msgs.isEmpty()){
      saveMessages(request, msgs);
View Full Code Here

TOP

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

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.