use of uk.nhs.digital.website.beans.ProjectUpdate in project hippo by NHS-digital-website.
the class ProjectUpdateFeedComponent method doBeforeRender.
@Override
public void doBeforeRender(final HstRequest request, final HstResponse response) {
super.doBeforeRender(request, response);
final HippoBean document = request.getRequestContext().getContentBean();
if (document != null) {
request.setAttribute("document", document);
}
try {
List<ProjectUpdate> unfilteredResults = toList(HstQueryBuilder.create(document.getParentBean()).ofTypes(ProjectUpdate.class).build().execute().getHippoBeans());
request.setAttribute("organisations", organisations(unfilteredResults));
request.setAttribute("updateTypes", types(unfilteredResults));
request.setAttribute("years", years(unfilteredResults));
} catch (QueryException e) {
log.error("Query for filter generation failed: {}", e.getMessage());
}
request.setAttribute("selectedOrganisation", getSelectedOrganisationTitle(request));
request.setAttribute("selectedUpdateType", getSelectedUpdateType(request));
request.setAttribute("selectedYear", getYearToFilter(request));
}
Aggregations