Package org.ametys.web.cocoon
Class I18nTransformer
-
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Component,Configurable,Contextualizable,LogEnabled,Serviceable,CacheableProcessingComponent,SitemapModelComponent,Transformer,XMLConsumer,XMLPipe,XMLProducer,XMLConsumer,ContentHandler,LexicalHandler
public class I18nTransformer extends I18nTransformer
CMS version of the I18nTransformer, dealing with skin catalogues.
It is also able to reconfigure itself dynamically, to reflect changes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cocoon.transformation.I18nTransformer
I18nTransformer.CatalogueInfo
-
-
Field Summary
Fields Modifier and Type Field Description private Configuration_confprivate long_lastConfigureTimeThe time the configure method was lastly called on this instanceprotected ServiceManager_managerthe avalon service managerprivate static long_needsReloadTimeprivate SkinModelsManager_skinModelsManagerprivate SkinsManager_skinsManager-
Fields inherited from class org.ametys.core.cocoon.I18nTransformer
_context, _i18nUtils, _resolver
-
Fields 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
Constructors Constructor Description I18nTransformer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void_configure()private void_configureModelsCatalogue(DefaultConfiguration catalogues)private void_configureSkinsCatalogue(DefaultConfiguration catalogues)private ParamSaxBuffer_getExternalMessage(String externalLocation, String key)voidconfigure(Configuration conf)protected ParamSaxBuffergetMessage(String catalogueID, String key)static voidneedsReload()Call this method when you change the list of i18n catalogues
by adding a new skin for example.voidservice(ServiceManager smanager)voidsetup(SourceResolver resolver, Map objModel, String source, Parameters parameters)-
Methods inherited from class org.ametys.core.cocoon.I18nTransformer
contextualize, getUntranslatedMessage
-
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
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 Detail
-
_needsReloadTime
private static long _needsReloadTime
-
_manager
protected ServiceManager _manager
the avalon service manager
-
_conf
private Configuration _conf
-
_lastConfigureTime
private long _lastConfigureTime
The time the configure method was lastly called on this instance
-
_skinsManager
private SkinsManager _skinsManager
-
_skinModelsManager
private SkinModelsManager _skinModelsManager
-
-
Constructor Detail
-
I18nTransformer
public I18nTransformer()
-
-
Method Detail
-
configure
public void configure(Configuration conf) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classI18nTransformer- Throws:
ConfigurationException
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classI18nTransformer- Throws:
ServiceException
-
_configure
private void _configure() throws ConfigurationException
- Throws:
ConfigurationException
-
_configureSkinsCatalogue
private void _configureSkinsCatalogue(DefaultConfiguration catalogues)
-
_configureModelsCatalogue
private void _configureModelsCatalogue(DefaultConfiguration catalogues)
-
getMessage
protected ParamSaxBuffer getMessage(String catalogueID, String key)
- Overrides:
getMessagein classI18nTransformer
-
_getExternalMessage
private ParamSaxBuffer _getExternalMessage(String externalLocation, String key)
-
needsReload
public static void needsReload()
Call this method when you change the list of i18n catalogues
by adding a new skin for example.
-
setup
public void setup(SourceResolver resolver, Map objModel, String source, Parameters parameters) throws ProcessingException, SAXException, IOException
- Specified by:
setupin interfaceSitemapModelComponent- Overrides:
setupin classI18nTransformer- Throws:
ProcessingExceptionSAXExceptionIOException
-
-