Implementing the Plugin
You can implement the Bloomreach Feed plugin, which works with Elastic Path Catalog Syndication, to send your catalog in the Bloomreach (TSV) Tab Separated Value format.
Before You Begin
important
Ensure that you are an Elastic Path Catalog Syndication consumer. For more information about catalog syndication, see the Catalog Syndication Overview.
Generate a public and private key pair by running the following command on Linux or Mac:
ssh-keygen -t rsa -m PEM
Contact Bloomreach technical support to enable Secure File Transfer Protocol (SFTP) access for your Bloomreach Search and Merchandising feed. You will need to send them the public key that you generated.
warning
Do not send Bloomreach technical support your private key.
Adding the Dependency for the Bloomreach Feed Plugin
In the
ep-commerce/extensions/batch/ext-batch/pom.xml
file, add the following dependency:<dependency> <groupId>com.elasticpath.plugins</groupId> <artifactId>bloomreach-feed</artifactId> <version>804.0.1</version> </dependency> <dependency> <groupId>com.elasticpath</groupId> <artifactId>ep-messaging-camel</artifactId> <version>${dce.version}</version> </dependency> <dependency> <groupId>com.elasticpath</groupId> <artifactId>ep-catalog-projection-spring-data</artifactId> <version>${dce.version}</version> </dependency> <dependency> <groupId>com.elasticpath</groupId> <artifactId>ep-catalog-batch</artifactId> <version>${dce.version}</version> </dependency>
In the
ep-commerce/extensions/batch/ext-batch-webapp/src/main/filtered-resources
folder, add a property file with the namebloomreachFeedUploader.properties
.Populate the
bloomreachFeedUploader.properties
file with some or all of the following values:sftp.host= sftp.username= sftp.privateKeyFilename= sftp.camel.options= outputDirectory=/tmp/bloomreach outputFileName= outputDirectory.camel.options= delimiterInColumn= crumbDelimiter= stores= valuesFilter.offerProperties= valuesFilter.itemProperties=
Note: For more information about the properties, see Configuring the Plugin.
Edit the
ep-commerce/extensions/batch/ext-batch-webapp/src/main/webapp/WEB-INF/elastic-path-servlet.xml
file, in thecontext
element, add the location of thebloomreachFeedUploader.properties
file to thelocation
attribute. The following example shows an updatedcontext
element:<context:property-placeholder ignore-resource-not-found="true" system-properties-mode="OVERRIDE" location=" classpath*:META-INF/elasticpath/conf/spring/plugin.properties, classpath:module.properties, classpath:bloomreachFeedUploader.properties, file:/etc/ep/ep.properties, file:/ep/conf/ep.properties, file:/ep/conf/ep.batch.properties, file:${user.home}/ep/ep.properties, file:${user.home}/ep/conf/ep.properties, file:${user.home}/ep/conf/ep.batch.properties"/>
Run
mvn clean install
to rebuild the extensions and batch files.Restart the batch service
Defining System Configuration Settings
You can configure the Bloomreach Feed plugin through Commerce Manager using the TSETTINGDEFINITION
database table.
note
Properties set through System Configuration settings are taken as priority over any property settings set through the bloomreachFeedUploader.properties
file.
Go to the
/ep-commerce/extensions/database/ext-data/src/main/resources/data/rel-1.0-data/importexport/system_configuration.xml
file.Add a new
configuration_setting
entry for each property using the values below.<configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/sftpHost</name_space> <description>The SFTP server host name for uploading the Bloomreach file. Defaults to ftp.bloomreach.com if not set.</description> <default_value type="String">${ep.bloomreach.sftpHost}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/sftpUsername</name_space> <description>The SFTP server username for uploading the Bloomreach file.</description> <default_value type="String">${ep.bloomreach.sftpUsername}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/sftpPrivateKeyFilename</name_space> <description>The full path of the file containing the SFTP private key.</description> <default_value type="String">${ep.bloomreach.sftpPrivateKeyFilename}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/sftpCamelOptions</name_space> <description>The SFTP component configuration options.</description> <default_value type="String">${ep.bloomreach.sftpCamelOptions}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/outputDirectory</name_space> <description>The Bloomreach Feed plugin file is placed in this directory before it is sent to the Secure File Transfer Protocol (SFTP) server.</description> <default_value type="String">${ep.bloomreach.outputDirectory}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/outputFileName</name_space> <description>The name of the file that is generated. Defaults to OfferCatalog if not specified.</description> <default_value type="String">${ep.bloomreach.outputFileName}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/outputDirectoryCamelOptions</name_space> <description>The file component configuration options.</description> <default_value type="String">${ep.bloomreach.outputDirectoryCamelOptions}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/delimiterInColumn</name_space> <description>The delimiter to use when separating values in multi-view column where there are values for multiple stores. Defaults to "|" if not specified.</description> <default_value type="String">${ep.bloomreach.delimiterInColumn}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/crumbDelimiter</name_space> <description> The delimiter to use for each component of the `crumbs` field definition. Each component of the `crumbs` field represents a level of the Elastic Path category tree. Defaults to "," if not specified.</description> <default_value type="String">${ep.bloomreach.crumbDelimiter}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/stores</name_space> <description>A comma-separated list of stores to export in the feed. Defaults to all stores if not specified.</description> <default_value type="String">${ep.bloomreach.stores}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/VALUESFILTER/offerProperties</name_space> <description>A comma-separated list of product attribute keys to include in the feed. Defaults to all product attribute values if not specified.</description> <default_value type="String">${ep.bloomreach.valuesFilter.offerProperties}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting> <configuration_setting> <name_space>COMMERCE/SYSTEM/PLUGIN/BLOOMREACH/VALUESFILTER/itemProperties</name_space> <description>A comma-separated list of sku attribute keys to include in the feed. Defaults to all sku attribute values if not specified.</description> <default_value type="String">${ep.bloomreach.valuesFilter.itemProperties}</default_value> <max_overrides>1</max_overrides> <setting_metadata/> </configuration_setting>
Go to the
/ep-commerce/extensions/database/ext-data/src/main/resources/environments
folder.For example, if you are working in your local environment, go to
/ep-commerce/extensions/database/ext-data/src/main/resources/environments/local
.Go to the
filtering.properties
file.In the
filtering.properties
file, add a new property key for each setting that you added in thesystem_configuration.xml
file.For example:
ep.bloomreach.sftpHost= ep.bloomreach.sftpUsername=MY_USERNAME ep.bloomreach.sftpPrivateKeyFilename=/ep/conf/bloomreachPrivateKey.pub ep.bloomreach.sftpCamelOptions= ep.bloomreach.outputDirectory= ep.bloomreach.outputFileName= ep.bloomreach.outputDirectoryCamelOptions= ep.bloomreach.delimiterInColumn= ep.bloomreach.crumbDelimiter= ep.bloomreach.stores= ep.bloomreach.valuesFilter.offerProperties= ep.bloomreach.valuesFilter.itemProperties=
Restart Batch Server for the new settings to take effect