Class DefaultHtmlContentGenerator
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.modules.output.table.html.helper.DefaultHtmlContentGenerator
-
- All Implemented Interfaces:
HtmlContentGenerator
public class DefaultHtmlContentGenerator extends Object implements HtmlContentGenerator
-
-
Constructor Summary
Constructors Constructor Description DefaultHtmlContentGenerator(org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.pentaho.reporting.libraries.repository.ContentItem
createItem(String name, String mimeType)
String
getRegisteredName(org.pentaho.reporting.libraries.resourceloader.ResourceKey source)
org.pentaho.reporting.libraries.resourceloader.ResourceManager
getResourceManager()
boolean
isCopyExternalImages()
boolean
isExternalContentAvailable()
boolean
isRegistered(org.pentaho.reporting.libraries.resourceloader.ResourceKey source)
protected boolean
isSupportedImageFormat(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
Tests, whether the given URL points to a supported file format for common browsers.void
registerContent(org.pentaho.reporting.libraries.resourceloader.ResourceKey source, String name)
void
registerFailure(org.pentaho.reporting.libraries.resourceloader.ResourceKey source)
void
setCopyExternalImages(boolean copyExternalImages)
void
setDataWriter(org.pentaho.reporting.libraries.repository.ContentLocation dataLocation, org.pentaho.reporting.libraries.repository.NameGenerator dataNameGenerator, ContentUrlReWriteService rewriterService)
String
writeImage(ImageContainer image, String encoderType, float quality, boolean alpha)
String
writeRaw(org.pentaho.reporting.libraries.resourceloader.ResourceKey source)
-
-
-
Method Detail
-
setDataWriter
public void setDataWriter(org.pentaho.reporting.libraries.repository.ContentLocation dataLocation, org.pentaho.reporting.libraries.repository.NameGenerator dataNameGenerator, ContentUrlReWriteService rewriterService)
-
setCopyExternalImages
public void setCopyExternalImages(boolean copyExternalImages)
- Specified by:
setCopyExternalImages
in interfaceHtmlContentGenerator
-
isCopyExternalImages
public boolean isCopyExternalImages()
-
getResourceManager
public org.pentaho.reporting.libraries.resourceloader.ResourceManager getResourceManager()
- Specified by:
getResourceManager
in interfaceHtmlContentGenerator
-
registerFailure
public void registerFailure(org.pentaho.reporting.libraries.resourceloader.ResourceKey source)
- Specified by:
registerFailure
in interfaceHtmlContentGenerator
-
registerContent
public void registerContent(org.pentaho.reporting.libraries.resourceloader.ResourceKey source, String name)
- Specified by:
registerContent
in interfaceHtmlContentGenerator
-
isRegistered
public boolean isRegistered(org.pentaho.reporting.libraries.resourceloader.ResourceKey source)
- Specified by:
isRegistered
in interfaceHtmlContentGenerator
-
getRegisteredName
public String getRegisteredName(org.pentaho.reporting.libraries.resourceloader.ResourceKey source)
- Specified by:
getRegisteredName
in interfaceHtmlContentGenerator
-
writeRaw
public String writeRaw(org.pentaho.reporting.libraries.resourceloader.ResourceKey source) throws IOException
- Specified by:
writeRaw
in interfaceHtmlContentGenerator
- Throws:
IOException
-
writeImage
public String writeImage(ImageContainer image, String encoderType, float quality, boolean alpha) throws org.pentaho.reporting.libraries.repository.ContentIOException, IOException
- Specified by:
writeImage
in interfaceHtmlContentGenerator
- Throws:
org.pentaho.reporting.libraries.repository.ContentIOException
IOException
-
isSupportedImageFormat
protected boolean isSupportedImageFormat(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
Tests, whether the given URL points to a supported file format for common browsers. Returns true if the URL references a JPEG, PNG or GIF image, false otherwise. The checked filetypes are the ones recommended by the W3C.- Parameters:
key
- the url that should be tested.- Returns:
- true, if the content type is supported by the browsers, false otherwise.
-
createItem
public org.pentaho.reporting.libraries.repository.ContentItem createItem(String name, String mimeType) throws org.pentaho.reporting.libraries.repository.ContentIOException
- Throws:
org.pentaho.reporting.libraries.repository.ContentIOException
-
isExternalContentAvailable
public boolean isExternalContentAvailable()
-
-