Package lumis.content.core
Class ContentLocale
- java.lang.Object
-
- lumis.content.core.ContentLocale
-
- All Implemented Interfaces:
java.io.Serializable
@StableMinor(version="16.1", sinceVersion="4.2") public class ContentLocale extends java.lang.Object implements java.io.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: 26157 $ $Date: 2024-01-13 11:35:03 -0300 (Sat, 13 Jan 2024) $
- 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(java.lang.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.java.util.List<ContentComment>
getComments()
Returns the comments for the content in this locale.Content
getContent()
Returns the content this object refers to.java.lang.String
getCreatedBy()
Returns the identifier of the principal that created this object.java.util.Date
getCreatedDateTime()
Returns the creation date-time of this entry.java.lang.String
getId()
Returns the identifier for this object.java.util.Locale
getLocale()
Returns the locale this object refers to.java.lang.String
getLockedBy()
Returns who created the lock.java.util.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.java.util.Collection<ContentTag>
getTags()
Returns the tags associated with thisContentLocale
.java.util.List<ContentVersion>
getVersions()
Returns the versions for the content in this locale.void
move(Content newContent, java.util.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(java.lang.String createdBy)
Sets the principal that created this object.void
setCreatedDateTime(java.util.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 java.lang.String getId()
Returns the identifier for this object.- Returns:
- the identifier for this object.
- Since:
- 4.2.0
-
getCreatedBy
public java.lang.String getCreatedBy()
Returns the identifier of the principal that created this object.- Returns:
- the principal identifier.
- Since:
- 4.2.0
-
setCreatedBy
public void setCreatedBy(java.lang.String createdBy)
Sets the principal that created this object.- Parameters:
createdBy
- the principal identifier.- Since:
- 4.2.0
-
getCreatedDateTime
public java.util.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(java.util.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 java.util.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 java.util.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 java.util.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 java.util.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, java.util.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 java.lang.String getLockedBy()
Returns who created the lock.- Returns:
- the lockedBy userId of the holder of the current lock
- Since:
- 6.0.0
-
getLockedDate
public java.util.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(java.lang.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 100 characters.
- Parameters:
tag
- the tag name.- Returns:
- true if the tag was associated to this
ContentLocale
, false otherwise. - Throws:
java.lang.IllegalArgumentException
- if the given tag name is not valid.java.lang.IllegalStateException
- if the tag repository is not associated to the content repository.- Since:
- 16.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()
-
-