use of uk.nhs.digital.website.beans.ComponentList in project hippo by NHS-digital-website.
the class TaskHubComponent method doBeforeRender.
@Override
public void doBeforeRender(HstRequest request, HstResponse response) {
super.doBeforeRender(request, response);
final ComponentList bean = (ComponentList) request.getRequestContext().getContentBean();
List<?> priorityTaskList = getTasksFromLinkBlocks(bean.getBlocks()).filter(task -> ((Task) task).getPriorityAction()).collect(Collectors.toList());
request.setAttribute("priorityTasks", priorityTaskList);
List<?> alternativeTaskList = getTasksFromLinkBlocks(bean.getBlocks()).flatMap(task -> addAlternativeNameEntries((Task) task)).collect(Collectors.toList());
request.setAttribute("alternativeTasks", alternativeTaskList);
}
Aggregations