Interface IContentManagementSystem

  • All Superinterfaces:
    IAdaptable, ch.ivyteam.ivy.cm.IContentManagementEntity, ch.ivyteam.ivy.lookup.restricted.IProjectManager, ch.ivyteam.ivy.search.restricted.indexed.ISearchSpace

    public interface IContentManagementSystem
    extends ch.ivyteam.ivy.cm.IContentManagementEntity, ch.ivyteam.ivy.search.restricted.indexed.ISearchSpace, ch.ivyteam.ivy.lookup.restricted.IProjectManager
    The Ivy Content Management System (CMS). The CMS is a container for various types of content. Content can be put in the CMS as name-tuple pairs where as a tuple consists of a value in the configured languages of the CMS.
    Version:
    10.5.2006, kvg: revised and simplified for 4.0
    API:
    This is a public API.
    • Method Detail

      • getSupportedLanguages

        List<Locale> getSupportedLanguages()
                                    throws PersistencyException
        Gets the supported languages as a list of Locale objects.
        Returns:
        list of Locale objects
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      • addSupportedLanguage

        void addSupportedLanguage​(Locale language)
                           throws PersistencyException
        Adds a supported language
        Parameters:
        language - language to add
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      • isSupportedLanguage

        boolean isSupportedLanguage​(Locale language)
                             throws PersistencyException
        Returns true if the given language is supported
        Parameters:
        language - language to check
        Returns:
        true if language is supported, otherwise false
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      • getDefaultLanguage

        Locale getDefaultLanguage()
                           throws PersistencyException
        Gets the default language of this cms
        Returns:
        default language (first supported language if not set, or null if no supported languages exist)
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      • setDefaultLanguage

        void setDefaultLanguage​(Locale defaultLanguage)
                         throws PersistencyException,
                                ch.ivyteam.ivy.cm.exceptions.UnsupportedLanguageException
        Sets the default supported language of this cms
        Parameters:
        defaultLanguage - the new default language
        Throws:
        PersistencyException - if DB access fails
        ch.ivyteam.ivy.cm.exceptions.UnsupportedLanguageException - if new default lang is not a supported language
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      • getRootContentObject

        IContentObject getRootContentObject()
                                     throws PersistencyException
        Gets the root content object of this content management system
        Returns:
        the root ContentObject
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • findContentObject

        IContentObject findContentObject​(String uri)
                                  throws PersistencyException
        Gets the content object with the given uri. The search scope is the current case's project or - if not available - this cms'es project and all of it's required projects.

        If you want to search locally only, without considering overriding, then you should use getContentObject(String) instead.

        Parameters:
        uri -
        Returns:
        content object with the given uri or null if not found
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getContentObject

        IContentObject getContentObject​(String uri)
                                 throws PersistencyException
        Gets the content object with the given uri. Only this content management system is searched (i.e. local search only), overriding is not considered.

        If you want to use overriding and include required projects in the search then you should use findContentObject(String) instead. This is normally the intended behavior.

        Parameters:
        uri -
        Returns:
        content object with the given uri or null if not found
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • findContentObjectValue

        IContentObjectValue findContentObjectValue​(String uri,
                                                   Locale language)
                                            throws PersistencyException
        Gets the currently valid content object value with the given uri and language. The search scope is the current case's project or - if not available - this cms'es project and all of it's required projects.

        Returns the default value of the associated content object, if no value with the given language exists for the given content object.

        Parameters:
        uri -
        language - optional, if null: return default value
        Returns:
        content object value or null if associated content object does not exist or has no values
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getContentObjectValue

        IContentObjectValue getContentObjectValue​(String uri,
                                                  Locale language)
                                           throws PersistencyException
        Gets the currently valid content object value with the given uri and language. Only this content management system is searched (i.e. local search only), overriding is not considered.

        If you want to use overriding and include required projects in the search then you should use findContentObjectValue(String, Locale) instead. This is normally the intended behavior.

        Returns the default value of the associated content object, if no value with the given language exists for the given content object.

        Parameters:
        uri -
        language - optional, if null: return default value
        Returns:
        content object value or null if associated content object does not exist or has no values
        Throws:
        PersistencyException - if DB access fails
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • co

        String co​(String uri)

        Returns the value of the ContentObject at the given URI in the currently active language. The value is rendered as a String, according to the context and to the type of the value. The result is dependent on the availability of renderers in the current context and may be the empty String if the value could not be rendered correcly.

        The search scope is the current case's project or - if not available - this cms'es project and all of it's required projects. If the given uri can not be resolved then the empty String will be returned.

        This method never returns null.

        Parameters:
        uri - the uri of the ContentObject to retrieve
        Returns:
        rendered String of ContentObjectValue with given uri in current language or the empty String (never null)
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • co

        String co​(String uri,
                  List<Object> formatObjects)

        Returns the value of the ContentObject at the given URI in the currently active language. The value is rendered as a String, according to the context and to the type of the value. The placeholders ({0}, {1}, etc.) in the content object value will be replaced by the specified formatObjects. The result is dependent on the availability of renderers in the current context and may be the empty String if the value could not be rendered correcly.

        The search scope is the current case's project or - if not available - this cms'es project and all of it's required projects. If the given uri can not be resolved then the empty String will be returned.

        This method never returns null.

        Parameters:
        uri - the uri of the ContentObject to retrieve
        formatObjects - The objects that will be used to replace the placeholders in the content object value. E.g. {0} will be replaced by the first object in the specified list, {1} with the second object and so on.
        Returns:
        rendered String of ContentObjectValue with given uri in current language or the empty String (never null)
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • coLocale

        String coLocale​(String uri,
                        Locale locale)

        Returns the value of the ContentObject in the given language. The value is rendered as a String, according to the context and to the type of the value. The result is dependent on the availability of renderers in the current context and may be the empty String if the value could not be rendered correctly.

        The search scope is the current case's project or - if not available - this cms'es project and all of it's required projects. If the given uri can not be resolved then the empty String will be returned.

        This method returns never null.

        Parameters:
        uri - the uri of the ContentObject to retrieve
        locale - the preferred language for the value
        Returns:
        rendered String of ContentObjectValue with given uri in current language or the empty String (never null)
        Since:
        6.4.0
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • coLocale

        String coLocale​(String uri,
                        String locale)

        Returns the value of the ContentObject in the given language. The value is rendered as a String, according to the context and to the type of the value. The result is dependent on the availability of renderers in the current context and may be the empty String if the value could not be rendered correctly.

        The search scope is the current case's project or - if not available - this cms'es project and all of it's required projects. If the given uri can not be resolved then the empty String will be returned.

        This method returns never null.

        Parameters:
        uri - the uri of the ContentObject to retrieve
        locale - the preferred language for the value. E.g. 'de_DE', 'de_CH', 'fr' or 'en'.
        Returns:
        rendered String of ContentObjectValue with given uri in current language or the empty String (never null)
        Since:
        6.4.0
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • cr

        String cr​(String uri)

        Returns a link to the content object with the given uri. The format and protocol of the returned link is dependent on the current context.

        If the given uri could not be resolved in this content management system, then all cms'es from required projects will be queried. If the given uri still isn't found then the empty String will be returned.

        This method never returns null.

        Parameters:
        uri - the uri of the content object to get a reference of
        Returns:
        link/reference to co or the empty String (never null)
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.