Changeset 8777 for trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/AlertingService.java
- Timestamp:
- 2004-12-10T15:48:39+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/AlertingService.java
r8775 r8777 21 21 import org.greenstone.gsdlas.users.UserManagementException; 22 22 import org.greenstone.gsdlas.users.UserManager; 23 import org.greenstone.gsdlas.util.ArrayHelper; 23 24 24 25 /** … … 30 31 public class AlertingService extends VelocityServlet { 31 32 32 public static final Set actions; 33 static { 34 Set set = new TreeSet(); 35 set.add("createSubscription"); 36 set.add("deleteSubscription"); 37 set.add("editSubscription"); 38 set.add("showFeed"); 39 set.add("listSubscriptions"); 40 41 set.add("login"); 42 set.add("register"); 43 set.add("logout"); 44 set.add("showLoginForm"); 45 set.add("showRegistrationForm"); 46 actions = Collections.unmodifiableSet(set); 47 } 33 public static final String[] actions = new String[] { 34 "createSubscription", 35 "deleteSubscription", 36 "editSubscription", 37 "showFeed", 38 "listSubscriptions", 39 "login", 40 "register", 41 "logout", 42 "showLoginForm", 43 "showRegistrationForm" 44 }; 48 45 49 46 … … 52 49 53 50 String action = req.getParameter("action"); 54 55 if (action == null || !actions.contains(action)) {56 String title = "Unknown action";57 String message = "I don't know how to " + action;58 String details = "The only actions I know are " + actions;59 return showError(context, message, details);60 }61 62 51 63 52 Map args = req.getParameterMap(); 64 53 // TODO stop this, we need multi-valued stuff 65 54 args = normalise(args); 66 55 56 if (action != null && action.equals("receiveEvent")) { 57 receiveEvent(args); 58 return null; 59 } 60 61 if (action == null || !ArrayHelper.contains(actions, action)) { 62 String title = "Unknown action"; 63 String message = "I don't know how to " + action; 64 String details = "The only actions I know are " + Arrays.toString(actions); 65 return showError(context, message, details); 66 } 67 67 68 String templateString = ""; 68 69 … … 163 164 String username = (String) session.getAttribute("username"); 164 165 context.put("title", "List of Subscriptions for " + username); 165 context.put("list", ProfileStore.getInstance().getAllSubscriptions ());166 context.put("list", ProfileStore.getInstance().getAllSubscriptionsFor(username)); 166 167 return "list.vm"; 167 168 }
Note:
See TracChangeset
for help on using the changeset viewer.