Class ThemeServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.CRUDServiceSecurity<ThemeDTO,Theme,ThemeData,ThemeDataParams>
-
- org.cyclos.security.contentmanagement.ThemeServiceSecurity
-
- All Implemented Interfaces:
ThemeService,CRUDService<ThemeDTO,ThemeData,ThemeDataParams>,CRUDWithConfirmationPasswordService<ThemeDTO,ThemeData,ThemeDataParams>,Service
@Security public class ThemeServiceSecurity extends CRUDServiceSecurity<ThemeDTO,Theme,ThemeData,ThemeDataParams> implements ThemeService
Security implementation for themes
-
-
Field Summary
-
Fields inherited from class org.cyclos.security.CRUDServiceSecurity
entityClass
-
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 ThemeServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyThemes(ApplyThemesDTO params)Applies the given themes to the given configuration: logged user, guests, mobile and pay application.protected voidcheckCreateNew(ThemeDataParams params)Checks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif notbooleandoHasManageAccess(Theme theme)Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given operationbooleandoHasViewAccess(Theme theme)Should be implemented in order to return whether the caller is allowed to view the given entity.FileInfoexport(Long id)Exports the given themeStringgetCSS(Long id)Returns the CSS corresponding to the theme with the given idStringgetFallbackCSS(ThemeType type)Returns a default CSS corresponding to the theme type.protected ThemeServiceLocalgetImplementation()Should be implemented in order to return the actual implementation of the serviceThemesListDatagetListData(ConfigurationVO configurationVO)Returns data to list themes in a configurationThemeVOgetTheme(ThemeType type)Returns the theme for the given type.ThemeVOgetVO(Long id)Returns theThemeVOwith the given id.LongimportNew(ConfigurationVO configurationVO, String importedFromFile, SerializableInputStream in)Import the theme definitions from file, creating it on the given configuration, returning the new theme idbooleanisAccessible(SessionData sessionData, Theme entity)Must be implemented in order to determine whether the given entity is accessible for the given session data.List<ThemeVO>list(ConfigurationVO configurationVO)Returns a list with visible themes on the given configuration sorted by theme type (first main web themes)-
Methods inherited from class org.cyclos.security.CRUDServiceSecurity
canPerformOperation, canViewData, checkManageAccess, checkOperation, checkSave, checkViewAccess, customizeData, find, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, hasManageAccess, hasViewAccess, load, onBeforeSave, remove, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveEntityCheck, save, saveWithConfirmationPassword
-
Methods inherited from class org.cyclos.security.BaseServiceSecurity
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initialize
-
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
-
-
-
-
Method Detail
-
applyThemes
public void applyThemes(ApplyThemesDTO params) throws FrameworkException
Description copied from interface:ThemeServiceApplies the given themes to the given configuration: logged user, guests, mobile and pay application. Passing null means the theme will be inherited from parent configurations, but is not possible for the system default configuration. The themes must be defined within that configuration or in any of it's ancestors.- Specified by:
applyThemesin interfaceThemeService- Throws:
FrameworkException
-
doHasManageAccess
public boolean doHasManageAccess(Theme theme)
Description copied from class:CRUDServiceSecurityShould be implemented in order to return whether the caller is allowed to manage the given entity, for the given operation- Specified by:
doHasManageAccessin classCRUDServiceSecurity<ThemeDTO,Theme,ThemeData,ThemeDataParams>
-
doHasViewAccess
public boolean doHasViewAccess(Theme theme)
Description copied from class:CRUDServiceSecurityShould be implemented in order to return whether the caller is allowed to view the given entity.- Specified by:
doHasViewAccessin classCRUDServiceSecurity<ThemeDTO,Theme,ThemeData,ThemeDataParams>
-
export
public FileInfo export(Long id)
Description copied from interface:ThemeServiceExports the given theme- Specified by:
exportin interfaceThemeService
-
getCSS
public String getCSS(Long id)
Description copied from interface:ThemeServiceReturns the CSS corresponding to the theme with the given id- Specified by:
getCSSin interfaceThemeService
-
getFallbackCSS
public String getFallbackCSS(ThemeType type)
Description copied from interface:ThemeServiceReturns a default CSS corresponding to the theme type. It's used only in case the selected theme fails to compile.- Specified by:
getFallbackCSSin interfaceThemeService
-
getListData
public ThemesListData getListData(ConfigurationVO configurationVO) throws FrameworkException
Description copied from interface:ThemeServiceReturns data to list themes in a configuration- Specified by:
getListDatain interfaceThemeService- Throws:
FrameworkException
-
getTheme
public ThemeVO getTheme(ThemeType type) throws FrameworkException
Description copied from interface:ThemeServiceReturns the theme for the given type. In case ofThemeType.MAIN_WEBthe returned theme depends on if there is a logged user or not.- Specified by:
getThemein interfaceThemeService- Throws:
FrameworkException
-
getVO
public ThemeVO getVO(Long id) throws EntityNotFoundException
Description copied from interface:ThemeServiceReturns theThemeVOwith the given id.- Specified by:
getVOin interfaceThemeService- Throws:
EntityNotFoundException
-
importNew
public Long importNew(ConfigurationVO configurationVO, String importedFromFile, SerializableInputStream in) throws FileParsingException
Description copied from interface:ThemeServiceImport the theme definitions from file, creating it on the given configuration, returning the new theme id- Specified by:
importNewin interfaceThemeService- Throws:
FileParsingException
-
isAccessible
public boolean isAccessible(SessionData sessionData, Theme entity)
Description copied from class:CRUDServiceSecurityMust be implemented in order to determine whether the given entity is accessible for the given session data. This method shouldn't check the same condition asCRUDServiceSecurity.hasViewAccess(BaseEntity). If the only condition for an entity isCRUDServiceSecurity.hasViewAccess(BaseEntity), this method should return false.- Specified by:
isAccessiblein classCRUDServiceSecurity<ThemeDTO,Theme,ThemeData,ThemeDataParams>
-
list
public List<ThemeVO> list(ConfigurationVO configurationVO) throws FrameworkException
Description copied from interface:ThemeServiceReturns a list with visible themes on the given configuration sorted by theme type (first main web themes)- Specified by:
listin interfaceThemeService- Throws:
FrameworkException
-
checkCreateNew
protected void checkCreateNew(ThemeDataParams params)
Description copied from class:CRUDServiceSecurityChecks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif not- Specified by:
checkCreateNewin classCRUDServiceSecurity<ThemeDTO,Theme,ThemeData,ThemeDataParams>
-
getImplementation
protected ThemeServiceLocal getImplementation()
Description copied from class:CRUDServiceSecurityShould be implemented in order to return the actual implementation of the service- Specified by:
getImplementationin classCRUDServiceSecurity<ThemeDTO,Theme,ThemeData,ThemeDataParams>
-
-