Monday, 1 August 2016


Commerce Composer - Clean up data scripts

-- Layout
delete from pagelayout where name in ('SampleHomePageLayout', 'SampleStaticContentLayout', 'SampleDepartmentPageLayout', 'SampleContentPageLayout', 'SampleDefaultContentPageLayout');

delete from dmactivity where dmactivity_id in (select dmactivity_id from pllocation where pagelayout_id in (select pagelayout_id from pagelayout where name like 'SampleHomePageLayout' and storeent_id in (select storeent_id from storeent where identifier = '<identifier_name>')));

delete from pagelayout where name like 'SampleHomePageLayout' and storeent_id in (select storeent_id from storeent where identifier = '<identifier_name>');

-- Page
delete from seourl where TOKENNAME='StaticPagesToken' and tokenValue in (select CAST(plpage_id AS CHAR(50)) plpage_id from plpage where adminname in ('SampleHelpPage', 'SampleHomePage'));

delete from seopagedef where pagename  = 'Content_' || (select CAST (CAST(plpage_id AS CHAR(50)) AS VARCHAR(50)) from plpage where adminname = 'SampleHelpPage');
delete from seopagedef where pagename  = 'Content_' || (select CAST (CAST(plpage_id AS CHAR(50)) AS VARCHAR(50)) from plpage where adminname = 'SampleHomePage');

delete from plpage where adminName in ('SampleHelpPage', 'SampleHomePage');

-- Template
delete from plwidgetdef where identifier in ('SampleHomePageContainer', 'SampleDepartmentPageContainer', 'SampleStaticContentContainer', 'SampleContentPageContainer');
delete from pagelayout where name in ('Sample home page', 'Sample department', 'Sample any page, five slots, right sidebar', 'Sample any page, single slot');


-- Widget
delete from plwidgetdef where identifier in ('SampleSiteWidget', 'SampleStoreWidget');
delete from pagelayout where name in ('SampleContentPageLayout');


Clean page layout scheduled job configuration

You can configure the clean page layouts scheduled job within the following file:
AIXLinux: WC_eardir/xml/config/com.ibm.commerce.pagelayout/wc-admin-component.xml
Windows: WC_eardir\xml\config\com.ibm.commerce.pagelayout\wc-admin-component.xml
The configurable properties for this job are included in the file by default. Set the value for the "cleanMarkedForDelete" configuration property to "Y" to have the job remove layouts that are marked for delete. You can also configure the job to also delete layouts that are inactive for longer that a specified number of days with the "daysExpiredToDelete configuration property. By default, the value for this property is "60" days. Your configured CleanPageLayouts job, can resemble the following code:

<_config:configgrouping name="CleanPageLayouts">
<!-- The property to configure the number of days that the page layout can be cleaned after it expired. -->

<_config:property name="daysExpiredToDelete" value="60" />

<!-- The property to configure whether to clean the page layouts that are marked for delete.
Y, clean the page layouts that are marked for delete.
N, do NOT clean the page layouts that are marked for delete.
-->

<_config:property name=cleanMarkedForDelete" value="Y"/>

</_config:configgrouping>

When this scheduled job runs, the widget data for the layout deletes first, then any layout assignment data that exists, before the job deletes the layout data. When the CleanPageLayouts process uses the WidgetManagementService.delete method to delete widget information, the method can delete the e-Marketing Spot used with the widget. If your widget includes an e-Marketing Spot, the e-Marketing Spot is deleted only if the e-Marketing Spot was created and managed with the Commerce Composer tool. To determine whether the e-Marketing Spot for a widget is created and managed with this tool, review the widget definition XML for the widget within the PROPERTIES column of the PLWIDGETNVP database table. If the widget definition XML contains the requireEMS property with a value of true, an e-Marketing Spot is created and managed with the Commerce Composer tool. If the e-Marketing Spot for the widget includes title content, this content is also deleted. e-Marketing Spots that are created and managed within the Marketing tool are not deleted.

No comments:

Post a Comment