Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Akeneo7 0 Tessa Connector Laravel Package

eikona-media/akeneo7-0-tessa-connector

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation:

    composer require eikona-media/akeneo7-0-tessa-connector
    

    Ensure your Akeneo version is 7.0.x (Community or Enterprise).

  2. Enable the Bundle: Add to config/bundles.php:

    Eikona\Tessa\ConnectorBundle\EikonaTessaConnectorBundle::class => ['all' => true],
    

    For Enterprise Edition, also enable:

    Eikona\Tessa\EEConnectorBundle\EikonaTessaEEConnectorBundle::class => ['all' => true],
    
  3. Routing: Append to config/routes/routes.yml:

    tessa_media:
        resource: "@EikonaTessaConnectorBundle/Resources/config/routing.yml"
    
  4. First Use Case:

    • Upload a test asset to TESSA DAM via the Akeneo UI.
    • Link it to a product via the "Media" tab in Akeneo.
    • Verify the asset appears in TESSA and is accessible via Akeneo’s media gallery.

Implementation Patterns

Core Workflows

  1. Media Synchronization:

    • Use the TessaMedia entity to manage asset metadata (e.g., title, description, tags).
    • Sync attributes between Akeneo and TESSA via product associations or custom fields:
      // Example: Linking a TESSA asset to a product
      $product->getMedia()->add($tessaMediaEntity);
      $product->save();
      
  2. Event-Driven Integration:

    • Listen for Akeneo events (e.g., product.save) to trigger TESSA actions:
      // In a service or event subscriber
      public function onProductSave(ProductSaveEvent $event)
      {
          $product = $event->getProduct();
          $this->tessaService->syncProductMedia($product);
      }
      
    • Register the subscriber in services.yaml:
      services:
          App\EventSubscriber\TessaSyncSubscriber:
              tags:
                  - { name: kernel.event_subscriber }
      
  3. Custom Field Mapping:

    • Extend the connector to map Akeneo custom fields to TESSA metadata:
      // Example: Syncing a custom "video_url" field to TESSA
      $tessaAsset->setCustomField('video_url', $product->getCustomField('video_url'));
      $this->tessaClient->updateAsset($tessaAsset);
      
  4. Bulk Operations:

    • Use the TessaMediaManager to batch-upload assets:
      $manager = $this->container->get('eikona_tessa.media_manager');
      $manager->uploadMediaFromDirectory('/path/to/assets', $productId);
      

Integration Tips

  • API Configuration: Store TESSA API credentials in config/packages/eikona_tessa.yaml:
    eikona_tessa:
        client:
            endpoint: 'https://your-tessa-instance.com/api'
            api_key: '%env(TESSA_API_KEY)%'
    
  • Validation: Validate TESSA responses in a custom validator:
    use Eikona\Tessa\ConnectorBundle\Validator\Constraints as TessaAssert;
    
    /**
     * @Assert\Valid()
     * @TessaAssert\TessaAssetExists()
     */
    private $tessaMedia;
    

Gotchas and Tips

Pitfalls

  1. Routing Conflicts:

    • Ensure tessa_media routes don’t clash with existing Akeneo routes. Test with:
      php bin/console debug:router | grep tessa
      
  2. Enterprise vs. Community:

    • Enterprise Edition requires the EEConnectorBundle. Forgetting this causes silent failures.
    • Verify with:
      composer show eikona-media/akeneo7-0-tessa-connector | grep "requires"
      
  3. Media Ownership:

    • TESSA assets linked to products aren’t automatically deleted if the product is removed. Implement a cleanup listener:
      public function onProductDelete(ProductDeleteEvent $event)
      {
          $this->tessaService->deleteOrphanedAssets($event->getProduct());
      }
      
  4. Rate Limiting:

    • TESSA’s API may throttle requests. Implement exponential backoff in your client:
      try {
          $response = $this->tessaClient->upload($asset);
      } catch (RateLimitException $e) {
          sleep($e->getRetryAfter());
          retry();
      }
      

Debugging

  • Enable Debug Mode: Add to config/packages/eikona_tessa.yaml:
    eikona_tessa:
        debug: true  # Logs API requests/responses
    
  • Log API Errors: Extend the TessaClient to log failures:
    public function callApi($method, $endpoint, $data = [])
    {
        try {
            return parent::callApi($method, $endpoint, $data);
        } catch (Exception $e) {
            $this->logger->error('TESSA API Error: ' . $e->getMessage(), [
                'endpoint' => $endpoint,
                'data' => $data,
            ]);
            throw $e;
        }
    }
    

Extension Points

  1. Custom Asset Types: Override the TessaMedia entity to support non-standard assets (e.g., 3D models):

    // src/Entity/TessaCustomMedia.php
    class TessaCustomMedia extends TessaMedia
    {
        private $modelFile;
    
        // Add getters/setters and DB mapping
    }
    
  2. Webhook Listeners: Listen for TESSA webhooks (e.g., asset updates) via Akeneo’s EventDispatcher:

    public function onTessaWebhook(Request $request)
    {
        $payload = json_decode($request->getContent(), true);
        $this->handleTessaEvent($payload['event_type']);
    }
    

    Register the route in routing.yml:

    tessa_webhook:
        path: /tessa/webhook
        methods: [POST]
        controller: App\Controller\TessaWebhookController::handle
    
  3. Batch Processing: Use Akeneo’s JobInstance to queue large syncs:

    $job = new JobInstance();
    $job->setJobName('tessa_sync');
    $job->setData(['product_ids' => [1, 2, 3]]);
    $this->jobRunner->run($job);
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver