Task #53910
closedMake FileCollections types configurable/extendable
100%
Description
Currently the the fileCollection types are hardcoded. It is not possible to add your own types.
You can extend the TCA so you can create you own collections in the backend. But in the RecourceFactory the conversion from type to object is hardcoded.
This should be changed so the class belonging to a type is fetched from configuration.
Updated by Frans Saris almost 11 years ago
Proposal for the configuration:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['collections']['file']['types']['static'] = 'TYPO3\\CMS\\Core\\Resource\\Collection\\StaticFileCollection';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['collections']['file']['types']['folder'] = 'TYPO3\\CMS\\Core\\Resource\\Collection\\FolderBasedFileCollection';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['collections']['file']['types']['category'] = 'TYPO3\\CMS\\Core\\Resource\\Collection\\CategoryBasedFileCollection';
Updated by Frans Saris almost 11 years ago
This gives the possibility to create your own collections types for example:
- recursive folder collection
- collection based on file type,size,creationdate,etc.
- recreate the DAM selections
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Frans Saris almost 11 years ago
To test the pending patch:
Add following to you ext_tables.php
/** @var $registry TYPO3\CMS\Core\Resource\Collection\FileCollectionRegistry */ $registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Collection\\FileCollectionRegistry'); $registry->addTypeToTCA('mediaAlbum', 'MediaAlbum', 'storage,folder');
And this to ext_localconf.php
/** @var $registry TYPO3\CMS\Core\Resource\Collection\FileCollectionRegistry */ $registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Collection\\FileCollectionRegistry'); $registry->registerFileCollectionClass('TYPO3\\CMS\\Core\\Resource\\Collection\\FolderBasedFileCollection', 'mediaAlbum');
Now you should have a extra type when creating/editing the collection types that behaves just like the folder collection
Updated by Gerrit Code Review almost 11 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Gerrit Code Review almost 11 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Gerrit Code Review almost 11 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Gerrit Code Review almost 11 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Gerrit Code Review almost 11 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Gerrit Code Review almost 11 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27257
Updated by Frans Saris almost 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e542fac68f84d56b7ce711593a4d58fc6a7fd37b.