1 25 26 package net.killingar.forum.actions.area; 27 28 import net.killingar.forum.internal.Message; 29 30 import java.util.ArrayList ; 31 32 public class ViewGuestbook extends View 33 { 34 36 38 40 42 44 46 48 protected String doExecute() 49 { 50 String s; 51 52 try 53 { 54 boolean logout = !manager.isLoggedIn(); 55 if (logout) 56 manager.login("SK Guestbook Robot", "a4mnc-a834n;zos;gwon5r23l"); 57 58 if (pageID == -1) 59 pageID = 0; 60 61 s = super.doExecute(); 62 63 java.util.List l = new ArrayList (); 64 65 if (!s.equals(ERROR)) 66 { 67 Message m[] = areamgr.getPage(areaID, pageID); 68 for (int i = 0; i != m.length; i++) 69 l.add(new GuestbookMessageData(m[i])); 70 } 71 72 messages = l.iterator(); 73 74 if (logout) 75 manager.logout(); 76 } 77 catch (Exception e) 78 { 79 s = ERROR; 80 addErrorMessage("failed to display guestbook "+e); 81 82 e.printStackTrace(); 83 } 84 85 return s; 86 } 87 } | Popular Tags |