|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.modules.Module
org.apache.turbine.modules.SecureModule
org.apache.turbine.modules.screens.TemplateSecureScreen
org.apache.turbine.TemplateSecureScreen
org.tigris.scarab.screens.Default
org.tigris.scarab.screens.DataExport
Sends file contents directly to the output stream, setting the
Content-Type and writing back to the browser a
tab-delimited file (Excel digests this fine). We used to use POI to compose an Excel
binary data file, but its outrageous memory consumption didn't
scale for large result sets. POI assembles the its output in
memory. After study of the native OLE2 Excel file format, it
appears very difficult to generate the file in another fashion.
Regards output encoding, for now we're assuming the response
stream is appropriately set upon fetching. Also, we're assuming
that Excel will do the right thing on receipt of our TSV file with
Japanese or other multibyte characters (we're not setting an
encoding on the Content-Type we return). Both of the
above to be verified.
| Nested Class Summary | |
protected class |
DataExport.TSVPrinter
Uses a PrintWriter internally to do actual
writing. |
| Field Summary | |
protected static java.lang.String |
NO_CONTENT
What to show if a cell is empty. |
| Constructor Summary | |
(package private) |
DataExport()
|
| Method Summary | |
protected boolean |
containsElements(java.util.List l)
|
void |
doBuildTemplate(org.apache.turbine.RunData data,
org.apache.turbine.TemplateContext context)
Sets the Content-Type header for the response.
|
protected java.lang.String |
escapeCommas(java.lang.String s)
Escape any commas in passed string. |
protected java.lang.String |
getEncodingForExport(org.apache.turbine.RunData data)
This function encapsulates the logic of determining which encoding to use. |
protected java.io.Writer |
getWriter(org.apache.turbine.RunData data)
This function is available to subclasses -- it is used to provide a Writer based on the current request and the site configuration, taking encoding issues into consideration. |
| Methods inherited from class org.tigris.scarab.screens.Default |
checkAuthorized, doBuild, getLocalizationTool, getScarabRequestTool, getTitle, isAuthorized, setTargetLogin, setTargetSelectModule |
| Methods inherited from class org.apache.turbine.modules.SecureModule |
doBuildTemplate |
| Methods inherited from class org.apache.turbine.modules.Module |
build, evaluate, execute, getPullService, getTemplateContext, getTemplateService, getTool, handleRequest, handleRequest, requestFinished, setTarget, setTemplate, templateExists |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String NO_CONTENT
| Constructor Detail |
DataExport()
| Method Detail |
public void doBuildTemplate(org.apache.turbine.RunData data,
org.apache.turbine.TemplateContext context)
throws java.lang.Exception
Content-Type header for the response.
Since this assumes we're writing the reponse ourself, indicates
no target to render by setting it to null.
doBuildTemplate in class Defaultjava.lang.Exceptionprotected java.lang.String getEncodingForExport(org.apache.turbine.RunData data)
protected java.io.Writer getWriter(org.apache.turbine.RunData data)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String escapeCommas(java.lang.String s)
s - String to check.
protected final boolean containsElements(java.util.List l)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||