use of org.hippoecm.hst.core.request.HstRequestContext in project hippo by NHS-digital-website.
the class HippoBeanHelper method getTaxonomyName.
public static String getTaxonomyName() throws HstComponentException {
String taxonomyName;
try {
HstRequestContext ctx = RequestContextProvider.get();
taxonomyName = ctx.getSession().getNode("/hippo:namespaces/publicationsystem/publication/editor:templates/_default_/classifiable").getProperty("essentials-taxonomy-name").getString();
} catch (RepositoryException repositoryException) {
throw new HstComponentException("Exception occurred during fetching taxonomy file name.", repositoryException);
}
return taxonomyName;
}
use of org.hippoecm.hst.core.request.HstRequestContext in project hippo by NHS-digital-website.
the class CiHubComponent method doBeforeRender.
@Override
public void doBeforeRender(final HstRequest request, final HstResponse response) throws HstComponentException {
super.doBeforeRender(request, response);
final HstRequestContext ctx = request.getRequestContext();
request.setAttribute("document", ctx.getContentBean());
}
use of org.hippoecm.hst.core.request.HstRequestContext in project hippo by NHS-digital-website.
the class GraphProviderImpl method getHttpRequest.
private HttpEntity<String> getHttpRequest(final MediaType acceptMediaType) {
final HttpHeaders headers = new HttpHeaders();
final HstRequestContext context = RequestContextProvider.get();
headers.setAccept(Collections.singletonList(acceptMediaType));
headers.setBearerAuth((String) context.getAttribute(Constants.ACCESS_TOKEN_PROPERTY_NAME));
return new HttpEntity<>(headers);
}
use of org.hippoecm.hst.core.request.HstRequestContext in project hippo by NHS-digital-website.
the class Task method getRelatedDocuments.
private <T extends HippoBean> List<T> getRelatedDocuments(String property, Class<T> beanClass) throws HstComponentException, QueryException {
final HstRequestContext context = RequestContextProvider.get();
HstQuery query = ContentBeanUtils.createIncomingBeansQuery(this.getCanonicalBean(), context.getSiteContentBaseBean(), property, beanClass, false);
return toList(query.execute().getHippoBeans());
}
use of org.hippoecm.hst.core.request.HstRequestContext in project hippo by NHS-digital-website.
the class MasterComponent method doBeforeRender.
@Override
public void doBeforeRender(HstRequest request, HstResponse response) {
super.doBeforeRender(request, response);
final HstRequestContext context = request.getRequestContext();
final HippoBean document = context.getContentBean();
if (document != null) {
request.setAttribute("document", document);
}
}
Aggregations