use of uk.nhs.digital.website.beans.SupplementaryInformationHub in project hippo by NHS-digital-website.
the class SupplementaryInformationHubComponent method doBeforeRender.
@Override
public void doBeforeRender(final HstRequest request, final HstResponse response) {
super.doBeforeRender(request, response);
final HstRequestContext context = request.getRequestContext();
final SupplementaryInformationHub document = (SupplementaryInformationHub) context.getContentBean();
if (document != null) {
request.setAttribute("document", document);
}
List<SupplementaryInformation> si = getListOfSupplementaryInformation();
request.setAttribute("years", years(si));
String selectedYear = DocumentUtils.findYearOrDefault(getSelectedYear(request), Calendar.getInstance().get(Calendar.YEAR));
request.setAttribute("selectedYear", selectedYear);
final Month selectedMonth = findMonthOrNull(getSelectedMonth(request));
if (Objects.nonNull(selectedMonth)) {
request.setAttribute("selectedMonth", selectedMonth);
}
request.setAttribute("months", months(Integer.parseInt(selectedYear), si));
}
Aggregations