Class ContentUtilInternal


  • public class ContentUtilInternal
    extends java.lang.Object
    Content utilities.
    Since:
    10.2.0
    Version:
    $Revision$ $Date$
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Optional<ContentUniqueSlug> findAlternativeSlug​(ContentUniqueSlug uniqueSlug)
      Returns an optional alternative unique slug.
      static java.util.Optional<Tuple2<java.lang.String,​java.util.Locale>> findContentLocaleByUniqueSlug​(ContentUniqueSlug uniqueSlug)
      Returns an optional Tuple of of the content that refer to the given unique slug.
      static java.lang.String getContentId​(java.lang.String id)
      Returns the content identifier based on the given identifier or null if none could be inferred.
      static java.lang.String getItemId​(java.lang.String id, java.lang.String localeId)
      Returns the item identifier based on the given identifier or null if none could be inferred.
      static boolean isContentPublished​(java.lang.String contentId)
      Returns whether the content with the given identifier exists and it is published.
      static boolean isContentPublished​(java.lang.String contentId, boolean ignorePublishedToPrincipals)
      Returns whether the content with the given identifier exists and it is published.
      • Methods inherited from class java.lang.Object

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

      • ContentUtilInternal

        public ContentUtilInternal()
    • Method Detail

      • isContentPublished

        public static boolean isContentPublished​(java.lang.String contentId)
                                          throws PortalException
        Returns whether the content with the given identifier exists and it is published.
        Parameters:
        contentId - the content identifier.
        Returns:
        whether the content with the given identifier exists and it is published.
        Throws:
        PortalException
        Since:
        10.2.0
      • isContentPublished

        public static boolean isContentPublished​(java.lang.String contentId,
                                                 boolean ignorePublishedToPrincipals)
                                          throws PortalException
        Returns whether the content with the given identifier exists and it is published.
        Parameters:
        ignorePublishedToPrincipals - indicates whether the publish to principals information should be ignored.
        contentId - the content identifier.
        Returns:
        whether the content with the given identifier exists and it is published.
        Throws:
        PortalException
        Since:
        15.0.1
      • getItemId

        public static java.lang.String getItemId​(java.lang.String id,
                                                 java.lang.String localeId)
                                          throws PortalException
        Returns the item identifier based on the given identifier or null if none could be inferred. Tries to use the given identifier as item id or contentId.
        Parameters:
        id - the identifier.
        localeId - the desired locale.
        Returns:
        the item identifier based on the given identifier or null if none could be inferred
        Throws:
        PortalException
        Since:
        11.1.0
      • getContentId

        public static java.lang.String getContentId​(java.lang.String id)
                                             throws PortalException
        Returns the content identifier based on the given identifier or null if none could be inferred. Tries to use the given identifier as item id or contentId.
        Parameters:
        id - the identifier.
        Returns:
        the item identifier based on the given identifier or null if none could be inferred
        Throws:
        PortalException
        Since:
        11.1.0
      • findContentLocaleByUniqueSlug

        public static java.util.Optional<Tuple2<java.lang.String,​java.util.Locale>> findContentLocaleByUniqueSlug​(ContentUniqueSlug uniqueSlug)
                                                                                                                 throws PortalException
        Returns an optional Tuple of of the content that refer to the given unique slug.
        Parameters:
        uniqueSlug - the unique slug
        Returns:
        an optional Tuple of of the content that refer to the given unique slug.
        Throws:
        PortalException
        Since:
        14.1.0
      • findAlternativeSlug

        public static java.util.Optional<ContentUniqueSlug> findAlternativeSlug​(ContentUniqueSlug uniqueSlug)
                                                                         throws PortalException
        Returns an optional alternative unique slug.
        Parameters:
        uniqueSlug - the unique slug
        Returns:
        an optional alternative unique slug.
        Throws:
        PortalException
        Since:
        14.1.0