Class SettingsManagementServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.SettingsManagementServiceImpl
-
- All Implemented Interfaces:
SettingsManagementService
@Service public class SettingsManagementServiceImpl extends java.lang.Object implements SettingsManagementService
-
-
Field Summary
Fields Modifier and Type Field Description private static com.fasterxml.jackson.databind.ObjectMapper
mapper
private SequenceGeneratorService
sequenceGenerator
private MongoStorageService
storageService
private UserManagementService
userManagementService
private WebSiteSettingsRepository
webSiteSettingsRepository
-
Constructor Summary
Constructors Constructor Description SettingsManagementServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSiteSettings
createSettings(WebSiteSettings settings)
This method creates a database entity.WebSiteSettings
createSettings(java.util.LinkedHashMap<java.lang.String,java.lang.Object> settingsAsMap)
This method creates a database entity from a map-representation.WebSiteSettingsRepository
getRepository()
java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>
getSettingsPaginationFilter(java.lang.String requestJson)
This method does calculation for a pages based on the request.void
removeSettingsAndClean(java.lang.String settingsId)
This method removes a database entity and clean all relationships from another entities.void
removeSettingsByIds(java.util.ArrayList<java.lang.String> settingsIds)
This method removes a list of database entities.WebSiteSettings
saveSettings(WebSiteSettings settings)
This method save an updates of database entity.WebSiteSettings
saveSettings(java.util.LinkedHashMap<java.lang.String,java.lang.Object> settingsAsMap)
This method save an updates of database entity.java.util.List<WebSiteSettings>
searchSettingsResults(java.lang.String requestJson)
This method does search requests and returns data as list.org.springframework.data.domain.Page<WebSiteSettings>
searchSettingsResultsPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.
-
-
-
Field Detail
-
userManagementService
@Autowired private UserManagementService userManagementService
-
storageService
@Autowired private MongoStorageService storageService
-
sequenceGenerator
@Autowired private SequenceGeneratorService sequenceGenerator
-
webSiteSettingsRepository
@Autowired private WebSiteSettingsRepository webSiteSettingsRepository
-
mapper
private static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
getRepository
public WebSiteSettingsRepository getRepository()
- Specified by:
getRepository
in interfaceSettingsManagementService
-
searchSettingsResultsPaged
public org.springframework.data.domain.Page<WebSiteSettings> searchSettingsResultsPaged(java.lang.String requestJson)
Description copied from interface:SettingsManagementService
This method does search requests and returns data as pages.- Specified by:
searchSettingsResultsPaged
in interfaceSettingsManagementService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
searchSettingsResults
public java.util.List<WebSiteSettings> searchSettingsResults(java.lang.String requestJson)
Description copied from interface:SettingsManagementService
This method does search requests and returns data as list.- Specified by:
searchSettingsResults
in interfaceSettingsManagementService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities as list
-
createSettings
public WebSiteSettings createSettings(java.util.LinkedHashMap<java.lang.String,java.lang.Object> settingsAsMap)
Description copied from interface:SettingsManagementService
This method creates a database entity from a map-representation.- Specified by:
createSettings
in interfaceSettingsManagementService
- Parameters:
settingsAsMap
- map-representation of database entity- Returns:
- saved instance of database entity
-
createSettings
public WebSiteSettings createSettings(WebSiteSettings settings)
Description copied from interface:SettingsManagementService
This method creates a database entity.- Specified by:
createSettings
in interfaceSettingsManagementService
- Parameters:
settings
- database entity- Returns:
- saved instance of database entity
-
saveSettings
public WebSiteSettings saveSettings(java.util.LinkedHashMap<java.lang.String,java.lang.Object> settingsAsMap)
Description copied from interface:SettingsManagementService
This method save an updates of database entity.- Specified by:
saveSettings
in interfaceSettingsManagementService
- Parameters:
settingsAsMap
- map-representation of database entity- Returns:
- saved instance of database entity
-
saveSettings
public WebSiteSettings saveSettings(WebSiteSettings settings)
Description copied from interface:SettingsManagementService
This method save an updates of database entity.- Specified by:
saveSettings
in interfaceSettingsManagementService
- Parameters:
settings
- database entity for a update- Returns:
- saved instance of database entity
-
removeSettingsByIds
public void removeSettingsByIds(java.util.ArrayList<java.lang.String> settingsIds)
Description copied from interface:SettingsManagementService
This method removes a list of database entities.- Specified by:
removeSettingsByIds
in interfaceSettingsManagementService
- Parameters:
settingsIds
- the list of database entities which will be removed
-
removeSettingsAndClean
public void removeSettingsAndClean(java.lang.String settingsId)
Description copied from interface:SettingsManagementService
This method removes a database entity and clean all relationships from another entities.- Specified by:
removeSettingsAndClean
in interfaceSettingsManagementService
- Parameters:
settingsId
- identification for database entity which will be removed
-
getSettingsPaginationFilter
public java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getSettingsPaginationFilter(java.lang.String requestJson)
Description copied from interface:SettingsManagementService
This method does calculation for a pages based on the request.- Specified by:
getSettingsPaginationFilter
in interfaceSettingsManagementService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
-