/**
* @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
InvocationListForm f = (InvocationListForm)form;
Group groupToDisplay = getCurrentGroup(req);
if (Boolean.TRUE.equals(f.getAllGroups()) && UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)) {
groupToDisplay = null;
}
Date now = new Date(System.currentTimeMillis());
if(Boolean.TRUE.equals(f.getOutdatedServices())){
now = null;
}
SmsDbManager smsDbManager = new SmsDbManager(locale, session);
@SuppressWarnings("unused")
String notAllowedString = getResources(req).getMessage(locale, "smssvc.notAllowed");
List<InvocationListForm.DisplayableInvocation> displayableInvocations = new LinkedList<InvocationListForm.DisplayableInvocation>();
List<Invocation> invocations = smsDbManager.getInvocations(groupToDisplay,now);
for (Invocation invocation : invocations) {
Group group = invocation.getGroup();
group.getGroupname(); // fill the cache
Long msisdn = invocation.getMsisdn();
String email = invocation.getEmail();
String keywords = invocation.getKeywords();
String displayableMsisdn = msisdn == null ? "" : msisdn + "";
if (msisdn != null && !smsDbManager.isMsisdnAllowedForAllKeywords(group, msisdn, keywords)){