SmartEdit Related Modules
SmartEdit is a web application to manage the contents of storefronts. The storefront of a Web site can be edited by SmartEdit if the storefront adheres to the SmartEdit Design Contract for Storefronts.
Introduction
For storefronts that are created using the yacceleratorstorefront or yb2bacceleratorstorefront extension, you can edit the storefronts using SmartEdit by enabling the smarteditaddon AddOn. This AddOn ensures that the contents of coreaccelerator-based storefronts can be edited using the SmartEdit web application.
When a storefront is enabled to be edited using the SmartEdit web application, various menus and actions are displayed on top of the storefront page contents. Page contents can change depending on numerous conditions, such as site, content catalog, content catalog version, language, and date and time. Each one of these variables composes the user's experience context. SmartEdit uses the Preview API provided by the previewwebservices extension to load the storefront into a specified experience context.
SmartEdit Architecture
The SmartEdit architecture can be split into two blocks: the frontend and the back end. It is as follows:
- Frontend: The frontend consists of the smartedit and cmssmartedit extensions. These extensions are written in JavaScript using the AngularJS framework. In order to manage the build life cycle of the JavaScript-based extensions, that is, cleaning, building, packaging, minifying, or beautifying the code, some libraries are required that aren’t provided by the SAP Commerce Cloud Platform by default. SmartEdit uses the npmancillary extension to store and organize the required libraries.
- Backend: The back end consists of the smarteditwebservices, cmswebservices, cmssmarteditwebservices, cmsfacades,cms2, and cms2lib extensions. These extensions are built in Java using the Spring framework.
The frontend communicates with the backend using RESTful APIs. The CMS-related REST APIs are defined in the smarteditwebservices, cmssmarteditwebservices, and cmswebservices extensions. The business logic used by the CMS APIs resides in the cmsfacades extension, which uses CMS services available in the cms2 and cms2lib extensions.
In order to provide multi-country support for deployments with multiple country content catalogs, SmartEdit provides sample data. To demonstrate multi-country features in the SmartEdit web application, the electronics storefront must be supplemented with additional sample data configured in the multicountrysampledataaddon AddOn. For more information, see Technical Overview of Multi-Country Site Support.
Authorization in SmartEdit
To use the SmartEdit web application, the user must enter a valid user name and password to sign in. If the user is valid, the user credentials are sent to the authorization server and an OAuth token is returned. This authorization functionality is supported by the SAP Commerce Cloud Platform. Similarly, all CMS APIs are protected and require that a proper authorization token is provided in the request header.