Package de.xima.fc.gui.elfinder
Class ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry extends IFileSystemEntry<?>,FileEntity extends IFileEntity<?,?>>
- java.lang.Object
-
- de.xima.fc.gui.elfinder.ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry,FileEntity>
-
- Type Parameters:
Entry
- Common super type of all file system entries.FileEntity
- The type of the file entity.
- Enclosing class:
- ElFinderDynamicResourceFileEntityThumbnails
public static final class ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry extends IFileSystemEntry<?>,FileEntity extends IFileEntity<?,?>> extends Object
A builder for a thumbnail request handler for file system entries from aICommonFileSystem
, with initial data from aIFileEntity
stored in a database. This is the builder for the URL creator, see alsoElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder
.ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder
creates a URL for the thumbnail, using PrimeFaces' dynamic resource feature, seeDynamicContentSrcBuilder
andDynamicContentHandler
.ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder
creates a handler for processing requests to the dynamic resource servlet. It finds or generates the thumbnail image and writes it to the response.The thumbnail may come from two sources: either directly from the file, in case the file was not
yet changed
; or directly from theICommonFileSystem
in case the file has unsaved changes.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
-
-
-
Method Detail
-
build
public IDynamicResourceThumbnailRequestHandler<Entry> build()
Builds a request handler for handling thumbnail requests. The request handler could be called by a URL for the dynamic resource servlet, seeElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder
. Subsequent changes to the builder will not affect the request handler.- Returns:
- The request handler.
-
fileEntityReader
public ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry,FileEntity> fileEntityReader(Class<FileEntity> fileEntityType)
Sets the reader to use for reading the file entity from the given file entity ID. Uses the default DAO for the given entity type to read the file entity, with the system entity context. The file entity readers is used when a thumbnail request for a file entity is made. Defaults to a no-op implementation that returns null.- Parameters:
fileEntityType
- The type of the file entity to read.- Returns:
- This builder for chaining method calls.
-
fileEntityReader
public ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry,FileEntity> fileEntityReader(ISerializableFunction<Long,FileEntity> fileEntityReader)
Sets the reader to use for reading the file entity from the given file entity ID. Used when a thumbnail request for a file entity is made. Defaults to a no-op implementation that returns null.- Parameters:
fileEntityReader
- The reader to use.- Returns:
- This builder for chaining method calls.
-
tempFileCreator
public ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry,FileEntity> tempFileCreator(ISerializableThrowingSupplier<Path> tempFileCreator)
Sets the creator for temporary files that will hold the thumbnail content. When not given, defaults to a creator that creates temporary files via the system's default mechanism.- Parameters:
tempFileCreator
- The creator for creating temporary files.- Returns:
- This builder for chaining method calls.
-
thumbnailGenerator
public ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry,FileEntity> thumbnailGenerator(IImageThumbnailGenerator thumbnailGenerator)
Sets the thumbnail generator to use for generating thumbnails. Defaults to a generic implementation.- Parameters:
thumbnailGenerator
- The thumbnail generator to use.- Returns:
- This builder for chaining method calls.
-
self
protected ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder<Entry,FileEntity> self()
-
-