Examples of ForumBean


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

Examples of com.liusoft.dlog4j.beans.ForumBean

   * @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

Examples of com.liusoft.dlog4j.beans.ForumBean

  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

Examples of com.liusoft.dlog4j.beans.ForumBean

      //��������
      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

Examples of com.liusoft.dlog4j.beans.ForumBean

  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

Examples of com.liusoft.dlog4j.beans.ForumBean

      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

Examples of org.nemesis.forum.webapp.admin.bean.ForumBean

        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        ProfileManager manager = forumFactory.getProfileManager();
        User user = manager.getUser(getAuthToken(request).getUserID());
        try {
         
          ForumBean fb=(ForumBean)PropertyUtils.getProperty(form, "forumBean");
          ForumFactory ff =ForumFactory.getInstance(getAuthToken(request));
          Forum f =ff.createForum(fb.getName(),fb.getDescription());
         
          //ForumPermissions permissions = forumFactory.getPermissions(getAuthToken(request));
          //boolean isSystemAdmin = permissions.get(ForumPermissions.SYSTEM_ADMIN);
          //boolean isUserAdmin   = permissions.get(ForumPermissions.FORUM_ADMIN);
         
          //f.addUserPermission(user,Constants.FORUM_ADMIN);
          f.addUserPermission(user,Constants.READ);
          f.addUserPermission(user,Constants.MODERATOR);
          f.addUserPermission(user,Constants.CREATE_THREAD);
          f.addUserPermission(user,Constants.CREATE_MESSAGE);
          f.addUserPermission(user,Constants.FORUM_ADMIN);
          //if(SecurityTools.isSystemAdmin(getAuthToken(request)))
          //f.addUserPermission(user,Constants.SYSTEM_ADMIN);
         
          f.setModerationType(fb.getModerationType());
         
          //properties
          String temp=null;
          for(Iterator it=fb.getProperties().keySet().iterator();it.hasNext();){
            temp=(String)it.next();
            f.setProperty(temp,(String)fb.getProperties().get(temp));
          }
         
         
        }
        catch( AlreadyExistsException aee ) {
View Full Code Here

Examples of org.nemesis.forum.webapp.admin.bean.ForumBean

        forumIterator = tempListe.iterator();
        request.setAttribute("nbItems"new Integer(c));
      }
      //populate
      String temp = null;
      ForumBean ub = null;
      Forum forum = null;
      while (forumIterator.hasNext()) {
        forum = (Forum) forumIterator.next();
        ub = new ForumBean();
        ub.setId(forum.getID());
        ub.setName(forum.getName());
        ub.setDescription(forum.getDescription());
        ub.setMessages(forum.getMessageCount());
        ub.setThreads(forum.getThreadCount());
        ub.setModerationType(forum.getModerationType());
       
        ub.setAdmin(SecurityTools.isSystemAdmin(getAuthToken(request)) || SecurityTools.isForumAdmin(getAuthToken(request),forum));
       
        //not necessary
        /*for(Enumeration enum =user.propertyNames(); enum.hasMoreElements();){
          temp=(String)enum.nextElement();
          ub.setValue(temp,user.getProperty(temp));
View Full Code Here

Examples of org.nemesis.forum.webapp.admin.bean.ForumBean

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
      //check permission
      checkPermission(request, OperationConstants.LIST_FORUM_CONTENT, forum);

      ForumBean fb = new ForumBean();
      fb.setId(forum.getID());
      fb.setName(forum.getName());
      fb.setNotApprovedMessages(forum.getMessageCount(false));
      fb.setNotApprovedThreads(forum.getThreadCount(false));
      fb.setThreads(forum.getThreadCount());
      fb.setMessages(forum.getMessageCount());

      request.setAttribute("fb", fb);
     
      request.setAttribute("nbItems",new Integer(forum.getThreadCount()));
     
View Full Code Here

Examples of org.nemesis.forum.webapp.admin.bean.ForumBean

      checkPermission(request, OperationConstants.EDIT_FORUM, forum);

      //first, populate
      if (request.getParameter("forumBean.id") == null) {
       
        ForumBean fb =new ForumBean();
        fb.setDescription(forum.getDescription());
        fb.setId(forum.getID());
        fb.setModerationType(forum.getModerationType());
        fb.setName(forum.getName());
        String key=null;
        for(Enumeration e= forum.propertyNames();e.hasMoreElements();){
          key=(String)e.nextElement();
          fb.setPropertie(key, forum.getProperty(key));
        }

        PropertyUtils.setProperty(form, "forumBean", fb);
        return mapping.findForward("view");
      }

      //save     
      ForumBean fb = (ForumBean) PropertyUtils.getProperty(form, "forumBean");
      forum.setModerationType(fb.getModerationType());
      forum.setDescription(fb.getDescription());
      //non forum.setName(fb.getDescription());
     
      //properties
      String temp = null;
      for (Iterator it = fb.getProperties().keySet().iterator(); it.hasNext();) {
        temp = (String) it.next();
        forum.setProperty(temp, (String) fb.getProperties().get(temp));
      }

    } catch (NumberFormatException aee) {
      errors.add("general", new ActionError("addForum.unauthorized"));
    } catch (UnauthorizedException aee) {     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.