public abstract class DeclarativeSpreadsheetWebScript
extends org.springframework.extensions.webscripts.DeclarativeWebScript
Modifier and Type | Class and Description |
---|---|
static class |
DeclarativeSpreadsheetWebScript.WriteExcel |
Modifier and Type | Field and Description |
---|---|
protected org.alfresco.service.cmr.dictionary.DictionaryService |
dictionaryService |
protected String |
filenameBase |
static String |
MODEL_CSV |
static String |
MODEL_EXCEL |
static String |
PARAM_REQ_DELIMITER |
Constructor and Description |
---|
DeclarativeSpreadsheetWebScript() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
allowHtmlFallback()
If the format is requested as HTML, should an exception be raised,
or should an HTML version be called?
|
protected abstract List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> |
buildPropertiesForHeader(Object resource,
String format,
org.springframework.extensions.webscripts.WebScriptRequest req)
Returns the QNames of the model properties to be output in
the header, and if they're required or not
|
protected Map<String,Object> |
createTemplateParameters(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res,
Map<String,Object> customParams) |
protected Map<String,Object> |
executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.Status status) |
void |
generateSpreadsheet(Object resource,
String format,
org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.Status status,
Map<String,Object> model)
Generates the spreadsheet, based on the properties in the header
and a callback for the body.
|
org.apache.commons.csv.CSVStrategy |
getCsvStrategy()
Get the CSVStrategy.
|
protected abstract Object |
identifyResource(String format,
org.springframework.extensions.webscripts.WebScriptRequest req)
Identifies the resource for the webscript.
|
protected abstract void |
populateBody(Object resource,
org.apache.commons.csv.CSVPrinter csv,
List<org.alfresco.service.namespace.QName> properties)
Populates the body of the CSV file, once the header has been
output.
|
protected abstract void |
populateBody(Object resource,
org.apache.poi.ss.usermodel.Workbook workbook,
org.apache.poi.ss.usermodel.Sheet sheet,
List<org.alfresco.service.namespace.QName> properties)
Populates the body of the Excel Workbook, once the header has been
output.
|
void |
setCsvStrategy(org.apache.commons.csv.CSVStrategy csvStrategy)
Set the CSVStrategy
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplate
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
public static final String MODEL_CSV
public static final String MODEL_EXCEL
public static final String PARAM_REQ_DELIMITER
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
protected String filenameBase
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- the DictionaryService to setprotected abstract Object identifyResource(String format, org.springframework.extensions.webscripts.WebScriptRequest req)
protected abstract boolean allowHtmlFallback()
protected abstract List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> buildPropertiesForHeader(Object resource, String format, org.springframework.extensions.webscripts.WebScriptRequest req)
protected abstract void populateBody(Object resource, org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, List<org.alfresco.service.namespace.QName> properties) throws IOException
IOException
protected abstract void populateBody(Object resource, org.apache.commons.csv.CSVPrinter csv, List<org.alfresco.service.namespace.QName> properties) throws IOException
IOException
public void setCsvStrategy(org.apache.commons.csv.CSVStrategy csvStrategy)
csvStrategy
- CSVStrategypublic org.apache.commons.csv.CSVStrategy getCsvStrategy()
CSVStrategy.EXCEL_STRATEGY
if none was set.protected Map<String,Object> executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status)
executeImpl
in class org.springframework.extensions.webscripts.DeclarativeWebScript
DeclarativeWebScript.executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status)
public void generateSpreadsheet(Object resource, String format, org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, Map<String,Object> model) throws IOException
IOException
protected Map<String,Object> createTemplateParameters(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res, Map<String,Object> customParams)
createTemplateParameters
in class org.springframework.extensions.webscripts.AbstractWebScript
Copyright © 2005–2017 Alfresco Software. All rights reserved.