DataHub


DataHub is an component of a software product information architecture. It can handles data from one or more sources and sends them to other target systems. SAP Data Hub is a tool that provides integration, processing and data management, Hybris Data Hub is a tool specially designed for Hybris Commerce with the purpose of inbound and outbound data transfer.

The SAP Commerce Data Hub achieves connection establishment between the Hybris and ERP system . When Order is place in Hybris Commerce platform , It will persist in Hybris DB, it has to be processed by some other ERP system like SAP ERP. So we need to send order details to SAP ERP through some connector. The data replication happens in both directions: product characteristics transfers from SAP ERP to SAP Hybris Commerce platform or orders are sent from the Hybris platform to SAP ERP.

Data is replicated into two processes:

    • inbound process (ERP sends data to SAP Hybris).

    • outbound process (SAP Hybris sends data to ERP).

Architecture of SAP Integrations

SAP integrations involve various possible system landscapes, types of communication, data transfer processes, and SAP-specific configuration settings.

Hybris - SAP Integrations Data Hub Architecture

The process of transferring data from this solution to SAP Hybris Commerce is as follows:

    1. SAP Commerce Data Hub sends ImpEx without data but with URL to Hybris system;

    2. Hybris sends a signal inversely for each URL, which is marked ‘delivered’ there, and then retrieves the URLs and requests data from Hybris Data Hub;

    3. It retrieves data and sends it to the Hybris system;

    4. Hybris creates ImpEx, and extracts the ImpEx script.

Hybris Data Hub Integration

Datahub in hybris is a set of extensions which is deployed as a web application on Tomcat server . The integration of data in the Data Hub architecture in Hybris execute takes place in following major steps:

    1. Load (raw format)

    2. Composition (canonical format)

    3. Publication (target format)

Load

items come directly from the source system. This stage begins by loading data into the Hybris Data Hub using the inbound extension. Then the program transforms the received data into raw items, which continue the integration process.

Composition

During the stage, Raw items go through grouping and filtering, which reduces the number of data blocks to process becoming canonical items. It is organised, consistent, and ready for use by a target system .

Publication

During the stage, the canonical items are converted into the target one. Hybris Data Hub then sends the target items to the target system for publication using the outbound extension, which is the final touch of integration.

SAP Data Hub integration

The IDoc format, which is the main one for import/export files in SAP ERP, it is used for asynchronous data transfer. SAP ERP sends IDocs via HTTP to Hybris Data Hub, where the files are processed using the adapter and imported into the Hybris platform database.

Step for Data hub implementation

Basic prerequisites software and its version for installing Data Hub.

  • Java 1.8

  • SAP/hybris Commerce 6.0 or higher (I am using 6.3)

  • Tomcat apache-tomcat-7.0.78 or higher

  • Data Base MySql

  • Maven apache-maven-3.5.0 or higher

Tomcat installation

  • Download tomcat(apache-tomcat-7.0.78) from https://tomcat.apache.org/download-70.cgi.

  • Unpack the tomcat zip on hard drive i.e. <TOMCAT_HOME>

  • Add CATALINA_HOME environment variable to <TOMCAT_HOME>

  • Update PATH environment variable, append Tomcat bin folder – %CATALINA_HOME%\bin

Maven installation

  • Download the Maven(apache-maven-3.5.0) from http://maven.apache.org/download.cgi

  • Unpack the Maven zip file on hard drive i.e. <MAVEN_HOME>

  • Add both M2_HOME and MAVEN_HOME environment variables to <MAVEN_HOME>

  • Update PATH environment variable, append Maven bin folder – %M2_HOME%\bin

Dathub installation

Directory structure needs to create for data hub i.e. <ROOT>\<projectname>\datahub

  • Archetype in this folder, datahub-extension-archetype-6.3.0.0-RC2 and datahub-extension-sdk-6.3.0.7-RC1 jars will be resided here.

  • Config in this folder, all config files will be resided here i.e. local.properties and encryption-key.txt. this is used for local environment.

  • crm in this folder, all custom data hub extension will be resided here.

  • dependencies in this folder, all data hub dependencies related jar will be resided here.

  • erp in this folder, all out of the box data hub extension will be resided here.

  • others in this folder, database connector will be resided here.

Step

  1. Archetype :Download the datahub-extension-archetype-6.3.0.0-RC2 jar and copy in folder

  2. copy datahub-extension-sdk-6.3.0.7-RC1 jar from <HYBRIS_HOME>\hybris\bin\ext-integration\datahub\sdk and paste in archetype folder.

  3. In Config folder create 2 file

Encryption-key.txt which will contain encryption key. Copy 32 digit key and paste in encryption-key file.

DAADDE8B29A08DF0C78852D582FD6162

local.properties will contain all the properties which is needed for data hub configuration.


#Below sample of My Sql DB Setup config replace with used DB config

#dataSource.className=com.mysql.jdbc.jdbc2.optional.MysqlDataSource

dataSource.driverClass=com.mysql.jdbc.Driver

dataSource.jdbcUrl=jdbc:mysql://localhost/javaoops?useConfigs=maxPerformance

dataSource.username=root

dataSource.password=root


#media storage

mediaSource.className=com.mysql.jdbc.jdbc2.optional.MysqlDataSource

mediaSource.driverClass=com.mysql.jdbc.Driver

mediaSource.jdbcUrl=jdbc:mysql://localhost/javaoops?useConfigs=maxPerformance

mediaSource.username=root

mediaSource.password=root


#Export url, username and password.

datahub.extension.exportURL=http://localhost:9001/datahubadapter

datahub.extension.username=admin

datahub.extension.password=nimda

#Target system url, username and password.

targetsystem.hybriscore.url=http://localhost:9001/datahubadapter

targetsystem.hybriscore.username=admin

targetsystem.hybriscore.password=nimda

# Encryption

datahub.encryption.key.path=encryption-key.txt

# enable/disable secured attribute value masking

datahub.secure.data.masking.mode=true

# set the masking value

datahub.secure.data.masking.value=*******

kernel.autoInitMode=create-drop

#kernel.autoInitMode=update

#====

sapcoreconfiguration.pool=SAPCONFIGURATION_POOL

sapcoreconfiguration.autocompose.pools=GLOBAL,SAPCONFIGURATION_POOL

sapcoreconfiguration.autopublish.targetsystemsbypools=GLOBAL.HybrisCore,SAPCUSTOMER_INBOUND_POOL.HybrisCore

datahub.publication.saveImpex=true

datahub.server.url=http://localhost:8080/datahub-webapp/v1


#datahub.core.export.service.clientid=eic

#datahub.core.export.service.clientsecret=secret

Dependencies

Now copy all jars from <HYBRIS_HOME>\Hybris\hybris\bin\ext-integration\datahub\dependencies and paste in this folder

Erp

Now copy all jars from <HYBRIS_HOME>\hybris\bin\ext-integration\datahub\extensions\sap and paste in erp folder.

Others

Database connector jar will be resided here. Download the mysql-connector-java-XXX-bin.jar file and copy to the others

MySql

Login to MYSQL Database and create a Schema "javaoops"

Tomcat configuration

  • Go to <TOMCAT_HOME>/conf/

  • create folder Catalina/localhost.

  • create xml file datahub-webapp.xml .

<Context antiJARLocking="true" docBase="<Your_PATH>/hybris/bin/ext-integration/datahub/web-app/datahub-webapp-6.3.0.7-RC1.war" reloadable="true">


<Loader className="org.apache.catalina.loader.VirtualWebappLoader"

virtualClasspath=

"<Your_PATH>/datahub/config;

<Your_PATH>/datahub/crm/*.jar;

<Your_PATH>/datahub/erp/*.jar;

<Your_PATH>/datahub/dependencies/*.jar;

<Your_PATH>/datahub/others/*.jar"/>

</Context>


  • After that Start tomcat and Open URL http://localhost:8080/datahub-webapp/v1/data-feeds

  • If request for user name or password pop-up then Stop tomcat

Go to the following path for disable Spring secure

  • <YOUR_PATH>\apache-tomcat-7.0.78\webapps\datahub-webapp\WEB-INF

  • open the web.xml file and comment the following code and Start the tomcat server

<!-- Spring Security -->

<!--

<filter>

<filter-name>springSecurityFilterChain</filter-name>

<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

</filter>

<filter-mapping>

<filter-name>springSecurityFilterChain</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

-->

Now validate datahub is up or not

DataHub Integration is successful completed