Tutorials > Program model


Next >


Tutorial: Extending the object model and modifying an existing task command

Attention: This tutorial is currently under revision. The content might contain errors or inaccuracies. Subscribe to this page to be notified when an updated version is available.

In this tutorial, you address a requirement to collect gift card information for orders. The information that must be collected is the name of the recipient, the name of the sender and two messages. The information will be collected when the customer submits the order. You will create a new database table to store the gift order information and a new entity bean to access the data.


Learning objectives

In addition to creating the new entity bean, you extend the existing ExtOrderProcessCmdImpl task command. At the end of the order process command, ExtOrderProcessCmdImpl is provided as an extension point to customized code. The extension is used to instantiate a new data bean that corresponds to the new table and it is used to update the gift information in the database. After completing this tutorial you should be able to extend the object model:


Time required

Expect this tutorial to take about 1 hour to complete.

You can load the completed tutorial code instead of performing each step. After loading the completed tutorial code into the workspace, you can run the code as if you performed each step in the tutorial. However, in order to fully attain the learning objectives, it is recommended that you perform the tutorial step by step.


Audience

This tutorial is intended for WebSphere Commerce store developers who are responsible for extending the object model.


Prerequisites


Saving the sample code

Before beginning this tutorial, download the WCSample.zip package that contains the starting point for these programming tutorials. Save this file onto the development machine. As an example, you might save the file into the WCDE_INSTALL/ directory.


Knowledge prerequisites

Before starting this tutorial you should have a basic understanding of:

  1. Rational Application Developer.

  2. The Java programming language.

  3. The database type, Apache Derby, , DB2, , or Oracle, used in the WebSphere Commerce development environment.


Code prerequisites

  1. This tutorial does not require that you have completed previous programming tutorials. If you have completed those tutorials, there is no harm in leaving the code in the workspace, as it will not conflict with this tutorial.

  2. Before starting this tutorial, have published a store based upon the consumer direct sample store. Within this store, be able to complete a purchase (for example, browse the catalog, add items to the shopping cart, check out and see the order confirmation).


Lessons in this tutorial

Next >


+

Search Tips   |   Advanced Search