io.spotnext.cms.endpoints.AbstractPageEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spot-cms-base Show documentation
Show all versions of spot-cms-base Show documentation
The spOt microservice framework.
package io.spotnext.cms.endpoints;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import io.spotnext.cms.exception.PageNotFoundException;
import io.spotnext.cms.service.TemplateRenderService;
import io.spotnext.core.infrastructure.http.ModelAndView;
import io.spotnext.itemtype.cms.CmsPage;
/**
* The abstract base class class for HTTP endpoints that will be rendered using
* a {@link CmsPage}.
*/
public abstract class AbstractPageEndpoint {
@Autowired
protected TemplateRenderService templateRenderService;
/**
* Prepares a {@link ModelAndView} based on the given cms page.
*
* @param pageId the id og the {@link CmsPage} to use
* @param context contains the variables for the template render service - can
* be null
* @return the prepared {@link ModelAndView} for the template renderer
* @return the prepared {@link ModelAndView} that will be rendered
*/
protected ModelAndView renderCmsPage(String pageId, Map context) throws PageNotFoundException {
return templateRenderService.prepareCmsPage(pageId, context);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy