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,BaseApplicationInitializationListener,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.BaseApplicationInitializationListener
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 fallbackToPropertyValue)Returns the customized translation (or default value) traversing the language's hierarchy for the tuple <language, entity, property>StringgetValue(Language language, BaseEntity entity, String propertyName, boolean fallbackToPropertyValue, boolean traverseHierachy)Returns the customized translation for the tuple <language, entity, property>, optionally returning the default property value (if fallbackToPropertyValue is true and there is no such translation).
The flag traverseHierachy is used to indicate if the language's hierarchy must be traversed (to the root) searching for translations.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, 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
-
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.BaseApplicationInitializationListener
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 fallbackToPropertyValue) throws FrameworkException
Description copied from interface:DataTranslationHandlerReturns the customized translation (or default value) traversing the language's hierarchy for the tuple <language, entity, property>- Specified by:
getValuein interfaceDataTranslationHandler- Throws:
FrameworkException
-
getValue
public String getValue(Language language, BaseEntity entity, String propertyName, boolean fallbackToPropertyValue, boolean traverseHierachy) throws FrameworkException
Description copied from interface:DataTranslationHandlerReturns the customized translation for the tuple <language, entity, property>, optionally returning the default property value (if fallbackToPropertyValue is true and there is no such translation).
The flag traverseHierachy is used to indicate if the language's hierarchy must be traversed (to the root) searching for translations.- 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
-
-