Package nl.gx.webmanager.cms.core
Interface ContentItemVersion<T extends ContentItem<?>>
-
- All Superinterfaces:
PublicationStatusEnabled
,WorkflowEnabled
- All Known Subinterfaces:
MediaItemArticleVersion
,MediaItemDownloadVersion
,MediaItemImageVersion
,MediaItemMultimediaVersion
,MediaItemPageVersion
,MediaItemVersion
,PageVersion
@Indexable public interface ContentItemVersion<T extends ContentItem<?>> extends PublicationStatusEnabled
Definition of a content item version.
-
-
Field Summary
Fields Modifier and Type Field Description static String
LABELCATEGORY_NOCATEGORY
static String
LABELCATEGORY_NOLABEL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createNewRevision()
Creates a new copy of this content item version and saves it as a new revision.void
deleteRevisions()
Deletes all revisions.Image
getAttachedLeadImage()
Returns the file upload lead image associated with this content item version.T
getContentItem()
Returns the master content item.List<String>
getContentLabelCategories()
Returns the categories of labels assigned to this content item.List<String>
getContentLabels()
Returns the labels assigned to this content item.Date
getCreationDate()
Returns creation date of the content item version.User
getCreationUser()
Returns creation user of the content item version.boolean
getHasLead()
Returns if this content item version has a lead.ContentItemVersionId
getIdentifier()
Returns the content item version identifier of this content item version.Language
getLanguage()
Returns the language of this page version.Date
getLastModifiedDate()
Returns last modified date of the content item version.User
getLastModifiedUser()
Returns the last modified user of this content item version.String
getLead()
Returns the lead text.Image
getLeadImage()
Returns the lead image.MediaItem
getLeadImageMediaItem()
Returns the image media item assigned as lead image of this content item version.Image
getLeadImageThumbnail()
Returns the lead image's thumbnail.List<ContentItemRevision>
getPreviousRevisions()
Loads all revisions for this version.String
getRemark()
Returns the remark text.int
getRevisionCount()
Returns the number of revisions that have been created for this item, including the current version.String
getTitle()
Returns the title of this content item version.boolean
isCurrent()
Returns true if this version equals the version returned bygetContentItem()
.ContentItem.getCurrent(Language language)
where language equals the language of this version, false otherwise.boolean
isEditable()
Only editable content can be modified in the rich text editor.boolean
isInContextCurrent()
Returns true if this version equals the version returned by eithergetContentItem()
.ContentItem.getCurrent(Language language)
orgetContentItem()
.ContentItem.getPlanned(Language language)
where language equals the language of this version, false otherwise.void
removeAttachedLeadImage()
Removes the lead image attached to this content item version as an upload file.void
setAttachedLeadImage(FileResource leadImage)
Sets the lead image of this content item version as an upload file associated with this particular content item version.void
setAttachedLeadImageFocusPoint(int x, int y)
Sets the (x, y) focus point for the attached lead image.void
setEditable(boolean isEditable)
Enable or disable editing this content item version.void
setLead(String leadText)
Sets the lead text.void
setLeadImageMediaItem(MediaItem mediaItem)
Sets the lead image of this content item version as reference to an image media item stored in the content repository.void
setRemark(String remark)
Sets the remark text.-
Methods inherited from interface nl.gx.webmanager.cms.core.PublicationStatusEnabled
getExpirationDate, getPublicationDate, getPublicationStatus, getPublicationStatus, setExpirationDate, setPublicationDate
-
Methods inherited from interface nl.gx.webmanager.cms.workflow.WorkflowEnabled
getWorkflowModel, getWorkflowModelInstance, isPublic
-
-
-
-
Field Detail
-
LABELCATEGORY_NOCATEGORY
static final String LABELCATEGORY_NOCATEGORY
- See Also:
- Constant Field Values
-
LABELCATEGORY_NOLABEL
static final String LABELCATEGORY_NOLABEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getContentItem
@Field(adapter=ContentReferenceFieldAdapter.class, indexed=true, boost=0.0) @Document T getContentItem()
Returns the master content item.- Returns:
- the master content item
-
getIdentifier
ContentItemVersionId getIdentifier()
Returns the content item version identifier of this content item version.- Returns:
- The content item version identifier of this content item version
- Since:
- 10.34.0
- See Also:
ContentItemVersionId
-
getTitle
@Field(heading=true, boost=1.0) @ReferField(body=true, facet=true) String getTitle()
Returns the title of this content item version.- Returns:
- title of this content item version
-
isCurrent
@Field(facet=true, adapter=CurrentFieldAdapter.class) boolean isCurrent()
Returns true if this version equals the version returned bygetContentItem()
.ContentItem.getCurrent(Language language)
where language equals the language of this version, false otherwise.- Returns:
- whether this version is the version returned by
getContentItem()
.ContentItem.getCurrent(Language language)
where language equals the language of this version - See Also:
ContentItem.getCurrent(Language language)
-
isInContextCurrent
@Field(indexed=true) boolean isInContextCurrent()
Returns true if this version equals the version returned by eithergetContentItem()
.ContentItem.getCurrent(Language language)
orgetContentItem()
.ContentItem.getPlanned(Language language)
where language equals the language of this version, false otherwise.- Returns:
- whether this version is the version returned by either
getContentItem()
.ContentItem.getCurrent(Language language)
orgetContentItem()
.ContentItem.getPlanned(Language language)
where language equals the language of this version - See Also:
ContentItem.getCurrent(Language language)
,ContentItem.getPlanned(Language language)
-
getCreationDate
@Field(facet=true) Date getCreationDate()
Returns creation date of the content item version.- Returns:
- creation date of the content item version
-
getCreationUser
@Document User getCreationUser()
Returns creation user of the content item version.- Returns:
- creation user of the page version
-
getLastModifiedDate
@Field(facet=true) Date getLastModifiedDate()
Returns last modified date of the content item version.- Returns:
- last modified date of the content item version
-
getLastModifiedUser
@Document User getLastModifiedUser()
Returns the last modified user of this content item version.- Returns:
- user who modified this content item last
-
getContentLabels
@Field(facet=true, body=true, boost=0.8, adapter=ContentLabelsFieldAdapter.class) List<String> getContentLabels()
Returns the labels assigned to this content item. Page implementations will return the string versions ofPageVersion.getPageLabels()
, while Media implementations will return the string versions ofMediaItemVersion.getTerms()
.- Returns:
- the labels
-
getContentLabelCategories
@Field(facet=true, adapter=ContentLabelsCategoryFieldAdapter.class) List<String> getContentLabelCategories()
Returns the categories of labels assigned to this content item. Page labels have no category so they are ignored, while Media implementations will return the string versions ofMediaTerm.getClassifications()
.- Returns:
- the label categories
-
getLanguage
Language getLanguage()
Returns the language of this page version.- Returns:
- language of this page version.
-
getRemark
@Field String getRemark()
Returns the remark text. This text is not meant to be shown on the website but can be used by an editor to leave a comment for other editors about the content item.- Returns:
- remark text.
- Since:
- 10.32.0
-
setRemark
void setRemark(String remark)
Sets the remark text. This text is not meant to be shown on the website but can be used by an editor to leave a comment for other editors about the content item.- Parameters:
remark
- the remark text- Since:
- 10.32.0
-
getRevisionCount
int getRevisionCount()
Returns the number of revisions that have been created for this item, including the current version. Revisions can be deleted to free up disk space, so this may be a lot larger than thegetPreviousRevisions()
size.- Returns:
- number of revisions that have been created
-
getPreviousRevisions
List<ContentItemRevision> getPreviousRevisions()
Loads all revisions for this version. Revisions can be deleted to free up space.- Returns:
- the revisions for this version.
-
createNewRevision
void createNewRevision()
Creates a new copy of this content item version and saves it as a new revision.- See Also:
getPreviousRevisions()
-
deleteRevisions
void deleteRevisions()
Deletes all revisions.- See Also:
getPreviousRevisions()
-
setEditable
void setEditable(boolean isEditable)
Enable or disable editing this content item version.- Parameters:
isEditable
- true to enable editing- See Also:
isEditable()
-
isEditable
boolean isEditable()
Only editable content can be modified in the rich text editor. If this content item version is not editable the rich text editor will be read only (in the canvas for this item).For example, a preview of a
ContentItemRevision
is not editable.- Returns:
- if this content item should be editable by users
- See Also:
ContentItemRevision
,EditableTag
-
getLead
@Field(boost=0.6) String getLead()
Returns the lead text. The getLead inPageVersion
was deprecated since 10.13.0, but has been re-introduced in 10.32.0. As of 10.32.0 both page versions and media items versions have both a meta description field and a lead field.- Returns:
- lead text.
- Since:
- 10.32.0
-
setLead
void setLead(String leadText)
Sets the lead text. The setLead inPageVersion
was deprecated since 10.13.0, but has been re-introduced in 10.32.0. As of 10.32.0 both page versions and media items versions have both a meta description field and a lead field.- Parameters:
leadText
- the lead text to set- Since:
- 10.32.0
-
getHasLead
boolean getHasLead()
Returns if this content item version has a lead.- Returns:
- true if the content item version has a lead, false otherwise
- Since:
- 10.32.0
-
getLeadImage
Image getLeadImage()
Returns the lead image. This may be either an attached image or a referenced lead image media item. In case both are assigned the latter takes precedence. If an image media item is attached, the image assigned to the current version of that image media item is returned. If an image media item is attached but the media item has no current (the current is null), null is returned instead.- Returns:
- lead image, or
null
if no lead image is assigned or referenced, or the referenced image media item has no current version. - Since:
- 10.32.0
-
getLeadImageThumbnail
@Document Image getLeadImageThumbnail()
Returns the lead image's thumbnail. This may be either the thumbnail of an attached image or of a referenced lead image media item. In case both are assigned the latter takes precedence.- Returns:
- lead image thumbnail, or
null
if no lead image is assigned or referenced. - Since:
- 10.32.0
-
getAttachedLeadImage
Image getAttachedLeadImage()
Returns the file upload lead image associated with this content item version. If no lead image is assigned or the lead image is stored as reference to an image media item in the content repository this method returns null. SeegetLeadImageMediaItem()
to load a lead image that refers to an image media item in the content repository.- Returns:
- the file upload lead image associated with this content item version or null of no file upload lead image is assigned
- Since:
- 10.32.0
-
setAttachedLeadImage
void setAttachedLeadImage(FileResource leadImage)
Sets the lead image of this content item version as an upload file associated with this particular content item version. The image cannot be reused by other content item versions. To reuse lead images, assign it from the content repository and usesetLeadImageMediaItem(nl.gx.webmanager.cms.mediarepository.MediaItem)
instead. If null is passed, any existing upload lead image will be removed.- Parameters:
leadImage
- The multipart file holding the image to assign as lead image to this content item version- Since:
- 10.32.0
-
removeAttachedLeadImage
void removeAttachedLeadImage()
Removes the lead image attached to this content item version as an upload file.- Since:
- 10.32.0
-
setAttachedLeadImageFocusPoint
void setAttachedLeadImageFocusPoint(int x, int y)
Sets the (x, y) focus point for the attached lead image.- Parameters:
x
- The x coordinate of the focus pointy
- The y coordinate of the focus point- Since:
- 10.32.0
-
getLeadImageMediaItem
@Field(stored=false, indexed=true, adapter=ContentReferenceFieldAdapter.class) MediaItem getLeadImageMediaItem()
Returns the image media item assigned as lead image of this content item version. If no lead image is assigned or the lead image is stored as file upload image (seegetAttachedLeadImage()
) this method returns null.- Returns:
- the image media item assigned as lead image of this content item version
- Since:
- 10.32.0
-
setLeadImageMediaItem
void setLeadImageMediaItem(MediaItem mediaItem)
Sets the lead image of this content item version as reference to an image media item stored in the content repository. If null is passed, any assigned media item lead image will be removed.- Parameters:
mediaItem
- the image media item to assign as lead image of this content item version- Since:
- 10.32.0
-
-