Package org.ametys.plugins.flipbook
Class Document2ImagesConvertor
- java.lang.Object
-
- org.ametys.plugins.flipbook.Document2ImagesConvertor
-
- All Implemented Interfaces:
Initializable
,Component
,Serviceable
public class Document2ImagesConvertor extends Object implements Component, Serviceable, Initializable
Converts a document file to PNG images, one image per page. The document images file name must begin with "page".
This component just delegates its behavior to the chosenDocument2ImagesConvertorPolicy
in configurationflipbook.convertor
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__CONFIGURATION_NAME
protected Document2ImagesConvertorPolicyExtensionPoint
_document2ImagesConvertorPolicies
protected Document2ImagesConvertorPolicy
_document2ImagesConvertorPolicyInConf
TheDocument2ImagesConvertorPolicy
chosen in global configuration to usestatic String
ROLE
The avalon role.
-
Constructor Summary
Constructors Constructor Description Document2ImagesConvertor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convert(File documentFile, File folder)
Convert the given document file to PNG images, one image per page.List<String>
getSupportedMimeTypes()
Get the list of mime types the convertor can convertvoid
initialize()
void
service(ServiceManager manager)
-
-
-
Field Detail
-
__CONFIGURATION_NAME
private static final String __CONFIGURATION_NAME
- See Also:
- Constant Field Values
-
_document2ImagesConvertorPolicies
protected Document2ImagesConvertorPolicyExtensionPoint _document2ImagesConvertorPolicies
-
_document2ImagesConvertorPolicyInConf
protected Document2ImagesConvertorPolicy _document2ImagesConvertorPolicyInConf
TheDocument2ImagesConvertorPolicy
chosen in global configuration to use
-
-
Constructor Detail
-
Document2ImagesConvertor
public Document2ImagesConvertor()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getSupportedMimeTypes
public List<String> getSupportedMimeTypes()
Get the list of mime types the convertor can convert- Returns:
- The list of supported mime-types
-
convert
public void convert(File documentFile, File folder) throws IOException, FlipbookException
Convert the given document file to PNG images, one image per page.- Parameters:
documentFile
- the document file to convert.folder
- the destination folder.- Throws:
IOException
- if an I/O error occurs.FlipbookException
- if a document error occurs.
-
-