Class ContentLocale

    • 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()
      • getContent

        public Content getContent()
        Returns the content this object refers to.
        Returns:
        the content this object refers to.
        Since:
        4.2.0
      • 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. If null, 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 this ContentLocale. Returns true if the tag was associated to this ContentLocale, 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 this ContentLocale and the given ContentTag.
        Parameters:
        contentTag - , the content tag.
        Returns:
        true if the tag was dissociated, false otherwise.
        Since:
        9.0.0
        See Also:
        addTag(String), getTags()