Class DefaultSiteThumbnailResolver

    • Constructor Detail

      • DefaultSiteThumbnailResolver

        public DefaultSiteThumbnailResolver()
    • Method Detail

      • resolveHomepageThumbnailUrl

        public java.util.Optional<java.lang.String> resolveHomepageThumbnailUrl​(CMSSiteModel cmsSiteModel)
        Description copied from interface: SiteThumbnailResolver
        Can be called to resolve the homepage thumbnail url. In the event you need to act on the URL you can override this method and resolve the URL in an alternative way.
        Specified by:
        resolveHomepageThumbnailUrl in interface SiteThumbnailResolver
        Parameters:
        cmsSiteModel - the cmsSiteModel
        Returns:
        Optional thumbnail url
      • resolveHomepageThumbnailUrl

        public java.util.Optional<java.lang.String> resolveHomepageThumbnailUrl​(CatalogVersionModel catalogVersion)
        Description copied from interface: SiteThumbnailResolver
        Can be called to resolve the homepage thumbnail url for a given catalog version.
        Specified by:
        resolveHomepageThumbnailUrl in interface SiteThumbnailResolver
        Parameters:
        catalogVersion - the catalog version containing the homepage
        Returns:
        Optional thumbnail url
      • resolveHomepageThumbnailUrl

        protected java.util.Optional<java.lang.String> resolveHomepageThumbnailUrl​(ContentPageModel homepage)
        Can be called to resolve the homepage thumbnail url. This method will also replace any leading '~' with a '/' using the replacePrefixTildeWithSlash(String) method.
        Parameters:
        homepage - the ContentPageModel representing the homepage
        Returns:
        Optional thumbnail url; Optional.empty() when no url is found
      • replacePrefixTildeWithSlash

        protected java.lang.String replacePrefixTildeWithSlash​(java.lang.String thumbnailUri)
        Used to replace a leading '~' with a '/'
         replacePrefixTildeWithSlash("~/someUri")    = "/someUri"
         replacePrefixTildeWithSlash("~someUri")     = "/someUri"
         replacePrefixTildeWithSlash("~//someUri")   = "//someUri"
         
        Parameters:
        thumbnailUri - a uri to a thumbnail
        Returns:
        A uri with the '~' removed
      • setCmsAdminPageService

        public void setCmsAdminPageService​(CMSAdminPageService cmsAdminPageService)
      • setCmsAdminSiteService

        public void setCmsAdminSiteService​(CMSAdminSiteService cmsAdminSiteService)
      • setCmsCatalogVersionService

        public void setCmsCatalogVersionService​(CMSCatalogVersionService cmsCatalogVersionService)