1 11 package org.jboss.portlet.forums.commands.admin; 12 13 import org.jboss.portal.common.command.result.Result; 14 import org.jboss.portal.core.modules.ModuleException; 15 import org.jboss.portlet.forums.ForumsModule; 16 import org.jboss.portlet.forums.commands.AbstractCommand; 17 import org.jboss.portlet.forums.model.Category; 18 import org.jboss.portlet.JBossActionRequest; 19 import org.jboss.portlet.JBossActionResponse; 20 21 26 public class DeleteMoveCategoryCommand 27 extends AbstractCommand 28 { 29 30 public Category source; 31 32 33 public Category target; 34 35 36 public ForumsModule module; 37 38 public DeleteMoveCategoryCommand(JBossActionRequest request, JBossActionResponse response) 39 { 40 super(request, response); 41 } 42 43 48 public Result execute() 49 { 50 if ((source != null) && (target != null) && !source.getID().equals(target.getID())) 51 { 52 module.addAllForums(source, target); 53 } 54 55 try 56 { 57 module.removeCategory(source); 58 return TYPE_CATEGORY_REMOVED; 59 } 60 catch (ModuleException e) 61 { 62 log.error("", e); 63 return TYPE_CANNOT_REMOVE_CATEGORY; 64 } 65 } 66 } | Popular Tags |