Class StaticContentServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>
-
- org.cyclos.impl.contentmanagement.StaticContentServiceImpl
-
- All Implemented Interfaces:
StaticContentServiceLocal,CRUDServiceLocal<BaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>,StaticContentService,CRUDService<BaseStaticContentDTO,StaticContentData,StaticContentDataParams>,CRUDWithConfirmationPasswordService<BaseStaticContentDTO,StaticContentData,StaticContentDataParams>,Service
@Service public class StaticContentServiceImpl extends CRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams> implements StaticContentServiceLocal
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, 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
-
-
Constructor Summary
Constructors Constructor Description StaticContentServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseStaticContentensureLastModifiedDate(BaseStaticContent content)Ensures the cache control works correctly for static contents when changing a configuration image which affects an unchanged content.StaticContentDatagetData(BaseStaticContent staticContent)Returns details data for the given entityStringgetHelpContent(Role role)StringgetHelpOrOriginalContent(BaseHelpContent helpContent)StaticContentListDatagetListData(ConfigurationVO configurationVO)Returns data to list the static contents of a given configurationStringgetSmsHelpContent(Role role)List<StaticContentVO>list(ConfigurationVO configurationVO)Lists the static contents of a given configurationBaseStaticContentnewEntity(StaticContentDataParams params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterRemove(BaseStaticContent entity)May be overridden in order to perform custom logic after removing an entityprotected voidonAfterSave(BaseStaticContent content, BaseStaticContent currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected ObjectonBeforeSave(BaseStaticContent entity, BaseStaticContent currentCopy)May be overridden in order to perform custom logic before saving an entity.StringpreviewEMail(PreviewEmailTemplateParams input)Previews the e-mail content by applying the given template to the given userStringreadOriginalHelp(StaticContentNature nature)Returns the original help content for the specifiedStaticContentNature.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(BaseStaticContentDTO dto)protected org.apache.commons.collections4.BidiMap<Class<? extends BaseStaticContent>,Class<? extends BaseStaticContentDTO>>subClassMappings()Should be overridden by subclasses which handle entity / dto hierarchies.BaseStaticContentDTOtoDTO(BaseStaticContent entity)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, doRemove, 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, 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.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, toEntity, validate
-
-
-
-
Method Detail
-
ensureLastModifiedDate
public BaseStaticContent ensureLastModifiedDate(BaseStaticContent content)
Description copied from interface:StaticContentServiceLocalEnsures the cache control works correctly for static contents when changing a configuration image which affects an unchanged content.- Specified by:
ensureLastModifiedDatein interfaceStaticContentServiceLocal
-
getData
public StaticContentData getData(BaseStaticContent staticContent) throws FrameworkException
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>- Throws:
FrameworkException
-
getHelpContent
public String getHelpContent(Role role)
- Specified by:
getHelpContentin interfaceStaticContentService- Returns:
- the help content according to the specified
Role
-
getHelpOrOriginalContent
public String getHelpOrOriginalContent(BaseHelpContent helpContent)
- Specified by:
getHelpOrOriginalContentin interfaceStaticContentServiceLocal- Returns:
- the help's content or the original according to the content definition type.
-
getListData
public StaticContentListData getListData(ConfigurationVO configurationVO) throws FrameworkException
Description copied from interface:StaticContentServiceReturns data to list the static contents of a given configuration- Specified by:
getListDatain interfaceStaticContentService- Throws:
FrameworkException
-
getSmsHelpContent
public String getSmsHelpContent(Role role)
- Specified by:
getSmsHelpContentin interfaceStaticContentService- Returns:
- the sms help content. Note for version 4.0.3.x: at this moment only the role admin is supported.
-
list
public List<StaticContentVO> list(ConfigurationVO configurationVO) throws FrameworkException
Description copied from interface:StaticContentServiceLists the static contents of a given configuration- Specified by:
listin interfaceStaticContentService- Throws:
FrameworkException
-
newEntity
public BaseStaticContent newEntity(StaticContentDataParams 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<BaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>- Specified by:
newEntityin classCRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>
-
previewEMail
public String previewEMail(PreviewEmailTemplateParams input) throws FrameworkException
Description copied from interface:StaticContentServicePreviews the e-mail content by applying the given template to the given user- Specified by:
previewEMailin interfaceStaticContentService- Throws:
FrameworkException
-
readOriginalHelp
public String readOriginalHelp(StaticContentNature nature)
Description copied from interface:StaticContentServiceLocalReturns the original help content for the specifiedStaticContentNature.- Specified by:
readOriginalHelpin interfaceStaticContentServiceLocal
-
toDTO
public BaseStaticContentDTO toDTO(BaseStaticContent entity)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<BaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>- Overrides:
toDTOin classCRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>
-
onAfterRemove
protected void onAfterRemove(BaseStaticContent entity)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after removing an entity- Overrides:
onAfterRemovein classCRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>
-
onAfterSave
protected void onAfterSave(BaseStaticContent content, BaseStaticContent currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>
-
onBeforeSave
protected Object onBeforeSave(BaseStaticContent entity, BaseStaticContent 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<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>
-
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(BaseStaticContentDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<BaseStaticContent,QBaseStaticContent,BaseStaticContentDTO,StaticContentData,StaticContentDataParams>
-
subClassMappings
protected org.apache.commons.collections4.BidiMap<Class<? extends BaseStaticContent>,Class<? extends BaseStaticContentDTO>> subClassMappings()
Description copied from class:CRUDServiceImplShould be overridden by subclasses which handle entity / dto hierarchies. The map key should be the entity class, while the map value, the DTO class
-
-