use of codeu.model.data.Activity in project codeu-2018-team12 by codeu-2018-team12.
the class ActivityServlet method doGet.
/**
* This function fires when a user navigates to the activity feed page. It gets a list of all
* current messages and forwards them to activityFeed.jsp.
*/
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
User loggedInUser = userStore.getUser((String) request.getSession().getAttribute("user"));
List<Activity> activitiesPermitted = loggedInUser == null ? sort(activityStore.getAllPublicActivities()) : sort(activityStore.getAllPermittedActivities(loggedInUser.getId()));
List<Activity> activities = sort(activityStore.getActivitiesPerPrivacy(loggedInUser, activitiesPermitted));
request.setAttribute("activities", activities);
request.getRequestDispatcher("/WEB-INF/view/activityFeed.jsp").forward(request, response);
}
Aggregations