Registers the Auctions application, which lets an organisation run points-based auctions where profiles bid reward points to win a prize. Wires up the auctions menu entries, KEditor components (auction list, auction detail, bid form and "coming up" widgets), the dashboard portlet, live bid websockets, and the auctionBidGoal journey builder node used by websites and the admin console. Also holds the highest-bid and lowest-unique-bid auction algorithms used to validate and process a bid and to close an auction once it ends.
Implements: Application, MenuApplication, BrowsableApplication, ChildPageApplication, PortletApplication, WebsocketApp, ComponentApplication, TemplatingApplication, DependentApplication, JourneyBuilderApplication, FieldProviderApplication
Properties
| Property | Returns | Description |
|---|---|---|
| auctionTypes | Map<String,IAuctionType> | The auction algorithms available on this account, keyed by their auction type code (see Auction.HighestBidAuction and Auction.LowestUniqueBidAuction). Never null. |
| instanceId | String | Unique key this application is registered under, used by the application manager to look it up. |
| roles | List<Role> | The roles this application contributes to the platform's role registry. |
Methods
getInstanceId()
Returns: String
Unique key this application is registered under, used by the application manager to look it up.
getAuctionTypes()
Returns: Map<String,IAuctionType>
The auction algorithms available on this account, keyed by their auction type code (see Auction.HighestBidAuction and Auction.LowestUniqueBidAuction). Never null.
getRoles()
Returns: List<Role>
The roles this application contributes to the platform's role registry.
checkCreateAuction(String name, String title, String auctionType, Date startDate, Date endDate, Website website, String pointsBucket, Boolean isActive)
Returns: boolean
Creates a new auction with the given name, but only if no auction with that name already exists for the current organisation. This is a convenience wrapper around createAuction that first checks for a name clash.
| Parameter | Description |
|---|---|
name | the auction name to check for a clash and to create |
title | the display title for the new auction |
auctionType | the auction algorithm to use, e.g. Auction.HighestBidAuction or Auction.LowestUniqueBidAuction |
startDate | the date and time the auction opens for bidding |
endDate | the date and time the auction closes |
website | the website the auction belongs to |
pointsBucket | the reward points bucket bids are drawn from and debited against |
isActive | whether the auction is active as soon as it is created |
createAuction(String name, String title, String auctionType, Date startDate, Date endDate, Website website, String pointsBucket, Boolean isActive)
Returns: Auction
Creates and persists a new auction for the current organisation.
| Parameter | Description |
|---|---|
name | the unique auction name |
title | the display title for the new auction |
auctionType | the auction algorithm to use, e.g. Auction.HighestBidAuction or Auction.LowestUniqueBidAuction |
startDate | the date and time the auction opens for bidding |
endDate | the date and time the auction closes |
website | the website the auction belongs to |
pointsBucket | the reward points bucket bids are drawn from and debited against |
isActive | whether the auction is active as soon as it is created |