Class AbstractViewerService
- java.lang.Object
-
- org.silverpeas.core.viewer.service.AbstractViewerService
-
- Direct Known Subclasses:
DefaultPreviewService
,DefaultViewService
public abstract class AbstractViewerService extends Object
- Author:
- Yohann Chastagnier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractViewerService.ViewerProcess<R extends Serializable>
This class handles the execution of aAbstractViewerService.ViewerTreatment
.protected static interface
AbstractViewerService.ViewerTreatment<R>
-
Field Summary
Fields Modifier and Type Field Description static String
PDF_DOCUMENT_EXTENSION
-
Constructor Summary
Constructors Constructor Description AbstractViewerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected File
changeFileExtension(File file, String fileExtension)
Changes the extension of a fileprotected File
generateTmpFile(ViewerContext viewerContext, String fileExtension)
Generate a tmp fileprotected <R extends Serializable>
AbstractViewerService.ViewerProcess<R>process(String processName, AbstractViewerService.ViewerTreatment<R> viewerTreatment)
This method permits to start the setting of aAbstractViewerService.ViewerTreatment
.
It manages also a cache mechanism in order to avoid taking too much resources at a same time and also in order to preserve memory space of filesystem.
-
-
-
Field Detail
-
PDF_DOCUMENT_EXTENSION
public static final String PDF_DOCUMENT_EXTENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateTmpFile
protected File generateTmpFile(ViewerContext viewerContext, String fileExtension)
Generate a tmp file- Parameters:
fileExtension
-- Returns:
-
changeFileExtension
protected File changeFileExtension(File file, String fileExtension)
Changes the extension of a file- Parameters:
fileExtension
-- Returns:
-
process
protected <R extends Serializable> AbstractViewerService.ViewerProcess<R> process(String processName, AbstractViewerService.ViewerTreatment<R> viewerTreatment)
This method permits to start the setting of aAbstractViewerService.ViewerTreatment
.
It manages also a cache mechanism in order to avoid taking too much resources at a same time and also in order to preserve memory space of filesystem.- Type Parameters:
R
-- Parameters:
processName
- the name of the process (preview for example).viewerTreatment
- the treatment to perform.- Returns:
-
-