eikona-media/akeneo2-3-tessa-connector
Verify Akeneo API Readiness
GET /api/rest/v1/products).Authorization headers.Install the Bundle
composer require eikona-media/akeneo2-3-tessa-connector
Register Routing
Append to app/config/routing.yml:
tessa_media:
resource: "@EikonaTessaConnectorBundle/Resources/config/routing.yml"
Configure TESSA Connection
app/config/config.yml (see TESSA Docs for required keys).eikona_tessa_connector:
api_key: "your_tessa_api_key"
api_secret: "your_tessa_api_secret"
endpoint: "https://your-tessa-instance.com/api"
First Use Case: Sync a Product’s Media
php bin/console eikona:tessa:sync --product-id=123
Automated Product Media Sync
// In a custom EventSubscriber
public function onProductSave(ProductSaveEvent $event)
{
$this->get('eikona.tessa.connector')->syncProduct($event->getProduct());
}
services.yml:
services:
app.tessa_sync_subscriber:
class: AppBundle\EventSubscriber\TessaSyncSubscriber
tags:
- { name: kernel.event_subscriber }
Bulk Media Migration
php bin/console eikona:tessa:batch-sync --batch-size=50
--log-file=sync.log.Custom Field Mapping
akeneo_field → tessa_field) in config:
eikona_tessa_connector:
field_mapping:
image: "primary_image"
document: "supporting_doc"
akeneo/api-client for pre-fetching product data before sync.$this->dispatch(new SyncProductJob($productId));
API Credentials
config.yml are insecure. Use environment variables:
api_key: "%env(TESSA_API_KEY)%"
.env to version control.Field Mismatches
name fields). Validate before sync:
if (empty($product->getImages()[0]->getPath())) {
throw new \RuntimeException("Missing image path for product {$product->getId()}");
}
Rate Limiting
use Symfony\Component\Process\Exception\TimeoutException;
try {
$response = $client->request('POST', '/assets', $data);
} catch (TimeoutException $e) {
sleep(2 ** $attempt); // Exponential backoff
retry();
}
Routing Conflicts
routing.yml paths don’t clash with existing Akeneo routes. Prefix with _tessa_ if needed:
_tessa_media_sync:
path: /_tessa/sync
defaults: { _controller: EikonaTessaConnectorBundle:Sync:product }
Enable Verbose Logging
Add to config.yml:
eikona_tessa_connector:
debug: true
Logs appear in var/log/dev.log.
Test with Mock API Use VCR to record/replay TESSA API calls during development:
VCR::configure()->setMode('all');
Custom Sync Logic
Extend the connector’s TessaConnector service:
// app/Eikona/TessaConnectorExtension.php
class TessaConnectorExtension implements ExtensionInterface
{
public function extendSync(Product $product, array $options)
{
$options['custom_field'] = $product->getCustomAttribute();
return $options;
}
}
Register in services.yml:
eikona.tessa.connector.extension:
class: AppBundle\Eikona\TessaConnectorExtension
tags:
- { name: eikona.tessa.connector.extension }
Asset Transformation
Hook into onAssetUpload event to resize images before upload:
$this->get('eikona.tessa.connector')->onAssetUpload(
$asset,
function ($asset) {
$asset->setData($this->resizeImage($asset->getData()));
return $asset;
}
);
Custom TESSA Endpoints Override the default API endpoint per environment:
# config_dev.yml
eikona_tessa_connector:
endpoint: "https://dev-tessa-instance.com/api"
How can I help you explore Laravel packages today?