Package org.cyclos.impl.system
Class LanguageServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
- org.cyclos.impl.system.LanguageServiceImpl
-
- All Implemented Interfaces:
ApplicationUpgradeInitializationListener,BaseApplicationInitializationListener,CRUDServiceLocal<Language,LanguageDTO,LanguageData,Void>,LanguageServiceLocal,CRUDService<LanguageDTO,LanguageData,Void>,CRUDWithConfirmationPasswordService<LanguageDTO,LanguageData,Void>,Service,LanguageService
@Service public class LanguageServiceImpl extends CRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void> implements LanguageServiceLocal, ApplicationUpgradeInitializationListener
implementation forLanguageService
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_LEVELS-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, richTextHandler, withConfirmationPassword
-
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 LanguageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoRemove(Language language, boolean flush)May be overridden in order to perform logical removing, instead of physical removing, or to remove some extra relationships as wellLanguageDetailedVOget(LanguageVO vo)Returns a language VO by idLanguageDetailedVOgetCurrent()Returns the language VO for the current userprotected LanguageDatagetData(Language language)Returns details data for the given entityList<Language>getHierarchy(Language language)Returns the language hierarchy, having as first element the root language, and last element the given languageList<Language>importBuiltin()Imports the built-in languages as global languagesvoidinitialize()booleanisBuiltin(Language language)Returns whether the given language is built-inList<LanguageDetailedVO>list()Lists languages filtered by networkList<Language>listAll()Lists all languagesLanguagenewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterRemove(Language language)May be overridden in order to perform custom logic after removing an entityprotected voidonAfterSave(Language language, Language currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityvoidonApplicationUpgradeInitialization()Invoked when the application service is initializedprotected ObjectonBeforeSave(Language language, Language currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(LanguageDTO dto)voidupdateLastModified(Language language)Updates the last modification timestamp of the given language and all its descendents-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onBeforeRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, toDTO, toEntity, validate
-
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, 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
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
-
-
-
Field Detail
-
MAX_LEVELS
public static final int MAX_LEVELS
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public LanguageDetailedVO get(LanguageVO vo)
Description copied from interface:LanguageServiceReturns a language VO by id- Specified by:
getin interfaceLanguageService
-
getCurrent
public LanguageDetailedVO getCurrent()
Description copied from interface:LanguageServiceReturns the language VO for the current user- Specified by:
getCurrentin interfaceLanguageService
-
getHierarchy
public List<Language> getHierarchy(Language language) throws FrameworkException
Description copied from interface:LanguageServiceLocalReturns the language hierarchy, having as first element the root language, and last element the given language- Specified by:
getHierarchyin interfaceLanguageServiceLocal- Throws:
FrameworkException
-
importBuiltin
public List<Language> importBuiltin()
Description copied from interface:LanguageServiceLocalImports the built-in languages as global languages- Specified by:
importBuiltinin interfaceLanguageServiceLocal
-
initialize
@PostConstruct public void initialize()
-
isBuiltin
public boolean isBuiltin(Language language)
Description copied from interface:LanguageServiceLocalReturns whether the given language is built-in- Specified by:
isBuiltinin interfaceLanguageServiceLocal
-
list
public List<LanguageDetailedVO> list()
Description copied from interface:LanguageServiceLists languages filtered by network- Specified by:
listin interfaceLanguageService
-
listAll
public List<Language> listAll()
Description copied from interface:LanguageServiceLocalLists all languages- Specified by:
listAllin interfaceLanguageServiceLocal
-
newEntity
public Language newEntity(Void params)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<Language,LanguageDTO,LanguageData,Void>- Specified by:
newEntityin classCRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
onApplicationUpgradeInitialization
public void onApplicationUpgradeInitialization()
Description copied from interface:ApplicationUpgradeInitializationListenerInvoked when the application service is initialized- Specified by:
onApplicationUpgradeInitializationin interfaceApplicationUpgradeInitializationListener
-
updateLastModified
public void updateLastModified(Language language) throws FrameworkException
Description copied from interface:LanguageServiceLocalUpdates the last modification timestamp of the given language and all its descendents- Specified by:
updateLastModifiedin interfaceLanguageServiceLocal- Throws:
FrameworkException
-
doRemove
protected void doRemove(Language language, boolean flush)
Description copied from class:CRUDServiceImplMay be overridden in order to perform logical removing, instead of physical removing, or to remove some extra relationships as well- Overrides:
doRemovein classCRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
getData
protected LanguageData getData(Language language)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
onAfterRemove
protected void onAfterRemove(Language language)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after removing an entity- Overrides:
onAfterRemovein classCRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
onAfterSave
protected void onAfterSave(Language language, Language currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
onBeforeSave
protected Object onBeforeSave(Language language, Language currentCopy)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before saving an entity. Any returned value will be passed to theCRUDServiceImpl.onAfterSave(BaseEntity, BaseEntity, Object)method- Overrides:
onBeforeSavein classCRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
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
-
resolveValidator
protected Validator resolveValidator(LanguageDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<Language,QLanguage,LanguageDTO,LanguageData,Void>
-
-