Sample Command Source Code Package README
IBM(R) WebSphere(R) Commerce Business Edition, Version 5.4
Contents
This package contains the following components:
- BE54Sample.dat
This file contains the source code for several task and controller commands in a
repository to be used within VisualAge(R) for Java(TM). The source code is provided
to help you develop a better understanding of how task and controller commands work.
Source code is not provided for the complete set of WebSphere Commerce task and
controller commands.
- BE54Sample.zip
This file contains the source code for several task and controller commands. The source code is provided
to help you develop a better understanding of how task and controller commands work.
Source code is not provided for the complete set of WebSphere Commerce task and
controller commands.
- Online sequence diagrams
The online sequence diagrams are a set of HTML pages that allow you to view
the sequence diagrams for the commands in this package in a web browser. These sequence diagrams are useful for understanding the workings of the commands.
- SequenceDiagrams.pdf
This file contains sequence diagrams for most of the commands included in this package.
Use this file if you want to print the sequence diagrams. If you only want to
view the sequence diagrams, refer to the online sequence diagrams.
Unzip the package to a temporary directory, for example, D:\temp.
Source code is provided for the following commands:
From the com.ibm.commerce.samples.catalog.commands
package:
- PackageResolveSkuCmdImpl
- ResolveSkuCmdImpl
From the com.ibm.commerce.samples.fulfillment.commands
package:
- AllocateExistingInventoryCmdImpl
- AllocateExpectedInventoryCmdImpl
- CheckInventoryAvailabilityCmdImpl
- DeallocateExistingInventoryCmdImpl
- DeallocateExpectedInventoryCmdImpl
From the com.ibm.commerce.samples.inventory.commands
package:
- MakeReceiptAvailableCmdImpl
From the com.ibm.commerce.samples.membergroup.commands
package:
- CheckUserInMemberGroupCmdImpl
From the com.ibm.commerce.samples.messaging.commands
package:
- OrderStatusCmdImpl
- ProductListPriceUpdateCmdImpl
- ProductOfferPriceUpdateCmdImpl
- ReleaseShipNotifyCmdImpl
- SendWCSOrderCmdImpl
From the com.ibm.commerce.samples.negotiation.commands
package:
- CheckBidDeleteAuthorizationCmdImpl
- DetermineWinnersCmdImpl
- NotifyCompleteOrderCmdImpl
From the com.ibm.commerce.samples.order.calculation
package:
- ApplyCalculationUsageCmdImpl
- ApplyShippingChargeByCarrierCmdImpl
From the com.ibm.commerce.samples.order.commands
package:
- ExtOrderProcessCmdImpl
- OrderProcessCheckApprovalCmdImpl
From the com.ibm.commerce.samples.orderitems.commands
package:
- AddOrderItemComponentsCmdImpl
From the com.ibm.commerce.samples.payment.commands
package:
- CheckPaymentAcceptTestCmdImpl
- DoCancelTestCmdImpl
- DoDepositTestCmdImpl
- DoPaymentTestCmdImpl
- DoRefundTestCmdImpl
From the com.ibm.commerce.samples.price.commands
package:
- GetBaseUnitPriceCmdImpl
- GetContractUnitPriceCmdImpl
- ResolvePriceListsCmdImpl
- RetrievePricesCmdImpl
Dependent .class files:
- CalculateContractPricesCmd
- ItemPriceInfo
- QualifyingOfferInfo
- SelectContractPricesCmd
From the com.ibm.commerce.samples.returns.commands
package:
- AutoApproveReturnItemCmdImpl
- CalculateRMAApprovalCmdImpl
- DetermineReturnCreditVehicleCmdImpl
Dependent .class files:
- Misc
- MiscContract
- StateChange
- StateMachine
From the com.ibm.commerce.samples.tools.campaigns
package:
- CampaignInitiativeEvaluateCmdImpl
- CampaignInitiativeSaveControllerCmdImpl
From the com.ibm.commerce.samples.tools.promotions
package:
From the com.ibm.commerce.samples.usermanagement.commands
package:
- AuditAddressCmdImpl
- AuditBaseCmdImpl
- ProcessProfileTypeCmdImpl
- SetBusinessEntityCmdImpl
- UserRegistrationAddCheckApprovalCmdImpl
To view a sample command sequence diagram, do the following:
- In the directory where you have unzipped this package, go to the HTML
directory.
- Open index.html in a web browser.
- Expand WebSphere Commerce Version 5.4 Sequence Diagrams.
- Double-click the name of the command for which you want to view the
sequence diagram.
To import the command source code into the VisualAge for Java workspace, do the
following:
- Open VisualAge for Java (Start > Programs > IBM VisualAge for Java for
Windows V4.0 > IBM VisualAge for Java).
- From the File menu, select Import.
- Select Repository and click Next.
- Select Local repository and in the Repository name
field, enter the full qualified path for the BE54Sample.dat
file. For example, enter D:\temp\BE54Sample.dat
- Select Projects, then click Details.
- Select the IBM WCS Sample Commands project and click OK.
- Ensure that Add most recent project edition to workspace is enabled.
- Click Finish.
The source code for the commands is packaged into uniquely named packages that use the
following naming convention:
com.ibm.commerce.samples.component_name.commands
This packaging convention permits you to import the code into your workspace without
conflicting with the original versions of the commands. These commands are to be used for
reference only. When you need to modify the source code, you should copy the required
command into a project and package of your own.
For example, if you must modify the source code of the ResolveSkuCmdImpl task command,
do the following:
- Create a new project in which you will store your customized code, by doing the
following:
- From the Selected menu, select Add Project.
- Enter a name for your project (for example, My Customized Commands)
and click Finish.
- Create a new package in which you will store your customized command, by doing the
following:
- Right-click your new project (for example, My Customized Commands) and select Add
> Package.
- In the Create a new package named field, enter an appropriate
name for your package. com.mycompany.catalog.mycommands is an example
of a package name.
- Click Finish.
- Move the sample command source code into your project, by doing the following:
- Expand the IBM WCS Sample Commands project.
- Expand the package that contains the task command you wish to modify. In
this case, expand com.ibm.commerce.samples.catalog.commands.
- Right-click the task command you wish to modify (the ResolveSkuCmdImpl
class, in this case) and select Reorganize > Move.
Note:
When you copy GetContractUnitPriceCmdImpl, you also need to copy its
dependent .class files:
CalculateContractPricesCmd
ItemPriceInfo
QualifyingOfferInfo
SelectContractPricesCmd
When you copy
AutoApproveReturnItemCmdImpl or
DetermineReturnCreditVehicleCmdImpl, you also need to copy their dependent
.class files:
Misc
MiscContract
StateChange
StateMachine
- In the Pattern field, enter the name of the package that you
created in step 2b. For example, enter com.mycompany.catalog.mycommands
and click OK.
- When a confirmation window opens, click OK.
- Open your own project and modify the command that you have just moved to your own
package.
Once you have modified the command, you must update the WebSphere Commerce command registry
to associate your new implementation class with the existing interface for the command.
In the case of the ResolveSkuCmdImpl task command, the original entry in the CMDREG
table appears as follows:
Interface |
Classname |
com.ibm.commerce.catalog.ResolveSkuCmd |
com.ibm.commerce.catalog.ResolveSkuCmdImpl |
Note that only columns relevant to this example are displayed.
To continue with the preceding example of modifying the ResolveSkuCmdImpl class, the
entry in the CMDREG would then need to be changed to the following:
Interface |
Classname |
com.ibm.commerce.catalog.ResolveSkuCmd |
com.mycompany.catalog.mycommands.ResolveSkuCmdImpl |
Note that if you change the command registry while the servlet engine in VisualAge for
Java's WebSphere Test Environment is running, you must refresh the cache before you can
test the new command. You can either stop and restart the servlet engine or run the
RefreshRegistry command to perform this refresh. For more information on the
RefreshRegistry command, refer to the WebSphere Commerce online help.
After you have tested your new command, you must create a JAR file containing the new
logic and deploy the command to a target WebSphere Commerce Server.
For further details about commands, refer to Chapter 6 of the Programmers Guide.
For more information about deployment, refer to Chapter 7 and Appendix B of the
Programmers Guide.
One of the commands for which source code is provided are base commands. These commands
are:
AuditBaseCmdImpl
- This base command is included in the com.ibm.commerce.samples.usermanagement.commands
package. This is the base command for the following task commands:
- AuditAddressCmdImpl
- AuditUserRegistrationCmdImpl
- AuditOrdEntityCmdImpl
The base command source code is provided for reference only. Viewing the source
code will help you to understand how the commands that extend from them work. When
modifiying business logic related to user management or fulfillment functions,
modifications should be made to a copy of the task commands that extend the base commands.
As such, sequence diagrams are not provided for the base commands.
Be sure to package all of your customized command and data bean code in project that is
separate from the IBM WebSphere Commerce Server project. This will make it easier to transition
to future repositories of WebSphere Commerce code.
For more information related to WebSphere Commerce and WebSphere Commerce Studio,
refer to the following Web sites:
- http://www.ibm.com/software/webservers/commerce/wc_be/lit-tech-general.html
- http://www.ibm.com/software/webservers/commerce/commercestudio/lit-tech-general.html
The following are trademarks of International Business Machines Corporation in the
United States and other countries or both:
Java and all Java-based trademarks and logos are trademarks or registered trademarks of
Sun Microsystems, Inc.
Other company, product and service names may be the trademarks or service marks of
others.
**************************************************************************
** © COPYRIGHT INTERNATIONAL BUSINESS MACHINES CORPORATION 2000, 2002
** ALL RIGHTS RESERVED.
**************************************************************************
Note to US Government Users -- Documentation related to restricted rights -- Use,
duplication, or disclosure is subject to restriction set forth in GSA ADP Schedule
Contract with IBM Corp.
End of README File