Interface MediaItemVersion
-
- All Superinterfaces:
ContentItemVersion<MediaItem>
,FormBackingObject
,PublicationStatusEnabled
,WorkflowEnabled
,Wrapper
- All Known Subinterfaces:
MediaItemArticleVersion
,MediaItemDownloadVersion
,MediaItemImageVersion
,MediaItemMultimediaVersion
,MediaItemPageVersion
@Indexable(extension=nl.gx.webmanager.services.contentindex.extension.content.MediaItemVersionExtension.class, languageGetter=ContentItemVersionLanguageGetter.class) public interface MediaItemVersion extends Wrapper, FormBackingObject, ContentItemVersion<MediaItem>
Representation of a version of a media item.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MediaItemVersion.SearchEngineInclude
Enumeration that contains the possible options for the mediaitem searchengine include options.
-
Field Summary
-
Fields inherited from interface nl.gx.webmanager.cms.core.ContentItemVersion
LABELCATEGORY_NOCATEGORY, LABELCATEGORY_NOLABEL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addTerm(MediaTerm mediaTerm)
Sets term.void
createRichTextElements()
Deprecated.See getElements()boolean
exists()
Returns whether this version still exists in the media repository.Component
getComponent()
Returns the component.String
getContentType()
Returns the content type name of this media item.String
getCopyrightNotice()
Returns the copyright notice for this media item version.Map<String,Object>
getCustomMetadataRepresentation()
Retrieve a map with a representation of the fields of this metadata object.DiscussionConfiguration
getDiscussionConfiguration()
Returns the discussion configuration for this media item version.ElementHolder
getElementHolder()
Returns the element holder for the media item version.Element[]
getElements()
Deprecated.This method and a few other methods related to elements in this interface don't belong here and have been deprecated.String
getExternalId()
Returns the external identifier.Forum
getForum()
Returns the forum associated with this article or null.ForumSettings
getForumSettings()
Returns the ForumSettings associated with the Forum or null.String
getFriendlyURLTitle()
Returns the friendly URL title.String
getHtmlTitle()
Returns the HTML title.MediaItemVersion.SearchEngineInclude
getIncludeInSearchEngine()
Returns whether this version should be included to be found by a search engine.Element
getLastElement()
Deprecated.See getElements()MediaItem
getMediaItem()
Deprecated.useContentItemVersion.getContentItem()
instead.String
getMetaDescription()
Returns the meta description for the media item.String
getMetaKeywords()
Gets the meta keywords for this page version.MetaTag[]
getMetaTags()
Return the meta tags for this media item version.javax.jcr.Node
getPrivateNode()
Gets the private node injected.ContentItem<?>[]
getReferencedContentItems()
Returns the content items that this item refers to.ResourceInstance[]
getResourceInstances()
Returns an array of the referred ResourceInstances for this article.SEOPriority
getSEOPriority()
Returns the SEO priority used for generating the Google sitemaps xml.SEOUpdateFrequency
getSEOUpdateFrequency()
Returns the SEO update frequency used for generating the Google sitemaps xml.Page
getTargetPage()
Returns the target page.MediaTerm[]
getTerms()
Returns the terms.int
getTotalVotes()
Gets the total votes.float
getVotingAverage()
Gets the ranking.VotingModel
getVotingModel()
Returns the VotingModel.Website
getWebsite()
Returns the website that owns the media item.void
insertLastElementAtCursor()
Deprecated.See getElements()boolean
isArticle()
Deprecated.This method is kept around for backward compatibility.boolean
isAuthorized()
Returnstrue
if the current user is authorized to update this media item version.boolean
isAuthorizedToPreview()
Returnstrue
if the current user is authorized to preview this media item version.boolean
isBundle()
Indicates if the media item is associated with a component from a bundle.boolean
isCurrent()
Returnstrue
if you may view thisMediaItemVersion
object either because it is public (i.e.void
removeTerm(MediaTerm mediaTerm)
Removes term.void
setArticle(boolean isArticle)
Deprecated.This method is kept around for backward compatibility.void
setAuthorized(boolean isAuthorized)
Deprecated.Will probably be removed in WM 9.2void
setComponent(Component component)
Sets the component.void
setContentType(String contentType)
Deprecated.This method is kept around for backward compatibility.void
setCopyrightNotice(String notice)
Sets the copyright notice for this media item version.void
setCustomMetadataRepresentation(Map<String,Object> metadata)
Process a map of metadata fields and set custom fields when the key of the field is recognized.void
setDiscussionConfiguration(DiscussionConfiguration discConfig)
Sets the discussion configuration for this media item version.void
setElementHolder(ElementHolder elementHolder)
Sets the element holder for the media item version.void
setElements(Element[] elements)
Deprecated.See getElements()void
setExternalId(String value)
Sets the external id.void
setForum(Forum forum)
Sets the forum associated with this article or null.void
setForumSettings(ForumSettings forumSettings)
Sets the ForumSettings associated with the Forum or null.void
setFriendlyURLTitle(String friendlyURLTitle)
Sets the friendly URL title.void
setHtmlTitle(String title)
Sets the HTML title of this media item.void
setIncludeInSearchEngine(MediaItemVersion.SearchEngineInclude searchEngineInclude)
Sets include mode whether it should be findable by a search engine for this version.void
setLanguage(Language language)
Sets the language for this item.void
setLastModifiedDate(Date date)
Sets the last modified date.void
setLastModifiedUser(User user)
Sets the last modified user of this version.void
setLeadImage(FileResource leadImage)
void
setLeadImage(Image leadImage)
void
setMetaDescription(String metaDescription)
Sets the meta description of the media item.void
setMetaKeywords(String keywords)
Sets the meta keywords for this page version.void
setPrivateNode(javax.jcr.Node node)
Sets the private node injected.void
setPublic(boolean isPublic)
Deprecated.Will probably be removed in WM 9.2void
setResourceInstances(ResourceInstance[] resourceInstances)
Sets the referred ResourceInstances for this article.void
setSEOPriority(SEOPriority priority)
Sets the SEO priority used for generating the Google sitemaps xml.void
setSEOUpdateFrequency(SEOUpdateFrequency frequency)
Sets the SEO update frequency used for generating the Google sitemaps xml.void
setTargetPage(Page targetPage)
Sets the target page.void
setTerms(MediaTerm[] mediaTerms)
Sets terms.void
setTitle(String title)
Sets the title of this media item.void
setTitleVolatile(String title)
Sets the title of this media item, does not persist to database.void
setWebsite(Website website)
Sets the website that owns the media item.-
Methods inherited from interface nl.gx.webmanager.cms.core.ContentItemVersion
createNewRevision, deleteRevisions, getAttachedLeadImage, getContentItem, getContentLabelCategories, getContentLabels, getCreationDate, getCreationUser, getHasLead, getIdentifier, getLanguage, getLastModifiedDate, getLastModifiedUser, getLead, getLeadImage, getLeadImageMediaItem, getLeadImageThumbnail, getPreviousRevisions, getRemark, getRevisionCount, getTitle, isEditable, isInContextCurrent, removeAttachedLeadImage, setAttachedLeadImage, setAttachedLeadImageFocusPoint, setEditable, setLead, setLeadImageMediaItem, setRemark
-
Methods inherited from interface nl.gx.webmanager.springmvc.FormBackingObject
getNestedPath, getUUID
-
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
-
-
-
-
Method Detail
-
getMediaItem
@Deprecated MediaItem getMediaItem()
Deprecated.useContentItemVersion.getContentItem()
instead.Returns media item of the media item version.- Returns:
- media item of the media item version
-
setTitleVolatile
void setTitleVolatile(String title)
Sets the title of this media item, does not persist to database.- Parameters:
title
- title of this media item to set
-
setTitle
void setTitle(String title)
Sets the title of this media item.- Parameters:
title
- title of this media item to set
-
getHtmlTitle
String getHtmlTitle()
Returns the HTML title. This is a title string which is suitable for use in the HTML TITLE tag. If no HTML title has been explicitly specified for the page then an empty string is returned.- Returns:
- HTML title, or "" if none has been specified.
-
setHtmlTitle
void setHtmlTitle(String title)
Sets the HTML title of this media item.- Parameters:
title
- HTML title to set.
-
setLastModifiedDate
void setLastModifiedDate(Date date)
Sets the last modified date.- Parameters:
date
- last modified date.
-
setLeadImage
@Deprecated void setLeadImage(FileResource leadImage)
Sets lead image.- Parameters:
leadImage
- lead image
-
setLeadImage
@Deprecated void setLeadImage(Image leadImage)
Sets the lead image.- Parameters:
leadImage
- lead image.
-
setMetaDescription
void setMetaDescription(String metaDescription)
Sets the meta description of the media item.- Parameters:
metaDescription
-
-
setMetaKeywords
void setMetaKeywords(String keywords)
Sets the meta keywords for this page version.- Parameters:
keywords
- the meta keywords value- Since:
- 10.32.0
-
getMetaKeywords
String getMetaKeywords()
Gets the meta keywords for this page version.- Returns:
- The meta keywords
- Since:
- 10.32.0
-
getMetaTags
MetaTag[] getMetaTags()
Return the meta tags for this media item version. Please note that this array only contains the settings explicitly set on the media item version. For all meta tags including fallbacks on the display on page and/or web initiative please usePageVersion.getMetaTags()
- Returns:
- array of MetaTag.
- Since:
- 10.32.0
-
getMetaDescription
@Field(boost=0.6, body=true) String getMetaDescription()
Returns the meta description for the media item.- Returns:
- the meta description for the media item.
-
getWebsite
Website getWebsite()
Returns the website that owns the media item. Use the PresentationContext to find the WebSite the media item is displayed on.- Returns:
- website that owns the media item.
-
setWebsite
void setWebsite(Website website)
Sets the website that owns the media item.- Parameters:
website
- website that owns the media item.
-
getTargetPage
@Field(stored=false, indexed=true, adapter=ContentReferenceFieldAdapter.class) Page getTargetPage()
Returns the target page.- Returns:
- target page.
-
setTargetPage
void setTargetPage(Page targetPage)
Sets the target page.- Parameters:
targetPage
- target page ornull
-
setPublic
@Deprecated void setPublic(boolean isPublic)
Deprecated.Will probably be removed in WM 9.2Set true if the mediaitemversion state is public.- Parameters:
isPublic
- true if the mediaitemversion state is public
-
getTerms
MediaTerm[] getTerms()
Returns the terms.- Returns:
- terms
-
setTerms
void setTerms(MediaTerm[] mediaTerms)
Sets terms.- Parameters:
mediaTerms
- terms
-
addTerm
void addTerm(MediaTerm mediaTerm)
Sets term.- Parameters:
mediaTerm
- term
-
removeTerm
void removeTerm(MediaTerm mediaTerm)
Removes term.- Parameters:
mediaTerm
- term
-
isAuthorized
boolean isAuthorized()
Returnstrue
if the current user is authorized to update this media item version.- Returns:
true
if the current user is authorized to update this media item version
-
isAuthorizedToPreview
boolean isAuthorizedToPreview()
Returnstrue
if the current user is authorized to preview this media item version.- Returns:
- return
true
if the current user is authorized to preview this media item version
-
setAuthorized
@Deprecated void setAuthorized(boolean isAuthorized)
Deprecated.Will probably be removed in WM 9.2Sets true if the current user is authorized to update this media item version.- Parameters:
isAuthorized
- true if the current user is authorized to update this media item version
-
isBundle
boolean isBundle()
Indicates if the media item is associated with a component from a bundle.- Returns:
-
isArticle
@Deprecated boolean isArticle()
Deprecated.This method is kept around for backward compatibility. Consider using "instanceof ElementHolder" instead.Indicates if the media item is an article. An article contains an element holder which may contain zero or more elements. A non-article does not have an element holder nor elements.- Returns:
- true if this media item is an article, false otherwise
-
setArticle
@Deprecated void setArticle(boolean isArticle)
Deprecated.This method is kept around for backward compatibility. You won't need it in new code.Sets if the media item is an article. An article contains an element holder which may contain zero or more elements. A non-article does not have an element holder nor elements.- Parameters:
isArticle
-true
if this media item is an article,false
otherwise
-
getContentType
String getContentType()
Returns the content type name of this media item.- Returns:
-
setContentType
@Deprecated void setContentType(String contentType)
Deprecated.This method is kept around for backward compatibility. You won't need it in new code.Sets the content type name of this media item.- Parameters:
contentType
- content type of this media item to set
-
setPrivateNode
void setPrivateNode(javax.jcr.Node node)
Sets the private node injected.- Parameters:
node
-
-
getPrivateNode
javax.jcr.Node getPrivateNode()
Gets the private node injected.- Returns:
- The private node
-
getElements
@Deprecated Element[] getElements()
Deprecated.This method and a few other methods related to elements in this interface don't belong here and have been deprecated. MediaItemVersion objects which use elements also implement the ElementHolder interface. If you need to call ElementHolder methods on a MediaItemVersion object then make use of instanceof and cast to ElementHolder.Returns elements in this media item version. May be null.- Returns:
- elements in this media item version. May be null.
-
setElements
@Deprecated void setElements(Element[] elements)
Deprecated.See getElements()Set elements in this media item version. May be null.- Parameters:
elements
- elements in this media item version. May be null.
-
getElementHolder
ElementHolder getElementHolder()
Returns the element holder for the media item version. May be null. It is often assumed in WM that the element holder object is stored in the JCR and implements the FileResourceSecurityCheckPoint interface, and hence, can be used in combination with a secure download.- Returns:
- the element holder for the media item version. May be null.
-
setElementHolder
void setElementHolder(ElementHolder elementHolder)
Sets the element holder for the media item version. May be null.- Parameters:
elementHolder
- the element holder for the media item version. May be null.
-
createRichTextElements
@Deprecated void createRichTextElements()
Deprecated.See getElements()Makes sure between every content element is a richText element for wysiwyg editting.
-
getLastElement
@Deprecated Element getLastElement()
Deprecated.See getElements()Returns the last element that is currently assigned to the MediaItemVersion object, or null if no element is assigned to the MediaItemVersion.- Returns:
- the last element that is currently assigned to the MediaItemVersion object, or null if no element is assigned to the MediaItemVersion
-
insertLastElementAtCursor
@Deprecated void insertLastElementAtCursor()
Deprecated.See getElements()Move the new ( last ) element to the cursor position.
-
getComponent
Component getComponent()
Returns the component.
-
setComponent
void setComponent(Component component)
Sets the component.- Parameters:
component
- Component to set.
-
getVotingModel
VotingModel getVotingModel()
Returns the VotingModel. Retrieves the Votingmodel from the current MediaItem. returns null if MediaItem does not contains a VotingModel.
-
getVotingAverage
float getVotingAverage()
Gets the ranking. This is the average of votes.
-
getTotalVotes
int getTotalVotes()
Gets the total votes.
-
getForum
Forum getForum()
Returns the forum associated with this article or null.- Returns:
- the forum associated with this article or null.
-
getForumSettings
ForumSettings getForumSettings()
Returns the ForumSettings associated with the Forum or null.- Returns:
- the ForumSettings associated with the Forum or null.
-
setForum
void setForum(Forum forum)
Sets the forum associated with this article or null. Note: Currently not implemented.- Parameters:
forum
- the forum associated with this article or null.
-
setForumSettings
void setForumSettings(ForumSettings forumSettings)
Sets the ForumSettings associated with the Forum or null. Note: Currently isn't implemented.- Parameters:
forumSettings
- the ForumSettings associated with the Forum or null.
-
getResourceInstances
ResourceInstance[] getResourceInstances()
Returns an array of the referred ResourceInstances for this article.- Returns:
- an array of the referred ResourceInstances for this article
-
setResourceInstances
void setResourceInstances(ResourceInstance[] resourceInstances)
Sets the referred ResourceInstances for this article.- Parameters:
resourceInstances
- an array of the referred ResourceInstances for this article
-
getExternalId
String getExternalId()
Returns the external identifier.- Returns:
- external identifier.
-
setExternalId
void setExternalId(String value)
Sets the external id.- Parameters:
value
- external id
-
setCopyrightNotice
void setCopyrightNotice(String notice)
Sets the copyright notice for this media item version.- Parameters:
notice
- The copyright notice
-
getCopyrightNotice
String getCopyrightNotice()
Returns the copyright notice for this media item version.- Returns:
- The copyright notice
-
getDiscussionConfiguration
DiscussionConfiguration getDiscussionConfiguration()
Returns the discussion configuration for this media item version.- Returns:
- The discussion configuration of this media item version.
-
setDiscussionConfiguration
void setDiscussionConfiguration(DiscussionConfiguration discConfig)
Sets the discussion configuration for this media item version.- Parameters:
discConfig
- The discussion configuration to set
-
isCurrent
boolean isCurrent()
Returnstrue
if you may view thisMediaItemVersion
object either because it is public (i.e. the current version) or because you're in the preview mode and have the required work flow based authorization.- Specified by:
isCurrent
in interfaceContentItemVersion<MediaItem>
- Returns:
true
if you may view thisMediaItemVersion
object either because it is public (i.e. the current version) or because you're in the preview mode and have the required work flow based authorization.- See Also:
ContentItem.getCurrent(Language language)
-
setLastModifiedUser
void setLastModifiedUser(User user)
Sets the last modified user of this version.- Parameters:
user
- the user object who modified this version last.
-
getFriendlyURLTitle
@Field(boost=1.0) String getFriendlyURLTitle()
Returns the friendly URL title. Not to be used in URLs directly. The returned string reflects the URL title as entered by an editor in the meta data section of an article. This URL title edit box is only visible in casewebsite_settings.friendly_url_setting
equalsurltitle
. The returned string is used by theSEOService
to normalize and store it in the friendly URL store.- Returns:
- Friendly URL title.
-
setFriendlyURLTitle
void setFriendlyURLTitle(String friendlyURLTitle)
Sets the friendly URL title.- Parameters:
friendlyURLTitle
- Friendly URL title to set.
-
getIncludeInSearchEngine
MediaItemVersion.SearchEngineInclude getIncludeInSearchEngine()
Returns whether this version should be included to be found by a search engine. This setting can be configured in the properties of the mediaitem. The property is used in the sitemap.xml and in the calculation of the robots noindex metatag.- Returns:
- is included in search engine
- Since:
- 10.31.0
-
setIncludeInSearchEngine
void setIncludeInSearchEngine(MediaItemVersion.SearchEngineInclude searchEngineInclude)
Sets include mode whether it should be findable by a search engine for this version.- Parameters:
searchEngineInclude
- include mode whether it should be findable by a search engine for this version- Since:
- 10.31.0
-
exists
boolean exists()
Returns whether this version still exists in the media repository.- Returns:
true
if this version exists in the media repository.
-
setLanguage
void setLanguage(Language language)
Sets the language for this item.- Parameters:
language
- new language- See Also:
ContentItemVersion.getLanguage()
-
getReferencedContentItems
@Field(stored=false, indexed=true, adapter=ContentReferenceFieldAdapter.class) ContentItem<?>[] getReferencedContentItems()
Returns the content items that this item refers to.- Returns:
- List of referred content items, or
null
if no content item is referenced.
-
getSEOPriority
SEOPriority getSEOPriority()
Returns the SEO priority used for generating the Google sitemaps xml. This property determines the value of the 'priority' attribute in the URL section for this media item version. For more information, see https://www.sitemaps.org/protocol.html#prioritydef.- Returns:
- the SEO priority used for generating the Google sitemaps xml
-
setSEOPriority
void setSEOPriority(SEOPriority priority)
Sets the SEO priority used for generating the Google sitemaps xml. This property determines the value of the 'priority' attribute in the URL section for this media item version. For more information, see https://www.sitemaps.org/protocol.html#prioritydef. If the passed priority is null, the priority is set to null.- Parameters:
priority
- the SEO priority to use for generating the Google sitemaps xml
-
getSEOUpdateFrequency
SEOUpdateFrequency getSEOUpdateFrequency()
Returns the SEO update frequency used for generating the Google sitemaps xml. This property determines the value of the 'changefreq' attribute in the URL section for this media item version. For more information, see https://www.sitemaps.org/protocol.html#changefreqdef.- Returns:
- The SEO update frequency used for generating the Google sitemaps xml
-
setSEOUpdateFrequency
void setSEOUpdateFrequency(SEOUpdateFrequency frequency)
Sets the SEO update frequency used for generating the Google sitemaps xml. This property determines the value of the 'changefreq' attribute in the URL section for this media item version. For more information, see https://www.sitemaps.org/protocol.html#changefreqdef. If the passed frequency is null, the frequency is set to null.- Parameters:
frequency
- The SEO update frequency to use for generating the Google sitemaps xml
-
getCustomMetadataRepresentation
Map<String,Object> getCustomMetadataRepresentation()
Retrieve a map with a representation of the fields of this metadata object. The output will be used as input for setCustomMetadataRepresentation on another contentitem. The keys of the map should make sense in the corresponding setCustomMetadataRepresentation as well.- Returns:
- a map with a representation of the fields of this metadata object
- Since:
- 10.37.0
-
setCustomMetadataRepresentation
void setCustomMetadataRepresentation(Map<String,Object> metadata)
Process a map of metadata fields and set custom fields when the key of the field is recognized.- Parameters:
metadata
- map of metadata fields retrieved from a getCustomMetadataRepresentation on another object- Since:
- 10.37.0
-
-