Class DefaultWishlist2Service

    • Field Detail

      • wishlistDao

        @Deprecated
        protected Wishlist2Dao wishlistDao
        Deprecated.
        Since 4.1. Implement the Wishlist2Dao as own property
      • saveAnonymousWishlists

        @Deprecated
        protected boolean saveAnonymousWishlists
        Deprecated.
        Since 4.1. Implement the saveAnonymousWishlists boolean as own property
    • Constructor Detail

      • DefaultWishlist2Service

        public DefaultWishlist2Service()
    • Method Detail

      • getCurrentUser

        protected UserModel getCurrentUser()
      • saveWishlist

        protected boolean saveWishlist​(UserModel user)
      • saveWishlist

        protected boolean saveWishlist​(Wishlist2Model wishlist)
      • getWishlistEntryForProduct

        public Wishlist2EntryModel getWishlistEntryForProduct​(ProductModel product,
                                                              Wishlist2Model wishlist)
        Description copied from interface: Wishlist2Service
        Returns the wishlist entry which contains the given product from the specific wishlist
        Specified by:
        getWishlistEntryForProduct in interface Wishlist2Service
        Parameters:
        product - the product which is contained in the wishlist entry which needs to be found
        wishlist - the wishlist which contains the wishlist entry
        Returns:
        the found wishlist entry
      • removeWishlistEntryForProduct

        public void removeWishlistEntryForProduct​(ProductModel product,
                                                  Wishlist2Model wishlist)
        Description copied from interface: Wishlist2Service
        Removes a wishlist entry from the wishlist which contains the given product. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
        Specified by:
        removeWishlistEntryForProduct in interface Wishlist2Service
        Parameters:
        product - the product which is contained in the wishlist entry which will be removed
        wishlist - the wishlist from which the entry should be removed
      • addWishlistEntry

        public void addWishlistEntry​(Wishlist2Model wishlist,
                                     Wishlist2EntryModel entry)
        Description copied from interface: Wishlist2Service
        Adds the given entry to the given wishlist. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
        Specified by:
        addWishlistEntry in interface Wishlist2Service
        Parameters:
        wishlist - the wishlist the entry should be added to
        entry - the entry which should be added to the wishlist
      • removeWishlistEntry

        public void removeWishlistEntry​(Wishlist2Model wishlist,
                                        Wishlist2EntryModel entry)
        Description copied from interface: Wishlist2Service
        Removes a given entry from the wishlist. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
        Specified by:
        removeWishlistEntry in interface Wishlist2Service
        Parameters:
        wishlist - the wishlist from which the entry should be removed
        entry - the entry which should be removed
      • addWishlistEntry

        public void addWishlistEntry​(Wishlist2Model wishlist,
                                     ProductModel product,
                                     java.lang.Integer desired,
                                     Wishlist2EntryPriority priority,
                                     java.lang.String comment)
        Description copied from interface: Wishlist2Service
        Adds a given product to the given wishlist
        Specified by:
        addWishlistEntry in interface Wishlist2Service
        Parameters:
        wishlist - The wishlist on which the product should be added
        product - The product which should be added to the wishlist
      • addWishlistEntry

        public void addWishlistEntry​(ProductModel product,
                                     java.lang.Integer desired,
                                     Wishlist2EntryPriority priority,
                                     java.lang.String comment)
        Description copied from interface: Wishlist2Service
        Adds a given product to the default wishlist of the current user
        Specified by:
        addWishlistEntry in interface Wishlist2Service
        Parameters:
        product - The product which should be added to the wishlist
      • addWishlistEntry

        public void addWishlistEntry​(UserModel user,
                                     ProductModel product,
                                     java.lang.Integer desired,
                                     Wishlist2EntryPriority priority,
                                     java.lang.String comment)
        Description copied from interface: Wishlist2Service
        Adds a given product to the default wishlist of the given user
        Specified by:
        addWishlistEntry in interface Wishlist2Service
        Parameters:
        user - the owner of the wishlist
        product - The product which should be added to the wishlist
      • createDefaultWishlist

        public Wishlist2Model createDefaultWishlist​(java.lang.String name,
                                                    java.lang.String description)
        Description copied from interface: Wishlist2Service
        creates a new default wishlist for the current user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
        Specified by:
        createDefaultWishlist in interface Wishlist2Service
        Parameters:
        name - The name of the wishlist
        description - The description of the wishlist
      • createDefaultWishlist

        public Wishlist2Model createDefaultWishlist​(UserModel user,
                                                    java.lang.String name,
                                                    java.lang.String description)
        Description copied from interface: Wishlist2Service
        creates a new default wishlist for the given user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
        Specified by:
        createDefaultWishlist in interface Wishlist2Service
        Parameters:
        user - The user for which the whishlist should be created
        name - The name of the wishlist
        description - The description of the wishlist
      • createWishlist

        public Wishlist2Model createWishlist​(java.lang.String name,
                                             java.lang.String description)
        Description copied from interface: Wishlist2Service
        creates a new wishlist for the current user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
        Specified by:
        createWishlist in interface Wishlist2Service
        Parameters:
        name - The name of the wishlist
        description - The description of the wishlist
      • createWishlist

        public Wishlist2Model createWishlist​(UserModel user,
                                             java.lang.String name,
                                             java.lang.String description)
        Description copied from interface: Wishlist2Service
        creates a new wishlist for the given user. For an anonymous customer (or anonymous customer wishlist), the wishlist will only be saved if the spring property saveAnonymousWishlists is set to true. Per default it is set to false.
        Specified by:
        createWishlist in interface Wishlist2Service
        Parameters:
        user - The user for which the whishlist should be created
        name - The name of the wishlist
        description - The description of the wishlist
      • hasDefaultWishlist

        public boolean hasDefaultWishlist()
        Specified by:
        hasDefaultWishlist in interface Wishlist2Service
        Returns:
        true if there is a default wishlist for the current user
      • setWishlistDao

        public void setWishlistDao​(Wishlist2Dao wishlistDao)
      • setSaveAnonymousWishlists

        public void setSaveAnonymousWishlists​(boolean saveAnonymousWishlists)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)