Interface ContentItem<T extends ContentItemVersion<?>>

    • Method Detail

      • getIdentifier

        ContentItemId getIdentifier()
        Returns the content item identifier of this content item.
        Returns:
        The content item identifier of this content item
        Since:
        10.34.0
        See Also:
        ContentItemId
      • getVersions

        T[] getVersions()
        Returns all ContentItemVersions this content item has. A ContentItem must have at least one ContentItemVersion.

        In exceptional cases like these, the method returns an empty array:

        • The ContentItem and therefore its last version has just been deleted within the current session.
        • The Content Type is inactive.
        Returns:
        all versions, in exceptional cases only an empty array, never null
      • getVersions

        T[] getVersions​(Language language)
        Returns all content items versions within the given language. Fallback languages are ignored here, even if fallback languages are enabled. So returned versions are guaranteed to have the specified language.
        A content item can have zero or more content item versions within a language, but there exists one language for which a version is available.
        Parameters:
        language - the language of the versions to be returned.
        Returns:
        all versions, or an empty array if there are no versions for the given language. Never returns null.
      • getVersion

        T getVersion​(Boolean matchActiveOnly,
                     Language matchLanguage,
                     boolean enforceLanguage,
                     Date matchDate,
                     boolean inContextFirst)
        Returns the version with the latest publication date/time of all versions of this content item that match the input parameters.
        Parameters:
        matchActiveOnly -
        • If true, only versions match that have an active state.
        • If false, all versions match, no matter their state (active or inactive).
        • If null, a default is used instead. For frontend requests, the default is true. For backend requests, the default is true when the in context view mode is set to Active only and false otherwise.
        matchLanguage -
        • If not null, only versions match that are in this language, or in its fallback language if fallback languages are enabled.
        • If null and the current editing language is not null, only versions match that are in the current editing language, or in its fallback language if fallback languages are enabled.
        • If null and the current editing language is null, only versions match that are in the default content language, or in its fallback language if fallback languages are enabled. NB: the default content language cannot be null.
        enforceLanguage -
        • If true and matchLanguage is not null, only versions will be matched that exactly match the language as specified in matchLanguage. Fallback languages are ignored, even if fallback languages are enabled.
        • If false, fallback languages are taken into account while matching versions (if enabled)
        • NB: if enforceLanguage is true, matchLanguage should not be null. If enforceLanguage is true and matchLanguage is null, this method always returns null.
        matchDate -
        • If not null, only versions match that have an active state at this provided date/time, considering its publication and expiration date.
        • If null, all versions match no matter their publication or expiration date.
        inContextFirst -
        Returns:
        The version with the latest publication date/time in case more then 1 version matches all input arguments. Returns null if no versions match all input arguments.
        Since:
        10.32.0
      • getCurrent

        T getCurrent()
        Returns the current version of this content item. Returns the exact same result as getCurrent(null).
        Returns:
        the current version, or null if there is no current version
        See Also:
        getCurrent(Language)
      • getCurrent

        T getCurrent​(Language language)
        Returns the current version of this content item in the specified language. This method returns the exact same result as getVersion(null, language, false, showDate), where showDate equals the in context date/time if specified (can only be the case for in context requests) or the current date/time otherwise.
        Returns:
        the current version for this language, or null if there is no current version
        See Also:
        #getVersion(Boolean, Language, boolean, Date)
      • getPlanned

        T getPlanned()
        Returns the planned version of this content item. Returns the exact same result as getPlanned(null).
        Returns:
        the planned version, or null if there is no planned version
        See Also:
        getPlanned(Language)
      • getPlanned

        T getPlanned​(Language language)
        Returns the planned version of this content item. The planned version is defined as;
        • null if getCurrent(language) returns not null
        • Otherwise, getVersion(false, null, false, null) if it is not null
        • Otherwise, the version of the first language returned by Website.getLanguages() for which getVersion(false, lang, false, null) is not null
        Returns:
        the planned version for this language, or null if there is no planned version
        See Also:
        #getVersion(Boolean, Language, boolean, Date)
      • getMostRelevantVersion

        @Deprecated
        T getMostRelevantVersion​(Language language)
        Deprecated.
        This method is deprecated. Please use getVersion(false, language, new Date()) instead.
      • getWebsite

        @ReferDocument
        Website getWebsite()
        Returns the website that owns this content item.
        Returns:
        website Owner website of the content item.
      • getLink

        Link getLink()
        Returns the link to this content item or null if no current of the (context) language is available.
        Returns:
        link to this content item or null if no current of the (context) language is available
      • getInternalLink

        Link getInternalLink()
        Returns the internal link to this content item.
        Returns:
        internal link to this content item
      • getEditVersion

        T getEditVersion()
        The version used to display version and/or language specific properties (like the title) of the content item in the Edit Environment. For example, if the edit environment needs to display a content item reference, it can use getEditVersion().getTitle() as name of that reference since the content item itself has no title.
        Returns:
        the version used to display version and/or language specific properties
        Since:
        10.31.0
      • getEditVersionInLanguage

        T getEditVersionInLanguage​(Language language)
        Same as getEditVersion(). However, versions in the specified language have precedence over all other versions. So whenever a version exists in the specified language of this content item, a version in the specified language is guaranteed to be returned. Like getEditVersion, this method also gives precedence to active versions over inactive versions.
        Parameters:
        language - The language of the version to return. If a version is returned and at least 1 version in that language exists, the returned version is guaranteed to be in this language. Hence, language must not be null.
        Returns:
        the version used to display version and/or language specific properties
        Since:
        10.32.0