Interface MediaItemVersion

    • Method Detail

      • 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.
      • 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 use PageVersion.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.
      • setTargetPage

        void setTargetPage​(Page targetPage)
        Sets the target page.
        Parameters:
        targetPage - target page or null
      • setPublic

        @Deprecated
        void setPublic​(boolean isPublic)
        Deprecated.
        Will probably be removed in WM 9.2
        Set 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()
        Returns true 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()
        Returns true 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.2
        Sets 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()
        Returns true if you may view this MediaItemVersion 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 interface ContentItemVersion<MediaItem>
        Returns:
        true if you may view this MediaItemVersion 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 case website_settings.friendly_url_setting equals urltitle. The returned string is used by the SEOService 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.
      • 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