Package lumis.content.core
Class ContentVersion
- java.lang.Object
-
- lumis.content.core.ContentVersion
-
- All Implemented Interfaces:
Serializable
@StableMinor(version="14.1", sinceVersion="10.2") public class ContentVersion extends Object implements 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: 24684 $ $Date: 2021-08-23 18:58:35 -0300 (Mon, 23 Aug 2021) $
- 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 thisversion
.URL
getCanonicalUrl()
Returns the canonical URL to be used on the detail page that displays this content.Collection<ContentAssociation>
getContentAssociations()
Returns the contents associated with this version.ContentLocale
getContentLocale()
Returns the content-locale object this version belongs to.String
getId()
Returns the identifier for this content version.String
getIntroduction()
Returns the introduction for this content version.String
getItemId()
Returns the identifier for the business data this content version refers to.String
getLastModifiedBy()
Returns the identifier of the last principal that modified this version.Date
getLastModifiedDateTime()
Returns the last modification date-time for this version.String
getPageSimpleTitle()
Returns the simple title to be used on the detail page that displays this content.String
getPageTitlePattern()
Returns the page title pattern to be used on the detail page that displays this content.String
getPrimaryName()
Returns the primary name for this content version.Collection<ContentPublication>
getPublications()
Returns the publications defined for this version.String
getSeoDescription()
Returns the description specific for SEO.String
getSlug()
Returns the slug.String
getSocialDescription()
Returns the description specific for social usage.String
getSocialImageMediaId()
Returns the media identifier for the image specific for social usage.String
getSocialTitle()
Returns the title specific for social usage.String
getUrlPath()
Returns the content version's URL friendly path customized by the publisher.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.void
setCanonicalUrl(URL canonicalUrl)
Sets the canonical URL to be used on the detail page that displays this content.void
setIntroduction(String introduction)
Returns the introduction for this content version.void
setItemId(String itemId)
Specifies the business data this content version refers to.void
setLastModifiedBy(String lastModifiedBy)
Sets the identifier of the last principal that modified this version.void
setLastModifiedDateTime(Date lastModifiedDateTime)
Sets the last modification date-time for this version.void
setPageSimpleTitle(String pageTitle)
Sets the simple title to be used on the detail page that displays this content.void
setPageTitlePattern(String pageTitlePattern)
Sets the page title pattern to be used on the detail page that displays this content.void
setPrimaryName(String primaryName)
Sets the primary name for this content version.void
setSeoDescription(String seoDescription)
Sets the description specific for SEO.void
setSlug(String slug)
Sets the slug.void
setSocialDescription(String socialDescription)
Sets the description specific for social usage.void
setSocialImageMediaId(String mediaId)
Sets the image specific for social usage.void
setSocialTitle(String socialTitle)
Sets the title specific for social usage.void
setUrlPath(String urlPath)
Sets the content version's URL friendly path customized by the publisher.void
setUrlTitle(String urlTitle)
Sets the title to be used when generating the URL for the detail page that displays this content.
-
-
-
Method Detail
-
getId
public String getId()
Returns the identifier for this content version.- Returns:
- the identifier for this content version.
- Since:
- 4.2.0
-
getItemId
public 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(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 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(String lastModifiedBy)
Sets the identifier of the last principal that modified this version.- Parameters:
lastModifiedBy
- the principal identifier.- Since:
- 4.2.0
-
getLastModifiedDateTime
public 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(Date lastModifiedDateTime)
Sets the last modification date-time for this version.- Parameters:
lastModifiedDateTime
- the date-time to set.- Since:
- 4.2.0
-
getPrimaryName
public String getPrimaryName()
Returns the primary name for this content version.- Returns:
- the primary name.
- Since:
- 4.2.0
-
setPrimaryName
public void setPrimaryName(String primaryName)
Sets the primary name for this content version.- Parameters:
primaryName
- the primary name.- Since:
- 4.2.0
-
getIntroduction
public String getIntroduction()
Returns the introduction for this content version.- Returns:
- the introduction
- Since:
- 4.2.0
-
setIntroduction
public void setIntroduction(String introduction)
Returns the introduction for this content version.- Parameters:
introduction
-- Since:
- 4.2.0
-
getContentAssociations
public 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
-
addContentAssociation
public ContentAssociation addContentAssociation()
-
getPublications
public Collection<ContentPublication> getPublications()
Returns the publications defined for this version.- Returns:
- an unmodifiable view of this version's publications.
- Since:
- 4.2.0
- See Also:
addPublication()
,ContentPublication.delete()
-
getContentLocale
public ContentLocale getContentLocale()
Returns the content-locale object this version belongs to.- Returns:
- the content-locale object.
- Since:
- 4.2.0
-
getPageSimpleTitle
public 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(String pageTitle)
Sets the simple title to be used on the detail page that displays this content.- Parameters:
pageTitle
- the simple title ornull
if there is no specific page simple title.- Since:
- 10.2.0
-
getPageTitlePattern
public 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(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 ornull
if no specific page title pattern was specified.- Since:
- 10.2.0
-
getCanonicalUrl
public 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(URL canonicalUrl)
Sets the canonical URL to be used on the detail page that displays this content.- Parameters:
canonicalUrl
- the canonical URL ornull
if there is no specific canonical URL.- Since:
- 10.1.0
-
getUrlTitle
public 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(String urlTitle)
Sets the title to be used when generating the URL for the detail page that displays this content.- Parameters:
urlTitle
- the title ornull
if there is no specific title for URL.- Since:
- 10.0.0
-
getSeoDescription
public 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(String seoDescription)
Sets the description specific for SEO.- Parameters:
seoDescription
- the description to be used for SEO ornull
if there is no description specific for SEO.- Since:
- 10.0.0
-
getSocialTitle
public 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(String socialTitle)
Sets the title specific for social usage.- Parameters:
socialTitle
- the title to be used for social ornull
if there is no title specific for social.- Since:
- 10.0.0
-
getSocialDescription
public 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(String socialDescription)
Sets the description specific for social usage.- Parameters:
socialDescription
- the description to be used for social ornull
if there is no description specific for social.- Since:
- 10.0.0
-
getSocialImageMediaId
public 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(String mediaId)
Sets the image specific for social usage.- Parameters:
mediaId
- the media identifier ornull
if there is no image specific for social.- Since:
- 10.0.0
-
getUrlPath
public 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(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
-
addPublication
public ContentPublication addPublication()
Adds a new publication for this version.- Returns:
- the new publication added.
- Since:
- 4.2.0
- See Also:
getPublications()
-
delete
public void delete() throws PortalException
Deletes thisversion
.- Throws:
PortalException
- Since:
- 6.0.0
-
getSlug
public String getSlug()
Returns the slug.- Returns:
- the slug.
- Since:
- 14.1.0
-
setSlug
public void setSlug(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
-
-