Class ContentVersion

  • All Implemented Interfaces:
    java.io.Serializable

    @StableMinor(version="16.0",
                 sinceVersion="10.2")
    public class ContentVersion
    extends java.lang.Object
    implements java.io.Serializable
    Represents a specific version of a content. A content version contains publication definition, metadata and a reference to the business data it relates to.

    If a content contains versioning support, it should always create a new content version instead of modifying the existing one. If the content does not contains versioning support, only one version will exist for each ContentLocale and this version should be modified when edited.

    Since:
    4.2.0
    Version:
    $Revision: 25809 $ $Date: 2023-07-04 15:23:22 -0300 (Tue, 04 Jul 2023) $
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ContentVersion()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ContentAssociation addContentAssociation()  
      ContentPublication addPublication()
      Adds a new publication for this version.
      void delete()
      Deletes this version.
      java.net.URL getCanonicalUrl()
      Returns the canonical URL to be used on the detail page that displays this content.
      java.util.Collection<ContentAssociation> getContentAssociations()
      Returns the contents associated with this version.
      ContentLocale getContentLocale()
      Returns the content-locale object this version belongs to.
      java.lang.String getId()
      Returns the identifier for this content version.
      java.lang.String getIntroduction()
      Returns the introduction for this content version.
      java.lang.String getItemId()
      Returns the identifier for the business data this content version refers to.
      java.lang.String getLastModifiedBy()
      Returns the identifier of the last principal that modified this version.
      java.util.Date getLastModifiedDateTime()
      Returns the last modification date-time for this version.
      java.lang.String getPageSimpleTitle()
      Returns the simple title to be used on the detail page that displays this content.
      java.lang.String getPageTitlePattern()
      Returns the page title pattern to be used on the detail page that displays this content.
      java.lang.String getPrimaryName()
      Returns the primary name for this content version.
      java.util.Collection<ContentPublication> getPublications()
      Returns the publications defined for this version.
      java.lang.String getSeoDescription()
      Returns the description specific for SEO.
      java.lang.String getSlug()
      Returns the slug.
      java.lang.String getSocialDescription()
      Returns the description specific for social usage.
      java.lang.String getSocialImageMediaId()
      Returns the media identifier for the image specific for social usage.
      java.lang.String getSocialTitle()
      Returns the title specific for social usage.
      java.lang.String getUrlPath()
      Returns the content version's URL friendly path customized by the publisher.
      java.lang.String getUrlTitle()
      Returns the title to be used when generating the URL for the detail page that displays this content.
      int getVersionNumber()
      Returns this version's number.
      boolean isPrimaryContent()
      Returns the value of the primaryContent.
      void setCanonicalUrl​(java.net.URL canonicalUrl)
      Sets the canonical URL to be used on the detail page that displays this content.
      void setIntroduction​(java.lang.String introduction)
      Returns the introduction for this content version.
      void setItemId​(java.lang.String itemId)
      Specifies the business data this content version refers to.
      void setLastModifiedBy​(java.lang.String lastModifiedBy)
      Sets the identifier of the last principal that modified this version.
      void setLastModifiedDateTime​(java.util.Date lastModifiedDateTime)
      Sets the last modification date-time for this version.
      void setPageSimpleTitle​(java.lang.String pageTitle)
      Sets the simple title to be used on the detail page that displays this content.
      void setPageTitlePattern​(java.lang.String pageTitlePattern)
      Sets the page title pattern to be used on the detail page that displays this content.
      void setPrimaryContent​(boolean isPrimaryContent)
      Sets the value of the PrimaryContent.
      void setPrimaryName​(java.lang.String primaryName)
      Sets the primary name for this content version.
      void setSeoDescription​(java.lang.String seoDescription)
      Sets the description specific for SEO.
      void setSlug​(java.lang.String slug)
      Sets the slug.
      void setSocialDescription​(java.lang.String socialDescription)
      Sets the description specific for social usage.
      void setSocialImageMediaId​(java.lang.String mediaId)
      Sets the image specific for social usage.
      void setSocialTitle​(java.lang.String socialTitle)
      Sets the title specific for social usage.
      void setUrlPath​(java.lang.String urlPath)
      Sets the content version's URL friendly path customized by the publisher.
      void setUrlTitle​(java.lang.String urlTitle)
      Sets the title to be used when generating the URL for the detail page that displays this content.
      • Methods inherited from class java.lang.Object

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

      • ContentVersion

        public ContentVersion()
    • Method Detail

      • getId

        public java.lang.String getId()
        Returns the identifier for this content version.
        Returns:
        the identifier for this content version.
        Since:
        4.2.0
      • getItemId

        public java.lang.String getItemId()
        Returns the identifier for the business data this content version refers to.
        Returns:
        the identifier for the business data this content version refers to.
        Since:
        4.2.0
      • setItemId

        public void setItemId​(java.lang.String itemId)
        Specifies the business data this content version refers to.
        Since:
        4.2.0
      • getVersionNumber

        public int getVersionNumber()
        Returns this version's number.
        Returns:
        the version number.
        Since:
        4.2.0
      • getLastModifiedBy

        public java.lang.String getLastModifiedBy()
        Returns the identifier of the last principal that modified this version.
        Returns:
        the principal identifier.
        Since:
        4.2.0
      • setLastModifiedBy

        public void setLastModifiedBy​(java.lang.String lastModifiedBy)
        Sets the identifier of the last principal that modified this version.
        Parameters:
        lastModifiedBy - the principal identifier.
        Since:
        4.2.0
      • getLastModifiedDateTime

        public java.util.Date getLastModifiedDateTime()
        Returns the last modification date-time for this version.
        Returns:
        the last modification date-time for this version.
        Since:
        4.2.0
      • setLastModifiedDateTime

        public void setLastModifiedDateTime​(java.util.Date lastModifiedDateTime)
        Sets the last modification date-time for this version.
        Parameters:
        lastModifiedDateTime - the date-time to set.
        Since:
        4.2.0
      • getPrimaryName

        public java.lang.String getPrimaryName()
        Returns the primary name for this content version.
        Returns:
        the primary name.
        Since:
        4.2.0
      • setPrimaryName

        public void setPrimaryName​(java.lang.String primaryName)
        Sets the primary name for this content version.
        Parameters:
        primaryName - the primary name.
        Since:
        4.2.0
      • getIntroduction

        public java.lang.String getIntroduction()
        Returns the introduction for this content version.
        Returns:
        the introduction
        Since:
        4.2.0
      • setIntroduction

        public void setIntroduction​(java.lang.String introduction)
        Returns the introduction for this content version.
        Parameters:
        introduction -
        Since:
        4.2.0
      • getContentAssociations

        public java.util.Collection<ContentAssociation> getContentAssociations()
        Returns the contents associated with this version. The returned collection may be changed to edit which contents are associated with this content version.
        Returns:
        the contents associated with this version.
        Since:
        4.2.0
      • getContentLocale

        public ContentLocale getContentLocale()
        Returns the content-locale object this version belongs to.
        Returns:
        the content-locale object.
        Since:
        4.2.0
      • getPageSimpleTitle

        public java.lang.String getPageSimpleTitle()
        Returns the simple title to be used on the detail page that displays this content.
        Returns:
        the simple title or null if no specific page title was specified.
        Since:
        10.2.0
      • setPageSimpleTitle

        public void setPageSimpleTitle​(java.lang.String pageTitle)
        Sets the simple title to be used on the detail page that displays this content.
        Parameters:
        pageTitle - the simple title or null if there is no specific page simple title.
        Since:
        10.2.0
      • getPageTitlePattern

        public java.lang.String getPageTitlePattern()
        Returns the page title pattern to be used on the detail page that displays this content.
        Returns:
        the page title pattern or null if no specific page title pattern was specified.
        Since:
        10.2.0
      • setPageTitlePattern

        public void setPageTitlePattern​(java.lang.String pageTitlePattern)
        Sets the page title pattern to be used on the detail page that displays this content.
        Parameters:
        pageTitlePattern - the page title pattern to be used on the detail page that displays this content or null if no specific page title pattern was specified.
        Since:
        10.2.0
      • getCanonicalUrl

        public java.net.URL getCanonicalUrl()
        Returns the canonical URL to be used on the detail page that displays this content.
        Returns:
        the canonical URL or null if no specific canonical URL was specified.
        Since:
        10.1.0
      • setCanonicalUrl

        public void setCanonicalUrl​(java.net.URL canonicalUrl)
        Sets the canonical URL to be used on the detail page that displays this content.
        Parameters:
        canonicalUrl - the canonical URL or null if there is no specific canonical URL.
        Since:
        10.1.0
      • getUrlTitle

        public java.lang.String getUrlTitle()
        Returns the title to be used when generating the URL for the detail page that displays this content.
        Returns:
        the title or null if no specific title for URL was specified.
        Since:
        10.0.0
      • setUrlTitle

        public void setUrlTitle​(java.lang.String urlTitle)
        Sets the title to be used when generating the URL for the detail page that displays this content.
        Parameters:
        urlTitle - the title or null if there is no specific title for URL.
        Since:
        10.0.0
      • getSeoDescription

        public java.lang.String getSeoDescription()
        Returns the description specific for SEO.
        Returns:
        the description or null if no description specific for SEO was defined.
        Since:
        10.0.0
      • setSeoDescription

        public void setSeoDescription​(java.lang.String seoDescription)
        Sets the description specific for SEO.
        Parameters:
        seoDescription - the description to be used for SEO or null if there is no description specific for SEO.
        Since:
        10.0.0
      • getSocialTitle

        public java.lang.String getSocialTitle()
        Returns the title specific for social usage.
        Returns:
        the title or null if no title specific for social was defined.
        Since:
        10.0.0
      • setSocialTitle

        public void setSocialTitle​(java.lang.String socialTitle)
        Sets the title specific for social usage.
        Parameters:
        socialTitle - the title to be used for social or null if there is no title specific for social.
        Since:
        10.0.0
      • getSocialDescription

        public java.lang.String getSocialDescription()
        Returns the description specific for social usage.
        Returns:
        the description or null if no description specific for social was defined.
        Since:
        10.0.0
      • setSocialDescription

        public void setSocialDescription​(java.lang.String socialDescription)
        Sets the description specific for social usage.
        Parameters:
        socialDescription - the description to be used for social or null if there is no description specific for social.
        Since:
        10.0.0
      • getSocialImageMediaId

        public java.lang.String getSocialImageMediaId()
        Returns the media identifier for the image specific for social usage.
        Returns:
        the media identifier or null if there is no media specific for social.
        Since:
        10.0.0
      • setSocialImageMediaId

        public void setSocialImageMediaId​(java.lang.String mediaId)
        Sets the image specific for social usage.
        Parameters:
        mediaId - the media identifier or null if there is no image specific for social.
        Since:
        10.0.0
      • getUrlPath

        public java.lang.String getUrlPath()
        Returns the content version's URL friendly path customized by the publisher.
        Returns:
        the content version's URL friendly path customized by the publisher.
        Since:
        12.5.0
      • setUrlPath

        public void setUrlPath​(java.lang.String urlPath)
        Sets the content version's URL friendly path customized by the publisher.
        Parameters:
        urlPath - the content version's URL friendly path customized by the publisher.
        Since:
        12.5.0
      • isPrimaryContent

        public boolean isPrimaryContent()
        Returns the value of the primaryContent.
        Returns:
        the primaryContent value.
        Since:
        15.0.0
      • setPrimaryContent

        public void setPrimaryContent​(boolean isPrimaryContent)
        Sets the value of the PrimaryContent.
        Parameters:
        primaryContent - the boolean value.
        Since:
        15.0.0
      • addPublication

        public ContentPublication addPublication()
        Adds a new publication for this version.
        Returns:
        the new publication added.
        Since:
        4.2.0
        See Also:
        getPublications()
      • getSlug

        public java.lang.String getSlug()
        Returns the slug.
        Returns:
        the slug.
        Since:
        14.1.0
      • setSlug

        public void setSlug​(java.lang.String slug)
                     throws ContentException
        Sets the slug.
        Parameters:
        slug - the slug.
        Throws:
        ContentException - if the slug has a length greater then 100 or has an invalid format.
        Since:
        14.1.0