Skip to content

Commit

Permalink
TASK: Compatibility with Flow 4.+
Browse files Browse the repository at this point in the history
  • Loading branch information
aertmann committed Dec 22, 2018
1 parent 8da803b commit 2888307
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*
* This file is part of the Ttree.FilePreviews package.
*
* (c) ttree ltd - www.neos.io
* (c) ttree ltd - www.ttree.ch
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -13,16 +13,16 @@

use Ttree\FilePreviews\Service\ApiClient;
use Ttree\FilePreviews\Service\FilePreviewsService;
use TYPO3\Flow\Annotations as Flow;
use Neos\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
use TYPO3\Flow\Resource\ResourceManager;
use TYPO3\Flow\Utility\Arrays;
use TYPO3\Media\Domain\Model\Thumbnail;
use TYPO3\Media\Domain\Model\ThumbnailGenerator\AbstractThumbnailGenerator;
use TYPO3\Media\Exception;
use Neos\Flow\ResourceManagement\ResourceManager;
use Neos\Utility\Arrays;
use Neos\Media\Domain\Model\Thumbnail;
use Neos\Media\Domain\Model\ThumbnailGenerator\AbstractThumbnailGenerator;
use Neos\Media\Exception;

/**
* A system-generated preview version of a Document (PDF, AI and EPS)
* A system-generated preview version of a Document (DOCX, AI and EPS)
*/
class FilePreviewsThumbnailGenerator extends AbstractThumbnailGenerator
{
Expand All @@ -38,9 +38,7 @@ class FilePreviewsThumbnailGenerator extends AbstractThumbnailGenerator
*/
public function canRefresh(Thumbnail $thumbnail)
{
return (
$this->isExtensionSupported($thumbnail)
);
return $this->isExtensionSupported($thumbnail);
}

/**
Expand Down
7 changes: 3 additions & 4 deletions Classes/Service/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
/*
* This file is part of the Ttree.FilePreviews package.
*
* (c) ttree ltd - www.neos.io
* (c) ttree ltd - www.ttree.ch
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use TYPO3\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
use TYPO3\Media\Exception;
use Neos\Flow\Annotations as Flow;
use Neos\Media\Exception;

/**
* File Previews Service
Expand Down
4 changes: 1 addition & 3 deletions Classes/Service/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
/*
* This file is part of the Ttree.FilePreviews package.
*
* (c) ttree ltd - www.neos.io
* (c) ttree ltd - www.ttree.ch
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use Guzzle\Http\Client as GuzzleClient;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Media\Exception;

/**
* File Previews Client Service
Expand Down
7 changes: 3 additions & 4 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
TYPO3:
Neos:
Media:
thumbnailGenerator:

thumbnailGenerators:
'Ttree\FilePreviews\Domain\Model\ThumbnailGenerator\FilePreviewsThumbnailGenerator':
apiKey: 'api-key'
apiSecret: 'api-secret'
Expand All @@ -10,4 +9,4 @@ TYPO3:
defaultOptions:
format: 'jpg'
retryInterval: 1
supportedExtensions: [ 'doc', 'docx', 'txt', 'rtf', 'ogg' ]
supportedExtensions: [ 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlxs', 'odt', 'ott', 'odp', 'txt', 'rtf', 'eps' ]
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# Neos CMS filepreviews.io integration
# Neos CMS filepreviews.io integration

This package generate thumbnail and extract metadata from different type of document
This package generate thumbnail and extract metadata from different type of document
based on the API of [filepreviews.io].

**This package is under development and depends on change not currently available in a stable version of Neos**

This package is Composer ready, [PSR-2] and [PSR-4] compliant.

How it work ?
-------------

This Generator call the FilePreviews.io API to generate Thumbnail for dozen of differents file format. Check [filepreviews.io]
This Generator call the FilePreviews.io API to generate Thumbnail for many different file formats. Check [filepreviews.io]
website for more informations.

![Thumbnail from an OGG Vorbis File](https://dl.dropboxusercontent.com/s/775z6n54b4goyc6/2015-11-19%20at%2012.40.png)

Configuration
-------------

Like any other Thumbnail Generator, you can change default settings. First step, you need to configure your API keys.

```yaml
TYPO3:
Neos:
Media:
thumbnailGenerator:

Expand All @@ -32,10 +28,10 @@ TYPO3:
defaultOptions:
format: 'jpg'
retryInterval: 1
supportedExtensions: [ 'doc', 'docx', 'txt', 'rtf', 'ogg' ]
supportedExtensions: [ 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlxs', 'odt', 'ott', 'odp', 'txt', 'rtf', 'eps' ]
```

- ```supportedExtensions```: check the official documentation of FilePreviews [Supported Formats] and enjoy.
- ```supportedExtensions```: check the official documentation of FilePreviews [Supported Formats] and enjoy.
- ```defaultOptions```: check the [API endpoint] documentation.

Acknowledgments
Expand All @@ -53,5 +49,5 @@ The MIT License (MIT). Please see [LICENSE](LICENSE.txt) for more information.
[PSR-2]: http://www.php-fig.org/psr/psr-2/
[PSR-4]: http://www.php-fig.org/psr/psr-4/
[filepreviews.io]: http://filepreviews.io/
[Supported Formats]: http://filepreviews.io/docs/features.html
[API endpoint]: http://filepreviews.io/docs/endpoints.html
[Supported Formats]: https://filepreviews.io/docs/features/
[API endpoint]: https://filepreviews.io/docs/endpoints/
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "ttree/filepreviews",
"type": "typo3-flow-package",
"type": "neos-package",
"license": "MIT",
"description": "Neos CMS filepreviews.io integration to generate thumbnail and extract metadata",
"require": {
"typo3/flow": "*",
"typo3/media": "*",
"neos/flow": ">4.0",
"neos/media": ">3.0",
"guzzle/guzzle": "~3.9"
},
"autoload": {
Expand Down

0 comments on commit 2888307

Please sign in to comment.