Tabnine Logo
ResolvedSiteMapItem.getRelativeContentPath
Code IndexAdd Tabnine to your IDE (free)

How to use
getRelativeContentPath
method
in
org.hippoecm.hst.core.request.ResolvedSiteMapItem

Best Java code snippets using org.hippoecm.hst.core.request.ResolvedSiteMapItem.getRelativeContentPath (Showing top 8 results out of 315)

origin: org.onehippo.cms7.hst.components/hst-core

private HippoBean getBeanForResolvedSiteMapItem(ResolvedSiteMapItem resolvedSiteMapItem) {
  String base = 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;
  }
  return getHippoBean(base, relPath);
}
origin: org.onehippo.cms7/hippo-essentials-components-hst

  protected HippoFacetNavigationBean getFacetNavigationBean(final HstRequestContext context, String path, String query) {
    if (Strings.isNullOrEmpty(path)) {
      log.warn("Facetpath was empty {}", path);
      return null;
    }
    ResolvedSiteMapItem resolvedSiteMapItem = context.getResolvedSiteMapItem();
    String resolvedContentPath = PathUtils.normalizePath(resolvedSiteMapItem.getRelativeContentPath());
    String parsedQuery = cleanupSearchQuery(query);
    HippoFacetNavigationBean facNavBean;
    if (!StringUtils.isBlank(resolvedContentPath)
        && !resolvedContentPath.startsWith("/")
        && context.getSiteContentBaseBean().getBean(resolvedContentPath, HippoFacetNavigationBean.class) != null) {
      facNavBean = ContentBeanUtils.getFacetNavigationBean(resolvedContentPath, parsedQuery);
    } else {
      facNavBean = ContentBeanUtils.getFacetNavigationBean(path, parsedQuery);
    }
    return facNavBean;
  }
}
origin: org.onehippo.cms7.hst/hst-content-beans

/**
 * @see {@link #getFacetNavigationBean(String, String, String)} with <code>absBasePath</code> as "/"+ requestContext.getSiteContentBasePath() and
 * <code>relPath </code> as requestContext.getResolvedSiteMapItem().getRelativeContentPath()
 */
public static HippoFacetNavigationBean getFacetNavigationBean(String query) throws HstComponentException {
  final HstRequestContext requestContext = RequestContextProvider.get();
  if (requestContext == null) {
    throw new HstComponentException("Cannot call #getFacetNavigationBean without HstRequestContext");
  }
  ResolvedSiteMapItem resolvedSiteMapItem = requestContext.getResolvedSiteMapItem();
  String relPath = PathUtils.normalizePath(resolvedSiteMapItem.getRelativeContentPath());
  return getFacetNavigationBean(relPath, query);
}
origin: org.onehippo.ecm.hst/hst-client

/**
 * 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) {
  String base = getSiteContentBasePath(request);
  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) getObjectBeanManager(request).getObject("/"+base);
    } else {
      return (HippoBean) getObjectBeanManager(request).getObject("/"+base+ "/" + relPath);
    }
  } catch (ObjectBeanManagerException e) {
    log.error("ObjectBeanManagerException. Return null : {}", e);
  }
  return null;
  
}

origin: org.onehippo.cms7.hst/hst-client

/**
 * 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;
}
origin: org.onehippo.cms7.hst/hst-content-beans

/**
 * Tries to return a bean that is located in a faceted navigation tree below a result set. When it cannot be found,
 * or the bean is not of type <code>beanMappingClass</code>, <code>null</code> will be returned.
 *
 * @param <T>
 * @param query the free text search as String that is used for this faceted navigation
 * @param beanMappingClass the class T must be of
 * @return The faceted navigation result document of type T and <code>null</code> if it cannot be found or is not of type <code>T</code>
 */
public static <T extends  HippoBean> T getFacetedNavigationResultDocument(String query, Class<T> beanMappingClass)  {
  final HstRequestContext requestContext = RequestContextProvider.get();
  if (requestContext == null) {
    throw new HstComponentException("Cannot call #getFacetNavigationBean without HstRequestContext");
  }
  ResolvedSiteMapItem resolvedSiteMapItem = requestContext.getResolvedSiteMapItem();
  String relPath = PathUtils.normalizePath(resolvedSiteMapItem.getRelativeContentPath());
  return getFacetedNavigationResultDocument(query, relPath, beanMappingClass);
}
origin: org.onehippo.cms7.hst.components/hst-core

final WebFileBundle webFileBundle = service.getJcrWebFileBundle(session, bundleName);
final String relativeContentPath = requestContext.getResolvedSiteMapItem().getRelativeContentPath();
origin: org.onehippo.cms7.hst.client-modules/hst-page-composer

if (StringUtils.isEmpty(resolvedSiteMapItem.getRelativeContentPath())) {
final String selectedPath = contentRootPath + "/" + resolvedSiteMapItem.getRelativeContentPath();
final ExpandedNodeHierarchy expandedNodeHierarchy = createExpandedNodeHierarchy(jcrSession,
    contentRootPath, Collections.singletonList(selectedPath));
org.hippoecm.hst.core.requestResolvedSiteMapItemgetRelativeContentPath

Javadoc

This method returns a content path, relative to the org.hippoecm.hst.configuration.site.HstSite#getContentPath(). This value should have resolved property placeholders, like ${1}/${2}. If a property placeholder cannot be resolved, the implementation may return null

Popular methods of ResolvedSiteMapItem

  • getHstSiteMapItem
  • getPathInfo
    Returns a relative path from hst request path to the SiteMapItem that was matched. This path never s
  • getHstComponentConfiguration
  • getResolvedSiteMount
  • getErrorCode
  • getNamedPipeline
    Returns the namedPipeline to be used for the Hst Request Processing. When the backing HstSiteMapItem
  • getParameters
    Return the parameter map from the HstSiteMapItem configuration, but all values containing property p
  • getResolvedMount
  • getRoles
  • getPageTitle
  • getParameter
    Returns a property from the HstSiteMapItem configuration but should have replaced possible property
  • getPortletHstComponentConfiguration
  • getParameter,
  • getPortletHstComponentConfiguration,
  • getStatusCode,
  • getUsers,
  • isAuthenticated,
  • isSecured

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now