Tutorials > Content management > Create a content-managed resource
Integrate the new resource
At the end of Part 3, we will be able to perform the following tasks:
Learning objectives
At the end of Part 3, we will be able to perform the following tasks:
- Run the authoring schema update tool.
- Create the task commands for creating and updating a content managed resource.
- Understand how to delete a content managed resource.
- Update existing controller commands.
- Update the WebSphere Commerce Accelerator for a sales catalog.
- Create a new data bean to display the new resource.
- Modify a store JSP page to display the extended description information.
Lessons in this module
- Run the authoring server update script
If you deploy changes to the WebSphere Commerce database schema, such as adding a new table, these changes must also be made in the workspace schemas. This script allows you to recalibrate the workspace schemas with the master database schema. Without recalibration, the authoring server will not work with the new changes to the base schema, and may cause data lost or inconsistency.
- Create the AddExtendedCatalogDescCmd interface
Create the interface for adding the extended catalog information in the database.
- Create the AddExtendedCatalogDescCmdImpl task command
This command will implement the AddExtendedCatalogDescCmd interface created in the last step. The performExecute() method will make use of the entity bean creation data and resource managers created to make this resource content managed.
- Create the UpdateExtendedCatalogDescCmd interface
Create the interface for updating the extended catalog description information in the database.
- Create the UpdateExtendedCatalogDescCmdImpl task command
This command implements the UpdateExtendedCatalogDescCmd interface created in the last step. The performExecute() method makes use of the entity bean creation data and resource managers created to make this resource content managed.
- Delete a managed resource
A task command is not required for deleting the extended description information as this is handled by the database constraint added when creating the new table. When the description is deleted in the CATALOGDSC table, it will be cascade deleted in the EXTCATALOGDSC table.
- Update existing controller commands
To use the new task commands, extend some existing sales catalog controller commands.
- Create the NavCatExtendedCatalogCreateControllerCmdImpl controller command
- Create NavCatExtendedCatalogUpdateControllerCmdImpl controller command
- Insert SQL for commands into CMDREG table
To register our newly created controller commands, we will have to insert some records into the CMDREG table.
- Update the WebSphere Commerce Accelerator tool
You must modify the Sales Catalog JSP files to incorporate the new catalog extended description information. You modify NavCatCatalogCreateContent.jsp and NavCatCatalogUpdateContent.jsp for creating and updating a sales catalog. There are no WebSphere Commerce Accelerator changes needed for deleting the extended description information, because a button already exists for this on the Sales Catalog page.
- Update NavCatCatalogCreateContent.jsp
This WebSphere Commerce Accelerator JSP will be modified to include new fields for the new extended catalog information.
- Update NavCatCatalogUpdateContent.jsp
This WebSphere Commerce Accelerator JSP will be modified to include new fields for the new extended catalog information. When a sales catalog is being updated, the fields will be populated with the previous information entered.
- Update the properties file
Some new properties need to be added to the catalog properties file.
- Create a new data bean
A data bean is a Java bean that is used in JSP pages to retrieve information from the enterprise bean. This data bean is used to display the extended description information in a store JSP page.
- Modify a store JSP page to display the extended description information
This JSP page will use the new data bean to display the extended catalog information.