| Seaside-Examples-Store |
Comment |
| WAStore
|
This component is the entry point for the store example. It provides the main stylesheet in its #style method, renders a simple banner at the top, and then embeds an instance of WAStoreTask, which is where the real action happens.
|
| WAStoreAddressEditor
|
A component for editing WAStoreAddress instances. When called, it will create a new address instance, present a form for the user to modify it, and then answer the instance on submit. Used by WAStoreTask>>getBillingAddress and getShippingAddress.
|
| WAStoreCartConfirmation
|
A component for confirming the contents of a WAStoreCart. The caller must provide a cart instance with #cart: . When called, it will display a summary of the items in the cart, along with two buttons: "Proceed with checkout" and "Modify cart". Answers true if the user presses the first button, false if the user presses the seecond. Used by WAStoreTask>>confirmContentsOfCart.
|
| WAStoreCartView
|
A component for displaying and modifying a WAStoreCart. Intended to be embedded rather than called. The parent must provide a cart instance with #cart:. Displays a list of items in the cart, and allows individual items to be removed. Used by WAStoreFillCart.
|
| WAStoreFillCart
|
This component provides the main UI for browsing the store inventory and filling the cart. The caller must provide a shopping cart instance with #cart:. The component presents a navigation bar with options to browse and search on the left, and embeds a WACartView showing the cart contents on the right. In the middle is initially embedded a WAStoreInfo. Browsing and searching will replace this with a stock WABatchSelection component for listing items (see #displatItems:), or a WAStoreItemView for displaying individual items. This answers back to the caller when the user chooses "checkout" from the nav bar.
|
| WAStoreInfo
|
A component that displays simple informative text about this example. Used by WAStoreFillCart.
|
| WAStoreItemView
|
A component for viewing an individual WAStoreItem. The caller must provide #item: and also the current #cart:. Shows the description and price info for the item, and presents two buttons: "Add to Cart", which will add the item to the cart, once, and "Done", which will answer back to the caller. Used by WAStoreFillCart>>displayItem: and displayItems:.
|
| WAStorePaymentEditor
|
A component for editing WAStoreCreditCard instances. When called, it presents a form for the user to choose credit card type, and enter name, number, and expiry date. On submit, it will create and answer an instance of the appropiate credit card subclass. Note the difference with WAStoreAddressEditor, where the form modifies the address instance directly. Used by WAStoreTask>>getPaymentInfo.
|
| WAStoreTask
|
This task models the main application flow of the store example. Most of the other components in the example are called from here. The flow is defined by the #go method. After creating a WAStoreCart instance, this calls WAStoreFillCart to allow the user to add items to it. It then calls WAStoreCartConfirmation, WAStoreAddressEditor, and WAStorePaymentEditor in succession for the checkout process. Many of the components it calls are wrapped with informative messages (#withMessage:) and validation (#validateWith:). It also makes use of WASession>>isolate: to ensure that once the checkout process starts, backtracking to modify the cart is forbidden. Used by WAStore.
|