Search in sources :

Example 1 with CardListComponentInfo

use of uk.nhs.digital.common.components.info.CardListComponentInfo in project hippo by NHS-digital-website.

the class CardListComponent method doBeforeRender.

@Override
public void doBeforeRender(final HstRequest request, final HstResponse response) throws HstComponentException {
    LOGGER.info("Card List Component Info");
    CardListComponentInfo info = getComponentParametersInfo(request);
    String headerText = info.getHeader();
    String introductionText = info.getIntroduction();
    request.setAttribute("headerText", headerText);
    request.setAttribute("introText", introductionText);
    String button1Title = info.getButton1Title();
    String button1Url = info.getButton1Link();
    String button2Title = info.getButton2Title();
    String button2Url = info.getButton2Link();
    request.setAttribute("button1Title", button1Title);
    request.setAttribute("button1Url", button1Url);
    request.setAttribute("button2Title", button2Title);
    request.setAttribute("button2Url", button2Url);
    List<HippoDocument> cardComponents = getCardComponents(info);
    request.setAttribute("cardList", cardComponents);
    String template = info.getTemplate();
    request.setAttribute("template", template);
}
Also used : HippoDocument(org.hippoecm.hst.content.beans.standard.HippoDocument) CardListComponentInfo(uk.nhs.digital.common.components.info.CardListComponentInfo)

Aggregations

HippoDocument (org.hippoecm.hst.content.beans.standard.HippoDocument)1 CardListComponentInfo (uk.nhs.digital.common.components.info.CardListComponentInfo)1