Package 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
DefaultFeatureProvider
implementation.- Author:
- Matthias Herlitzius
-
-
Constructor Summary
Constructors Constructor Description FeatureProviderImpl(Properties applicationProperties)
Creates a newFeatureProviderImpl
using the givenProperties
, which have been retrieved from aApplication
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
getImageCache()
Returns the folder to use for caching images, only available iffeatureImageProcessing
is enabled.ImageProcessor
getImageProcessor(File sourceFile, String targetFile)
Returns anImageProcessor
for the given sourceFile.
To enable this feature, set theApplication
'sProperty
featureImageProcessing
totrue
.Consumer<DocumentEvent,DocumentProducer>
getIndexer()
Returns aConsumer
which consumesDocumentEvent
s produced by aDocumentProducer
.The returnedConsumer
writes to the Lucene-powered
search-index of theSite
.
To enable this feature, set theApplication
'sProperty
featureIndexing
totrue
.void
initImageProcessor(File imageMagickPath, File imageCache)
void
setIndexer(DocumentIndexer indexer)
-
-
-
Constructor Detail
-
FeatureProviderImpl
public FeatureProviderImpl(Properties applicationProperties)
Creates a newFeatureProviderImpl
using the givenProperties
, which have been retrieved from aApplication
.- Parameters:
applicationProperties
- theProperties
to use.
-
-
Method Detail
-
initImageProcessor
public void initImageProcessor(File imageMagickPath, File imageCache)
- Parameters:
imageMagickPath
- the path to the ImageMagick executableimageCache
- the folder to use for caching images- See Also:
getImageProcessor(File, String)
-
setIndexer
public void setIndexer(DocumentIndexer indexer)
- Parameters:
indexer
- theDocumentIndexer
- See Also:
getIndexer()
-
getImageProcessor
public ImageProcessor getImageProcessor(File sourceFile, String targetFile)
Description copied from interface:FeatureProvider
Returns anImageProcessor
for the given sourceFile.
To enable this feature, set theApplication
'sProperty
featureImageProcessing
totrue
.- Specified by:
getImageProcessor
in interfaceFeatureProvider
- Parameters:
sourceFile
- the source image (should have an absolute path)targetFile
- the path to the target file to be created, relative toPlatform.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 iffeatureImageProcessing
is enabled.- Specified by:
getImageCache
in interfaceFeatureProvider
- Returns:
- the cache folder for images
- See Also:
FeatureProvider.getImageProcessor(File, String)
-
getIndexer
public Consumer<DocumentEvent,DocumentProducer> getIndexer()
Description copied from interface:FeatureProvider
Returns aConsumer
which consumesDocumentEvent
s produced by aDocumentProducer
.The returnedConsumer
writes to the Lucene-powered
search-index of theSite
.
To enable this feature, set theApplication
'sProperty
featureIndexing
totrue
.- Specified by:
getIndexer
in interfaceFeatureProvider
- Returns:
- a
Consumer
consumingDocumentEvent
s produced by aDocumentProducer
-
-