Class ViewerContext
- java.lang.Object
- 
- org.silverpeas.core.viewer.service.ViewerContext
 
- 
 public class ViewerContext extends Object The context of a conversion process.- Author:
- Yohann Chastagnier
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ViewerContextcopy()static ViewerContextfrom(SimpleDocument document)Initializes a context from an instance ofSimpleDocument.StringgetDocumentId()Gets the identifier of the document.StringgetDocumentType()Gets the type of the document.StringgetLanguage()Gets the language of the contentStringgetOriginalFileName()Gets the name of the original file.FilegetOriginalSourceFile()Gets the original file.StringgetViewId()Gets the identifier associated to the current conversion processes for viewing.
 If an id has been explicitly set, then it is returned.
 Otherwise, a unique id is computed.TemporaryWorkspaceTranslationgetWorkspace()Gets the workspace into which the processes will write the results.booleanisCacheRequired()Indicates if cache is required.booleanisProcessingCache()Indicates if the current process is the one which is in charge of performing the conversion tasks.voidprocessingCache()Sets into context that the current process is in charge of the conversion tasks.ViewerContextwithUniqueDocumentId(String uniqueDocumentId)Sets a unique identifier associated to the current document to convert.
 This id is used bygetViewId()in order to compute the final unique identifier.
 
- 
- 
- 
Method Detail- 
frompublic static ViewerContext from(SimpleDocument document) Initializes a context from an instance ofSimpleDocument.- Parameters:
- document- the- SimpleDocumentfor which the file must be converted.
- Returns:
- an instance of ViewerContextinitialized from the givenSimpleDocument.
 
 - 
getDocumentIdpublic String getDocumentId() Gets the identifier of the document.- Returns:
- a string.
 
 - 
getDocumentTypepublic String getDocumentType() Gets the type of the document.- Returns:
- a string.
 
 - 
getOriginalFileNamepublic String getOriginalFileName() Gets the name of the original file.- Returns:
- the name as string.
 
 - 
getOriginalSourceFilepublic File getOriginalSourceFile() Gets the original file.- Returns:
- the Filethat represents the original file.
 
 - 
getWorkspacepublic TemporaryWorkspaceTranslation getWorkspace() Gets the workspace into which the processes will write the results.- Returns:
- the Filethat represents the workspace.
 
 - 
getViewIdpublic String getViewId() Gets the identifier associated to the current conversion processes for viewing.
 If an id has been explicitly set, then it is returned.
 Otherwise, a unique id is computed.- Returns:
- a unique identifier as string.
 
 - 
withUniqueDocumentIdpublic ViewerContext withUniqueDocumentId(String uniqueDocumentId) Sets a unique identifier associated to the current document to convert.
 This id is used bygetViewId()in order to compute the final unique identifier.- Parameters:
- uniqueDocumentId- a unique document identifier (please be careful about 'unique' word).
- Returns:
- the current context instance.
 
 - 
isCacheRequiredpublic boolean isCacheRequired() Indicates if cache is required.- Returns:
- true if required, false otherwise.
 
 - 
isProcessingCachepublic boolean isProcessingCache() Indicates if the current process is the one which is in charge of performing the conversion tasks.- Returns:
- true if the current process is in charge, false otherwise.
 
 - 
processingCachepublic void processingCache() Sets into context that the current process is in charge of the conversion tasks.
 - 
getLanguagepublic String getLanguage() Gets the language of the content- Returns:
- a string.
 
 - 
copyprotected ViewerContext copy() 
 
- 
 
-