* javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
@SuppressWarnings("unchecked")
public ActionForward deleteIncludingInteractions(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
InteractionListEnterEditDuplicateForm f = (InteractionListEnterEditDuplicateForm)form;
IL interactionList = entryFromDatabase(f.getId());
if (interactionList == null){
throw new InputException(getResources(req).getMessage(locale, "admin.entryNotAvailable"));
}
CommandEntryManager commandEntryManager = new CommandEntryManager(locale,session);
Set<CommandEntry> commandEntries = interactionList.getCommandEntries();
for (CommandEntry entry : commandEntries) {
commandEntryManager.delete(entry);
}
SmsDbManager smsDbManager = new SmsDbManager(locale,session);
smsDbManager.modifyInteractionList(interactionList); // update edited-at attribute to allow recognizing the change
LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": deleted interactions of interaction list #"+ f.getId());
delete(mapping,form,req,resp);
return mapping.findForward("deleted");
}