public class CacheRenderData extends java.lang.Object implements RenderData
CASE_SENSITIVE, REGULAR_EXPRESSION, WHOLE_WORD
Constructor and Description |
---|
CacheRenderData(java.lang.String url,
PropertiesChecker checker,
java.lang.Object req)
Creates a RenderData source connection to i-net Clear Reports cache.
|
CacheRenderData(java.util.Properties props,
PropertiesChecker checker,
java.lang.Object req)
Creates a RenderData source connection to i-net Clear Reports cache.
|
Modifier and Type | Method and Description |
---|---|
RenderData |
getCopy()
"Clones" this RenderData object with all its properties and returns the copy.
|
protected EngineFactory |
getEngineFactory()
returns the
EngineFactory to pass to the Cache |
int |
getExportChunkCount(java.util.Properties expProps)
Returns the total number of export "chunks" for the report for the specified export format.
|
byte[] |
getFontData(int fontID)
Returns the byte array of the embedded font at the specified fontId,
which is encoded in the Viewer's protocol.
|
byte[] |
getGroupTree()
Returns the group tree which can be sent to the java viewer as a byte array.
|
protected ReportCacheKey |
getKey(java.util.Properties props)
Create a key and start the rendering.
|
byte[] |
getNextExportChunk()
Returns the next chunk of the exported report if there is at least one more chunk available.
|
int |
getPageCount()
Returns the number of pages in the report.
|
byte[] |
getPageData(int page)
Returns the binary data of one page for the Java Viewer.
|
java.util.Properties |
getProperties()
Returns the Properties object used by this RenderData object.
|
java.lang.String |
getReportLocation()
Returns the location of the report set by setReportLocation.
|
java.lang.String |
getReportProperty(java.lang.String propertyKey)
Returns the chosen property value which has been set either via setReportProperty or otherwise.
|
java.lang.String |
getReportTitle()
Returns the manually set title of the report if there is one, that is, what would be typically displayed in a title bar, e.g.
|
boolean |
isPageLimitExceeded()
Check if the rendering of the report ran into a page limit.
|
boolean |
isPromptOnRefresh()
Returns the property "promptOnRefresh", that is, whether prompts are to be shown
whenever new data is fetched from the server.
|
byte[] |
refreshPageData(int page)
Enforces the whole report to be re-rendered on server side and returns the refreshed binary data of one page for the Java Viewer.
|
void |
resetServerCacheTimeout()
Notifies the server that the report with the currently set properties is
still being viewed and therefore should not be removed from the cache yet
if there is one.
|
byte[] |
search(java.lang.String phrase,
int startPage,
int flags)
Searches the given phrase in the report, starting at a certain page and using
the search options given in the flags.
|
void |
setPromptOnRefresh(boolean promptOnRefresh)
Sets the property "promptOnRefresh", that is, whether prompts are to be shown whenever the report is refreshed, that is,
whenever new data is fetched from the server.
|
void |
setReportLocation(java.lang.String name)
Sets the location of the report which this RenderData is to obtain its data for.
|
void |
setReportProperty(java.lang.String key,
java.lang.String value)
Sets the given property for the report.
|
void |
setReportTitle(java.lang.String title)
Sets the title of the report.
|
void |
stop()
Stops and cancels the rendering process if one is running.
|
public CacheRenderData(java.lang.String url, PropertiesChecker checker, java.lang.Object req)
url
- The same data like setReportLocation.checker
- an implementation of PropertiesChecker for validate the Properties. Can be null.req
- The HTTP servlet request, either null or HttpServletsetReportLocation(String)
public CacheRenderData(java.util.Properties props, PropertiesChecker checker, java.lang.Object req)
props
- A list of Properties.checker
- an implementation of PropertiesChecker for validate the Properties. Can be null.req
- The HTTP servlet request, either null or HttpServletpublic void setReportTitle(java.lang.String title)
setReportTitle
in interface RenderData
title
- Title of the report as simple string.public java.lang.String getReportTitle()
getReportTitle
in interface RenderData
public void setReportLocation(java.lang.String name)
setReportLocation
in interface RenderData
name
- The location at which the report can be found. May not be null. *public java.lang.String getReportLocation()
getReportLocation
in interface RenderData
*
protected ReportCacheKey getKey(java.util.Properties props) throws ReportException
props
- the properties, differ for report and export renderingReportException
- e.g. if the reportfile does not existCache.getKey(Properties, PropertiesChecker, Object)
public byte[] getPageData(int page) throws ViewerException
getPageData
in interface RenderData
page
- The number of the page. The first page is 1, the second is 2, ... .
ViewerException
- If an exception is returned from the server, it is wrapped in a ViewerException.
Often this will be a com.inet.report.ReportExceptionRenderData.getPageCount()
public int getPageCount() throws ViewerException
getPageCount
in interface RenderData
ViewerException
- If there are rendering problems, etc.RenderData.getPageData(int)
public boolean isPageLimitExceeded()
isPageLimitExceeded
in interface RenderData
public byte[] getNextExportChunk() throws ViewerException
getNextExportChunk
in interface RenderData
ViewerException
- If there are connection problems or other issues while fetching the dataRenderData.getExportChunkCount(Properties)
public int getExportChunkCount(java.util.Properties expProps) throws ViewerException
getExportChunkCount
in interface RenderData
expProps
- Properties to be appended to the current report properties for this export.
The properties should contain at least the export format with the key "export_fmt". The following
formats are valid:ViewerException
- If there are connection problems or other issues while fetching the dataRenderData.getNextExportChunk()
,
RenderData.getProperties()
protected EngineFactory getEngineFactory()
EngineFactory
to pass to the CacheEngineFactory
to pass to the Cachepublic byte[] getGroupTree() throws ViewerException
getGroupTree
in interface RenderData
ViewerException
- If there are connection problems or other issues while fetching the datapublic byte[] refreshPageData(int page) throws ViewerException
refreshPageData
in interface RenderData
page
- The number of the page. The first page is 1, the second is 2, ... .
If the page number is bigger than the page count the data from the last page will be returned.ViewerException
- If there are connection problems or other issues while
fetching the dataRenderData.getPageCount()
public void setReportProperty(java.lang.String key, java.lang.String value)
setReportProperty
in interface RenderData
key
- Name of property to set, will be converted to lower casevalue
- Value of property to set, null to remove this propertypublic java.lang.String getReportProperty(java.lang.String propertyKey)
getReportProperty
in interface RenderData
propertyKey
- Name of property to get value forpublic java.util.Properties getProperties()
Note also that any key values should be set in lower case. This Properties object will never be null, at most it will be empty.
getProperties
in interface RenderData
public void setPromptOnRefresh(boolean promptOnRefresh)
setPromptOnRefresh
in interface RenderData
promptOnRefresh
- Value to set for this propertypublic boolean isPromptOnRefresh()
isPromptOnRefresh
in interface RenderData
public RenderData getCopy()
getCopy
in interface RenderData
ReportViewer.addNewReportView(RenderData)
,
RenderData.getProperties()
public void stop()
stop
in interface RenderData
public byte[] search(java.lang.String phrase, int startPage, int flags)
WHOLE_WORD : search only the word in its entirety, not parts of words.
CASE_SENSITIVE : observe upper and lower cases in the search, that is "Search" != "search"
REGULAR_EXPRESSION : The search phrase is to be handled as a regular expression (using Java's Regex
methods for the search).
Desired flags should be connected by the OR operator "|". So, for example, to search with the flags WHOLE_WORD and CASE_SENSITIVE, simply use WHOLE_WORD | CASE_SENSITIVE as the flags option.
Note that phrases going over more than one page will not be found, nor will text parts with formatting inside the word itself, such as this word. Note that this method is thread-safe, that is, two or more threads concurrently calling this method and the other thread-safe methods in RenderData should cause no problems.
search
in interface RenderData
phrase
- Word or phrase to search. Should be a regular expression if this flag is set.startPage
- Page to start searching on (1-based)flags
- Desired search options (see above)RenderData.WHOLE_WORD
,
RenderData.CASE_SENSITIVE
,
RenderData.REGULAR_EXPRESSION
public byte[] getFontData(int fontID)
The fontID is 1-based. null
will be returned if there are no fonts embedded for the
report of this Engine. If fontID is greater than the number of embedded
fonts available it will return the last font available. This method is the mirror method to com.inet.report.Engine.getFontData(int),
so implementations can either call that if an engine is available, or a running i-net Clear Reports server
also returns the font data with an HTTP request of the form
"http://server:9000/?report=report.rpt&export_fmt=font&page=FONTID&cmd=get_pg" where FONTID is replaced with the given font ID.
Note that this method is thread-safe, that is, two or more threads concurrently calling
this method and the other thread-safe methods in RenderData should cause no problems.
getFontData
in interface RenderData
fontID
- ID of font as specified in the i-net Clear Reports protocolpublic void resetServerCacheTimeout()
This method will be called in regular intervals (default is every 5 minutes) by its corresponding ReportView(s).
resetServerCacheTimeout
in interface RenderData
Copyright © 1999-2018 by i-net software GmbH