use of uk.nhs.digital.website.beans.Signup in project hippo by NHS-digital-website.
the class CustomAutoDetectFormComponent method getFormBeanFromSignupDocument.
@Nullable
private FormBean getFormBeanFromSignupDocument(final HstRequest request) {
final HippoBean document = request.getRequestContext().getContentBean();
if (document instanceof Signup) {
final Signup signupDocument = (Signup) document;
return (FormBean) signupDocument.getFormLink().getLink();
}
if (document == null || !document.isHippoDocumentBean() || !(document instanceof FormBean)) {
if (log.isDebugEnabled()) {
log.warn("*** EFORMS ***");
log.warn("Cannot get the form bean, returning null. Reason: the content bean is null or it does not match the FormBean type [eforms:form].");
log.warn("Override the method [BaseEformComponent#getFormBean(HstRequest)] to get the form bean in a different way, e.g. from a linked bean.");
log.warn("Will attempt to get the form bean from the component picker.");
log.warn("*** EFORMS ***");
}
return null;
}
return (FormBean) document;
}