Package org.xwiki.office.viewer.script
Class DefaultOfficeViewerScriptService
- java.lang.Object
-
- org.xwiki.office.viewer.script.DefaultOfficeViewerScriptService
-
- All Implemented Interfaces:
OfficeViewerScriptService
,org.xwiki.script.service.ScriptService
@Component @Named("officeviewer") @Singleton public class DefaultOfficeViewerScriptService extends Object implements OfficeViewerScriptService
Default implementation ofOfficeViewerScriptService
.- Since:
- 2.5M2
- Version:
- $Id: ae5dcbb74ec180f6bfde2131ab60551b7b6830e4 $
-
-
Constructor Summary
Constructors Constructor Description DefaultOfficeViewerScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Exception
getCaughtException()
boolean
isMimeTypeSupported(String mimeType)
Checks if a given mime type is supported for viewing.String
view(org.xwiki.model.reference.AttachmentReference attachmentReference)
Builds a XHTML representation of the specified office attachment.String
view(org.xwiki.model.reference.AttachmentReference attachmentReference, Map<String,String> parameters)
Builds a XHTML representation of the specified office attachment.
-
-
-
Method Detail
-
getCaughtException
public Exception getCaughtException()
- Specified by:
getCaughtException
in interfaceOfficeViewerScriptService
- Returns:
- the exception caught during the last office attachment view on the current execution, or
null
if no exception has been thrown
-
view
public String view(org.xwiki.model.reference.AttachmentReference attachmentReference)
Description copied from interface:OfficeViewerScriptService
Builds a XHTML representation of the specified office attachment.- Specified by:
view
in interfaceOfficeViewerScriptService
- Parameters:
attachmentReference
- reference to the office attachment to be viewed- Returns:
- a XHTML representation of the specified office attachment or
null
if an error occurs
-
view
public String view(org.xwiki.model.reference.AttachmentReference attachmentReference, Map<String,String> parameters)
Description copied from interface:OfficeViewerScriptService
Builds a XHTML representation of the specified office attachment.- Specified by:
view
in interfaceOfficeViewerScriptService
- Parameters:
attachmentReference
- reference to the office attachment to be viewedparameters
- view parameters specific to the underlyingOfficeResourceViewer
implementation- Returns:
- a XHTML representation of the specified office attachment or
null
if an error occurs
-
isMimeTypeSupported
public boolean isMimeTypeSupported(String mimeType)
Description copied from interface:OfficeViewerScriptService
Checks if a given mime type is supported for viewing.- Specified by:
isMimeTypeSupported
in interfaceOfficeViewerScriptService
- Parameters:
mimeType
- a mime type- Returns:
true
if the specified mime type can be viewed,false
otherwise
-
-