Package de.hybris.platform.wishlist2
Interface Wishlist2Service
- All Known Implementing Classes:
DefaultWishlist2Service
public interface Wishlist2Service
This interface provides the wish list related methods.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddWishlistEntry(ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment) Adds a given product to the default wishlist of the current uservoidaddWishlistEntry(UserModel user, ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment) Adds a given product to the default wishlist of the given uservoidaddWishlistEntry(Wishlist2Model wishlist, ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment) Adds a given product to the given wishlistvoidaddWishlistEntry(Wishlist2Model wishlist, Wishlist2EntryModel entry) Adds the given entry to the given wishlist.createDefaultWishlist(UserModel user, String name, String description) creates a new default wishlist for the given user.createDefaultWishlist(String name, String description) creates a new default wishlist for the current user.createWishlist(UserModel user, String name, String description) creates a new wishlist for the given user.createWishlist(String name, String description) creates a new wishlist for the current user.Returns the default wishlist for the current usergetDefaultWishlist(UserModel user) Returns the default wishlist for the given usergetWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist) Returns the wishlist entry which contains the given product from the specific wishlistResturns all wishlists for the current usergetWishlists(UserModel user) Returns all wishlists for the given userbooleanbooleanhasDefaultWishlist(UserModel user) voidremoveWishlistEntry(Wishlist2Model wishlist, Wishlist2EntryModel entry) Removes a given entry from the wishlist.voidremoveWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist) Removes a wishlist entry from the wishlist which contains the given product.
-
Method Details
-
getWishlists
Returns all wishlists for the given user- Parameters:
user- the owner of the wish lists- Returns:
- all wishlists of the given user
-
getWishlists
List<Wishlist2Model> getWishlists()Resturns all wishlists for the current user- Returns:
- all wishlists of the current user
-
hasDefaultWishlist
boolean hasDefaultWishlist()- Returns:
- true if there is a default wishlist for the current user
-
hasDefaultWishlist
- Returns:
- true if there is a default wishlist for the given user
-
createDefaultWishlist
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.- Parameters:
name- The name of the wishlistdescription- The description of the wishlist- Throws:
SystemException- when a default wishlist already exists for the current user
-
createDefaultWishlist
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.- Parameters:
user- The user for which the whishlist should be createdname- The name of the wishlistdescription- The description of the wishlist- Throws:
SystemException- when a default wishlist already exists for the current user
-
createWishlist
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.- Parameters:
name- The name of the wishlistdescription- The description of the wishlist
-
createWishlist
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.- Parameters:
user- The user for which the whishlist should be createdname- The name of the wishlistdescription- The description of the wishlist
-
getDefaultWishlist
Returns the default wishlist for the given user- Parameters:
user- the owner of the wishlist- Returns:
- the default wishlist
- Throws:
NullPointerException- if the user has no default wishlist
-
getDefaultWishlist
Wishlist2Model getDefaultWishlist()Returns the default wishlist for the current user- Returns:
- the default wishlist
- Throws:
NullPointerException- if the user has no default wishlist
-
addWishlistEntry
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.- Parameters:
wishlist- the wishlist the entry should be added toentry- the entry which should be added to the wishlist
-
addWishlistEntry
void addWishlistEntry(Wishlist2Model wishlist, ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment) Adds a given product to the given wishlist- Parameters:
wishlist- The wishlist on which the product should be addedproduct- The product which should be added to the wishlist
-
addWishlistEntry
void addWishlistEntry(ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment) Adds a given product to the default wishlist of the current user- Parameters:
product- The product which should be added to the wishlist- Throws:
NullPointerException- if the user has no default wishlist
-
addWishlistEntry
void addWishlistEntry(UserModel user, ProductModel product, Integer desired, Wishlist2EntryPriority priority, String comment) Adds a given product to the default wishlist of the given user- Parameters:
user- the owner of the wishlistproduct- The product which should be added to the wishlist- Throws:
NullPointerException- if the user has no default wishlist
-
removeWishlistEntry
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.- Parameters:
wishlist- the wishlist from which the entry should be removedentry- the entry which should be removed
-
getWishlistEntryForProduct
Returns the wishlist entry which contains the given product from the specific wishlist- Parameters:
product- the product which is contained in the wishlist entry which needs to be foundwishlist- the wishlist which contains the wishlist entry- Returns:
- the found wishlist entry
- Throws:
UnknownIdentifierException- if no wishlist entry that meets the conditions can be found.AmbiguousIdentifierException- if more than one wishlist entry that meets the conditions can be foundIllegalArgumentException- if parameterproductorwishlistisnull.
-
removeWishlistEntryForProduct
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.- Parameters:
product- the product which is contained in the wishlist entry which will be removedwishlist- the wishlist from which the entry should be removed- Throws:
UnknownIdentifierException- if no wishlist entry that meets the conditions can be found.AmbiguousIdentifierException- if more than one wishlist entry that meets the conditions can be foundIllegalArgumentException- if parameterproductorwishlistisnull.
-