Overview of the CMS2 Data Model
This document provides an overview of the CMS2 data model.
cms2 Extension UML
cms2 Extension Basics
A CMSSite is the entry point to a website. A CMSSite is assigned to one or more stores, known as base stores, which define the product catalogs and the versions that should be available in the website. Every page in the frontend is represented by a page. There are different types of pages, such as a product page for a displaying a single product, a category page to display the contents of a product category, or a content page for a static content page such as Delivery Information, About Us, and so on.
Every page in a website must be assigned a page template. A page template defines the number and names of content slots in which editorial content can be placed. Page templates can contain predefined pieces of information, which are available on every page instance that uses that page template. They can also be used to distinguish between different layouts or designs, for example, a standard PageTemplate for normal pages and a brand PageTemplate for brand pages.
A CMS component is a small block of content. A component is based on a component type, which is a template that provides specific content, such as text, graphics, media, links, and so on. Each component type has its own properties and serves a specific purpose. A component can consist of simple content information such as an Image, a Paragraph, or a Link, or composed content information such as a Banner, which contains an image, a link, and a headline. It is also possible to create more complex CMS components such as a PromotionComponent, a SearchResult component, or a ProductList component.
The following image shows a typical scenario for page templates, pages, and the CMS components within the cms2 extension:
In the above scenario, three areas are shown as follows:
- PageTemplates: There are two page templates: Default PageTemplate and Brand PageTemplate. Each template contains ContentSlots, where CMS components can be placed. The Default Page Template has four content slots: header, footer, navigation, and main. The Brand Page Template has two content slots: navigation and main. In each page template, components have already been assigned to content slots. For example, in the Default Page Template, the header content slots contains an image and the footer content slot contains a text element. In the Brand Page Template, the navigation content slot contains a Link List.
- Pages: Three pages are displayed. Two pages use the default page template as the page template and one page uses the brand page template. The pages already contain the components that are defined for the page templates, so an editor does not need to define the image in the header content slot and so on. All changes to components in a page template are automatically applied to all pages that use that template.
- CMS Components: A list of components that can be used in page templates or in pages.
Creating or editing a page is executed as follows:
-
The content manager defines a set of page templates and components.
-
An editor selects a page template for each page.
-
The editor adds content to pages using components that are added to content slots. The editor can also add components to the content slots of page templates so that the components will appear in every new page that uses that page template.
Types
BaseStore
The BaseStore type is part of the basecommerce extension. A BaseStore is used by other extensions, such as the CMS2 extension and the promotions extension.
A store can be an online store and it can also be used to represent traditional stores, which do not always need to be related to a website. A website can also can contain one or more stores; for example, it is possible to have a website that represents all traditional stores, or to have multiple websites to represent the same store but in different languages, such as English, German, and Spanish.
A BaseStore contains the following attributes:
|
Attribute Name |
Description |
|---|---|
|
catalogs |
Product and classification catalogs that should be available in the store. |
|
cmsSites |
The list of sites. |
|
name |
The localized name of the store. |
|
uid |
Unique identifier for a store. |
For more information, see basecommerce Extension.
CMSSite
A CMSSite is the same as a website. However, the Website type is already reserved by the previous SAP Commerce Cloud CMS system and because both content management systems can be installed on the same machine, a different type name must be used here. Therefore, we use the CMSSite type.
A CMSSite must be assigned to at least one BaseStore, which defines the product and classification catalogs for this store. The catalogs are also part of the CMSSite, therefore only products and classification attributes of the assigned catalogs can be accessed in this CMSSite instance.
The cms2 extension manages all content information, such as pages, page templates, content slots, and components in the content catalogs. A CMSSite therefore also defines the content catalogs that are available in this site.
The following attributes are defined for a CMSSite:
|
Attribute Name |
Description |
|---|---|
|
active |
A flag indicating if the CMSSite is active or not. If a customer tries to access an inactive CMSSite, the cms2 extension will throw an exception. |
|
activeFrom and activeUntil |
Period of time in which the CMSSite is active. If a customer tries to access an inactive CMSSite, the cms2 extension will throw an exception. |
|
contentCatalogs |
List of content catalogs available in the CMSSite. |
|
defaultCatalog |
Product catalog to be used as default if a CMSSite has more than one product catalog. This attribute is not mandatory. If a CMSSite contains more than one product catalog, you can specify the product catalog that is be used as the default for product/category look-up when no catalog is explicitly set. If product or category codes are not unique over multiple catalogs, we recommend that you specify a default catalog. |
|
defaultPreviewCatalog |
The default catalog to be used for CatalogPage previews within the CMSCockpit. |
|
defaultPreviewCategory |
The default category to be used for CategoryPage previews within the CMSCockpit. |
|
defaultPreviewProduct |
The default product to be used for ProductPage previews within the CMSCockpit. |
|
name |
Localized name of a store. |
|
previewURL |
The URL to be used for CMSCockpit page previews. |
|
redirectURL |
The URL for redirecting. Used if a CMSSite redirects the customer to another location. |
|
startingPage |
ContentPage used as start page or as a homepage. The landing page of this CMSSite. Used when a client accesses the root of a website, such as www.myshop.com. |
|
stores |
List of stores assigned to the CMSSite. |
|
uid |
Unique identifier of a CMSSite. |
|
urlPatterns |
List of URL patterns where CMSSite is accessible. URL patterns describe under which URL a store will be accessible. A store can have more than one URL pattern and the value can be a regular expression. For example the pattern https?://[cms2 - Data Model Overview^/]*/storetemplate.* matches all URLs that start with http (optionally followed by an 's' for https connections) and ://, followed at least once by the expression in square brackets ^/. This means no (^)/ , that is, all characters but the slash. The next part is /storetemplate followed by any number of characters (.*). In this example, the CMSSite is activated through the URL http(or https)://(any domain)/storetemplate/(...). |
Content Catalog
All content in the CMS, such as components, pages, page templates, restrictions, are catalog-version aware, that is they are assigned to a content catalog version. This makes it possible to assign content to catalog versions, which can be synchronized between each other. For example: all content changes from one or more editors are made in the staged version of a catalog. When all the changes have been approved, they are synchronized from the staged version of the content catalog to the online version of the content catalog. This makes it possible for editors to continuously work on a website without affecting the online live version, which is the version that is displays to customers.
The ContentCatalog is only a sub-type of the SAP Commerce Cloud catalog and there are no additional changes.
The following attributes are defined for the ContentCatalog:
|
Attribute Name |
Description |
|---|---|
|
catalogLevelName |
Content catalog name in a multi-country environment |
|
cmsSites |
CMSSites |
|
subCatalogs |
List of child catalogs in a multi-country environment |
|
superCatalog |
Parent catalog in a multi-country environment |
CMSItem and CMSRelation
All CMS types extend the CMSItem or CMSRelation type. These two types can be assigned to content catalog versions.Therefore, if you create your own CMS types, you must ensure that you always extend the CMSItem or CMSRelation type to make your custom types catalog-version aware.
The following attributes are defined for the CMSItem type:
|
Attribute Name |
Description |
|---|---|
|
catalogVersion |
Assigned catalog version for the item. |
|
name |
Name of the item. |
|
uid |
Unique identifier for the item. |
The following attributes are defined for the CMSRelation type:
|
Attribute Name |
Description |
|---|---|
|
catalogVersion |
Catalog version assigned to the item. |
|
uid |
Unique identifier for the item. |
PageTemplate, ContentSlotName and ContentSlotForTemplate
Each page in your catalog is based on a page template. A page template defines the number and names of content slots that are available on the page. It can also contain predefined components (in the content slots) that are automatically on every page instance that uses the page template. A page template in the cms2 extension does not define layouts or designs, but it can be used in the frontend to switch between different page layouts, depending on the selected page template.
A page template can have one or more content slot names. Each content slot is represented in the template by a unique name.
The PageTemplate above defines the following content slots:
- Header
- Footer
- Main
- Navigation
The number and the names of the content slots in a page template depend on the requirements and design of the project. It is possible to have simple and complex page templates.
The ContentSlotForTemplate defines the content slots and their components within a page template. It uses the position attribute type to define where content slots and their components are placed on a page. This is not a standard relation.
The following object diagram shows the definition of the Brand PageTemplate:
The Brand PageTemplate refers to two ContentSlotNames instances: navigation and main. It refers to one ContentSlotForTemplate instance with the position navigation that refers to a ContentSlot instance.
The Brand Page Template defines two positions with the name navigation and main for content slots. It provides one predefined content slot at the position navigation that contains one CMS component, a LinkList component.
AbstractPage, ContentSlotForPage and Page Subtypes
A page represents a single web page. There are different types of pages depending on the information to be displayed. All pages extend the AbstractPage type, which is always assigned to a PageTemplate that defines the available content slots and the existing, predefined content slots and components.
|
Page Type |
Description |
|---|---|
| CatalogPage | A page that displays the contents of a catalog or multiple catalogs. This kind of page can be used when customers switch the catalog of a store. |
| CategoryPage | A page that displays the contents of a category. |
| ContentPage | A standard content page, such as the homepage, a help page, press releases, policies. |
| ProductPage | A page that displays a single product. |
You can create your own page types, for example, a PromotionPage that displays a list of available promotions or a product recommendation page.
The procedure of assigning content slots to positions on a page is the same as described in the PageTemplate section above.
ContentSlot
A content slot is basically a container for CMS components. It is assigned to a page using the ContentSlotForPage or to a PageTemplate using ContentSlotForTemplate.
The following image shows components in a content slot in SmartEdit.
AbstractCMSComponent, SimpleCMSComponent and Their Subtypes
A CMS Component is the smallest piece of information that can be managed in WCMS. The AbstractCMSComponent has two subtypes: AbstractCMSComponentContainer and SimpleCMSComponent.
-
AbstractCMSComponentContainer: Is a container for CMS components, similar to a content slot. However, unlike a content slot, a component container can be added to a content slot. A component container also contains an additional rule that determines which components should be returned.
An example of a component container is an A/B Test ComponentContainer, which contains banners and a simple rule that randomly returns one of the Banner components. Therefore, for each frontend request, the container returns a different banner to be displayed for the customer. You can create other component containers with different rules. For example, a NewsContentContainer that contains a list of News components and returns them ordered by date, author, or another attribute, or an External Rule ComponentContainer that requests the information that components are to show from an external system.
-
SimpleCMSComponent: Is the smallest piece of information you can put in a content slot. Many components extend the SimpleCMSComponent type. The cms2 extension provides the following SimpleCMSComponents:
Component Type
Attributes
Description
CMSParagraphComponent content A simple text element that contains one text field. CMSImageComponent media A simple image element that containsone image (media). CMSLinkComponent linkName, external, url, contentPage, product, category A link to a resource such as an external URL, a ContentPage, a Product, or a Category.
Additional SimpleCMSComponents are defined in the cms2lib extension. For more information, see cms2lib Extension.
If you want to create a CMS component type in SmartEdit, see Trail: Creating a Custom Component Type.
AbstractRestriction and Its Subtypes
Restrictions are used to determine when CMS components and pages are displayed in a website based on context information.
The following tables lists the accessible restriction types and the items that the restrictions can be applied to:
|
Restriction Type |
Available Data |
Components |
Product Pages | Category Pages | Catalog Pages | Content Pages | Example |
|---|---|---|---|---|---|---|---|
|
Campaign |
List of campaigns |
|
|
|
|
|
The restriction allows you to control the visibility of components or pages based on the defined Campaign lifecycle. |
|
Catalog |
List of catalogs |
|
|
|
|
|
|
|
Category |
List of categories, recursive flag |
|
|
|
|
|
|
|
Product |
List of products |
|
|
|
|
|
Component or Product Page is visible only if the current product the user is viewing on the frontend is in the list of specified products. If not, the component will not be shown, the page will not be found. |
|
User |
List of users |
|
|
|
|
|
Component or Page is visible only if the current user on the frontend is in the list of specified users. If not, the component will not be shown, the page will not be found. |
|
User Group |
List of usergroups |
|
|
|
|
|
Component or Page is visible only if the current user on the frontend is in one of the specified usergroups. If not, the component will not be shown, the page will not be found. |
|
Time |
Valid from (DateAndTime) and Valid until (DateAndTime) |
|
|
|
|
|
Component or Page is visible only in the specified period of time. If the current time is not in the specified period of time, the component will not be shown, the page will not be found. |
You can also add your own type of restrictions.