Key-User Extensibility for Simple Field Extensions
This is fully experimental and the implementation as well as the setup will change over time. This preview is only disclosed for testing purposes and for gathering feedback. Go to the end of this document for a list of current limitations.
CAP has added a first experimental support for simple field extensibility that can be turned on in the latest release of the CAP Node.js runtime. This is a first step to enable extensibility in CAP applications without depending on an MTX/HDI based deployment and an SAP HANA database. The UI Adaptation tool in UI5 already provides experimental support for key-user extensions using SAPUI5 flexibility.
The CAP Samples @capire/bookshop already has everything setup to give key-user extensibility a try. The changes are located in the branch key-user-ext. You can either switch to the branch, if you've already cloned samples, or clone it directly via
CAP has added a new aspect, called extensible in @sap/cds/common. This aspect provides the necessary plumbing for simple field extensibility. Add this aspect to any entity in your schema to enable extensibility for all services exposing it without any additional work.
To enable the underlying technology, please add the following to your package.json:
With simple field extensibility turned on in your package.json, a new service and an action are added to the application to accept field extensions at runtime. While the API accepts any valid CSN snippet, only simple field extensions are allowed for the time being. The simple field extensibility in CAP is using property-bags. Property-bags are generic attachments to base entities, that can accept content for multiple extensions without changes to the underlying database schema. The aspect extensible is adding this property-bag to an entity, and the property-bags are automatically merged to the rest of the model.
After activating an extension, the application server will automatically restart. This restart feature is for local development purposes only.