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

Akeneo2 3 Tessa Connector Laravel Package

eikona-media/akeneo2-3-tessa-connector

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps

  1. Verify Akeneo API Readiness

    • Ensure Akeneo API is functional (test via GET /api/rest/v1/products).
    • Check Apache headers (if using Apache) to avoid stripping Authorization headers.
    • Troubleshooting Guide.
  2. Install the Bundle

    composer require eikona-media/akeneo2-3-tessa-connector
    
  3. Register Routing Append to app/config/routing.yml:

    tessa_media:
        resource: "@EikonaTessaConnectorBundle/Resources/config/routing.yml"
    
  4. Configure TESSA Connection

    • Set TESSA API credentials in app/config/config.yml (see TESSA Docs for required keys).
    • Example:
      eikona_tessa_connector:
          api_key: "your_tessa_api_key"
          api_secret: "your_tessa_api_secret"
          endpoint: "https://your-tessa-instance.com/api"
      
  5. First Use Case: Sync a Product’s Media

    • Trigger a manual sync via CLI:
      php bin/console eikona:tessa:sync --product-id=123
      
    • Verify TESSA dashboard for uploaded assets.

Implementation Patterns

Workflows

  1. Automated Product Media Sync

    • Use Akeneo’s product save event to auto-trigger sync:
      // In a custom EventSubscriber
      public function onProductSave(ProductSaveEvent $event)
      {
          $this->get('eikona.tessa.connector')->syncProduct($event->getProduct());
      }
      
    • Register subscriber in services.yml:
      services:
          app.tessa_sync_subscriber:
              class: AppBundle\EventSubscriber\TessaSyncSubscriber
              tags:
                  - { name: kernel.event_subscriber }
      
  2. Bulk Media Migration

    • Export products via Akeneo API, then batch-process:
      php bin/console eikona:tessa:batch-sync --batch-size=50
      
    • Log progress with --log-file=sync.log.
  3. Custom Field Mapping

    • Override default field mappings (e.g., akeneo_fieldtessa_field) in config:
      eikona_tessa_connector:
          field_mapping:
              image: "primary_image"
              document: "supporting_doc"
      

Integration Tips

  • Akeneo API Client: Use akeneo/api-client for pre-fetching product data before sync.
  • Queue Jobs: Offload syncs to Laravel queues for large catalogs:
    $this->dispatch(new SyncProductJob($productId));
    
  • Webhooks: Configure TESSA to notify Akeneo of asset updates via Akeneo’s webhook system.

Gotchas and Tips

Pitfalls

  1. API Credentials

    • Hardcoded secrets in config.yml are insecure. Use environment variables:
      api_key: "%env(TESSA_API_KEY)%"
      
    • Never commit .env to version control.
  2. Field Mismatches

    • TESSA may reject malformed data (e.g., empty name fields). Validate before sync:
      if (empty($product->getImages()[0]->getPath())) {
          throw new \RuntimeException("Missing image path for product {$product->getId()}");
      }
      
  3. Rate Limiting

    • TESSA APIs may throttle requests. Implement exponential backoff:
      use Symfony\Component\Process\Exception\TimeoutException;
      try {
          $response = $client->request('POST', '/assets', $data);
      } catch (TimeoutException $e) {
          sleep(2 ** $attempt); // Exponential backoff
          retry();
      }
      
  4. Routing Conflicts

    • Ensure 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 }
      

Debugging

  • 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');
    

Extension Points

  1. 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 }
    
  2. 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;
        }
    );
    
  3. Custom TESSA Endpoints Override the default API endpoint per environment:

    # config_dev.yml
    eikona_tessa_connector:
        endpoint: "https://dev-tessa-instance.com/api"
    
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