Class StandardHttpExporter
- java.lang.Object
-
- org.intermine.web.logic.export.http.HttpExporterBase
-
- org.intermine.web.logic.export.http.StandardHttpExporter
-
- All Implemented Interfaces:
TableHttpExporter
- Direct Known Subclasses:
CSVHttpExporter
,TabHttpExporter
public abstract class StandardHttpExporter extends HttpExporterBase implements TableHttpExporter
Abstract class implementing functionality common for exporters exporting table in simple format like comma separated format. The business logic of export is performed with exporter obtained via getExport method and so each subclass can redefine it overwriting this method.- Author:
- Jakub Kulaviak
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description StandardHttpExporter()
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canExport(PagedTable pt)
Check if this TableExporter can export the given PagedTable.void
export(PagedTable pt, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, TableExportForm form, java.util.Collection<Path> unionPathCollection, java.util.Collection<Path> newPathCollection)
Perform export.protected abstract Exporter
getExporter(java.io.OutputStream out, java.lang.String separator, java.util.List<java.lang.String> headers)
Do the export.java.util.List<Path>
getInitialExportPaths(PagedTable pt)
The initial export path list is just the paths from the columns of the PagedTable.protected abstract void
setResponseHeader(javax.servlet.http.HttpServletResponse response, boolean doGzip)
Sets header and content type of result in response.-
Methods inherited from class org.intermine.web.logic.export.http.HttpExporterBase
getResultRows
-
-
-
-
Method Detail
-
canExport
public boolean canExport(PagedTable pt)
Description copied from interface:TableHttpExporter
Check if this TableExporter can export the given PagedTable.- Specified by:
canExport
in interfaceTableHttpExporter
- Parameters:
pt
- PagedTable- Returns:
- true if given PagedTable can be exported with this exporter
-
export
public void export(PagedTable pt, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, TableExportForm form, java.util.Collection<Path> unionPathCollection, java.util.Collection<Path> newPathCollection)
Perform export.- Specified by:
export
in interfaceTableHttpExporter
- Parameters:
pt
- exported PagedTablerequest
- requestresponse
- responseform
- the formunionPathCollection
- view pathsnewPathCollection
- columns paths
-
getInitialExportPaths
public java.util.List<Path> getInitialExportPaths(PagedTable pt)
The initial export path list is just the paths from the columns of the PagedTable. Return a list of the Paths to show the user as initial export columns or header contents. The List is likely to be based on the columns of the PagedTable plus or minus special cases for this exporter.- Specified by:
getInitialExportPaths
in interfaceTableHttpExporter
- Parameters:
pt
- the PagedTable- Returns:
- the Paths
-
getExporter
protected abstract Exporter getExporter(java.io.OutputStream out, java.lang.String separator, java.util.List<java.lang.String> headers)
Do the export.- Parameters:
out
- output streamseparator
- line separatorheaders
- if non-null, a list of the column headers which will be written by export()- Returns:
- exporter that will perform the business logic of export.
-
setResponseHeader
protected abstract void setResponseHeader(javax.servlet.http.HttpServletResponse response, boolean doGzip)
Sets header and content type of result in response.- Parameters:
response
- responsedoGzip
- whether to compress the stream
-
-