pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.checkout
Class CheckoutController

java.lang.Object
  extended by org.torweg.pulse.bundle.Controller
      extended by org.torweg.pulse.component.shop.checkout.CheckoutController
All Implemented Interfaces:
Configurable<CheckoutControllerConfiguration>

public class CheckoutController
extends Controller
implements Configurable<CheckoutControllerConfiguration>

The CheckoutController.

Version:
$Revision: 2059 $
Author:
Christian Schatt

Nested Class Summary
protected static class CheckoutController.DispatchAndPaymentConfigurations
          A wrapper class, that is used as a method return type, and that is holding DispatchConfigurations and PaymentConfigurations.
 
Nested classes/interfaces inherited from class org.torweg.pulse.bundle.Controller
Controller.AlwaysRun
 
Constructor Summary
CheckoutController()
           
 
Method Summary
 CheckoutControllerResult authorizePayment(Bundle bundle, ServiceRequest request)
          Authorize the payment.
 CheckoutControllerResult cancel(Bundle bundle, ServiceRequest request)
          Cancel the checkout process.
 CheckoutControllerResult capturePayment(Bundle bundle, ServiceRequest request)
          Capture the payment.
 CheckoutControllerResult editBillingAddress(Bundle bundle, ServiceRequest request)
          Edit the billing address.
 CheckoutControllerResult editCustomer(Bundle bundle, ServiceRequest request)
          Edit the Customer.
 CheckoutControllerResult editDeliveryAddress(Bundle bundle, ServiceRequest request)
          Edit the delivery address.
 CheckoutControllerResult editDispatchData(Bundle bundle, ServiceRequest request)
          Edit the DispatchData.
 CheckoutControllerResult editOrder(Bundle bundle, ServiceRequest request)
          Edit the whole OrderBuilder.
 CheckoutControllerResult editOrderDetails(Bundle bundle, ServiceRequest request)
          Edit the OrderDetails.
 CheckoutControllerResult editPaymentData(Bundle bundle, ServiceRequest request)
          Edit the PaymentData.
 CheckoutControllerResult finish(Bundle bundle, ServiceRequest request)
          Finish the checkout process.
protected  CheckoutControllerConfiguration getConfiguration()
          Returns the CheckoutControllerConfiguration of the CheckoutController.
protected static CheckoutController.DispatchAndPaymentConfigurations getDispatchAndPaymentConfigurations(ServiceRequest request, Order.OrderBuilder orderBuilder, CheckoutControllerConfiguration.CheckoutControllerLocaleConfiguration config)
          Returns a DispatchAndPaymentConfigurations holding the DispatchConfigurations and PaymentConfigurations available for the given ServiceRequest, OrderBuilder and CheckoutControllerLocaleConfiguration.
 CheckoutControllerResult getOrder(Bundle bundle, ServiceRequest request)
          Just return the OrderBuilder.
 void initialize(CheckoutControllerConfiguration c)
          Initializes the CheckoutController with the given CheckoutControllerConfiguration.
protected static boolean matchUsers(ServiceRequest request, Order.OrderBuilder orderBuilder)
          Determines whether the id of the User matches the Customer's user id.
 CheckoutControllerResult start(Bundle bundle, ServiceRequest request)
          Start the checkout process by creating a new OrderBuilder.
 
Methods inherited from class org.torweg.pulse.bundle.Controller
getAlwaysRun, isAlwaysRun, setAlwaysRun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckoutController

public CheckoutController()
Method Detail

start

@Action(value="startCheckout", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="startCheckout")
@Groups(values="checkout")
public final CheckoutControllerResult start(Bundle bundle, ServiceRequest request)
Start the checkout process by creating a new OrderBuilder.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

editCustomer

@Action(value="editCustomer", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="editCustomer")
@Groups(values="checkout")
public final CheckoutControllerResult editCustomer(Bundle bundle, ServiceRequest request)
Edit the Customer.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

editDeliveryAddress

@Action(value="editDeliveryAddress", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="editDeliveryAddress")
@Groups(values="checkout")
public final CheckoutControllerResult editDeliveryAddress(Bundle bundle, ServiceRequest request)
Edit the delivery address.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

editBillingAddress

@Action(value="editBillingAddress", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="editBillingAddress")
@Groups(values="checkout")
public final CheckoutControllerResult editBillingAddress(Bundle bundle, ServiceRequest request)
Edit the billing address.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

editDispatchData

@Action(value="editDispatchData", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="editDispatchData")
@Groups(values="checkout")
public final CheckoutControllerResult editDispatchData(Bundle bundle, ServiceRequest request)
Edit the DispatchData.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

editPaymentData

@Action(value="editPaymentData", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="editPaymentData")
@Groups(values="checkout")
public final CheckoutControllerResult editPaymentData(Bundle bundle, ServiceRequest request)
Edit the PaymentData.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

editOrderDetails

@Action(value="editOrderDetails", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="editOrderDetails")
@Groups(values="checkout")
public final CheckoutControllerResult editOrderDetails(Bundle bundle, ServiceRequest request)
Edit the OrderDetails.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

editOrder

@Action(value="editOrder", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="editOrder")
@Groups(values="checkout")
public final CheckoutControllerResult editOrder(Bundle bundle, ServiceRequest request)
Edit the whole OrderBuilder.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

getOrder

@Action(value="getOrder", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="getOrder")
@Groups(values="checkout")
public final CheckoutControllerResult getOrder(Bundle bundle, ServiceRequest request)
Just return the OrderBuilder.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

authorizePayment

@Action(value="authorizePayment", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="authorizePayment")
@Groups(values="checkout")
public final CheckoutControllerResult authorizePayment(Bundle bundle, ServiceRequest request)
Authorize the payment.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

capturePayment

@Action(value="capturePayment", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="capturePayment")
@Groups(values="checkout")
public final CheckoutControllerResult capturePayment(Bundle bundle, ServiceRequest request)
Capture the payment.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

cancel

@Action(value="cancelCheckout", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="cancelCheckout")
@Groups(values="checkout")
public final CheckoutControllerResult cancel(Bundle bundle, ServiceRequest request)
Cancel the checkout process.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

finish

@Action(value="finishCheckout", generate=true, security=ALWAYS, stripSitemapID=false)
@Permission(value="finishCheckout")
@Groups(values="checkout")
public final CheckoutControllerResult finish(Bundle bundle, ServiceRequest request)
Finish the checkout process.

Parameters:
bundle - the Bundle.
request - the ServiceRequest.
Returns:
the CheckoutControllerResult.

initialize

public final void initialize(CheckoutControllerConfiguration c)
Initializes the CheckoutController with the given CheckoutControllerConfiguration.

Specified by:
initialize in interface Configurable<CheckoutControllerConfiguration>
Parameters:
c - the CheckoutControllerConfiguration
Throws:
java.lang.IllegalArgumentException - if the given CheckoutControllerConfiguration is null.

getConfiguration

protected final CheckoutControllerConfiguration getConfiguration()
Returns the CheckoutControllerConfiguration of the CheckoutController.

Returns:
the CheckoutControllerConfiguration.

matchUsers

protected static boolean matchUsers(ServiceRequest request, Order.OrderBuilder orderBuilder)
Determines whether the id of the User matches the Customer's user id.

Parameters:
request - the ServiceRequest.
orderBuilder - the OrderBuilder.
Returns:
true, if the id of the User matches the Customer's user id. Returns false, otherwise.

getDispatchAndPaymentConfigurations

protected static CheckoutController.DispatchAndPaymentConfigurations getDispatchAndPaymentConfigurations(ServiceRequest request, Order.OrderBuilder orderBuilder, CheckoutControllerConfiguration.CheckoutControllerLocaleConfiguration config)
Returns a DispatchAndPaymentConfigurations holding the DispatchConfigurations and PaymentConfigurations available for the given ServiceRequest, OrderBuilder and CheckoutControllerLocaleConfiguration.

Parameters:
request - the ServiceRequest.
orderBuilder - the OrderBuilder.
config - the CheckoutControllerLocaleConfiguration.
Returns:
the DispatchAndPaymentConfigurations.