Generating Commerce Composer widget source code
About this task
WebSphere Commerce provides a Java Emitter Template (JET), called the JET Commerce Composer Resource pattern. This pattern is used by the JET Transformation to generate the source code files and file directories that you need to create a Commerce Composer widget. The generated files include source code for customizing the storefront and Management Center to use your widget, and the CSV and configurations files for loading your widget data with the Data Load utility.
Use the generated source code files as a starting point for creating a custom Commerce Composer widget. These files provide you with a code package that you must update to define your widget functionality and rendering style. You can then use the files to register your widget information with the Commerce Composer framework, and add support for your widget within Management Center. To use this pattern, you must create a pattern input file that contains the information that is required to generate the source code files.
For more information about using the JET tool to generate source code for creating a custom widget, see Generating Commerce Composer widget source code.
Procedure
- Start WebSphere Commerce Developer.
- Create a temporary project in your WebSphere Commerce Developer
workspace. The project is used as the target location where the Java
Emitter Template (JET) package Transformation generates the source
code files for creating a widget.
- In your temporary NewWidgetProject project,
create an XML file to use as a pattern input file for the JET Transformation.
The JET Transformation uses the pattern input XML file to create the
widget source code files. You can copy and edit the input file to
use for generating source code of more custom widgets.
- Use the JET Transformation to generate the source code
files to use when you create your custom widget.
- Right-Click your pattern input XML file. Select
- In the Run Configurations wizard, right-click JET Transformation in the list of filters. Select New. The configuration options for the JET Transformation displays.
- Ensure that the value of the Name field is the name of your pattern input XML file.
- Click the Main tab.
- Ensure that the value of the Transformation Input field is the file path within your workspace to the pattern input XML file.
- In the Transformation section, select com.ibm.commerce.toolkit.internal.pattern.pageLayout for the value of the ID field.
- Optional: Specify the severity level for the Display Message logging. The default value is information.
- Click .
Results
- Management Center - LOBTools
- Storefront - Stores
- Data Load utility - DataLoad.
The Data Load utility files include the configuration and CSV input files that you must use to register your widget and have a store subscribe to your widget. In the following lessons, you use and update the generated source code to create, register, and use your new widget.