Deleting Commerce Composer objects
If you no longer need a specific Commerce Composer object, such as a widget, layout template, layout, or page, we can remove the object from the store and delete the object.
About this task
Depending on the type of object we are removing or deleting, the steps that are involved can differ:
- To delete a layout or layout assignment, a business user can delete the object within the Commerce Composer tool to remove the object from store pages and Management Center. When a user deletes a layout assignment, the assignment deletes from your system. When a user deletes a layout, the layout is removed from Management Center and marked for delete within the database. As an administrator or developer, we can physically delete the layout from your system by running a scheduled job that invokes the CleanPageLayoutsCmd command. Alternatively we can use the Data Load utility to delete a layout, however this option can take time when multiple layouts are to be deleted. See Remove marked for delete Commerce Composer layouts.
- To delete a page, an administrator can use the Data Load utility to delete the page. If the page is configured to allow business users to delete the page, a business user can delete the page in the Commerce Composer tool. Within the PLPAGE database table, the DELETABLE column indicates whether a business user can delete a page with the Commerce Composer tool. If the value for this column is 1, then the Data Load utility must be used to either delete the page or update the page to allow a business user to delete the page. If the value for the column is 0, then a business user can delete the page. The default value for this column when a page is created is 1.
- To delete a widget or a layout template from your system, the widget or layout template must be removed from any layout that uses the object. When the object is no longer used on store pages, the object registration can be removed and the widget or layout template can be deleted.
Since a widget or layout template can be used on multiple pages and removing the object from all layouts that use it can be difficult, consider phasing out use of the object. As an administrator, we can begin phasing out the use of a widget or layout template by removing the store subscription to the object. Then, when a business user is creating a layout, the user cannot view the object in the Commerce Composer tool to select the template or widget. Existing layouts that use the widget or template however continue to function. To remove the widget or template from store pages, the registration of the object must be removed. Removing the registration of the object can affect the display of the store pages that used the object. If the widget or layout template must be deleted instead of removed for use in a store, the object registration must first be deleted for all stores. With the object registration removed, the actual source code for the object can be deleted. We must use the Data Load utility to remove the subscriptions and registration of a widget or layout template.
Note: Do not remove the registration of any widget or layout template provided by default with WebSphere Commerce. Do not delete or change the source code for any Commerce Composer object that is provided by default with WebSphere Commerce.
If a widget uses an e-Marketing Spot that is created and Managed with the Marketing tool, removing the subscription or registration of the widget, or deleting the widget, does not affect the e-Marketing Spot.
To remove and delete a page, widget, or layout template object from your system, complete the following steps:
Procedure
- Open the Commerce Composer tool..
- Ensure that the object to remove is not in use on a store page.
- If we are deleting a page, ensure that the layout assignment is removed for the page and any links from other pages to the page are removed.
- If we are deleting a layout template, ensure that business users delete any layouts that are based on the layout template. Alternatively, as an administrator, we can use the Data Load utility to delete the layouts. Ensure that any layout assignments for pages that use the layout are deleted before the layout is deleted.
- If we are deleting a widget, ensure that the widget is removed from any layouts that include the widget.
- Use the Data Load utility to remove the Commerce Composer object from Management Center for the store.
- Create a CSV input file that identifies the Commerce Composer object to remove the subscription for or delete and flag the data for deletion. Within the CSV file, ensure that you include the Delete column and set the value for the column to 1 for the row that includes the data.If we are deleting a custom widget, layout template, or page, we can reuse the CSV files that were used to create the custom object. If you do not have an existing CSV file, WebSphere Commerce provides sample CSV files that we can copy and edit for use in deleting your Commerce Composer object. These sample files are in the appropriate subfolder within the following directory:
- WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer
Widgets Use CSV files that contain the following information with the value 1 set for the Delete column:
- To unsubscribe a widget, use a subscribeWidgetdef.csv CSV file.
- To unregister a widget, use a registerWidgetdef.csv CSV file. If we are removing a widget that is provided by default with WebSphere Commerce, do not unregister the widget.
- To delete the properties values set for a widget within a layout, use a widgetnvp.csv CSV file.
- To delete the layout relationship between a widget and a layout, use a layoutWidgetRelationship.csv CSV file.
Layout templates Use CSV files that contain the following information with the value 1 set for the Delete column:
- To unsubscribe a layout template container, use a subscribeWidgetdef.csv CSV file.
- To unregister a layout template container, use a registerWidgetdef.csv CSV file. If we are removing a layout template that is provided by default with WebSphere Commerce, do not unregister the template.
- To delete the layout relationship between a widget and a layout, use a layoutWidgetRelationship.csv CSV file.
- To delete the registration of the layout template as a template, use a template.csv CSV file.
- To remove the additional layout template information that defines the template slots, use a
slotDefinition.csv CSV file.
Content pages Use CSV files that contain the following information with the value 1 set for the Delete column:
- To delete the page information, use a page.csv
- To delete any remaining layout assignments for the page, use a layoutAssignment.csv CSV file.
- To delete custom search engine optimization (SEO) properties for the content page, such as the URL keyword, page title, and meta description, use a seopage.csv CSV file.
- To delete any custom search engine optimization (SEO) descriptive information for the content page, use a seopagedesc.csv CSV file.
- Configure the Data Load utility. We can reuse the configuration files that you were used to create the Commerce Composer objects. If you do not have the configuration files, WebSphere Commerce provides sample files that we can copy, edit, and use to run the Data Load utility. The sample environment and business object configuration files are in the following directory. The load order configuration files are in the appropriate subfolder:
- WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer
- Run the Data Load utility.
- Verify the results of the data load. Ensure that the object you deleted no longer displays in Management Center for the store.
- Optional: If we are deleting, a widget or layout template, locate the files that define the storefront and Management Center assets for the widget, layout template within the file system for the store. We can delete the files specific to the widget or layout template. Edit the remaining files to remove the code for our custom widget or layout template.
If we are using removing a widget that is provided by default with WebSphere Commerce from the store or stores, do not delete the storefront and Management Center assets for the widget.
- Rebuild the LOBTools project.
- Restart the WebSphere Commerce server.
Results
The Commerce Composer object is removed from the store, and deleted from your system.
- Remove marked for delete Commerce Composer layouts
We can run the CleanPageLayoutsCmdImpl command to remove layouts from the database that business users delete. When a business user deletes a layout with the Commerce Composer tool, the layout is removed from the tool and store pages, but not from the database. The layout is only marked for delete in the database. As an administrator, run the CleanPageLayoutsCmdImpl command as a scheduled job to clean up the database by removing any layouts that are marked for delete.
Related concepts
Developing Commerce Composer assets
Widgets for Commerce Composer
Commerce Composer widget library
Layouts, layout templates, and default layouts
Layout assignments for category pages
Layout assignments for catalog entry pages
Layout assignments for search terms
Pages and page creation
Related tasks
Creating Commerce Composer layout templates
Creating Commerce Composer widgets
Related reference
Remove marked for delete Commerce Composer layouts
Best practices for developing Commerce Composer assets