Package org.ametys.core.cocoon
Class I18nTransformer
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,Configurable
,Contextualizable
,LogEnabled
,Serviceable
,CacheableProcessingComponent
,SitemapModelComponent
,Transformer
,XMLConsumer
,XMLPipe
,XMLProducer
,XMLConsumer
,ContentHandler
,LexicalHandler
- Direct Known Subclasses:
ExternalI18nTransformer
,I18nTransformer
This class extends the classic I18nTransormer by automatically filling it with plugins catalogues.
It also handles special sitemap parameters :
plugin
: when specified and when the given plugin exists, the default catalogue id is set to plugin.plugin
workspace
: when specified and when the given workspace exists, the default catalogue id is set to workspace.workspace
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cocoon.transformation.I18nTransformer
I18nTransformer.CatalogueInfo
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
Cocoon contextprotected I18nUtils
The i18n utilsprotected SourceResolver
Source ResolverFields inherited from class org.apache.cocoon.transformation.I18nTransformer
CURRENCY_LOCALE_ATTRIBUTE, factory, I18N_ATTR_ATTRIBUTE, I18N_CATALOGUE_ATTRIBUTE, I18N_CHOOSE_ELEMENT, I18N_CURRENCY_ELEMENT, I18N_CURRENCY_NO_UNIT_ELEMENT, I18N_DATE_ELEMENT, I18N_DATE_TIME_ELEMENT, I18N_DEFAULT_CATALOGUE_ID, I18N_EXPR_ATTRIBUTE, I18N_FRACTION_DIGITS_ATTRIBUTE, I18N_IF_ELEMENT, I18N_INT_CURRENCY_ELEMENT, I18N_INT_CURRENCY_NO_UNIT_ELEMENT, I18N_KEY_ATTRIBUTE, I18N_LOCALE, I18N_LOCALE_ATTRIBUTE, I18N_NAMESPACE_URI, I18N_NUMBER_ELEMENT, I18N_OLD_NAMESPACE_URI, I18N_OTHERWISE_ELEMENT, I18N_PARAM_ELEMENT, I18N_PARAM_NAME_ATTRIBUTE, I18N_PATTERN_ATTRIBUTE, I18N_PERCENT_ELEMENT, I18N_PRELOAD, I18N_SRC_LOCALE_ATTRIBUTE, I18N_SRC_PATTERN_ATTRIBUTE, I18N_TEXT_ELEMENT, I18N_TIME_ELEMENT, I18N_TRANSLATE_ELEMENT, I18N_TYPE_ATTRIBUTE, I18N_UNTRANSLATED, I18N_VALUE_ATTRIBUTE, I18N_WHEN_ELEMENT, locale, manager, objectModel
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration conf) void
contextualize
(Context context) protected ParamSaxBuffer
getMessage
(String catalogueID, String key) protected ParamSaxBuffer
getUntranslatedMessage
(String catalogueID, String key) Retrieve the message when the key is not foundvoid
service
(ServiceManager smanager) void
setup
(SourceResolver resolver, Map objModel, String source, Parameters parameters) Methods inherited from class org.apache.cocoon.transformation.I18nTransformer
characters, dispose, endElement, endPrefixMapping, getKey, getLocale, getValidity, recycle, startElement, startPrefixMapping
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
comment, endCDATA, endDocument, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration, endDocument, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
Field Details
-
_context
Cocoon context -
_resolver
Source Resolver -
_i18nUtils
The i18n utils
-
-
Constructor Details
-
I18nTransformer
public I18nTransformer()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classI18nTransformer
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classI18nTransformer
- Throws:
ConfigurationException
-
setup
public void setup(SourceResolver resolver, Map objModel, String source, Parameters parameters) throws ProcessingException, SAXException, IOException - Specified by:
setup
in interfaceSitemapModelComponent
- Overrides:
setup
in classI18nTransformer
- Throws:
ProcessingException
SAXException
IOException
-
getMessage
- Overrides:
getMessage
in classI18nTransformer
-
getUntranslatedMessage
Retrieve the message when the key is not found- Parameters:
catalogueID
- The catalogue idkey
- The i18n key- Returns:
- SaxBuffer containing the message for untranslated key
-