Class DataTranslationHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.contentmanagement.DataTranslationHandlerImpl
-
- All Implemented Interfaces:
ApplicationInitializationListener,DataTranslationHandler
@Component public class DataTranslationHandlerImpl extends BaseNetworkedHandlerImpl implements DataTranslationHandler, ApplicationInitializationListener
Implementation forDataTranslationHandler
-
-
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, translationHandler
-
Fields inherited from interface org.cyclos.impl.ApplicationInitializationListener
MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description DataTranslationHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToStorage(DataTranslation translation)Adds to the data translation storage the given data translation.StringgetName(NamedEntity entity)Returns the customized translation (or default value) for the name property of the given given entity, on the current languageStringgetName(Language language, NamedEntity entity)Returns the customized translation (or default value) for the name property of the given given entity, on the given languageStringgetValue(BaseEntity entity, com.querydsl.core.types.dsl.StringPath path)Returns the customized translation (or default value) for the given property of the given given entity, on the current languageStringgetValue(BaseEntity entity, String propertyName, boolean fallbackToDefault)Same asDataTranslationHandler.getValue(Language, BaseEntity, String, boolean)but for the current languageStringgetValue(Language language, BaseEntity entity, com.querydsl.core.types.dsl.StringPath path)Returns the customized translation (or default value) for the given property of the given given entity, on the given languageStringgetValue(Language language, BaseEntity entity, String propertyName, boolean fallbackToDefault)Returns the customized translation for the given property of the given entity on the given language, optionally returning the default property value (if fallbackToDefault is true and there is no such translation)voidinitialize()voidonApplicationInitialization()Invoked when the application service is initializedvoidremoveFromStorage(DataTranslation translation)Removes from the data translation storage the given data translation.-
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, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.impl.ApplicationInitializationListener
applicationInitializationPriority, getInitializationId
-
-
-
-
Method Detail
-
addToStorage
public void addToStorage(DataTranslation translation)
Description copied from interface:DataTranslationHandlerAdds to the data translation storage the given data translation.- Specified by:
addToStoragein interfaceDataTranslationHandler
-
getName
public String getName(Language language, NamedEntity entity) throws FrameworkException
Description copied from interface:DataTranslationHandlerReturns the customized translation (or default value) for the name property of the given given entity, on the given language- Specified by:
getNamein interfaceDataTranslationHandler- Throws:
FrameworkException
-
getName
public String getName(NamedEntity entity) throws FrameworkException
Description copied from interface:DataTranslationHandlerReturns the customized translation (or default value) for the name property of the given given entity, on the current language- Specified by:
getNamein interfaceDataTranslationHandler- Throws:
FrameworkException
-
getValue
public String getValue(BaseEntity entity, String propertyName, boolean fallbackToDefault) throws FrameworkException
Description copied from interface:DataTranslationHandlerSame asDataTranslationHandler.getValue(Language, BaseEntity, String, boolean)but for the current language- Specified by:
getValuein interfaceDataTranslationHandler- Throws:
FrameworkException- See Also:
DataTranslationHandler.getValue(Language, BaseEntity, String, boolean)
-
getValue
public String getValue(BaseEntity entity, com.querydsl.core.types.dsl.StringPath path) throws FrameworkException
Description copied from interface:DataTranslationHandlerReturns the customized translation (or default value) for the given property of the given given entity, on the current language- Specified by:
getValuein interfaceDataTranslationHandler- Throws:
FrameworkException
-
getValue
public String getValue(Language language, BaseEntity entity, String propertyName, boolean fallbackToDefault) throws FrameworkException
Description copied from interface:DataTranslationHandlerReturns the customized translation for the given property of the given entity on the given language, optionally returning the default property value (if fallbackToDefault is true and there is no such translation)- Specified by:
getValuein interfaceDataTranslationHandler- Throws:
FrameworkException
-
getValue
public String getValue(Language language, BaseEntity entity, com.querydsl.core.types.dsl.StringPath path) throws FrameworkException
Description copied from interface:DataTranslationHandlerReturns the customized translation (or default value) for the given property of the given given entity, on the given language- Specified by:
getValuein interfaceDataTranslationHandler- Throws:
FrameworkException
-
initialize
@PostConstruct public void initialize()
-
onApplicationInitialization
public void onApplicationInitialization()
Description copied from interface:ApplicationInitializationListenerInvoked when the application service is initialized- Specified by:
onApplicationInitializationin interfaceApplicationInitializationListener
-
removeFromStorage
public void removeFromStorage(DataTranslation translation)
Description copied from interface:DataTranslationHandlerRemoves from the data translation storage the given data translation.- Specified by:
removeFromStoragein interfaceDataTranslationHandler
-
-