Ignore:
Timestamp:
2004-12-10T15:48:39+13:00 (19 years ago)
Author:
schweer
Message:

started to work on multi-valued predicates; started to rework the filter algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/AlertingService.java

    r8775 r8777  
    2121import org.greenstone.gsdlas.users.UserManagementException;
    2222import org.greenstone.gsdlas.users.UserManager;
     23import org.greenstone.gsdlas.util.ArrayHelper;
    2324
    2425/**
     
    3031public class AlertingService extends VelocityServlet {
    3132   
    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    };
    4845   
    4946   
     
    5249       
    5350        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        
    6251
    6352        Map args = req.getParameterMap();
    6453        // TODO stop this, we need multi-valued stuff
    6554        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               
    6768        String templateString = "";
    6869       
     
    163164        String username = (String) session.getAttribute("username");
    164165        context.put("title", "List of Subscriptions for " + username);
    165         context.put("list", ProfileStore.getInstance().getAllSubscriptions());
     166        context.put("list", ProfileStore.getInstance().getAllSubscriptionsFor(username));
    166167        return "list.vm";
    167168    }
Note: See TracChangeset for help on using the changeset viewer.