Monday, 1 August 2016


Commerce Composer - MigrationAccessControlPolicies.xml

<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE Policies SYSTEM "../dtd/accesscontrolpolicies.dtd">

<Policies>
<Action Name="GenericStaticContentPageLayoutView"
CommandName="GenericStaticContentPageLayoutView">
</Action>
<ActionGroup Name="<storeName>AllUsersViews"
OwnerID="RootOrganization">
<ActionGroupAction Name="GenericStaticContentPageLayoutView"/>
</ActionGroup>
</Policies>


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.

Thursday, 28 January 2016


Generating SDO from XSD in eclipse 

1. Select xsd file for which you want to generate SDO in Enterprise Explorer 
2. Right click on the xsd and select “New -> Other..” option. 
3. In the next popup screen select the “EMF Model” and Click on “Next” button. 
4. In the next popup screen select the “model” as parent folder and Click on “Next” button. 
5. In the next popup screen select the “XML Schema” and Click on “Next” button. 
6. In the next popup screen click on “Load” button then Click on “Next” button. 
7. In next screen click on “Finish” button. 
8. Open .genmodel file whatever you create then right click on it and select “Set SDO Defaults” 

In the Properties Window (while your genmodel file is selected above) ensure that the following values are set. 

Under the All heading, set these properties: 

  • Property Value 
  • Bundle Manifest False 
  • Compliance Level 1.4 
  • Copyright Fields True 
  • Runtime Version 2.2 
  • Under the Model heading, set these properties: 
  • Suppress EMF Metadata False 
  • Suppress EMF Model Tags True 
  • Save your changes and close the file 

9. Save .genmodel file whatever you created and Right click on genmodel and then click on “Generate Model Code”. 
10. Following folder structure will display on Explorer/ Navigator view. 
11. Create an SDO properties file 

  • Create an SDO properties file to register the generated SDO package class. In order to support auto detection of an XML document to the appropriate Java object, the SDO package needs to be registered in the application. 
  • Using Windows Explorer, navigate to WCDE_installdir/workspace/WC/xml/config/. Create a new folder based on your module (For example for Retail Interfaces in DFS com.dfs.interfaces). 

12. Inside your new folder, using any text editor, create a new file called SDO.properties. 
Open SDO.properties with an editor and insert the following text. Save and close the file 
13. com.mycompany.commerce.order.facade.datatypes.impl.MyOrderPackageImpl. For DFS Finance Options in Retail Interfaces it is com.dfs.interfaces.datatypes.incoming.financeoptions.impl.FinanceoptionsPackageImpl 
14. Check that the above class is present in that location by the generated SDO code.
15. Check-in code into svn. 

Referencing your SDO Project in other projects

1. If it is a newly created project, it needs to be referenced in the WC and ExtensionLogic projects.
2. Open the application.xml in WC Project. In the design view, click on Manage Utility Jars link 
3. It opens the Java EE Module Dependencies window. 
4. Check your Data Objects jar. (In the above screen shot , it is Common-SDO.jar). Click Apply and then Ok.
5. Right click on ExtensionsLogic project and click on properties. 
6. Select the “Java EE Module Dependencies” option. 
7. Check your DataObjects project jar (In the above screenshot it is Common-SDO.jar). Click Apply and then Ok.
8. Clean and build all projects and start the Server to test the new functionality.