* This method is used to fetch a list and forward them to the view component
*
* @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) {
InteractionLogListForm listForm = (InteractionLogListForm)form;
ApplicationManager applicationManager = new ApplicationManager(locale,session);
Group groupToDisplay = null;
Application applicationToDisplay = null;
groupToDisplay = this.getCurrentGroup(req);
Long applicationId = listForm.getApplicationId();
if (applicationId != null && applicationId != -1) {
Application application = applicationManager.getApplication(applicationId);
if (application != null && application.getGroup() == groupToDisplay){
applicationToDisplay = application;
}
}
// application selection
Set<Application> applications = groupToDisplay.getApplications();
Hibernate.initialize(applications);
req.setAttribute("applications", applications);
listForm.setApplicationId(applicationToDisplay != null ? applicationToDisplay.getId() : -1);
// sorting
String sortCriterion = "date"; // default sort criterion
if(req.getParameter("sort") != null){
sortCriterion = req.getParameter("sort");