eikona-media/akeneo4-0-tessa-connector
Verify Akeneo API Readiness
GET /api/rest/v1/products).Install the Connector
composer require eikona-media/akeneo4-0-tessa-connector
Register Routes
Append to config/routes/routes.yml:
tessa_media:
resource: "@EikonaTessaConnectorBundle/Resources/config/routing.yml"
Configure TESSA Connection
config/packages/eikona_tessa_connector.yaml:
eikona_tessa_connector:
api_url: 'https://your-tessa-instance.com/api'
api_key: '%env(TESSA_API_KEY)%'
api_secret: '%env(TESSA_API_SECRET)%'
First Use Case: Sync Product Media
php bin/console eikona:tessa:sync --entity=product --media-field=image
Media Synchronization
image, video) daily:
# config/cron.yml
sync_tessa_media:
command: eikona:tessa:sync
args: ['--entity=product', '--media-field=image']
schedule: '0 3 * * *'
php bin/console eikona:tessa:sync --entity=product --family=electronics --media-field=image
Asset Linking
image, video) to TESSA asset IDs via the tessa_asset_id attribute.brochure) by overriding the MediaFieldMapper service.Event-Driven Sync
product.save) to trigger real-time syncs:
// src/EventListener/TessaSyncListener.php
public function onProductSave(ProductUpdateEvent $event)
{
$this->tessaSyncService->syncProductMedia($event->getProduct());
}
Register in services.yaml:
App\EventListener\TessaSyncListener:
tags:
- { name: kernel.event_listener, event: product.save, method: onProductSave }
Bulk Operations
bulk-sync command for large datasets:
php bin/console eikona:tessa:bulk-sync --entity=product --batch-size=100
<!-- templates/product/_partials/tessa_assets.html.twig -->
{% if product.tessaAssetId %}
<div class="tessa-assets">
<a href="{{ tessaAssetUrl(product.tessaAssetId) }}" target="_blank">
View in TESSA
</a>
</div>
{% endif %}
use Eikona\TessaConnectorBundle\Validator\Constraints as TessaAssert;
/**
* @TessaAssert\ValidTessaAsset()
*/
private $tessaAssetId;
API Rate Limits
try {
$response = $this->tessaClient->upload($asset);
} catch (RateLimitException $e) {
sleep($e->getRetryAfter());
retry();
}
Field Mapping Mismatches
media_field names match TESSA’s expected fields (e.g., image vs. product_image). Override the MediaFieldMapper to customize:
# config/packages/eikona_tessa_connector.yaml
eikona_tessa_connector:
field_mapping:
image: 'product_image'
video: 'product_video'
Authentication Issues
TESSA_API_KEY and TESSA_API_SECRET are correctly set in .env:
TESSA_API_KEY=your_api_key_here
TESSA_API_SECRET=your_api_secret_here
php bin/console debug:container eikona_tessa_connector.client
Data Duplication
asset_id to avoid re-uploading identical assets. Extend the AssetUploader service:
public function upload(Asset $asset)
{
if ($asset->getTessaAssetId()) {
return $this->updateAsset($asset);
}
return $this->createAsset($asset);
}
Enable Verbose Logging:
# config/packages/monolog.yaml
handlers:
tessa:
type: stream
path: "%kernel.logs_dir%/tessa.log"
level: debug
channels: ["tessa"]
Log TESSA API calls in a custom client:
$this->logger->debug('TESSA API Request', [
'url' => $url,
'data' => $data,
'response' => $response->getBody()->getContents(),
]);
Test Locally:
Use a TESSA sandbox environment (e.g., https://sandbox.tessa-dam.com) during development.
Custom Asset Types
Extend the AssetType class to support non-standard media (e.g., 3D models):
class CustomAssetType extends AssetType
{
public function getMimeTypes(): array
{
return ['model/vnd.collada+xml'];
}
}
Register in services.yaml:
App\CustomAssetType:
tags:
- { name: eikona_tessa_connector.asset_type }
Webhooks Implement TESSA webhook handlers to sync changes back to Akeneo:
// src/EventListener/TessaWebhookListener.php
public function onTessaWebhook(Request $request)
{
$data = json_decode($request->getContent(), true);
$this->akeneoRepository->updateFromTessa($data['asset_id'], $data['changes']);
}
Route in routing.yml:
tessa_webhook:
path: /tessa/webhook
methods: [POST]
controller: App\Controller\TessaWebhookController::handle
Performance Optimization
$this->tessaClient->bulkUpload($assets, 50); // Batch size of 50
$cache = $this->cachePool->getItem('tessa_assets_' . $productId);
if (!$cache->isHit()) {
$assets = $this->tessaClient->getAssetsForProduct($productId);
$cache->set($assets);
}
How can I help you explore Laravel packages today?