Interface ProductService

  • All Known Implementing Classes:
    ProductServiceImpl

    public interface ProductService
    Interface providing methods to work with products
    • Method Detail

      • isBaseProduct

        boolean isBaseProduct​(TypedObject item)
        Checks if item is a base product
        Parameters:
        item - item to be checked
        Returns:
        true if 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:
        true if 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 null if 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 status
        code - 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:
        true if attachment has been successfully created
      • deletePdfDatasheetDocument

        void deletePdfDatasheetDocument​(TypedObject document)
        Deletes provided PDF document
        Parameters:
        document - document to be deleted