| 1 package org.javabb.action; 2 3 import java.util.ArrayList ; 4 import java.util.List ; 5 6 import org.javabb.action.infra.BaseAction; 7 import org.javabb.transaction.ForumTransaction; 8 import org.javabb.vh.ForumConfigView; 9 import org.javabb.vo.Forum; 10 11 26 27 33 public class ForumAction extends BaseAction { 34 35 private ForumConfigView forumConfigView = new ForumConfigView(); 36 37 protected Forum forum = new Forum(); 38 39 protected ForumTransaction forumTransaction; 40 41 protected List forums = new ArrayList (); 42 43 private int removeForum = 0; 44 45 private List themes = new ArrayList (); 47 private List langs; 48 private List btnLang = new ArrayList (); 50 51 55 private Integer destOrder; 57 private Integer position; 58 59 62 public void setRemoveForum(int removeForum) { 63 this.removeForum = removeForum; 64 } 65 66 70 71 74 public void setForumTransaction(ForumTransaction forumTransaction) { 75 this.forumTransaction = forumTransaction; 76 } 77 78 82 86 public String forumConfig() throws Exception { 87 btnLang = forumTransaction.listButtons(); 88 return SUCCESS; 90 } 91 92 96 public String listaForum() throws Exception { 97 forums = forumTransaction.findAll(); 98 return SUCCESS; 99 } 100 101 105 public String loadForum() throws Exception { 106 forum = forumTransaction.loadForum(forum.getId()); 107 return SUCCESS; 108 } 109 110 114 public String updateForum() throws Exception { 115 forumTransaction.update(forum.getIdForum(), forum); 116 return SUCCESS; 117 } 118 119 123 public String insertForum() throws Exception { 124 forumTransaction.insertForum(forum); 125 return SUCCESS; 126 } 127 128 132 public String deleteForum() throws Exception { 133 if (removeForum != -1) { 134 forumTransaction.transferForum(forum, removeForum); 135 } 136 forumTransaction.deleteForum(forum); 137 return SUCCESS; 138 } 139 140 public String sortForum() throws Exception { 141 forumTransaction.sortForuns(_categoryId, destOrder, position); 142 return SUCCESS; 143 } 144 145 146 150 public String saveForumConfig() throws Exception { 151 forumTransaction.saveConfigForum(forumConfigView); 152 return SUCCESS; 153 } 154 155 public String sortUserRankByForum() throws Exception { 156 forumTransaction.refreshForumUserRank(); 157 return SUCCESS; 158 } 159 160 161 165 168 public Forum getForum() { 169 return forum; 170 } 171 172 175 public List getForums() { 176 return forums; 177 } 178 179 182 public int getRemoveForum() { 183 return removeForum; 184 } 185 186 189 public List getThemes() { 190 return themes; 191 } 192 193 196 public List getLangs() { 197 return langs; 198 } 199 202 public ForumConfigView getForumConfigView() { 203 return forumConfigView; 204 } 205 208 public Integer getDestOrder() { 209 return destOrder; 210 } 211 214 public void setDestOrder(Integer destOrder) { 215 this.destOrder = destOrder; 216 } 217 220 public Integer getPosition() { 221 return position; 222 } 223 226 public void setPosition(Integer position) { 227 this.position = position; 228 } 229 232 public List getBtnLang() { 233 return btnLang; 234 } 235 } | Popular Tags |