org.silverpeas.viewer
Class AbstractViewerService

java.lang.Object
  extended by org.silverpeas.viewer.AbstractViewerService
Direct Known Subclasses:
DefaultPreviewService, DefaultViewService

public abstract class AbstractViewerService
extends Object

Author:
Yohann Chastagnier

Nested Class Summary
protected  class AbstractViewerService.ViewerProcess<RETURN_VALUE extends Serializable>
          This class handles the execution of a AbstractViewerService.ViewerTreatment.
protected  class AbstractViewerService.ViewerTreatment<RETURN_VALUE>
          Inner class handled by
 
Field Summary
static String PDF_DOCUMENT_EXTENSION
           
 
Constructor Summary
AbstractViewerService()
           
 
Method Summary
protected  File changeFileExtension(File file, String fileExtension)
          Changes the extension of a file
protected  File generateTmpFile(ViewerContext viewerContext, String fileExtension)
          Generate a tmp file
protected
<RETURN_VALUE extends Serializable>
AbstractViewerService.ViewerProcess<RETURN_VALUE>
process(String processName, AbstractViewerService.ViewerTreatment<RETURN_VALUE> viewerTreatment)
          This method permits to start the setting of a AbstractViewerService.ViewerTreatment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDF_DOCUMENT_EXTENSION

public static final String PDF_DOCUMENT_EXTENSION
See Also:
Constant Field Values
Constructor Detail

AbstractViewerService

public AbstractViewerService()
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 <RETURN_VALUE extends Serializable> AbstractViewerService.ViewerProcess<RETURN_VALUE> process(String processName,
                                                                                                        AbstractViewerService.ViewerTreatment<RETURN_VALUE> viewerTreatment)
This method permits to start the setting of a AbstractViewerService.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:
RETURN_VALUE -
Parameters:
processName - the name of the process (preview for example).
viewerTreatment - the treatment to perform.
Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.