Class ContentContainerServiceImpl

    • Field Detail

      • mongoTemplate

        @Autowired
        private org.springframework.data.mongodb.core.MongoTemplate mongoTemplate
      • mapper

        private static final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • ContentContainerServiceImpl

        public ContentContainerServiceImpl()
    • Method Detail

      • createContainer

        public void createContainer​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> blogAsMap)
        Description copied from interface: ContentContainerService
        This method creates a database entity from a map-representation.
        Specified by:
        createContainer in interface ContentContainerService
        Parameters:
        blogAsMap - map-representation of 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: ContentContainerService
        This method save an updates of database entity.
        Specified by:
        saveContainer in interface ContentContainerService
        Parameters:
        blogAsMap - map-representation of database entity
        blogId - identification for database entity which will be updated
        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: ContentContainerService
        This method removes a list of database entities.
        Specified by:
        removeArticles in interface ContentContainerService
        Parameters:
        blogId - identification for database entity which will be updated
        articleIds - the list of database entities which will be removed
      • getContainerArticles

        public java.util.List<java.util.Map<java.lang.String,​java.lang.String>> getContainerArticles​(java.lang.String blogId)
        Description copied from interface: ContentContainerService
        This method retrieves a map, which can be processed in a templates.
        Specified by:
        getContainerArticles in interface ContentContainerService
        Parameters:
        blogId - identification for database entity which will be retrieved
        Returns:
        map-representation of data
      • getArticles

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getArticles​(java.lang.String regex)
        Description copied from interface: ContentContainerService
        This method retrieves a map, which can be processed in a templates.
        Specified by:
        getArticles in 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: ContentContainerService
        This method removes a list of database entities.
        Specified by:
        removeContainersByIds in 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: ContentContainerService
        This method removes a database entity and clean all relationships from another entities.
        Specified by:
        removeContainerAndClean in interface ContentContainerService
        Parameters:
        blogId - identification for database entity which will be removed
      • getContainerPaginationFilter

        public java.util.Deque<java.util.Map<java.lang.String,​java.lang.Object>> getContainerPaginationFilter​(java.lang.String requestJson)
        Description copied from interface: ContentContainerService
        This method does calculation for a pages based on the request.
        Specified by:
        getContainerPaginationFilter in interface ContentContainerService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        map-representation of data
      • searchContainerResultsPaged

        public org.springframework.data.domain.Page<ContentContainer> searchContainerResultsPaged​(java.lang.String requestJson)
        Description copied from interface: ContentContainerService
        This method does search requests and returns data as pages.
        Specified by:
        searchContainerResultsPaged in interface ContentContainerService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        database entities separated to pages
      • searchContainersResults

        public java.util.List<ContentContainer> searchContainersResults​(java.lang.String requestJson)
        Description copied from interface: ContentContainerService
        This method does search requests and returns data as list.
        Specified by:
        searchContainersResults in interface ContentContainerService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        database entities as list
      • getContainerTypes

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getContainerTypes()
        Description copied from interface: ContentContainerService
        This method retrieves a map, which can be processed in a templates.
        Specified by:
        getContainerTypes in interface ContentContainerService
        Returns:
        map-representation of data
      • convertToContentContainer

        private ContentContainer convertToContentContainer​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> blogAsMap)