Setting Up Multi-Country Site Support
SmartEdit with Multi-Country Site Support allows you to manage the content of sites with multiple content catalogs set up in a hierarchy. This allows you to set up a consistent look and feel across all your websites while making it possible for you to customize content catalogs for different regions and languages.
If you have an existing multi-country setup and you want to edit it using SmartEdit with Multi-Country Site Support, you must create your own AddOn to import the data into SAP Commerce Cloud. You must create the ImpEx files and specify the data for them. You will create the following ImpEx files for your AddOn:
- catalog.impex for each content catalog
- site.impex for each content catalog
- store.impex for each content catalog
- user-groups.impex for your users and usergroups
This procedure provides an example of how to set up an AddOn that will create the data for a multi-country setup. In particular it describes how to create an AddOn to import sample data for Electronics storefronts in a hierarchical structure.
Procedure
To set up Multi-Country Site Support, do the following:
-
Create an AddOn named testmulticountrysampledata. You will use the yaddon template to create your AddOn.
In your testmulticountrysampledata AddOn you will create a folder structure as follows:
testmulticountrysampledata resources testmulticountrysampledata import common user-groups.impex contentCatalogs electronics-deContentCatalog catalog.impex electronics-euContentCatalog catalog.impex electronicsContentCatalog catalog.impex ... stores electronics-deContentCatalog site.impex store.impex electronics-euContentCatalog site.impex store.impex electronicsContentCatalog site.impex store.impex ...
For more information about ImpEx files, see the following:
-
In the user-groups.impex file, create the required users and user groups as shown in the following example:
INSERT_UPDATE usergroup;uid[unique=true];groups(uid)[mode=append]; ;testcmsmanagergroup;basecmsmanagergroup; INSERT_UPDATE Employee;UID[unique=true];;description;name;groups(uid)[mode=append]; ;testcmsmanager;;Electronics CMS test manager;Electronics CMS test manager;testcmsmanagergroup,previewmanagergroup;
You must ensure that the new user is part of both the basecmsmanagegroup and previewmanagergroup usergroups. This is required so that the user can access the smartedit and Preview APIs.
-
In each content catalog folder, create an ImpEx file called catalog.impex.
The following example shows the content of the catalog.impex file:
# Content catalog for CMS contents INSERT_UPDATE ContentCatalog;id[unique=true] ;electronicsContentCatalog ;electronics-euContentCatalog ;electronics-deContentCatalog # Content catalog for CMS contents INSERT_UPDATE ContentCatalog;id[unique=true];supercatalog(id) ;electronics-euContentCatalog;electronicsContentCatalog ;electronics-deContentCatalog;electronics-euContentCatalog
-
Create base stores for each of the sites that you want to create and associate each site to its respective base store, as shown in the following example.
# Base Store INSERT_UPDATE BaseStore;uid[unique=true] ;electronics; ;electronics-eu; ;electronics-de; #Site INSERT_UPDATE CMSSite;contentCatalogs(id) ;electronics;electronicsContentCatalog; ;electronics-eu;electronicsContentCatalog,electronics-euContentCatalog ;electronics-de;electronicsContentCatalog,electronics-euContentCatalog,electronics-deContentCatalog
For more information about creating base stores, see the Creating a Base Store for the Website section of the Setting Up a Basic Web Site in the Backoffice.
-
Once you have created your testmulticountrysampledata AddOn, you must add it to your localextensions.xml file.
-
Update your SAP Commerce Cloud to implement the changes you have made for your multi-country setup by executing the following command:
ant updatesystem