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.
- API login
- Search:
SearchRequest
- Browse:
BrowseRequest
- Create:
CreateRequest
- Update:
UpdateRequest
- Update bulk:
UpdateBulkRequest
- Copy asset:
CopyAssetRequest
- Move / rename:
MoveRequest
- Remove:
RemoveRequest
- Create relation:
CreateRelationRequest
- Create folder:
CreateFolderRequest
- Get folder metadata:
GetFolderRequest
- Update folder metadata:
UpdateFolderRequest
Use Composer to add this library your project’s composer.json file:
$ composer require der-spiegel/ww-assets-client
Here’s how to do a quick test, starting from scratch with a new project (Docker required):
$ 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
$ 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
}
$ docker run -it --rm --name assets-client-example \
--volume "$PWD":/usr/src/myapp --workdir /usr/src/myapp \
php:cli php MyExample.php
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
This library is licensed under the MIT License - see the LICENSE
file for details.