Package de.hybris.platform.wishlist2
Interface Wishlist2Service
-
- All Known Implementing Classes:
DefaultWishlist2Service
public interface Wishlist2ServiceThis interface provides the wish list related methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddWishlistEntry(ProductModel product, java.lang.Integer desired, Wishlist2EntryPriority priority, java.lang.String comment)Adds a given product to the default wishlist of the current uservoidaddWishlistEntry(UserModel user, ProductModel product, java.lang.Integer desired, Wishlist2EntryPriority priority, java.lang.String comment)Adds a given product to the default wishlist of the given uservoidaddWishlistEntry(Wishlist2Model wishlist, ProductModel product, java.lang.Integer desired, Wishlist2EntryPriority priority, java.lang.String comment)Adds a given product to the given wishlistvoidaddWishlistEntry(Wishlist2Model wishlist, Wishlist2EntryModel entry)Adds the given entry to the given wishlist.Wishlist2ModelcreateDefaultWishlist(UserModel user, java.lang.String name, java.lang.String description)creates a new default wishlist for the given user.Wishlist2ModelcreateDefaultWishlist(java.lang.String name, java.lang.String description)creates a new default wishlist for the current user.Wishlist2ModelcreateWishlist(UserModel user, java.lang.String name, java.lang.String description)creates a new wishlist for the given user.Wishlist2ModelcreateWishlist(java.lang.String name, java.lang.String description)creates a new wishlist for the current user.Wishlist2ModelgetDefaultWishlist()Returns the default wishlist for the current userWishlist2ModelgetDefaultWishlist(UserModel user)Returns the default wishlist for the given userWishlist2EntryModelgetWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)Returns the wishlist entry which contains the given product from the specific wishlistjava.util.List<Wishlist2Model>getWishlists()Resturns all wishlists for the current userjava.util.List<Wishlist2Model>getWishlists(UserModel user)Returns all wishlists for the given userbooleanhasDefaultWishlist()booleanhasDefaultWishlist(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 Detail
-
getWishlists
java.util.List<Wishlist2Model> getWishlists(UserModel user)
Returns all wishlists for the given user- Parameters:
user- the owner of the wish lists- Returns:
- all wishlists of the given user
-
getWishlists
java.util.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
boolean hasDefaultWishlist(UserModel user)
- Returns:
- true if there is a default wishlist for the given user
-
createDefaultWishlist
Wishlist2Model createDefaultWishlist(java.lang.String name, java.lang.String description)
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
Wishlist2Model createDefaultWishlist(UserModel user, java.lang.String name, java.lang.String description)
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
Wishlist2Model createWishlist(java.lang.String name, java.lang.String description)
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
Wishlist2Model createWishlist(UserModel user, java.lang.String name, java.lang.String description)
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
Wishlist2Model getDefaultWishlist(UserModel user)
Returns the default wishlist for the given user- Parameters:
user- the owner of the wishlist- Returns:
- the default wishlist
- Throws:
java.lang.NullPointerException- if the user has no default wishlist
-
getDefaultWishlist
Wishlist2Model getDefaultWishlist()
Returns the default wishlist for the current user- Returns:
- the default wishlist
- Throws:
java.lang.NullPointerException- if the user has no default wishlist
-
addWishlistEntry
void addWishlistEntry(Wishlist2Model wishlist, Wishlist2EntryModel entry)
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, java.lang.Integer desired, Wishlist2EntryPriority priority, java.lang.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, java.lang.Integer desired, Wishlist2EntryPriority priority, java.lang.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:
java.lang.NullPointerException- if the user has no default wishlist
-
addWishlistEntry
void addWishlistEntry(UserModel user, ProductModel product, java.lang.Integer desired, Wishlist2EntryPriority priority, java.lang.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:
java.lang.NullPointerException- if the user has no default wishlist
-
removeWishlistEntry
void removeWishlistEntry(Wishlist2Model wishlist, Wishlist2EntryModel entry)
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
Wishlist2EntryModel getWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)
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 foundjava.lang.IllegalArgumentException- if parameterproductorwishlistisnull.
-
removeWishlistEntryForProduct
void removeWishlistEntryForProduct(ProductModel product, Wishlist2Model wishlist)
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 foundjava.lang.IllegalArgumentException- if parameterproductorwishlistisnull.
-
-