-
Notifications
You must be signed in to change notification settings - Fork 0
Workspace
Given a CoreMedia Content Cloud workspace as you can clone it or download it, it is not recommended to hack your code at arbitrary places into that workspace to be able to update it later to the current releases from CoreMedia.
So we chose to present all the needed parts for the mock as a standard CoreMedia Commerce Cloud Extension with some documentational aspects included.
For your own extension thus basic knowledge in creating an extension is required. Find a very minimal extension as another example at
We need an extension to hold any of the additions we need to make related to the backend connection to the catalog of the commerce system and to the frontend with the preview and live presentation layer elements.
In our case it is the mock-catalog extension:
<module>taxonomy</module>
<module>validators</module>
<module>mock</module>
</modules>
The extension is comprised of the following sub-components:
- Integration Library Codes for Commerce Access
- Integration component to be plugged into the Studio and the CAE
- CAE intgration as library or library and component
- Optional test data module
The mock extension is used as a git submodule to not interefere with any CoreMedia Content Cloud changes or updates more than necessary and to keep our custom code separate.
git submodule add https://gitlab.com/provocon/coremedia-commerce-mock.git modules/extensions/mock
or
git submodule add https://github.com/provocon/coremedia-commerce-mock.git modules/extensions/mock
So the root pom.xml
looks similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.coremedia.blueprint</groupId>
<artifactId>extensions</artifactId>
<version>1-SNAPSHOT</version>
</parent>
<artifactId>mock</artifactId>
<name>Mock Commerce Integration - Root Module</name>
<packaging>pom</packaging>
<properties>
<coremedia.project.extension.name>Commerce Integration</coremedia.project.extension.name>
<coremedia.project.extension.modelVersion>1.0</coremedia.project.extension.modelVersion>
</properties>
<modules>
<module>lc-ecommerce-mock-lib</module>
<module>lc-ecommerce-mock-component</module>
</modules>
</project>
The bits and pieces within these modules will be discussed in the following chapters of this document. The important preparation step now is, that you will activate your extension .
echo "mock" >> workspace-configuration/extensions/managed-extensions.txt
After this step the activation of the extension will be in effect after the usual
mvn dependency:copy -Dartifact=com.coremedia.tools.extensions:extensions:LATEST:jar:all -DlocalRepositoryDirectory=extensions-tool -Dtransitive=false -DoutputDirectory=tool -Dmdep.stripVersion=true -Dmdep.stripClassifier=true
java -jar tool/extensions.jar --task synchronize --extension-config-file workspace-configuration/extensions/extension-config.properties --task-input-file workspace-configuration/extensions/managed-extensions.txt
step.
For consistency reasons you might decide to move the dependency management part
of the root pom.xml
of the magento extension to the root pom.xml
of the
workspace.
After the usual
mvn clean install [-DskipTests=true]
you should find your extension's parts in the studio and the (preview) cae.