Class LanguageSupportImpl
java.lang.Object
ch.tocco.nice2.dbrefactoring.impl.LanguageSupportImpl
- All Implemented Interfaces:
LanguageSupport
-
Constructor Summary
ConstructorDescriptionLanguageSupportImpl
(org.slf4j.Logger log, ModuleManager moduleManager, IteratorFactory iteratorFactory, DataModelSupport dbDataModel, L10N l10n, PostProcessor postProcessor, DataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptiongenerateNewLanguageChangelog
(Locale[] languages, @Nullable CallbackHandler callbackHandler) Generates a changelog that adds the given languages.generateNewLanguageChangelog
(Locale[] languages, Set<String> moduleNames, @Nullable CallbackHandler callbackHandler) Generates a changelog that adds the given languages for entities defined in the given module.getInstalledLanguages
(@Nullable Connection conn) Queries a table to find out what languages are installed at the given connection.getNewLanguageChangelogFile
(Locale[] languages, @Nullable CallbackHandler callbackHandler) LikeLanguageSupport.generateNewLanguageChangelog(Locale[], CallbackHandler)
but the changelog is post-processed by the contribtued processors and stored in the file system undervar
of the current installation.getNewLanguageChangelogFile
(Locale[] languages, Set<String> moduleNames, @Nullable CallbackHandler callbackHandler) LikeLanguageSupport.generateNewLanguageChangelog(Locale[], Set, CallbackHandler)
but the changelog is post-processed by the contributed processors and then stored in the file system undervar
of the current installation.getNewLanguagesToInstall
(@Nullable Connection conn) Compares the available languages as given in application[.local].properties with the languages really installed in the database.void
setCustomLanguageChanges
(List<CustomLanguageChangeContribution> customLanguageChanges)
-
Constructor Details
-
LanguageSupportImpl
public LanguageSupportImpl(org.slf4j.Logger log, ModuleManager moduleManager, IteratorFactory iteratorFactory, DataModelSupport dbDataModel, L10N l10n, PostProcessor postProcessor, DataSource dataSource)
-
-
Method Details
-
generateNewLanguageChangelog
public Changelog generateNewLanguageChangelog(Locale[] languages, @Nullable @Nullable CallbackHandler callbackHandler) throws DbRefactoringException Description copied from interface:LanguageSupport
Generates a changelog that adds the given languages.
The language must be available within nice2, that is, it must be added to the list of available languages.
- Specified by:
generateNewLanguageChangelog
in interfaceLanguageSupport
- Parameters:
languages
- array of new languages to add, must be at least one elementcallbackHandler
- receives progress messages (MessageCallback
- Throws:
DbRefactoringException
- on any error
-
getNewLanguageChangelogFile
public File getNewLanguageChangelogFile(Locale[] languages, @Nullable @Nullable CallbackHandler callbackHandler) throws DbRefactoringException Description copied from interface:LanguageSupport
LikeLanguageSupport.generateNewLanguageChangelog(Locale[], CallbackHandler)
but the changelog is post-processed by the contribtued processors and stored in the file system undervar
of the current installation.- Specified by:
getNewLanguageChangelogFile
in interfaceLanguageSupport
- Parameters:
callbackHandler
- receives progress messages (MessageCallback
- Throws:
DbRefactoringException
-
generateNewLanguageChangelog
public Changelog generateNewLanguageChangelog(Locale[] languages, Set<String> moduleNames, @Nullable @Nullable CallbackHandler callbackHandler) throws DbRefactoringException Description copied from interface:LanguageSupport
Generates a changelog that adds the given languages for entities defined in the given module.
The language must be available within nice2, that is, it must be added to the list of available languages.
- Specified by:
generateNewLanguageChangelog
in interfaceLanguageSupport
- Parameters:
callbackHandler
- receives progress messages (MessageCallback
- Throws:
DbRefactoringException
-
getNewLanguageChangelogFile
public File getNewLanguageChangelogFile(Locale[] languages, Set<String> moduleNames, @Nullable @Nullable CallbackHandler callbackHandler) throws DbRefactoringException Description copied from interface:LanguageSupport
LikeLanguageSupport.generateNewLanguageChangelog(Locale[], Set, CallbackHandler)
but the changelog is post-processed by the contributed processors and then stored in the file system undervar
of the current installation.- Specified by:
getNewLanguageChangelogFile
in interfaceLanguageSupport
- Parameters:
callbackHandler
- receives progress messages (MessageCallback
- Throws:
DbRefactoringException
-
getInstalledLanguages
public Set<Locale> getInstalledLanguages(@Nullable @Nullable Connection conn) throws DbRefactoringException Description copied from interface:LanguageSupport
Queries a table to find out what languages are installed at the given connection. Returns an empty set if nothing has been installed yet.- Specified by:
getInstalledLanguages
in interfaceLanguageSupport
- Throws:
DbRefactoringException
-
getNewLanguagesToInstall
Description copied from interface:LanguageSupport
Compares the available languages as given in application[.local].properties with the languages really installed in the database. It will query a table to find installed languages. If no such table exists, an empty set is returned. Otherwise a set with all languages specified in application[.local].properties minus the languages installed on the database is returned.- Specified by:
getNewLanguagesToInstall
in interfaceLanguageSupport
-
setCustomLanguageChanges
@Autowired(required=false) public void setCustomLanguageChanges(List<CustomLanguageChangeContribution> customLanguageChanges)
-