1 11 package org.jboss.portlet.forums.commands.admin; 12 13 import java.util.Iterator ; 14 15 import org.jboss.portal.common.command.result.Result; 16 import org.jboss.portal.core.modules.ModuleException; 17 import org.jboss.portlet.forums.ForumsModule; 18 import org.jboss.portlet.forums.commands.AbstractCommand; 19 import org.jboss.portlet.forums.model.Forum; 20 import org.jboss.portlet.JBossActionRequest; 21 import org.jboss.portlet.JBossActionResponse; 22 23 28 public class DeleteMoveForumCommand 29 extends AbstractCommand 30 { 31 32 public Forum source; 33 34 35 public Forum target; 36 37 38 public ForumsModule module; 39 40 public DeleteMoveForumCommand(JBossActionRequest request, JBossActionResponse response) 41 { 42 super(request, response); 43 } 44 45 50 public Result execute() 51 { 52 Iterator topics = source.getTopics().iterator(); 53 54 57 64 try 65 { 66 target.setLastPost(source.getLastPost()); 67 target.setPostCount(target.getPostCount() + source.getPostCount()); 68 target.setTopicCount(target.getTopicCount() + source.getTopicCount()); 69 module.removeForum(source); 70 } 71 catch (ModuleException e) 72 { 73 target.setLastPost(null); 74 } 75 76 return TYPE_FORUM_MOVED_AND_REMOVED; 77 } 78 79 144 } | Popular Tags |