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 a ICommonFileSystem, with initial data from a IFileEntity stored in a database. This is the builder for the URL creator, see also ElFinderDynamicResourceFileEntityThumbnails.RequestHandlerBuilder.

ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder creates a URL for the thumbnail, using PrimeFaces' dynamic resource feature, see DynamicContentSrcBuilder and DynamicContentHandler.

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 the ICommonFileSystem in case the file has unsaved changes.

Since:
8.3.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • 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 use ElFinderDynamicResourceFileEntityThumbnails.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

      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

      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 access view scoped beans in the method expression, as no view scope is available during resource requests. Usually, you should use a request 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 to elfinder_sid.
      Parameters:
      paramNameSessionId - The name of the session ID parameter.
      Returns:
      This builder for chaining method calls.
    • 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

    • paramNameFileEntityId

      public ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> paramNameFileEntityId(String paramNameFileEntityId)
      Sets the name of the file entity ID parameter. Defaults to elfinder_feid.
      Parameters:
      paramNameFileEntityId - The name of the file entity ID parameter.
      Returns:
      This builder for chaining method calls.
    • paramNameFileEntryHash

      public ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> paramNameFileEntryHash(String paramNameFileEntryHash)
      Sets the name of the file entry hash parameter. Defaults to elfinder_feh.
      Parameters:
      paramNameFileEntryHash - The name of the file entry hash parameter.
      Returns:
      This builder for chaining method calls.
    • paramNameThumbnailConstraints

      public ElFinderDynamicResourceFileEntityThumbnails.UrlGeneratorBuilder<Entry> paramNameThumbnailConstraints(String paramNameThumbnailConstraints)
      Sets the name of the thumbnail constraints' parameter. This parameter is added to request a certain set of constraints on the thumbnail, such as a target width. Defaults to elfinder_tc.
      Parameters:
      paramNameThumbnailConstraints - Parameter name for the thumbnail constraints.
      Returns:
      This builder for chaining method calls.