/** * @deprecated since 7.9.0 : use {@link org.hippoecm.hst.core.request.HstRequestContext#getObjectBeanManager()} instead */ @Deprecated public ObjectBeanManager getObjectBeanManager(HstRequest request) { return request.getRequestContext().getObjectBeanManager(); }
protected ObjectBeanManager getObjectBeanManager(HstRequest request) { return request.getRequestContext().getObjectBeanManager(); }
/** * @param request * @return the root gallery HippoFolderBean at <code>/content/gallery</code> and <code>null</code> if it does not exist */ public HippoFolderBean getGalleryBaseBean(HstRequest request){ try { HippoBean gallery = (HippoBean)request.getRequestContext().getObjectBeanManager().getObject("/content/gallery"); if(gallery instanceof HippoFolderBean) { return (HippoFolderBean)gallery; } else { log.warn("Gallery base folder not of type folder. Cannot return folder bean for it. Return null"); } } catch (ObjectBeanManagerException e) { log.warn("Cannot find the root Gallery folder. Return null"); } return null; }
/** * @param request * @return the root asset HippoFolderBean at <code>/content/assets</code> and null if it does not exist */ public HippoFolderBean getAssetBaseBean(HstRequest request){ try { HippoBean assets = (HippoBean)request.getRequestContext().getObjectBeanManager().getObject("/content/assets"); if(assets instanceof HippoFolderBean) { return (HippoFolderBean)assets; } else { log.warn("Assets base folder not of type folder. Cannot return folder bean for it. Return null"); } } catch (ObjectBeanManagerException e) { log.warn("Cannot find the root Asset folder. Return null"); } return null; }
@Override public void doBeforeRender(final HstRequest request, final HstResponse response) { super.doBeforeRender(request, response); final EssentialsImageComponentInfo paramInfo = getComponentParametersInfo(request); final String documentPath = paramInfo.getDocument(); log.debug("Calling EssentialsImageComponent for document path: [{}]", documentPath); if (!Strings.isNullOrEmpty(documentPath)) { try { final Object image = RequestContextProvider.get().getObjectBeanManager().getObject(documentPath); request.setModel(REQUEST_ATTR_DOCUMENT, image); } catch (ObjectBeanManagerException e) { if (log.isDebugEnabled()) { log.error("Error getting image", e); } } } request.setAttribute(REQUEST_ATTR_PARAM_INFO, paramInfo); } }
/** * Return a <code>HippoBean</code> when it can be found for the relativeContentPath for the <code>{@link ResolvedSiteMapItem}</code>. If there is no * relativeContentPath available in the <code>{@link ResolvedSiteMapItem}</code>, or when the relativeContentPath does not point to an existing jcr node, * <code>null</code> will be returned * @param request * @param resolvedSiteMapItem * @return A <code>HippoBean</code> or <code>null</code> when there cannot be created a content bean for this resolvedSiteMapItem */ public HippoBean getBeanForResolvedSiteMapItem(HstRequest request, ResolvedSiteMapItem resolvedSiteMapItem) { final HstRequestContext requestContext = request.getRequestContext(); String base = requestContext.getSiteContentBasePath(); String relPath = PathUtils.normalizePath(resolvedSiteMapItem.getRelativeContentPath()); if(relPath == null) { log.debug("Cannot return a content bean for relative path null for resolvedSitemapItem belonging to '{}'. Return null", resolvedSiteMapItem.getHstSiteMapItem().getId()); return null; } try { if("".equals(relPath)) { return (HippoBean) requestContext.getObjectBeanManager().getObject("/"+base); } else { return (HippoBean) requestContext.getObjectBeanManager().getObject("/"+base+ "/" + relPath); } } catch (ObjectBeanManagerException e) { log.error("ObjectBeanManagerException. Return null : {}", e); } return null; }
HippoBean bean = (HippoBean)requestContext.getObjectBeanManager().getObject(absPath); if(bean == null) { log.info("Cannot return Document below faceted navigation for path '{}'. Return null", absPath); ObjectBeanManager objectBeanMngr = requestContext.getObjectBeanManager(querySession);
HippoBean bean = (HippoBean)requestContext.getObjectBeanManager().getObject(absPath); if(bean == null) { log.info("Cannot return HippoFacetNavigationBean for path '{}'. Return null", absPath); ObjectBeanManager objectBeanMngr = requestContext.getObjectBeanManager(querySession);
hippoBean = (HippoBean) reqContext.getObjectBeanManager().getObjectByUuid(nodeId); } catch (ObjectBeanManagerException e) { log.warn("Cannot find content bean by id: '{}'.", nodeId);