|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.inet.report.CacheRenderData
public class CacheRenderData
This class is a RenderData source object running on i-net Clear Reports cache, for use with i-net Clear Reports Viewer. An RenderData object, such as an object of this class, is needed to create a new SwingReportView, for example. It uses the methods provided in Cache to get a cache object (Cache.getCache()), and then passes any data requests on to the cache.
| Field Summary |
|---|
| Fields inherited from interface com.inet.viewer.RenderData |
|---|
CASE_SENSITIVE, REGULAR_EXPRESSION, WHOLE_WORD |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
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)
Returns the binary data of one page for the Java Viewer, however, it causes the page to be rendered anew rather than possibly taking a cached version. |
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. |
| Constructor Detail |
|---|
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 HttpServlet| Method Detail |
|---|
public void setReportTitle(java.lang.String title)
setReportTitle in interface RenderDatatitle - Title of the report as simple string.public java.lang.String getReportTitle()
getReportTitle in interface RenderDatapublic void setReportLocation(java.lang.String name)
setReportLocation in interface RenderDataname - The location at which the report can be found. May not be null. *public java.lang.String getReportLocation()
getReportLocation in interface RenderData*
public byte[] getPageData(int page)
throws ViewerException
getPageData in interface RenderDatapage - 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 RenderDataViewerException - If there are rendering problems, etc.RenderData.getPageData(int)public boolean isPageLimitExceeded()
isPageLimitExceeded in interface RenderData
public byte[] getNextExportChunk()
throws ViewerException
getNextExportChunk in interface RenderDataViewerException - 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 RenderDataexpProps - 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 Cache
EngineFactory to pass to the Cache
public byte[] getGroupTree()
throws ViewerException
getGroupTree in interface RenderDataViewerException - If there are connection problems or other issues while fetching the data
public byte[] refreshPageData(int page)
throws ViewerException
refreshPageData in interface RenderDatapage - 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 RenderDatakey - 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 RenderDatapropertyKey - Name of property to get value for
public 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 RenderDatapublic void setPromptOnRefresh(boolean promptOnRefresh)
setPromptOnRefresh in interface RenderDatapromptOnRefresh - Value to set for this propertypublic boolean isPromptOnRefresh()
isPromptOnRefresh in interface RenderDatapublic RenderData getCopy()
getCopy in interface RenderDataReportViewer.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 RenderDataphrase - 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_EXPRESSIONpublic 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 RenderDatafontID - ID of font as specified in the i-net Clear Reports protocol
public void resetServerCacheTimeout()
This method will be called in regular intervals (default is every 5 minutes) by its corresponding ReportView(s).
resetServerCacheTimeout in interface RenderData
|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||