Package lumis.content.core
Class ContentLocale
- java.lang.Object
-
- lumis.content.core.ContentLocale
-
- All Implemented Interfaces:
Serializable
@StableMinor(version="14.1", sinceVersion="4.2") public class ContentLocale extends Object implements Serializable
Contains the content information for a specific locale. There must be at least oneContentVersion
in each instance of this class.- Since:
- 4.2.0
- Version:
- $Revision: 24684 $ $Date: 2021-08-23 18:58:35 -0300 (Mon, 23 Aug 2021) $
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentComment
addComment()
Adds a new comment.boolean
addTag(String tag)
Associates a tag to thisContentLocale
.ContentVersion
addVersion()
Adds a new version.ContentVersion
addVersionBasedOnAnother(ContentVersion pBaseVersion)
Adds a new version, based on an already existing version.void
delete()
Deletes this instance from persistence.ContentVersion
getActiveVersion()
Returns the active version of the content in this locale.List<ContentComment>
getComments()
Returns the comments for the content in this locale.Content
getContent()
Returns the content this object refers to.String
getCreatedBy()
Returns the identifier of the principal that created this object.Date
getCreatedDateTime()
Returns the creation date-time of this entry.String
getId()
Returns the identifier for this object.Locale
getLocale()
Returns the locale this object refers to.String
getLockedBy()
Returns who created the lock.Date
getLockedDate()
Returns the date the lock was created.LockType
getLockType()
Returns the lock for the current content-locale.ContentVersion
getPublishedVersion()
Returns the published version of the content in this locale.Collection<ContentTag>
getTags()
Returns the tags associated with thisContentLocale
.List<ContentVersion>
getVersions()
Returns the versions for the content in this locale.void
move(Content newContent, Locale newLocale)
Moves this content locale object to another content or locale value.boolean
removeTag(ContentTag contentTag)
Removes the association between thisContentLocale
and the givenContentTag
.void
setCreatedBy(String createdBy)
Sets the principal that created this object.void
setCreatedDateTime(Date createdDateTime)
Sets the date-time this object was created.void
setPublishedVersion(ContentVersion publishedVersion)
Sets the published version of the content in this locale.
-
-
-
Method Detail
-
getId
public String getId()
Returns the identifier for this object.- Returns:
- the identifier for this object.
- Since:
- 4.2.0
-
getCreatedBy
public String getCreatedBy()
Returns the identifier of the principal that created this object.- Returns:
- the principal identifier.
- Since:
- 4.2.0
-
setCreatedBy
public void setCreatedBy(String createdBy)
Sets the principal that created this object.- Parameters:
createdBy
- the principal identifier.- Since:
- 4.2.0
-
getCreatedDateTime
public Date getCreatedDateTime()
Returns the creation date-time of this entry.- Returns:
- the creation date-time of this entry.
- Since:
- 4.2.0
-
setCreatedDateTime
public void setCreatedDateTime(Date createdDateTime)
Sets the date-time this object was created.- Parameters:
createdDateTime
- the date-time this object was created.- Since:
- 4.2.0
-
getLocale
public Locale getLocale()
Returns the locale this object refers to.- Returns:
- the locale.
- Since:
- 4.2.0
-
getActiveVersion
public ContentVersion getActiveVersion()
Returns the active version of the content in this locale.- Returns:
- the active version of the content in this locale.
- Since:
- 4.2.0
-
getPublishedVersion
public ContentVersion getPublishedVersion()
Returns the published version of the content in this locale.- Returns:
- the published version of the content in this locale.
- Since:
- 4.2.0
-
setPublishedVersion
public void setPublishedVersion(ContentVersion publishedVersion)
Sets the published version of the content in this locale.- Parameters:
publishedVersion
- the published version to set.- Since:
- 4.2.0
-
getComments
public List<ContentComment> getComments()
Returns the comments for the content in this locale. The comments are ordered chronologically.- Returns:
- the comments for the content in this locale.
- Since:
- 4.2.0
-
getVersions
public List<ContentVersion> getVersions()
Returns the versions for the content in this locale. The versions are ordered chronologically.- Returns:
- the versions for the content in this locale.
- Since:
- 4.2.0
- See Also:
addVersion()
-
getTags
public Collection<ContentTag> getTags()
Returns the tags associated with thisContentLocale
.- Returns:
- a unmodifiable collection containing
ContentTag
s associated with thisContentLocale
. - Since:
- 9.0.0
- See Also:
addTag(String)
,removeTag(ContentTag)
-
getContent
public Content getContent()
Returns the content this object refers to.- Returns:
- the content this object refers to.
- Since:
- 4.2.0
-
addComment
public ContentComment addComment()
Adds a new comment.- Returns:
- the comment added.
- Since:
- 4.2.0
- See Also:
getComments()
-
addVersion
public ContentVersion addVersion()
Adds a new version. The version added will be made active.- Returns:
- the new version added.
- Since:
- 4.2.0
- See Also:
getVersions()
,getActiveVersion()
,addVersionBasedOnAnother(ContentVersion)
-
addVersionBasedOnAnother
public ContentVersion addVersionBasedOnAnother(ContentVersion pBaseVersion)
Adds a new version, based on an already existing version. The version added will be made active.- Parameters:
baseVersion
- the version that will be used as a base to create the new version to be added.- Returns:
- the added version.
- Since:
- 4.2.0
- See Also:
addVersion()
-
delete
public void delete() throws PortalException
Deletes this instance from persistence. This will also delete all content versions that belongs to this locale.- Throws:
PortalException
- Since:
- 4.2.0
-
move
public void move(Content newContent, Locale newLocale) throws PortalException
Moves this content locale object to another content or locale value.Deletes this contentLocale's original content, if it becomes empty after the move is performed. In this case, association references to that content is updated to refer to contentLocale's new content.
- Parameters:
newContent
- a persisted content, to which this content locale is to be moved to. Ifnull
, this content locale will be moved to a new content.newLocale
- the locale to set in this contentLocale.- Throws:
PortalObjectAlreadyExistsException
- if this operation would result in a content having more than one contentLocale with the same locale value.PortalException
- Since:
- 4.2.0
-
getLockType
public LockType getLockType()
Returns the lock for the current content-locale.- Returns:
- the current lock for this content-locale.
- Since:
- 6.0.0
-
getLockedBy
public String getLockedBy()
Returns who created the lock.- Returns:
- the lockedBy userId of the holder of the current lock
- Since:
- 6.0.0
-
getLockedDate
public Date getLockedDate()
Returns the date the lock was created.- Returns:
- the lockedDate date of the lock creation date/time.
- Since:
- 6.0.0
-
addTag
public boolean addTag(String tag)
Associates a tag to thisContentLocale
. Returns true if the tag was associated to thisContentLocale
, otherwise return false.If the given tag name corresponds to a tag's active content version in the same tag repository, that tag is used for the association. Otherwise a new tag is created for the association.
The tag name comparison is case insensitive.
The max length of a tag name is 30 characters.
- Parameters:
tag
- the tag name.- Returns:
- true if the tag was associated to this
ContentLocale
, false otherwise. - Throws:
IllegalArgumentException
- if the given tag name is not valid.IllegalStateException
- if the tag repository is not associated to the content repository.- Since:
- 9.0.0
- See Also:
removeTag(ContentTag)
,getTags()
-
removeTag
public boolean removeTag(ContentTag contentTag)
Removes the association between thisContentLocale
and the givenContentTag
.- Parameters:
contentTag
- , the content tag.- Returns:
- true if the tag was dissociated, false otherwise.
- Since:
- 9.0.0
- See Also:
addTag(String)
,getTags()
-
-