Interface ProductService
-
- All Known Implementing Classes:
ProductServiceImpl
public interface ProductService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ProductaddProductToCategory(java.lang.String categoryId, java.lang.String productId)This method does a relationship between entities.ProductaddProductToCategory(java.lang.String categoryId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> productAsMap)This method does a relationship between entities.java.util.Optional<Product>createProduct(Product product)This method creates a database entity.java.util.Optional<Product>createProduct(java.util.LinkedHashMap<java.lang.String,java.lang.Object> productAsMap)This method creates a database entity.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>getPaginationFilter(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>>getProductsByCategoryAndFirstLetter(java.lang.String categoryId, java.lang.String firstLetter)This method retrieves a map, which can be processed in a templates.ProductRepositorygetRepository()java.util.List<java.util.Map<java.lang.String,java.lang.String>>getSortedProductsByCategory(java.lang.String categoryId)This method retrieves a map, which can be processed in a templates.ProductDTOmapProductToDto(Product product, boolean optimal)This method does map product entity to dto objectvoidremoveProductAndClean(java.lang.String productId)This method removes a database entity and clean all relationships from another entities.voidremoveProductFromAttribute(java.lang.String productId, java.lang.String attrId)This method removes relationship between database entities.voidremoveProductFromAttributes(java.lang.String productId)This method removes relationship between database entities.voidremoveProductFromCategories(java.lang.String productId)This method removes relationship between database entities.voidremoveProductFromCategory(java.lang.String productId, java.lang.String categoryId)This method removes relationship between database entities.voidremoveProductFromSKU(java.lang.String productId, java.lang.String skuId)This method removes relationship between database entities.voidremoveProductFromSKUs(java.lang.String productId)This method removes relationship between database entities.voidremoveProductFromTranslation(java.lang.String productId, java.lang.String tranId)This method removes relationship between database entities.voidremoveProductFromTranslations(java.lang.String productId)This method removes relationship between database entities.voidremoveProductsByIds(java.util.ArrayList<java.lang.String> productsIds)This method removes a list of database entities.ProductsaveProduct(Product product)This method saves a database entity.ProductsaveProduct(java.util.LinkedHashMap<java.lang.String,java.lang.Object> productAsMap)This method save an updates of database entity.java.util.LinkedHashSet<ProductDTO>searchProducts(java.lang.String requestJson)This method does search requests and returns data as list.java.util.List<Product>searchProducts(java.lang.String query, java.lang.String offset, java.lang.String limit)Deprecated.co.mastermindcms.modules.beans.SearchResponsesearchProducts(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)This method does search requests and returns data as list.co.mastermindcms.modules.beans.SearchResponsesearchProductsLightweight(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)Retrieves lightweight products based on the given request JSON.org.springframework.data.domain.Page<Product>searchProductsPaged(java.lang.String requestJson)This method does search requests and returns data as pages.
-
-
-
Method Detail
-
getRepository
ProductRepository getRepository()
-
getPaginationFilter
java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationFilter(java.lang.String requestJson)
This method does calculation for a pages based on the request.- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
searchProducts
co.mastermindcms.modules.beans.SearchResponse searchProducts(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)
This method does search requests and returns data as list.- Parameters:
requestJson- search request- Returns:
- database entities separated to pages
-
searchProductsLightweight
co.mastermindcms.modules.beans.SearchResponse searchProductsLightweight(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestJson)
Retrieves lightweight products based on the given request JSON.- Parameters:
requestJson- a LinkedHashMap containing the request parameters- Returns:
- a SearchResponse object containing the lightweight products
-
searchProducts
java.util.LinkedHashSet<ProductDTO> searchProducts(java.lang.String requestJson)
This method does search requests and returns data as list.- Parameters:
requestJson- search request- Returns:
- data transport entities as list
-
searchProductsPaged
org.springframework.data.domain.Page<Product> searchProductsPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
searchProducts
@Deprecated java.util.List<Product> searchProducts(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.This method does search requests and returns data as list.- Parameters:
query- search queryoffset- offset for returned itemslimit- limit for returned items- Returns:
- database entities as list
-
createProduct
java.util.Optional<Product> createProduct(java.util.LinkedHashMap<java.lang.String,java.lang.Object> productAsMap)
This method creates a database entity.- Parameters:
productAsMap- map-representation of database entity- Returns:
- database entity
-
createProduct
java.util.Optional<Product> createProduct(Product product)
This method creates a database entity.- Parameters:
product- database entity- Returns:
- optional value to externally interaction
-
addProductToCategory
Product addProductToCategory(java.lang.String categoryId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> productAsMap)
This method does a relationship between entities.- Parameters:
categoryId- identification for database entity which will be updatedproductAsMap- map-representation of database entity- Returns:
- database entity
-
addProductToCategory
Product addProductToCategory(java.lang.String categoryId, java.lang.String productId)
This method does a relationship between entities.- Parameters:
categoryId- identification for database entity which will be updatedproductId- identification for database entity which will be updated- Returns:
- database entity
-
saveProduct
Product saveProduct(java.util.LinkedHashMap<java.lang.String,java.lang.Object> productAsMap)
This method save an updates of database entity.- Parameters:
productAsMap- map-representation of database entity- Returns:
- saved instance of database entity
-
saveProduct
Product saveProduct(Product product)
This method saves a database entity.- Parameters:
product- database entity- Returns:
- saved instance of database entity
-
removeProductFromCategory
void removeProductFromCategory(java.lang.String productId, java.lang.String categoryId)This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removedcategoryId- identification for database entity which will be updated
-
removeProductFromSKU
void removeProductFromSKU(java.lang.String productId, java.lang.String skuId)This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removedskuId- identification for database entity which will be updated
-
removeProductFromAttribute
void removeProductFromAttribute(java.lang.String productId, java.lang.String attrId)This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removedattrId- identification for database entity which will be updated
-
removeProductFromTranslation
void removeProductFromTranslation(java.lang.String productId, java.lang.String tranId)This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removedtranId- identification for database entity which will be updated
-
removeProductFromCategories
void removeProductFromCategories(java.lang.String productId)
This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removed
-
removeProductFromSKUs
void removeProductFromSKUs(java.lang.String productId)
This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removed
-
removeProductFromAttributes
void removeProductFromAttributes(java.lang.String productId)
This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removed
-
removeProductFromTranslations
void removeProductFromTranslations(java.lang.String productId)
This method removes relationship between database entities.- Parameters:
productId- identification for database entity which will be removed
-
removeProductAndClean
void removeProductAndClean(java.lang.String productId)
This method removes a database entity and clean all relationships from another entities.- Parameters:
productId- identification for database entity which will be removed
-
removeProductsByIds
void removeProductsByIds(java.util.ArrayList<java.lang.String> productsIds)
This method removes a list of database entities.- Parameters:
productsIds- the list of database entities which will be removed
-
getSortedProductsByCategory
java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSortedProductsByCategory(java.lang.String categoryId)
This method retrieves a map, which can be processed in a templates.- Parameters:
categoryId- identification for database entity which will be retrieved- Returns:
- map-representation of data
-
getProductsByCategoryAndFirstLetter
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getProductsByCategoryAndFirstLetter(java.lang.String categoryId, java.lang.String firstLetter)This method retrieves a map, which can be processed in a templates.- Parameters:
categoryId- identification for database entity which will be retrievedfirstLetter- first letter of the name for the product- Returns:
- map-representation of data
-
mapProductToDto
ProductDTO mapProductToDto(Product product, boolean optimal)
This method does map product entity to dto object- Parameters:
product- database entity which be used to map to dtooptimal- this pointer optimises the data transfer object- Returns:
- data transport object
-
-