Class SeoServiceUtil


  • public class SeoServiceUtil
    extends java.lang.Object
    Utility class for SEO Service
    Since:
    10.1.0
    Version:
    $Revision: 20873 $ $Date: 2018-01-05 17:31:56 -0200 (Fri, 05 Jan 2018) $
    • Constructor Summary

      Constructors 
      Constructor Description
      SeoServiceUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.URL getCanonicalUrl​(java.lang.String pageId, java.util.Locale locale)
      Returns the canonical URL for the specified page SeoRule if defined.
      static java.lang.String getPageDescription​(java.lang.String pageId, java.util.Locale locale)
      Returns the description for the specified page SeoRule if defined.
      static java.lang.String getPageSocialDescription​(java.lang.String pageId, java.util.Locale locale)
      Returns the social description for the specified page SeoRule if defined.
      static java.lang.String getPageSocialImageFileId​(java.lang.String pageId, java.util.Locale locale)
      Returns the social image file id for the specified page SeoRule if defined.
      static java.lang.String getPageSocialTitle​(java.lang.String pageId, java.util.Locale locale)
      Returns the social title for the specified page SeoRule if defined.
      static java.lang.String getPageTitle​(java.lang.String pageId, java.util.Locale locale)
      Returns the title for the specified page SeoRule if defined.
      static java.lang.String getPageTitlePattern​(java.lang.String pageId, java.util.Locale locale)
      Returns the page title pattern for the given page and locale.
      static java.lang.String getUrlPathByChannelId​(java.lang.String channelId, java.util.Locale locale)
      Returns the url path for the specified channel SeoRule if defined.
      static java.lang.String getUrlPathByPageId​(java.lang.String pageId, java.util.Locale locale)
      Returns the url path for the specified PageConfig#getId( page) SeoRule if defined.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SeoServiceUtil

        public SeoServiceUtil()
    • Method Detail

      • getCanonicalUrl

        public static java.net.URL getCanonicalUrl​(java.lang.String pageId,
                                                   java.util.Locale locale)
                                            throws PortalException
        Returns the canonical URL for the specified page SeoRule if defined.
        Parameters:
        pageId - The identifier of the PageConfig linked to the SeoRule
        Returns:
        the canonicalUrl or null if no canonical URL is defined.
        Throws:
        PortalException
        Since:
        10.1.0
      • getPageTitle

        public static java.lang.String getPageTitle​(java.lang.String pageId,
                                                    java.util.Locale locale)
                                             throws PortalException
        Returns the title for the specified page SeoRule if defined.
        Parameters:
        pageId - The identifier of the PageConfig linked to the SeoRule
        locale - The locale of the SeoRule containing the title
        Returns:
        The title or null if no title is defined.
        Throws:
        PortalException
        Since:
        10.1.0
      • getPageDescription

        public static java.lang.String getPageDescription​(java.lang.String pageId,
                                                          java.util.Locale locale)
                                                   throws PortalException
        Returns the description for the specified page SeoRule if defined.
        Parameters:
        pageId - The identifier of the PageConfig linked to the SeoRule
        locale - The locale of the SeoRule containing the description
        Returns:
        The description or null if no description is defined.
        Throws:
        PortalException
        Since:
        10.1.0
      • getUrlPathByPageId

        public static java.lang.String getUrlPathByPageId​(java.lang.String pageId,
                                                          java.util.Locale locale)
                                                   throws PortalException
        Returns the url path for the specified PageConfig#getId( page) SeoRule if defined.
        Parameters:
        pageId - The identifier of the PageConfig linked to the SeoRule
        locale - The locale of the SeoRule containing the urlPath
        Returns:
        The urlPath of the desired channel or null
        Throws:
        PortalException
        Since:
        10.1.0
      • getUrlPathByChannelId

        public static java.lang.String getUrlPathByChannelId​(java.lang.String channelId,
                                                             java.util.Locale locale)
                                                      throws PortalException
        Returns the url path for the specified channel SeoRule if defined.
        Parameters:
        channelId - The identifier of the ChannelConfig linked to the SeoRule
        locale - The locale of the SeoRule containing the urlPath
        Returns:
        The urlPath of the desired channel or null
        Throws:
        PortalException
        Since:
        10.1.0
      • getPageSocialTitle

        public static java.lang.String getPageSocialTitle​(java.lang.String pageId,
                                                          java.util.Locale locale)
                                                   throws PortalException
        Returns the social title for the specified page SeoRule if defined.
        Parameters:
        pageId - The identifier of the PageConfig linked to the SeoRule
        locale - The locale of the SeoRule containing the title
        Returns:
        The social title or null if no social title is defined.
        Throws:
        PortalException
        Since:
        10.1.0
      • getPageSocialDescription

        public static java.lang.String getPageSocialDescription​(java.lang.String pageId,
                                                                java.util.Locale locale)
                                                         throws PortalException
        Returns the social description for the specified page SeoRule if defined.
        Parameters:
        pageId - The identifier of the PageConfig linked to the SeoRule
        locale - The locale of the SeoRule containing the description
        Returns:
        The social description or null if no social description is defined.
        Throws:
        PortalException
        Since:
        10.1.0
      • getPageSocialImageFileId

        public static java.lang.String getPageSocialImageFileId​(java.lang.String pageId,
                                                                java.util.Locale locale)
                                                         throws PortalException
        Returns the social image file id for the specified page SeoRule if defined.
        Parameters:
        pageId - The identifier of the PageConfig linked to the SeoRule
        locale - The Locale of the SeoRule containing the image
        Returns:
        The social image file id or null if no social image is defined.
        Throws:
        PortalException
        Since:
        10.2.0
      • getPageTitlePattern

        public static java.lang.String getPageTitlePattern​(java.lang.String pageId,
                                                           java.util.Locale locale)
                                                    throws PortalException
        Returns the page title pattern for the given page and locale.
        Parameters:
        pageId - the page.
        locale - the locale.
        Returns:
        the page title pattern for the given page and locale.
        Throws:
        PortalException
        Since:
        10.2.0