Interface ProductService
-
- All Known Implementing Classes:
ProductServiceImpl
public interface ProductServiceInterface providing methods to work with products
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancreatePdfDatasheetDocument(TypedObject product)Creates new pdf attachment for productvoiddeletePdfDatasheetDocument(TypedObject document)Deletes provided PDF documentjava.util.List<java.lang.String>getAllApprovalStatusCodes()Gets all available approval status codesjava.lang.StringgetApprovalStatusCode(TypedObject item)Gets approval status code for provided itemjava.lang.StringgetApprovalStatusName(java.lang.String code)Gets an enum value name of provided approval status codejava.util.List<TypedObject>getPdfDatasheetDocuments(TypedObject product)Gets all PDF documents attached to product.java.util.List<TypedObject>getVariants(TypedObject base)Gets all variants of provided item that are defined in the systemjava.lang.StringgetVariantTypecode(TypedObject base)Gets a type code of variants for provided item.booleanhasVariants(TypedObject item)Checks if item is a product that has at least one variant existingbooleanisBaseProduct(TypedObject item)Checks if item is a base productvoidsetApprovalStatus(TypedObject item, java.lang.String code)Sets new approval status code for prodcut
-
-
-
Method Detail
-
isBaseProduct
boolean isBaseProduct(TypedObject item)
Checks if item is a base product- Parameters:
item- item to be checked- Returns:
trueif item provided is a base product
-
hasVariants
boolean hasVariants(TypedObject item)
Checks if item is a product that has at least one variant existing- Parameters:
item- item to be checked- Returns:
trueif there is at least one variant defined for provided item
-
getVariants
java.util.List<TypedObject> getVariants(TypedObject base)
Gets all variants of provided item that are defined in the system- Parameters:
base- base item- Returns:
- list of variants defined
-
getVariantTypecode
java.lang.String getVariantTypecode(TypedObject base)
Gets a type code of variants for provided item.Provided item needs to be a base product.
- Parameters:
base- base product- Returns:
- type code for variats of provided product
- Throws:
java.lang.IllegalArgumentException- if provided item is not a base product- See Also:
isBaseProduct(TypedObject)
-
getApprovalStatusCode
java.lang.String getApprovalStatusCode(TypedObject item)
Gets approval status code for provided item- Parameters:
item- product to be checked- Returns:
- approval status code or
nullif provided item is not a product - See Also:
ArticleApprovalStatus.getCode()
-
setApprovalStatus
void setApprovalStatus(TypedObject item, java.lang.String code)
Sets new approval status code for prodcut- Parameters:
item- product to change an approval statuscode- new approval status code- See Also:
ArticleApprovalStatus.getCode()
-
getApprovalStatusName
java.lang.String getApprovalStatusName(java.lang.String code)
Gets an enum value name of provided approval status code- Parameters:
code- approval status code- Returns:
- enum value name for approval status
- See Also:
ArticleApprovalStatus
-
getAllApprovalStatusCodes
java.util.List<java.lang.String> getAllApprovalStatusCodes()
Gets all available approval status codes- Returns:
- list approval status codes
-
getPdfDatasheetDocuments
java.util.List<TypedObject> getPdfDatasheetDocuments(TypedObject product)
Gets all PDF documents attached to product.- Parameters:
product- product which attachments are required- Returns:
- list of pdfs attached
-
createPdfDatasheetDocument
boolean createPdfDatasheetDocument(TypedObject product)
Creates new pdf attachment for product- Parameters:
product- product to which new pdf should be attached- Returns:
trueif attachment has been successfully created
-
deletePdfDatasheetDocument
void deletePdfDatasheetDocument(TypedObject document)
Deletes provided PDF document- Parameters:
document- document to be deleted
-
-