der-spiegel/ww-elvis-client

This package is abandoned and no longer maintained. The author suggests using the der-spiegel/ww-assets-client package instead.

PHP client for the WoodWing Assets (formerly: Elvis DAM) system https://www.woodwing.com/en/products/woodwing-assets

v6.2.0 2024-02-27 09:01 UTC

README

WoodWing Assets is a DAM (Digital Asset Management) system. This PHP client library uses its REST API.

This is not an official library supplied by the WoodWing vendor. It has been developed during the WoodWing Assets implementation at the German SPIEGEL Gruppe, 2019-2020.

Functionality

Installation

Use Composer to add this library your project’s composer.json file:

$ composer require der-spiegel/ww-assets-client

Quick test

Here’s how to do a quick test, starting from scratch with a new project (Docker required):

Install dependencies using Composer

$ mkdir MyExample && cd MyExample
$ docker run --rm --interactive --tty \
  --volume $PWD:/app \
  --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
  composer/composer require der-spiegel/ww-assets-client monolog/monolog

Copy and edit the example script

$ cp vendor/der-spiegel/ww-assets-client/UsageExample.php MyExample.php

Edit your copy, setting the correct Assets URL, username (API user preferred) and password in this section:

$assetsConfig = AssetsConfig::create(
    'https://assets.example.com/', // Assets URL (without app/ or services/ postfix)
    'username',                    // Assets user name (API user preferred)
    'password'                     // That user's password
);

The example script performs a simple search across all assets (visible for that user) and returns the first 50 asset IDs – you can leave it as is for a first test:

$assetsClient = new AssetsClient($assetsConfig, $logger); // Create client

$request = new SearchRequest($assetsClient,               // Create search request
        q: '',                                            // Assets query
        metadataToReturn: ['']                            // Metadata fields to return
);

$response = $request();                                   // Perform search

foreach ($response->hits as $assetResponse) {             // Loop through results
    echo $assetResponse->id . "\n";                       // Access asset metadata
}

Then run your copy

$ docker run -it --rm --name assets-client-example \
  --volume "$PWD":/usr/src/myapp --workdir /usr/src/myapp \
  php:cli php MyExample.php

Development

See Running tests for instructions on how to run unit and integration tests.

To regenerate the documentation in docs/_build/html from the source files, run Sphinx:

$ docker run --rm --volume "$PWD":/usr/src/myapp --workdir /usr/src/myapp/docs sphinxdoc/sphinx:5.3.0 make html

Authors

License

This library is licensed under the MIT License - see the LICENSE file for details.