Package org.nemesis.forum

Examples of org.nemesis.forum.ForumFactory


    }

  }

  public static void flush(Authorization auth) throws UnauthorizedException{
    ForumFactory forumFactory = ForumFactory.getInstance(auth);
    if(! forumFactory.getPermissions(auth).get(Constants.SYSTEM_ADMIN)) throw new UnauthorizedException();
    try {
      IndexWriter writer = new IndexWriter(new File(PATH), new StopAnalyzer(), true);
      writer.close();
    } catch (IOException e) {
      log.error("impossible de flusher l'index ", e);
View Full Code Here


      log.error("impossible de flusher l'index ", e);
    }
  }
 
  public static void reindex(Authorization auth) throws UnauthorizedException{
    ForumFactory forumFactory = ForumFactory.getInstance(auth);
    if(! forumFactory.getPermissions(auth).get(Constants.SYSTEM_ADMIN)) throw new UnauthorizedException();
    //ok system admin
    flush(auth);
    Forum f=null;
    ForumThread ft=null;
    for(Iterator it=forumFactory.forums();it.hasNext();){
      f=(Forum)it.next();
      for(Iterator it2=f.threads();it2.hasNext();){
        ft=(ForumThread)it2.next();
        index(ft.getRootMessage());
      }
View Full Code Here

  /**
   * @param b
   */
  public static void setAutoIndex(boolean b,Authorization auth) throws UnauthorizedException {
    ForumFactory forumFactory = ForumFactory.getInstance(auth);
    if(! forumFactory.getPermissions(auth).get(Constants.SYSTEM_ADMIN)) throw new UnauthorizedException();
    autoIndex = b;
  }
View Full Code Here

   
   
    try {
       
       
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        ProfileManager manager = forumFactory.getProfileManager();
        User user = manager.getUser(getAuthToken(request).getUserID());
         
        Group group = manager.getGroup(request.getParameter("group"));
        request.setAttribute("id",group.getID()+"";
        User  u = manager.getUser(request.getParameter("username"));
View Full Code Here

    ActionErrors errors = new ActionErrors();
   
    try {
        try {
         
          ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
          ProfileManager manager = forumFactory.getProfileManager();
          Forum f = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
          forumFactory.deleteForum(f);
         
          errors.add("general"new ActionError("delForum.confirm"));
         
        }
        catch( NotFoundException fnfe ) {
View Full Code Here

    checkPermission(request,OperationConstants.MANAGE_CACHE);
   
    ActionErrors errors = new ActionErrors();
   
    try {
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        DbForumFactory dbForumFactory = null;
        dbForumFactory = (DbForumFactory)((ForumFactoryProxy)forumFactory).getUnderlyingForumFactory();
        DbCacheManager cacheManager = dbForumFactory.getCacheManager();
 
        //action
View Full Code Here

   
   
    ActionErrors errors = new ActionErrors();
   
    try {
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
        //check permission
        checkPermission(request,OperationConstants.LIST_FORUM_CONTENT,forum);
       
        ForumThread t=forum.getThread(Integer.parseInt(request.getParameter("threadID")));
        t.setApproved(!t.isApproved());
View Full Code Here

    ActionErrors errors = new ActionErrors();
   
    try {
        try {
         
          ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
          ProfileManager manager = forumFactory.getProfileManager();
          User u = manager.getUser(Integer.parseInt(request.getParameter("id")));
          manager.deleteUser(u);
          errors.add("general"new ActionError("delUser.confirm"));
         
        }
View Full Code Here

    ActionErrors errors = new ActionErrors();

    try {

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
      request.setAttribute("id", request.getParameter("id"));
      //check permission
      checkPermission(request, OperationConstants.EDIT_FORUM_FILTER, forum);
     
      MessageFilter filter= forum.getForumMessageFilters()[Integer.parseInt(request.getParameter("edit"))];
View Full Code Here

    ActionErrors errors = new ActionErrors();
    boolean isRootmessage=false;
    try {

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
      request.setAttribute("id", request.getParameter("id"));
      //check permission
      checkPermission(request, OperationConstants.DELETE_MESSAGE, forum);
     
      ForumThread t=forum.getThread( Integer.parseInt(request.getParameter("threadID")));
View Full Code Here

TOP

Related Classes of org.nemesis.forum.ForumFactory

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.