Class ContentContainerServiceImpl
- java.lang.Object
- 
- co.mastermindcms.modules.services.ContentContainerServiceImpl
 
- 
- All Implemented Interfaces:
- ContentContainerService
 
 @Service public class ContentContainerServiceImpl extends java.lang.Object implements ContentContainerService 
- 
- 
Field SummaryFields Modifier and Type Field Description private BlogCategoryServiceblogCategoryServiceprivate ContentContainerRepositorycontentContainerRepositoryprivate static com.fasterxml.jackson.databind.ObjectMappermapperprivate org.springframework.data.mongodb.core.MongoTemplatemongoTemplateprivate SequenceGeneratorServicesequenceGeneratorprivate MongoStorageServicestorageServiceprivate TranslationServicetranslationServiceprivate UserManagementServiceuserManagementService
 - 
Constructor SummaryConstructors Constructor Description ContentContainerServiceImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description private ContentContainerconvertToContentContainer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> blogAsMap)voidcreateContainer(ContentContainer contentContainer)This method creates a database entity.voidcreateContainer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> blogAsMap)This method creates a database entity from a map-representation.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getArticles(java.lang.String regex)This method retrieves a map, which can be processed in a templates.java.util.List<java.util.Map<java.lang.String,java.lang.String>>getContainerArticles(java.lang.String blogId)This method retrieves a map, which can be processed in a templates.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>getContainerPaginationFilter(java.lang.String requestJson)This method does calculation for a pages based on the request.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getContainerTypes()This method retrieves a map, which can be processed in a templates.ContentContainerRepositorygetRepository()voidremoveArticles(java.lang.String blogId, java.util.ArrayList<java.lang.String> articleIds)This method removes a list of database entities.voidremoveContainerAndClean(java.lang.String blogId)This method removes a database entity and clean all relationships from another entities.voidremoveContainersByIds(java.util.ArrayList<java.lang.String> blogsIds)This method removes a list of database entities.ContentContainersaveContainer(ContentContainer container)This method save an updates of database entity.ContentContainersaveContainer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> blogAsMap, java.lang.String blogId)This method save an updates of database entity.org.springframework.data.domain.Page<ContentContainer>searchContainerResultsPaged(java.lang.String requestJson)This method does search requests and returns data as pages.java.util.List<ContentContainer>searchContainersResults(java.lang.String requestJson)This method does search requests and returns data as list.
 
- 
- 
- 
Field Detail- 
contentContainerRepository@Autowired private ContentContainerRepository contentContainerRepository 
 - 
blogCategoryService@Autowired private BlogCategoryService blogCategoryService 
 - 
translationService@Autowired private TranslationService translationService 
 - 
sequenceGenerator@Autowired private SequenceGeneratorService sequenceGenerator 
 - 
storageService@Autowired private MongoStorageService storageService 
 - 
mongoTemplate@Autowired private org.springframework.data.mongodb.core.MongoTemplate mongoTemplate 
 - 
userManagementService@Autowired private UserManagementService userManagementService 
 - 
mapperprivate static final com.fasterxml.jackson.databind.ObjectMapper mapper 
 
- 
 - 
Method Detail- 
getRepositorypublic ContentContainerRepository getRepository() - Specified by:
- getRepositoryin interface- ContentContainerService
 
 - 
createContainerpublic void createContainer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> blogAsMap) Description copied from interface:ContentContainerServiceThis method creates a database entity from a map-representation.- Specified by:
- createContainerin interface- ContentContainerService
- Parameters:
- blogAsMap- map-representation of database entity
 
 - 
createContainerpublic void createContainer(ContentContainer contentContainer) Description copied from interface:ContentContainerServiceThis method creates a database entity.- Specified by:
- createContainerin interface- ContentContainerService
- Parameters:
- contentContainer- database entity
 
 - 
saveContainer@Transactional public ContentContainer saveContainer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> blogAsMap, java.lang.String blogId) Description copied from interface:ContentContainerServiceThis method save an updates of database entity.- Specified by:
- saveContainerin interface- ContentContainerService
- Parameters:
- blogAsMap- map-representation of database entity
- blogId- identification for database entity which will be updated
- Returns:
- saved instance of database entity
 
 - 
saveContainerpublic ContentContainer saveContainer(ContentContainer container) Description copied from interface:ContentContainerServiceThis method save an updates of database entity.- Specified by:
- saveContainerin interface- ContentContainerService
- Parameters:
- container- database entity for a update
- Returns:
- saved instance of database entity
 
 - 
removeArticles@Transactional public void removeArticles(java.lang.String blogId, java.util.ArrayList<java.lang.String> articleIds)Description copied from interface:ContentContainerServiceThis method removes a list of database entities.- Specified by:
- removeArticlesin interface- ContentContainerService
- Parameters:
- blogId- identification for database entity which will be updated
- articleIds- the list of database entities which will be removed
 
 - 
getContainerArticlespublic java.util.List<java.util.Map<java.lang.String,java.lang.String>> getContainerArticles(java.lang.String blogId) Description copied from interface:ContentContainerServiceThis method retrieves a map, which can be processed in a templates.- Specified by:
- getContainerArticlesin interface- ContentContainerService
- Parameters:
- blogId- identification for database entity which will be retrieved
- Returns:
- map-representation of data
 
 - 
getArticlespublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getArticles(java.lang.String regex) Description copied from interface:ContentContainerServiceThis method retrieves a map, which can be processed in a templates.- Specified by:
- getArticlesin interface- ContentContainerService
- Parameters:
- regex- regexp for a filtering by "_id" field of database entity
- Returns:
- map-representation of data
 
 - 
removeContainersByIds@Transactional public void removeContainersByIds(java.util.ArrayList<java.lang.String> blogsIds) Description copied from interface:ContentContainerServiceThis method removes a list of database entities.- Specified by:
- removeContainersByIdsin interface- ContentContainerService
- Parameters:
- blogsIds- the list of database entities which will be removed
 
 - 
removeContainerAndClean@Transactional public void removeContainerAndClean(java.lang.String blogId) Description copied from interface:ContentContainerServiceThis method removes a database entity and clean all relationships from another entities.- Specified by:
- removeContainerAndCleanin interface- ContentContainerService
- Parameters:
- blogId- identification for database entity which will be removed
 
 - 
getContainerPaginationFilterpublic java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getContainerPaginationFilter(java.lang.String requestJson) Description copied from interface:ContentContainerServiceThis method does calculation for a pages based on the request.- Specified by:
- getContainerPaginationFilterin interface- ContentContainerService
- Parameters:
- requestJson- JSON-object of request contains an instructions for search queries
- Returns:
- map-representation of data
 
 - 
searchContainerResultsPagedpublic org.springframework.data.domain.Page<ContentContainer> searchContainerResultsPaged(java.lang.String requestJson) Description copied from interface:ContentContainerServiceThis method does search requests and returns data as pages.- Specified by:
- searchContainerResultsPagedin interface- ContentContainerService
- Parameters:
- requestJson- JSON-object of request contains an instructions for search queries
- Returns:
- database entities separated to pages
 
 - 
searchContainersResultspublic java.util.List<ContentContainer> searchContainersResults(java.lang.String requestJson) Description copied from interface:ContentContainerServiceThis method does search requests and returns data as list.- Specified by:
- searchContainersResultsin interface- ContentContainerService
- Parameters:
- requestJson- JSON-object of request contains an instructions for search queries
- Returns:
- database entities as list
 
 - 
getContainerTypespublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getContainerTypes() Description copied from interface:ContentContainerServiceThis method retrieves a map, which can be processed in a templates.- Specified by:
- getContainerTypesin interface- ContentContainerService
- Returns:
- map-representation of data
 
 - 
convertToContentContainerprivate ContentContainer convertToContentContainer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> blogAsMap) 
 
- 
 
-