org.appng.core.model

## Class FeatureProviderImpl

- java.lang.Object
- - org.appng.core.model.FeatureProviderImpl

- All Implemented Interfaces:
    FeatureProvider

      public class FeatureProviderImpl
      extends Object
      implements FeatureProvider

  Default `FeatureProvider` implementation.
  Author:
    Matthias Herlitzius

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FeatureProviderImpl(Properties applicationProperties)` Creates a new `FeatureProviderImpl` using the given `Properties`, which have been retrieved from a `Application`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `File` | `getImageCache()` Returns the folder to use for caching images, only available if `featureImageProcessing` is enabled.
    `ImageProcessor` | `getImageProcessor(File sourceFile, String targetFile)` Returns an `ImageProcessor` for the given sourceFile. To enable this feature, set the `Application`'s `Property` `featureImageProcessing` to `true`.
    `Consumer<DocumentEvent,DocumentProducer>` | `getIndexer()` Returns a `Consumer` which consumes `DocumentEvent`s produced by a `DocumentProducer`.The returned `Consumer` writes to the Lucene-powered search-index of the `Site`. To enable this feature, set the `Application`'s `Property` `featureIndexing` to `true` .
    `void` | `initImageProcessor(File imageMagickPath, File imageCache)` Initializes an `ImageProcessor`, in case the property "featureImageProcessing" equals to '`true`'.
    `void` | `setIndexer(DocumentIndexer indexer)` Sets the `DocumentIndexer` which is passed to the `Application` if "featureIndexing" equals to '`true`'.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FeatureProviderImpl

          public FeatureProviderImpl(Properties applicationProperties)

      Creates a new `FeatureProviderImpl` using the given `Properties`, which have been retrieved from a `Application`.
      Parameters:
        `applicationProperties` - the `Properties` to use.

  - ### Method Detail

    - #### initImageProcessor

          public void initImageProcessor(File imageMagickPath,
                                         File imageCache)

      Initializes an `ImageProcessor`, in case the property "featureImageProcessing" equals to '`true`'.
      Parameters:
        `imageMagickPath` - the path to the ImageMagick executable
        `imageCache` - the folder to use for caching images
      See Also:
        `getImageProcessor(File, String)`

    - #### setIndexer

          public void setIndexer(DocumentIndexer indexer)

      Sets the `DocumentIndexer` which is passed to the `Application` if "featureIndexing" equals to '`true`'.
      Parameters:
        `indexer` - the `DocumentIndexer`
      See Also:
        `getIndexer()`

    - #### getImageProcessor

          public ImageProcessor getImageProcessor(File sourceFile,
                                                  String targetFile)

      Description copied from interface: `FeatureProvider`
      Returns an `ImageProcessor` for the given sourceFile.
      To enable this feature, set the `Application`'s `Property` `featureImageProcessing` to `true`.
      Specified by:
        `getImageProcessor` in interface `FeatureProvider`
      Parameters:
        `sourceFile` - the source image (should have an absolute path)
        `targetFile` - the path to the target file to be created, relative to `Platform.Property.IMAGE_CACHE_FOLDER`.
      Returns:
        an `ImageProcessor` for the given source file

    - #### getImageCache

          public File getImageCache()

      Description copied from interface: `FeatureProvider`
      Returns the folder to use for caching images, only available if `featureImageProcessing` is enabled.
      Specified by:
        `getImageCache` in interface `FeatureProvider`
      Returns:
        the cache folder for images
      See Also:
        `FeatureProvider.getImageProcessor(File, String)`

    - #### getIndexer

          public Consumer<DocumentEvent,DocumentProducer> getIndexer()

      Description copied from interface: `FeatureProvider`
      Returns a `Consumer` which consumes `DocumentEvent`s produced by a `DocumentProducer`.The returned `Consumer` writes to the Lucene-powered
      search-index of the `Site`.
      To enable this feature, set the `Application`'s `Property` `featureIndexing` to `true` .
      Specified by:
        `getIndexer` in interface `FeatureProvider`
      Returns:
        a `Consumer` consuming `DocumentEvent`s produced by a `DocumentProducer`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.