use of uk.nhs.digital.common.components.info.NavigationBlockComponentInfo in project hippo by NHS-digital-website.
the class NavigationBlockComponent method doBeforeRender.
@Override
public void doBeforeRender(HstRequest request, HstResponse response) {
super.doBeforeRender(request, response);
NavigationBlockComponentInfo componentInfo = getComponentParametersInfo(request);
final String theme = componentInfo.getTheme();
final String size = componentInfo.getSize();
final String position = componentInfo.getPosition();
final String heading = componentInfo.getHeading();
List<HippoBean> allDocuments = new ArrayList<>();
HippoBean document1 = getHippoBeanForPath(componentInfo.getDocument1(), HippoBean.class);
allDocuments.add(document1);
HippoBean document2 = getHippoBeanForPath(componentInfo.getDocument2(), HippoBean.class);
allDocuments.add(document2);
HippoBean document3 = getHippoBeanForPath(componentInfo.getDocument3(), HippoBean.class);
allDocuments.add(document3);
HippoBean document4 = getHippoBeanForPath(componentInfo.getDocument4(), HippoBean.class);
allDocuments.add(document4);
HippoBean document5 = getHippoBeanForPath(componentInfo.getDocument5(), HippoBean.class);
allDocuments.add(document5);
HippoBean document6 = getHippoBeanForPath(componentInfo.getDocument6(), HippoBean.class);
allDocuments.add(document6);
request.setAttribute("theme", theme);
request.setAttribute("size", size);
request.setAttribute("position", position);
request.setAttribute("heading", heading);
request.setAttribute("documents", buildDocumentsList(allDocuments));
}
Aggregations