Package de.xima.fc.gui.elfinder
Class ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry extends IFileSystemEntry<?>>
- java.lang.Object
-
- de.xima.fc.gui.elfinder.ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry>
-
- Enclosing class:
- ElFinderDynamicResourceFileEntityThumbnails
public static final class ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry extends IFileSystemEntry<?>> extends Object
A builder for a URL creator that generates URLs for thumbnails of 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IElFinderThumbnailUrlGenerator<Entry>
build()
Builds a URL creator that generates thumbnail URLs for the given file system entries.ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry>
fileEntityIdFinder(IElFinderThumbnailFileEntityFinder<Entry> fileEntityIdFinder)
Sets the file entity ID finder to use.<FileEntity extends IFileEntity<?,?>>
ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry>fileEntityIdFinder(Iterable<FileEntity> fileEntities, Function<? super FileEntity,? extends IFileSystemEntry<?>> fileEntryFactory)
Extracts a file entry from the file entity and then set the file entity ID finder to one that maps from that file entry back to the entity ID.ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry>
methodExpression(String methodExpression)
Sets them method expression to use for the dynamic resource URL.ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry>
paramNameSessionId(String paramNameSessionId)
Sets the name of the session ID parameter.protected ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry>
self()
ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry>
sessionId(String sessionId)
Sets the value for the session ID parameter.
-
-
-
Method Detail
-
build
public IElFinderThumbnailUrlGenerator<Entry> build()
Builds a URL creator that generates thumbnail URLs for the given file system entries. The URLs use the dynamic resource feature from PrimeFaces to invoke the configured method expression. To handle the request, you can useElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder
. Subsequent changes to the builder will not affect the URL creator.- Returns:
- The URL creator.
-
fileEntityIdFinder
public <FileEntity extends IFileEntity<?,?>> ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> fileEntityIdFinder(Iterable<FileEntity> fileEntities, Function<? super FileEntity,? extends IFileSystemEntry<?>> fileEntryFactory)
Extracts a file entry from the file entity and then set the file entity ID finder to one that maps from that file entry back to the entity ID.- Type Parameters:
FileEntity
- The type of the file entity.- Parameters:
fileEntities
- The file entities to find the IDs for.fileEntryFactory
- The function to create the file system entry from the file entity.- Returns:
- This builder for chaining method calls.
-
fileEntityIdFinder
public ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> fileEntityIdFinder(IElFinderThumbnailFileEntityFinder<Entry> fileEntityIdFinder)
Sets the file entity ID finder to use. Defaults to null.- Parameters:
fileEntityIdFinder
- The file entity ID finder to use.- Returns:
- This builder for chaining method calls.
-
methodExpression
public ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> methodExpression(String methodExpression)
Sets them method expression to use for the dynamic resource URL. This method expression is invoked when the URL is accessed. Note that you should not accessview scoped
beans in the method expression, as no view scope is available during resource requests. Usually, you should use arequest scoped
bean. Defaults to null (but you probably want to set this).- Parameters:
methodExpression
- The method expression to use.- Returns:
- This builder for chaining method calls.
-
paramNameSessionId
public ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> paramNameSessionId(String paramNameSessionId)
Sets the name of the session ID parameter. The session ID is added only when the file has unsaved changes. Otherwise, no request ID is added, and the content should be read directly from the file entity. Defaults toelfinder_sid
.- Parameters:
paramNameSessionId
- The name of the session ID parameter.- Returns:
- This builder for chaining method calls.
-
sessionId
public ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> sessionId(String sessionId)
Sets the value for the session ID parameter. The session ID is added only when the file has unsaved changes. Otherwise, no request ID is added, and the content should be read directly from the file entity.- Parameters:
sessionId
- The session ID to use.- Returns:
- This builder for chaining method calls.
-
self
protected ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> self()
-
-