Evaluating Custom Backoffice Extensions

Objective

After completing this lesson, you will be able to evaluate how to create custom Backoffice extensions and identify the required configuration files to successfully create extensions for various implementations.

Custom Backoffice Extensions

The Backoffice application is built on the Cockpit NG Framework and offers extensive customization options. It is implemented in the Backoffice extension, so let's explore its essentials and how to use the yBackoffice template to manage your own Backoffice extensions.

Backoffice extension contains all out-of-the-box functionalities of Backoffice, which includes the Backoffice framework and the Administration Cockpit with its standard widgets. It's a single web application that serves as a container for all Backoffice modules. It also includes the Application Orchestrator (F4), which you can use to design your own custom mashup. By default, you can access the application at: (https://localhost:9002/backoffice)

yBackoffice extension template helps you customize your Backoffice. Use this template to generate a custom extension in which you can implement your own Backoffice modules, widgets, or UI configurations. Each extension based on yBackoffice contributes to the main Backoffice application. Note, however, that these extensions cannot be used to create a separate Backoffice application with a different access URL.

Watch the following demo to see how to create a custom Backoffice extension.

Backoffice-Related Files in a Custom Backoffice Extension

After learning how to create a custom Backoffice extension, you might be curious about how it differs from other SAP Commerce Cloud extensions.

Custom Backoffice extensions, created using the yBackoffice template, come with unique Backoffice-related files. These files are designed specifically to configure, extend, or customize the Backoffice according to your needs. Let's look at an example (following image) of a custom Backoffice extension named demoBackoffice, and understand how these special files are organized within this extension.

Screenshot of a custom backoffice extension folder structure, with the backoffice and resources folders highlighted.

As illustrated in the preceding image, within the custom Backoffice extension, "demobackoffice", there exist two folders containing Backoffice-related files.

The first folder, referred to as backoffice, typically contains a subfolder named widgets where custom widget types are stored.

For example, the widgets/mywidget folder contains all the necessary files for a custom widget type called mywidget. These files include:

  • demobackoffice/backoffice/resources/widgets/mywidget/definition.xml: Declaration of a specific widget type. The component definition, inputs and outputs, and meta data related to it.
  • demobackoffice/backoffice/resources/widgets/mywidget/view.zul (optional): Default view for a widget type based on ZK.
  • demobackoffice/backoffice/src/<package_of_demobackoffice>/widgets/MywidgetController: is the Java class acting as the Controller for the custom widget type.
  • demobackoffice/backoffice/resources/widgets/mywidget/cockpit-config.xml (optional): Default context configuration of a custom widget type. Consider it as the widget’s default configuration.

Creating a custom widget type in the backoffice folder is beyond the scope of this learning journey. For further information, refer to the Creating a Widget section in our help portal documentation.​

The second folder, resources, maintains special Backoffice-related files. Particularly in the demoBackoffice extension, this folder contains two vital Backoffice configuration XML files.

  • demobackoffice/resources/demobackoffice-backoffice-config.xml: Configuration of context components defined in the demoBackoffice extension. 
  • demobackoffice/resources/demobackoffice-backoffice-widgets.xml: Configuration of widgets (IDs, positions, settings, and so on) and their socket communication is defined in the demoBackoffice extension.

Summary

  • Custom Backoffice extensions are built on the Cockpit NG Framework using the yBackoffice template to add modules, widgets, and UI configurations to the Backoffice application.
  • A custom Backoffice extension is created by running the ant extgen task with the ybackoffice template.
  • Custom Backoffice extensions organize their unique files into two folders: backoffice (for custom widget types) and resources (for Backoffice configuration XML files).