Class TranslationMessageServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.contentmanagement.TranslationMessageServiceImpl
-
- All Implemented Interfaces:
InternalTranslationMessageServiceLocal,TranslationMessageServiceLocal,InternalTranslationMessageService,TranslationMessageService,Service,MessageProducer
@Service public class TranslationMessageServiceImpl extends BaseServiceImpl implements TranslationMessageServiceLocal, InternalTranslationMessageServiceLocal
Implementation forTranslationMessageService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler
-
-
Constructor Summary
Constructors Constructor Description TranslationMessageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidevictCustomizedKeysCache(Language language)TranslationsDatagetAppI18n()Returns the translation messages for the new frontendApplicationTranslationDatagetApplicationTranslationData(LanguageVO languageVO)Gets data for translations for the given languageTranslationsDatagetBySubmodules(Set<Submodule> submodules)Returns all the translation messages for the given submodulesList<String>getCustomizedKeys(Long id)Returns the customized translation message keys for the given languagePropertiesgetCustomizedKeysPerLanguage(LanguageVO languageVO)Returns all customized keys for the given language, in form of aPropertiesobjectTranslationKeyDatagetTranslationKeyData(BasicTranslationKeyDTO key)Returns data for the given translation keyList<LanguageDetailedVO>listTranslatableLanguages()List the languages the current user can translateTranslationKeyVOloadKey(Long langId, String key)Loads a translation keyStringmessage(MessageFormat messageFormat, MessageKey key, Object... arguments)Returns a translation message in a given format, for the current user's language, applying the given arguments, if anyStringmessage(MessageKey key, Object... arguments)Returns a translation message for the current user's language, applying the given arguments, if anyprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidrestoreOriginalTranslation(BasicTranslationKeyDTO key)Reverts any changes on the given keyvoidsaveKey(TranslationKeyDTO key)Save a customized keyPage<TranslationKeyVO>searchKeys(TranslationQuery params)Searches for translation keysvoidsetCustomizedKeysPerLanguage(SetCustomizedTranslationsDTO params)Set the customized keys for a language-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
getAppI18n
public TranslationsData getAppI18n() throws FrameworkException
Description copied from interface:InternalTranslationMessageServiceReturns the translation messages for the new frontend- Specified by:
getAppI18nin interfaceInternalTranslationMessageService- Throws:
FrameworkException
-
getApplicationTranslationData
public ApplicationTranslationData getApplicationTranslationData(LanguageVO languageVO)
Description copied from interface:TranslationMessageServiceGets data for translations for the given language- Specified by:
getApplicationTranslationDatain interfaceTranslationMessageService
-
getBySubmodules
public TranslationsData getBySubmodules(Set<Submodule> submodules)
Description copied from interface:InternalTranslationMessageServiceReturns all the translation messages for the given submodules- Specified by:
getBySubmodulesin interfaceInternalTranslationMessageService
-
getCustomizedKeys
public List<String> getCustomizedKeys(Long id)
Description copied from interface:TranslationMessageServiceLocalReturns the customized translation message keys for the given language- Specified by:
getCustomizedKeysin interfaceTranslationMessageServiceLocal
-
getCustomizedKeysPerLanguage
public Properties getCustomizedKeysPerLanguage(LanguageVO languageVO)
Description copied from interface:TranslationMessageServiceReturns all customized keys for the given language, in form of aPropertiesobject- Specified by:
getCustomizedKeysPerLanguagein interfaceTranslationMessageService
-
getTranslationKeyData
public TranslationKeyData getTranslationKeyData(BasicTranslationKeyDTO key) throws FrameworkException
Description copied from interface:TranslationMessageServiceReturns data for the given translation key- Specified by:
getTranslationKeyDatain interfaceTranslationMessageService- Throws:
FrameworkException
-
listTranslatableLanguages
public List<LanguageDetailedVO> listTranslatableLanguages() throws FrameworkException
Description copied from interface:TranslationMessageServiceList the languages the current user can translate- Specified by:
listTranslatableLanguagesin interfaceTranslationMessageService- Throws:
FrameworkException
-
loadKey
public TranslationKeyVO loadKey(Long langId, String key)
Description copied from interface:TranslationMessageServiceLocalLoads a translation key- Specified by:
loadKeyin interfaceTranslationMessageServiceLocal
-
message
public String message(MessageFormat messageFormat, MessageKey key, Object... arguments)
Description copied from interface:InternalTranslationMessageServiceReturns a translation message in a given format, for the current user's language, applying the given arguments, if any- Specified by:
messagein interfaceInternalTranslationMessageService- Specified by:
messagein interfaceMessageProducer- Overrides:
messagein classAbstractNetworkedServerComponent
-
message
public String message(MessageKey key, Object... arguments)
Description copied from interface:InternalTranslationMessageServiceReturns a translation message for the current user's language, applying the given arguments, if any- Specified by:
messagein interfaceInternalTranslationMessageService- Specified by:
messagein interfaceMessageProducer- Overrides:
messagein classAbstractNetworkedServerComponent
-
restoreOriginalTranslation
public void restoreOriginalTranslation(BasicTranslationKeyDTO key) throws FrameworkException
Description copied from interface:TranslationMessageServiceReverts any changes on the given key- Specified by:
restoreOriginalTranslationin interfaceTranslationMessageService- Throws:
FrameworkException
-
saveKey
public void saveKey(TranslationKeyDTO key) throws FrameworkException
Description copied from interface:TranslationMessageServiceSave a customized key- Specified by:
saveKeyin interfaceTranslationMessageService- Throws:
FrameworkException
-
searchKeys
public Page<TranslationKeyVO> searchKeys(TranslationQuery params)
Description copied from interface:TranslationMessageServiceSearches for translation keys- Specified by:
searchKeysin interfaceTranslationMessageService
-
setCustomizedKeysPerLanguage
public void setCustomizedKeysPerLanguage(SetCustomizedTranslationsDTO params) throws FrameworkException
Description copied from interface:TranslationMessageServiceSet the customized keys for a language- Specified by:
setCustomizedKeysPerLanguagein interfaceTranslationMessageService- Throws:
FrameworkException
-
evictCustomizedKeysCache
protected void evictCustomizedKeysCache(Language language)
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-