diff --git a/Classes/Domain/Model/ThumbnailGenerator/FilePreviewsThumbnailGenerator.php b/Classes/Domain/Model/ThumbnailGenerator/FilePreviewsThumbnailGenerator.php index 047d782..92611bd 100644 --- a/Classes/Domain/Model/ThumbnailGenerator/FilePreviewsThumbnailGenerator.php +++ b/Classes/Domain/Model/ThumbnailGenerator/FilePreviewsThumbnailGenerator.php @@ -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 @@ -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 { @@ -38,9 +38,7 @@ class FilePreviewsThumbnailGenerator extends AbstractThumbnailGenerator */ public function canRefresh(Thumbnail $thumbnail) { - return ( - $this->isExtensionSupported($thumbnail) - ); + return $this->isExtensionSupported($thumbnail); } /** diff --git a/Classes/Service/ApiClient.php b/Classes/Service/ApiClient.php index a40b143..2af5a85 100644 --- a/Classes/Service/ApiClient.php +++ b/Classes/Service/ApiClient.php @@ -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 diff --git a/Classes/Service/Client.php b/Classes/Service/Client.php index af87588..193e92b 100644 --- a/Classes/Service/Client.php +++ b/Classes/Service/Client.php @@ -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 @@ -12,8 +12,6 @@ */ use Guzzle\Http\Client as GuzzleClient; -use TYPO3\Flow\Annotations as Flow; -use TYPO3\Media\Exception; /** * File Previews Client Service diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index 3308021..5db8766 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -1,7 +1,6 @@ -TYPO3: +Neos: Media: - thumbnailGenerator: - + thumbnailGenerators: 'Ttree\FilePreviews\Domain\Model\ThumbnailGenerator\FilePreviewsThumbnailGenerator': apiKey: 'api-key' apiSecret: 'api-secret' @@ -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' ] diff --git a/README.md b/README.md index 1fbe2ad..a87fb6b 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 @@ -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/ diff --git a/composer.json b/composer.json index 61a5a82..9359d4e 100644 --- a/composer.json +++ b/composer.json @@ -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": {