info.magnolia.cms.i18n
Interface I18nContentSupport

All Known Implementing Classes:
AbstractI18nContentSupport, DefaultI18nContentSupport, HierarchyBasedI18nContentSupport, RequestLocaleAwareI18nContentSupport

public interface I18nContentSupport

Support for i18n content. Used to rewrite uris and getting nodedatas based on the current language.

Version:
$Id$
Author:
philipp

Method Summary
 Locale determineLocale()
          This method uses the current agregation state to set the locale used for the rendering process .
 Locale getFallbackLocale()
          The default locale to be used.
 Locale getLocale()
          Get the current locale used for rendering content.
 Collection<Locale> getLocales()
          Returns the available locales.
 javax.jcr.Node getNode(javax.jcr.Node node, String name)
          Returns named localized child (if exists) of provided node (or non localized in case localized child doesn't exist).
 NodeData getNodeData(Content node, String name)
          Deprecated. since 4.5.4 use getProperty(Node, String) instead.
 NodeData getNodeData(Content node, String name, Locale locale)
          Deprecated. since 4.5.4 use getProperty(Node, String, Locale) instead.
 javax.jcr.Property getProperty(javax.jcr.Node node, String name)
          Returns localized property of given name and current locale.
 javax.jcr.Property getProperty(javax.jcr.Node node, String name, Locale locale)
          Returns localized property of given named and given locale.
 boolean hasProperty(javax.jcr.Node node, String name)
          Returns true if localized property or default property exists false if there is no variation of property for any locale.
 boolean isEnabled()
           
 void setFallbackLocale(Locale fallbackLocale)
           
 void setLocale(Locale locale)
           
 String toI18NURI(String uri)
          Transform the internal uri to a i18n uri.
 String toRawURI(String i18nURI)
          Remove all i18n tokens form the uri.
 

Method Detail

getLocale

Locale getLocale()
Get the current locale used for rendering content.


setLocale

void setLocale(Locale locale)

getFallbackLocale

Locale getFallbackLocale()
The default locale to be used. Can be used to fix the system to a certain language.


setFallbackLocale

void setFallbackLocale(Locale fallbackLocale)

toI18NURI

String toI18NURI(String uri)
Transform the internal uri to a i18n uri. This method may add a prefix or suffix


toRawURI

String toRawURI(String i18nURI)
Remove all i18n tokens form the uri. The uri can then be used to get the content.


determineLocale

Locale determineLocale()
This method uses the current agregation state to set the locale used for the rendering process .


getNodeData

@Deprecated
NodeData getNodeData(Content node,
                                String name,
                                Locale locale)
                     throws javax.jcr.RepositoryException
Deprecated. since 4.5.4 use getProperty(Node, String, Locale) instead.

Returns the NodeData object based on the language passes.

Throws:
javax.jcr.RepositoryException

getNodeData

@Deprecated
NodeData getNodeData(Content node,
                                String name)
Deprecated. since 4.5.4 use getProperty(Node, String) instead.

Returns the NodeData object based on the current language.


getNode

javax.jcr.Node getNode(javax.jcr.Node node,
                       String name)
                       throws javax.jcr.RepositoryException
Returns named localized child (if exists) of provided node (or non localized in case localized child doesn't exist).

Throws:
javax.jcr.RepositoryException

getProperty

javax.jcr.Property getProperty(javax.jcr.Node node,
                               String name)
                               throws javax.jcr.RepositoryException
Returns localized property of given name and current locale.

Throws:
javax.jcr.RepositoryException

hasProperty

boolean hasProperty(javax.jcr.Node node,
                    String name)
                    throws javax.jcr.RepositoryException
Returns true if localized property or default property exists false if there is no variation of property for any locale.

Throws:
javax.jcr.RepositoryException

getProperty

javax.jcr.Property getProperty(javax.jcr.Node node,
                               String name,
                               Locale locale)
                               throws javax.jcr.RepositoryException
Returns localized property of given named and given locale.

Throws:
javax.jcr.RepositoryException

getLocales

Collection<Locale> getLocales()
Returns the available locales.


isEnabled

boolean isEnabled()


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.