The Bynder connector for Akeneo CE provides a seamless integration between Akeneo PIM CE and Bynder DAM. Once installed, assets uploaded in Akeneo PIM CE are automatically stored on Bynder DAM.
Afterwards managing these assets in Bynder DAM is very easy, as the connector provides the ability to enrich asset metadata in Bynder DAM by syncing product data of the linked product in Akeneo PIM CE.
This documentation will guide you through the necessary steps to get the connector up and running on your Akeneo CE project.
An Akeneo CE project (minimum supported version 4.x)
Akeneo runs on a server with CRON installed
Composer
A Bynder instance
Add our packages.induxx.be repository to the composer.json of the Akeneo CE project.
{
"repositories": [
{
"type": "composer",
"url": "packages.induxx.be"
}
]
}
Install the connector using Composer.
composer require induxx/akeneo-bynder-bundle
Add the following lines to /config/bundles.php.
Induxx\Bundle\BynderBundle\InduxxBynderBundle::class => ['all' => true],
Induxx\Bundle\CredentialsManagerBundle\InduxxCredentialsManagerBundle::class => ['all' => true],
Add the necessary routes to config/routes/bynder.yml.
bynder_media:
resource: "@InduxxBynderBundle/Resources/config/routing/bynder_media.yml"
Add the necessary routes to /config/routes/credentials_manager.yml.
induxx_credentials_manager:
resource: "@InduxxCredentialsManagerBundle/Resources/config/routing.yml"
prefix: /induxx/
Add the new parameters in the /config/services/services.yml.
parameters:
tmp_storage_dir: '%kernel.project_dir%/var/tmp/file_storage'
kernel_secrets_dir: '%kernel.project_dir%/config/secrets'
Add the new catalog storage adapter configuration to /config/packages/oneup_flysystem.yml or /config/packages/<environment>/oneup_flysystem.yml.
oneup_flysystem:
adapters:
catalog_storage_adapter:
custom:
service: induxx.bynder.adapter
Create the yaml file config/services/bynder_attribute_mappings.yml with the content below.
parameters:
asset_type_metaproperty_options_mappings: [ ]
metaproperty_mappings:
'product_code': ''
'product_model_code': ''
'asset_type': ''
'sort_order': ''
sortable_asset_type_metaproperty_mappings: []
enrichment_metaproperty_mappings: []
enrichment_metaproperty_options_mappings: []
enrichment_metaproperty_locale_mappings: []
derivative_to_use: 'original'
asset_unlink_after_archiving: true
update_metaproperty_on_empty_only_mappings: []
We will ellaborate on this file in the next chapter to provide the connector with the correct mappings and configuration.
The ‘autoload’-section of the composer.json file should contain the the FileUploader.php path and namespace under ‘files’ and ‘exclude-from-classmap’.
{
"autoload": {
"psr-0": {
"": "src/"
},
"files": [
"src/Bynder/Api/Impl/Upload/FileUploader.php"
],
"psr-4": {
"Pim\\Upgrade\\": "upgrades/"
},
"exclude-from-classmap": [
"vendor/akeneo/pim-community-dev/src/Kernel.php",
"vendor/bynder/bynder-php-sdk/src/Bynder/Api/Impl/Upload/FileUploader.php"
]
}
}
Unzip Bynder.zip located in the bundle in the src folder of the project (/src/Bynder/..)
Lastly, make sure you recompile the frontend assets running make front and run a composer dump-autoload to reflect the changes made in the composer.json file.
We will start off by doing the preparations on the Bynder instance. A few things need to be set up here.
You can create a permanent token by navigating to ‘Advanced settings’ > ‘Portal settings’ > ‘Permanent tokens’ using the cog in the upper right hand side of the application, provided you have the necessary rights to do so.
Clicking ‘Add new’ prompts a form with a Bynder user selection. This would preferably be linked to a dedicated user, since the history/actions will be linked to the selected one. The user should have the following permission active:
Next, you select the access scopes of the token:
After selecting the user, scopes and confirming, a permanent token should be generated (store it somewhere on temporary location as leaving the page will obscure the token) which we can use to add to the credentials in Akeneo.
A few metaproperties need to be defined/existing to link to a product’s (or model’s) identifier and the related attribute within that product in Akeneo.
First of all, we want a product identifier with the advised configuration as following:
Then we define the same type of metaproperty, but for product model codes:
We want to make sure there is a metaproperty that contains/links to the attribute name that reflects the image attribute name of the product in Akeneo. The following setup would be advised:
There is an optional possibility to map 1 metaproperty option to multiple image attributes, provided they have the same name affixed with a dash and count. (f.e. ‘application’ in bynder => ‘application_1’, ‘application_2’ in Akeneo CE) In that case, an order field needs to be added in Bynder to define the order of the assets that get linked.
Now that we set up Bynder and we have the permanent token at hand, we can provide mapping and credentials to Akeneo, and have the linking/enrichment jobs scheduled.
Adding Bynder credentials to Akeneo CE is done in the UI using the credentials manager provided with the connector. Browse to System > Credentials manager and click on ‘create credential’. Provide the code input with the value ‘bynder’ and select one time key as the type of credential.
When added, you can add the hostname (f.e. induxx-demo.bynder.com) and the permanent token. That’s it!
Let’s revisit the bynder_attribute_mappings.yml we added in the installation step. Below we provided some context to the parameter names. What key => value in this configuration is concerned, we are mapping Akeneo (key) to Bynder (value).
Linking an asset and providing enrichment to an asset is achieved using scheduled commands (cronjob):
We have added suggestions on the intervals on which the jobs should be executed. This is project-specific and should be finetuned accordingly.
All commands have the same 2 options available:
--max_updated_time_in_minutes, which defaults to 60. It’s adviced to set the time to the interval length of the cronjob
--credential_code, defaults to ‘bynder’. If another credential code would have been used during the configuration, it can be defined here.
AKBYNDCON-27 - Added fallback to local storage
We added a fallback to local storage for reading and downloading files in Akeneo.
AKBYNDCON-26 - Function attributeIsOnCorrectLevel is not working for product models
The function attributeIsOnCorrectLevel is not working for product models. It always returns false.
AKBYNDCON-24 - Original filename is missing extension
Original filename is missing extension when we upload to Bynder
AKBYNDCON-25 - Mass unlinking of products from an asset
Fixed issue with mass unlinking of products from an asset
AKBYNDCON-23 - Link products when uploading asset
Unlinking of the previous asset was not done. We made also a fix for linking the products when uploading using the mass edit action.
AKBYNDCON-22 - Meta property options mapping not working
The connector didn't used the meta property options mapping correctly. This is now fixed.
AKBYNDCON-21 - Link products when uploading asset
We now link automatically the product('s) when you upload an image in Akeneo. This also works when you use mass action
AKBYNDCON-8 - added better console output
perf: added better console output
AKBYNDCON-9 - using wrong derivative
fix: The upload of an asset does not result in the correct derivative
AKBYNDCON-10 - api routes doesn't work anymore
fix: api routes
AKBYNDCON-11 - refresh asset thumbnail
feature: Akeneo asset thumbnail preview refresh
AKBYNDCON-12 - fallback to original derivative
fix: get original file when derivative is not found
AKBYNDCON-7 - getFamilyVariant() on null
fix: Call to a member function getFamilyVariant() on null
AKBYNDCON-6 - map meta property option to multiple attributes
feat: made it possible to map a meta property option to multiple attributes
AKBYNDCON-5 - added tests
feat: added phpunit tests
AKBYNDCON-4 - fix updating properties of assets
fix: updating properties of assets linked to product models
AKBYNDCON-2 - fix unlinking of asset
fix: unlinking of asset doesn't work
AKBYNDCON-3 - using default image
feat: use default image if derivative is not found
AKBYNDCON-1 - Inital release
Inital release for the Bynder connector