eikona-media/akeneo6-0-tessa-connector
Verify Akeneo API Readiness
GET /api/rest/v1/health-check).Install the Bundle
composer require eikona-media/akeneo6-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:
endpoint: 'https://your-tessa-instance.com/api'
username: 'your_username'
password: 'your_password'
akeneo:
api_token: 'your_akeneo_api_token'
First Use Case: Sync a Product Image
tessa_media attribute.Asset Management Workflow
tessa_media attribute.family, categories) to Tessa for asset organization.
// Example: Sync product metadata to Tessa (via custom command/service)
$product = $this->akeneoProductRepository->find($productId);
$this->tessaSyncService->syncProductMetadata($product);
Automated Asset Processing
# config/packages/eikona_tessa_connector.yaml
eikona_tessa_connector:
webhooks:
enabled: true
secret: 'your_webhook_secret'
// Dispatch a sync job
SyncTessaAssetsJob::dispatch($productId);
Attribute Mapping
config/packages/eikona_tessa_connector.yaml:
eikona_tessa_connector:
attribute_mapping:
tessa_media: 'tessa_asset_id'
product_name: 'akeneo_product_name'
Akeneo API Client: Use the bundle’s built-in AkeneoApiClient for programmatic access:
$client = $this->container->get('eikona_tessa_connector.akeneo_api');
$products = $client->getProducts(['limit' => 10]);
Event Listeners: Extend functionality by subscribing to Akeneo events:
// src/EventListener/TessaSyncListener.php
public function onProductUpdate(ProductUpdateEvent $event) {
$this->tessaSyncService->syncProduct($event->getProduct());
}
Register in services.yaml:
services:
App\EventListener\TessaSyncListener:
tags:
- { name: kernel.event_listener, event: product.update, method: onProductUpdate }
Custom Fields: Add Tessa-specific fields to Akeneo product forms via Twig:
{% extends 'AkeneoPimEnrichBundle:Product:form.html.twig' %}
{% block product_tabs %}
{{ parent() }}
{% include 'EikonaTessaConnectorBundle:Product:tessa_media_tab.html.twig' %}
{% endblock %}
API Authentication Issues
akeneo.api_token in config and ensure the token has ROLE_API_USER.curl -X GET "http://akeneo/api/rest/v1/health-check" -H "Authorization: Bearer YOUR_TOKEN"
Missing Routes
/tessa-media/* endpoints.routes.yml).Attribute Not Found
tessa_media attribute missing in Akeneo.php bin/console doctrine:migrations:execute --up
pim_catalog_identifier, code: tessa_media).Webhook Failures
X-Tessa-Signature header in your webhook endpoint:
// src/Controller/TessaWebhookController.php
public function handleWebhook(Request $request) {
$signature = $request->headers->get('X-Tessa-Signature');
if (!hash_equals($signature, hash_hmac('sha256', $request->getContent(), config('eikona_tessa_connector.webhooks.secret')))) {
throw new \RuntimeException('Invalid signature');
}
// Process payload
}
Enable API Logging
Add to config/packages/eikona_tessa_connector.yaml:
eikona_tessa_connector:
debug: true
Logs appear in var/log/dev.log.
Test Connections Manually
Use the tessa:test-connection command:
php bin/console tessa:test-connection
Custom Sync Logic
Extend the TessaSyncService:
// src/Service/CustomTessaSyncService.php
class CustomTessaSyncService extends TessaSyncService {
protected function getAssetMetadata(ProductInterface $product) {
// Custom logic here
return parent::getAssetMetadata($product);
}
}
Override in services.yaml:
services:
App\Service\CustomTessaSyncService:
decorates: 'eikona_tessa_connector.tessa_sync_service'
arguments:
$inner: '@.inner'
Add New Asset Types Register custom asset handlers:
// src/EventSubscriber/TessaAssetSubscriber.php
public static function getSubscribedEvents() {
return [
TessaEvents::ASSET_UPLOADED => 'onAssetUploaded',
];
}
public function onAssetUploaded(AssetEvent $event) {
if ($event->getAsset()->getType() === 'video') {
$this->processVideoAsset($event->getAsset());
}
}
Override Templates Copy default templates from the bundle to your theme:
mkdir -p templates/EikonaTessaConnectorBundle/Product
cp vendor/eikona-media/akeneo6-0-tessa-connector/src/Resources/views/Product/tessa_media_tab.html.twig templates/EikonaTessaConnectorBundle/Product/
Customize as needed.
php bin/console cache:clear
php bin/console akeneo:cache:clear
.env for sensitive data:
TESSA_API_USERNAME=your_username
TESSA_API_PASSWORD=your_password
Reference in config:
eikona_tessa_connector:
api:
username: '%env(TESSA_API_USERNAME)%'
use Symfony\Component\HttpClient\RetryableHttpException;
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
try {
$response = $this->httpClient->request('GET', $url);
} catch (RetryableHttpException $e) {
sleep(2 ** $attempt); // Exponential backoff
throw $e;
}
How can I help you explore Laravel packages today?