Adding Support for Additional Repository Types
The Easy Extension Framework currently supports the following type of Easy Repositories:
Local Repository (for development purpose only at developer's computer and not supported on SAP Commerce Cloud)
Git Repository
There may be the need to support additional repository types. This documentation explains the step-by-step process to add support for a new repository type.
Adding a new Easy Repository item type
To add a new Repository type, do the following:
Extend the item type
EasyRepository
ineasycore/resources/easycore-items.xml
for your Easy Repository type.Define the attributes required for your repository type in the item definitions.
Add localization for your Easy Repository item type in
easycore/resources/localization/easycore-locales_xx.properties
Build and execute system update.
Add backoffice configurations for the new Easy Repository item type
You must add the backoffice configurations for your repository item type in easycore/resources/easycore-backoffice-config.xml
for the following contexts:
Wizard to create the instance of your new repository type
Editor Area
List View
Tree View (Optional)
Simple Search
Advanced Search
Base
If you use any backoffice labels, add the backoffice labels localizations in easycore/resources/easycore-backoffice-labels/labels_xx.properties
Implementing the Repository Provider for the new Easy Repository type
Once you define a repository item type, you need to implement a repository provider for your Easy Repository type to support the following functions:
Get Latest From the Repository
Validate Repository
Get Repository Version
Calculate Repository Hash
Validate the Repository Hash
To implement the Repository Provider for your Easy Repository Type, create a class (say EasyXXXRepositoryProvider
) implementing the EasyRepositoryProvider
interface and implement its methods for the functions mentioned above.
Register the Repository Provider for the new Easy Repository Type
Once you implement the Repository Provider for your new Easy Repository type, you need to register it by:
Registering the spring bean (say
easyXXXRepositoryProvider
) for your Repository Provider ineasycore/resources/easycore-spring.xml
Add your repository provider to the list of repository providers by adding the following spring bean definition:
<bean depends-on="repositoryProviders" parent="mapMergeDirective"> <property name="key"> <util:constant static-field="com.sap.cx.boosters.easy.core.model.EasyXXXRepositoryModel._TYPECODE"/> </property> <property name="value" ref="easyXXXRepositoryProvider"/> </bean>
Implement the integration test for your new Repository type implementation
Once you completed the implementation, implement a JUnit
integration test to test your repository provider's functions as explained above for positive, negative and edge scenarios.