1 25 26 package net.killingar.forum.actions; 27 28 import net.killingar.forum.internal.User; 29 import net.killingar.forum.internal.managers.AreaManager; 30 import net.killingar.forum.internal.managers.OptionsManager; 31 import net.killingar.forum.internal.managers.TimeManager; 32 33 import java.util.ArrayList ; 34 import java.util.List ; 35 36 public class ViewAddressbook extends ActionForumSupport 37 { 38 40 private List users = new ArrayList (); 42 43 45 47 public List getUsers() { return users; } 49 50 protected String doExecute() 52 { 53 try 54 { 55 TimeManager timeMgr = (TimeManager)manager.getManager(TimeManager.class.getName()); 56 OptionsManager optionMgr = (OptionsManager)manager.getManager(OptionsManager.class.getName()); 57 AreaManager areas = (AreaManager)manager.getManager(AreaManager.class.getName()); 58 59 User users[] = manager.getCommonGroupUsers(manager.getUserID()); 60 java.util.Arrays.sort(users); 61 62 for (int i = 0; i < users.length; i++) 63 this.users.add(new UserData(manager, users[i])); 64 } 65 catch (Exception e) 66 { 67 e.printStackTrace(); 68 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 69 return ERROR; 70 } 71 72 return SUCCESS; 73 } 74 75 } 76 | Popular Tags |