Class DSRequest
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
AdvancedCriterionSubquery
DataSource operation
.
All properties which are legal on RPCRequest
are legal, in addition to the properties
listed here.- See Also:
-
Field Summary
Fields inherited from class com.smartgwt.client.core.RefDataClass
id
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties
-
Constructor Summary
ConstructorDescriptionDSRequest
(JavaScriptObject jsObj) DSRequest
(DSOperationType operationType) DSRequest
(DSOperationType operationType, JavaScriptObject data) DSRequest
(DSOperationType operationType, Criteria criteria) DSRequest
(DSOperationType operationType, Record data) DSRequest
(DSOperationType operationType, String operationId) DSRequest
(DSOperationType operationType, String operationId, JavaScriptObject data) DSRequest
(DSOperationType operationType, String operationId, Criteria criteria) DSRequest
(DSOperationType operationType, String operationId, Record data) -
Method Summary
Modifier and TypeMethodDescriptionFor fetch, add or update operation, an optional comma separated list of fields to fetch from another, related DataSource.DSRequest-level override for the DataSource-levelarrayCriteriaForceExact
flag.For requests submitted by aDataBoundComponent
, theCanvas.ID
of the submitting component.Return the Criteria associated with a FETCH operation.DataProtocol
for this particular request.DataSource this DSRequest will act on.End row of requested results, used only with fetch operations.The format in which the data should be exported.When usingRPCManager.exportContent()
to produce a .pdf from a Smart GWT UI, this property allows dynamic CSS to be passed to the server.Record[]
Only applies to request properties passed toListGrid.exportClientData()
.When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces dates to export as a string rather than a true date value.The character to use as a field-separator in CSV exports.Specifies whether the exported data will be downloaded as an attachment or displayed in a new browser window.String[]
The list of field names to export.The name of the file to save the exported data into.Optional text to appear at the end of the file.Optional text to appear at the beginning of the file.This property allows omitting column names from CSV and Excel exports (no effect on JSON or XML exports).The image format in which the SVG graphic should be exported.Deprecated.If exporting inJPEG format
, the output JPEG quality level.When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces numbers to export as a string rather than a true numerical value.IfexportToFilesystem
is set, optionally specifies a path to use when saving the file.Determines thePropertyIdentifier
to be used in the exported data.Whether formatting settings should be applied to data being exported.When set, causes the results of the DSRequest to be exported to a file, whose name and format are indicated byexportFilename
andexportAs
respectively.When you erxport aListGrid
that hasheaderSpans
, should headerSpans also be exported.When you export aListGrid
that hasheaderSpans
defined andexportShowHeaderSpanTitles
is true, the behavior is dependent on the export type.boolean
When exporting to OOXML format (this is the standard file format used by Excel 2007 and later), we default to using streaming mode, for memory efficiency.The character with which to replace spaces in field-titles when exporting to XML.If set to true (the default), Smart GWT Server will export data back to the client, either as a file download or as content in a new browser window, depending on the setting ofexportDisplay
.If set, Smart GWT Server will export data to a file on the server filesystem.For server-side export withExportFormat
"xls" or "ooxml" only, timezone to use when saving values fromFieldType
"datetime" to the spreadsheet.This flag has a different meaning depending on whether you are doing a client-driven or server-driven export.A set of key:value pairs, mapping field names to expressions that will be evaluated server-side to derive a value for that field.Specifies should related updates have to be generated.String[]
List of fields to group by when usingserver-side summarization
.For DataSources using SOAP messaging with a WSDL web service, data to be serialized to form SOAP headers, as a map from the header part name to the data.This property is for advanced use in integrating trees thatload data on demand
using data paging.The style of line-breaks to use in the exported output.For a databoundmulti-link tree
, this is theoperationId
to use for the separate fetch on theResultTree.linkDataSource
that will be generated ifLinkDataFetchMode
is "separate".For anupdate
orremove
operation, the original values from the record that is being updated or removed.When aDataBoundComponent
sends a DSRequest, thedsRequest.operationId
will be automatically picked up from thefetchOperation
,addOperation
, etc properties of the DataBoundComponent.Type of operation being performed: "fetch", "add", "remove", "update" or "custom".static DSRequest
getOrCreateRef
(JavaScriptObject jsObj) The list of fields to return in the response, specified as a comma-separated string (eg,"foo, bar, baz"
).For advanced use in integrating trees thatload data on demand
with web services,parentNode
is automatically set in "fetch" DSRequests issued by a databound TreeGrid that is loading children for thatparentNode
.Indicates that a validation request is being made for a record that will ultimately be saved with an "add" request, as opposed to an "update" request.Setsprogressive loading mode
for this particular request, overriding the OperationBinding- and DataSource-level settings.Same asgetSummaryFunctions()
, but allowing to get any functions, not just ones built into the framework, so that in combination with custom implementation on the server-side you can perform custom aggregation.Automatically generated unique ID for this request.For advanced use in integrating dataset paging with web services, the ResultSet that issued this "fetch" DSRequest is automatically made available as theresultSet
property.For advanced use in integrating trees thatload data on demand
with web services, the ResultTree that issued this "fetch" DSRequest is automatically made available as theresultTree
property.This is a per-request flag for explicitly controlling whether the cache is used (bypassing it when not wanted, or using it when settings would indicate otherwise).Fieldname to sortByStarting row of requested results, used only with fetch operations.boolean
If true, results will be streamed on the server, rather than all records being read into server memory at once; this approach is appropriate for retrieving or exporting large datasets without swamping the server.A mapping from field names to summary functions to be applied to each field.For "fetch" operations, how search criteria should be interpreted for text fields: one of "exact" for exact match, "exactCase" for case-sensitive exact match, "startsWith" for matching at the beginning only, or "substring" for substring match.WhenuseFlatFields
is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties inrequest.data
will be used as the values for XML elements of the same name, at any level of nesting.Cause theuseFlatFields
XML serialization behavior to be used for all soap headers in the request.Should the HTTP response to this request be formatted using the strict JSON subset of the javascript language? If set to true, responses returned by the server should match the format described here.Mode of validation for entered data.setAdditionalOutputs
(String additionalOutputs) For fetch, add or update operation, an optional comma separated list of fields to fetch from another, related DataSource.setArrayCriteriaForceExact
(Boolean arrayCriteriaForceExact) DSRequest-level override for the DataSource-levelarrayCriteriaForceExact
flag.setAttribute
(String property, Object value) Set a custom attribute value on the DSRequest as an Object.final void
setCallback
(DSCallback callback) setComponentId
(String componentId) For requests submitted by aDataBoundComponent
, theCanvas.ID
of the submitting component.setCriteria
(Criteria criteria) This method applies to "fetch" requests only; for update or delete operations pass a Record to setData() which contains primaryKey values as Record attributes.setDataProtocol
(DSProtocol dataProtocol) DataProtocol
for this particular request.setDataSource
(String dataSource) DataSource this DSRequest will act on.End row of requested results, used only with fetch operations.setExportAs
(ExportFormat exportAs) The format in which the data should be exported.setExportCSS
(String exportCSS) When usingRPCManager.exportContent()
to produce a .pdf from a Smart GWT UI, this property allows dynamic CSS to be passed to the server.setExportData
(Record... exportData) Only applies to request properties passed toListGrid.exportClientData()
.setExportDatesAsFormattedString
(Boolean exportDatesAsFormattedString) When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces dates to export as a string rather than a true date value.setExportDelimiter
(String exportDelimiter) The character to use as a field-separator in CSV exports.setExportDisplay
(ExportDisplay exportDisplay) Specifies whether the exported data will be downloaded as an attachment or displayed in a new browser window.setExportFields
(String... exportFields) The list of field names to export.setExportFilename
(String exportFilename) The name of the file to save the exported data into.setExportFooter
(String exportFooter) Optional text to appear at the end of the file.setExportHeader
(String exportHeader) Optional text to appear at the beginning of the file.setExportHeaderless
(Boolean exportHeaderless) This property allows omitting column names from CSV and Excel exports (no effect on JSON or XML exports).setExportImageFormat
(ExportImageFormat exportImageFormat) The image format in which the SVG graphic should be exported.setExportImageQuality
(Double exportImageQuality) If exporting inJPEG format
, the output JPEG quality level.setExportImageQuality
(Float exportImageQuality) Deprecated.setExportNumbersAsFormattedString
(Boolean exportNumbersAsFormattedString) When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces numbers to export as a string rather than a true numerical value.setExportPath
(String exportPath) IfexportToFilesystem
is set, optionally specifies a path to use when saving the file.setExportPropertyIdentifier
(PropertyIdentifier exportPropertyIdentifier) Determines thePropertyIdentifier
to be used in the exported data.setExportRawValues
(Boolean exportRawValues) Whether formatting settings should be applied to data being exported.setExportResults
(Boolean exportResults) When set, causes the results of the DSRequest to be exported to a file, whose name and format are indicated byexportFilename
andexportAs
respectively.setExportShowHeaderSpanTitles
(Boolean exportShowHeaderSpanTitles) When you erxport aListGrid
that hasheaderSpans
, should headerSpans also be exported.setExportSpanTitleSeparator
(String exportSpanTitleSeparator) When you export aListGrid
that hasheaderSpans
defined andexportShowHeaderSpanTitles
is true, the behavior is dependent on the export type.setExportStreaming
(boolean exportStreaming) When exporting to OOXML format (this is the standard file format used by Excel 2007 and later), we default to using streaming mode, for memory efficiency.setExportTitleSeparatorChar
(String exportTitleSeparatorChar) The character with which to replace spaces in field-titles when exporting to XML.setExportToClient
(Boolean exportToClient) If set to true (the default), Smart GWT Server will export data back to the client, either as a file download or as content in a new browser window, depending on the setting ofexportDisplay
.setExportToFilesystem
(Boolean exportToFilesystem) If set, Smart GWT Server will export data to a file on the server filesystem.setExportTZ
(String exportTZ) For server-side export withExportFormat
"xls" or "ooxml" only, timezone to use when saving values fromFieldType
"datetime" to the spreadsheet.setExportValueFields
(Boolean exportValueFields) This flag has a different meaning depending on whether you are doing a client-driven or server-driven export.setFieldValueExpressions
(Map fieldValueExpressions) A set of key:value pairs, mapping field names to expressions that will be evaluated server-side to derive a value for that field.setGenerateRelatedUpdates
(Boolean generateRelatedUpdates) Specifies should related updates have to be generated.setGroupBy
(String... groupBy) List of fields to group by when usingserver-side summarization
.setHeaderData
(Map headerData) For DataSources using SOAP messaging with a WSDL web service, data to be serialized to form SOAP headers, as a map from the header part name to the data.setKeepParentsOnFilter
(Boolean keepParentsOnFilter) This property is for advanced use in integrating trees thatload data on demand
using data paging.setLineBreakStyle
(String lineBreakStyle) The style of line-breaks to use in the exported output.setLinkDataFetchOperation
(String linkDataFetchOperation) For a databoundmulti-link tree
, this is theoperationId
to use for the separate fetch on theResultTree.linkDataSource
that will be generated ifLinkDataFetchMode
is "separate".void
setOldValues
(JavaScriptObject oldValues) For anupdate
orremove
operation, the original values from the record that is being updated or removed.setOldValues
(Record oldValues) For anupdate
orremove
operation, the original values from the record that is being updated or removed.void
setOldValues
(Map oldValues) For anupdate
orremove
operation, the original values from the record that is being updated or removed.setOperationId
(String operationId) When aDataBoundComponent
sends a DSRequest, thedsRequest.operationId
will be automatically picked up from thefetchOperation
,addOperation
, etc properties of the DataBoundComponent.setOperationType
(DSOperationType operationType) Type of operation being performed: "fetch", "add", "remove", "update" or "custom".setOutputs
(String outputs) The list of fields to return in the response, specified as a comma-separated string (eg,"foo, bar, baz"
).Values to be sent as simple HTTP params, as a JavaScript Object where each property/value pair will become an HTTP parameter name and value.setPendingAdd
(Boolean pendingAdd) Indicates that a validation request is being made for a record that will ultimately be saved with an "add" request, as opposed to an "update" request.setProgressiveLoading
(Boolean progressiveLoading) Setsprogressive loading mode
for this particular request, overriding the OperationBinding- and DataSource-level settings.void
setRawSummaryFunctions
(Map<String, String> summaryFunctions) Same as#setSummaryFunctions()
, but allowing to set any functions, not just ones built into the framework, so that in combination with custom implementation on the server-side you can perform custom aggregation.setShouldUseCache
(Boolean shouldUseCache) This is a per-request flag for explicitly controlling whether the cache is used (bypassing it when not wanted, or using it when settings would indicate otherwise).void
setSkinName
(String skinName) Set the skin to use.void
setSortBy
(SortSpecifier sortSpecifier) Fieldnames to sortBy.void
setSortBy
(SortSpecifier[] sortSpecifiers) Fieldnames to sortBy.setStartRow
(Integer startRow) Starting row of requested results, used only with fetch operations.setStreamResults
(boolean streamResults) If true, results will be streamed on the server, rather than all records being read into server memory at once; this approach is appropriate for retrieving or exporting large datasets without swamping the server.void
setSummaryFunctions
(Map<String, SummaryFunctionType> summaryFunctions) A mapping from field names to summary functions to be applied to each field.setTextMatchStyle
(TextMatchStyle textMatchStyle) For "fetch" operations, how search criteria should be interpreted for text fields: one of "exact" for exact match, "exactCase" for case-sensitive exact match, "startsWith" for matching at the beginning only, or "substring" for substring match.setUseFlatFields
(Boolean useFlatFields) WhenuseFlatFields
is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties inrequest.data
will be used as the values for XML elements of the same name, at any level of nesting.setUseFlatHeaderFields
(Boolean useFlatHeaderFields) Cause theuseFlatFields
XML serialization behavior to be used for all soap headers in the request.setUseStrictJSON
(Boolean useStrictJSON) Should the HTTP response to this request be formatted using the strict JSON subset of the javascript language? If set to true, responses returned by the server should match the format described here.setValidationMode
(ValidationMode validationMode) Mode of validation for entered data.Methods inherited from class com.smartgwt.client.rpc.RPCRequest
downloadCallback, getActionURL, getAllowIE9Leak, getBypassCache, getCallbackParam, getContainsCredentials, getContentType, getData, getDataAsString, getDownloadResult, getDownloadToNewWindow, getEvalResult, getHttpHeaders, getHttpMethod, getHttpProxyURL, getIgnoreTimeout, getIsBackgroundRequest, getMockMode, getOmitNullMapValuesInResponse, getParams, getPrompt, getPromptCursor, getPromptDelay, getPromptStyle, getReportDownloadErrorsAsDocuments, getSendNoQueue, getServerOutputAsString, getShowPrompt, getSuppressAutoDraw, getTimeout, getTransport, getUseCursorTracker, getUseHttpProxy, getUseSimpleHttp, getWillHandleError, getWithCredentials, isDSRequest, setActionURL, setAllowIE9Leak, setBypassCache, setCallbackParam, setContainsCredentials, setContentType, setData, setData, setData, setData, setDownloadResult, setDownloadToNewWindow, setEvalResult, setEvalVars, setHttpHeaders, setHttpMethod, setHttpProxyURL, setIgnoreTimeout, setIsBackgroundRequest, setMockMode, setOmitNullMapValuesInResponse, setPrompt, setPromptCursor, setPromptDelay, setPromptStyle, setReportDownloadErrorsAsDocuments, setSendNoQueue, setServerOutputAsString, setShowPrompt, setSuppressAutoDraw, setTimeout, setTransport, setUseCursorTracker, setUseHttpProxy, setUseSimpleHttp, setWillHandleError, setWithCredentials, xhr_onProgress
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetID
Methods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
-
Constructor Details
-
DSRequest
public DSRequest() -
DSRequest
-
DSRequest
-
DSRequest
-
DSRequest
-
DSRequest
-
DSRequest
-
DSRequest
-
DSRequest
-
DSRequest
-
-
Method Details
-
getOrCreateRef
-
setAdditionalOutputs
For fetch, add or update operation, an optional comma separated list of fields to fetch from another, related DataSource.Fields should be specified in the format
"localFieldName!relatedDataSourceID.relatedDataSourceFieldName"
. whererelatedDataSourceID
is the ID of the related dataSource, andrelatedDataSourceFieldName
is the field for which you want to fetch related values. The returned field values will be stored on the data returned to the client under the specifiedlocalFieldName
. Note that this will be applied in addition to any specifiedoutputs
.Note that as with
DataSourceField.includeFrom
, the related dataSource must be linked to the primary datasource via a foreignKey relationship.Note additionalOutputs sent in request from the browser can be completely disabled in
server.properties
by settingdatasource.allowClientAdditionalOutputs
:datasource.allowClientAdditionalOutputs: false
In this caseadditionalOutputs
sent from the browser will be cleared before executing request. Note that programatically configured additionalOutputs are always allowed, but you can't modify them from within a DMI method, so the only way to execute a request with additionalOutputs that differ from what was sent by the client is to create a new DSRequestNote : This is an advanced setting
- Parameters:
additionalOutputs
- New additionalOutputs value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getAdditionalOutputs
For fetch, add or update operation, an optional comma separated list of fields to fetch from another, related DataSource.Fields should be specified in the format
"localFieldName!relatedDataSourceID.relatedDataSourceFieldName"
. whererelatedDataSourceID
is the ID of the related dataSource, andrelatedDataSourceFieldName
is the field for which you want to fetch related values. The returned field values will be stored on the data returned to the client under the specifiedlocalFieldName
. Note that this will be applied in addition to any specifiedoutputs
.Note that as with
DataSourceField.includeFrom
, the related dataSource must be linked to the primary datasource via a foreignKey relationship.Note additionalOutputs sent in request from the browser can be completely disabled in
server.properties
by settingdatasource.allowClientAdditionalOutputs
:datasource.allowClientAdditionalOutputs: false
In this caseadditionalOutputs
sent from the browser will be cleared before executing request. Note that programatically configured additionalOutputs are always allowed, but you can't modify them from within a DMI method, so the only way to execute a request with additionalOutputs that differ from what was sent by the client is to create a new DSRequest- Returns:
- Current additionalOutputs value. Default value is null
-
setArrayCriteriaForceExact
DSRequest-level override for the DataSource-levelarrayCriteriaForceExact
flag. See the documentation for that flag for details.- Parameters:
arrayCriteriaForceExact
- New arrayCriteriaForceExact value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getArrayCriteriaForceExact
DSRequest-level override for the DataSource-levelarrayCriteriaForceExact
flag. See the documentation for that flag for details.- Returns:
- Current arrayCriteriaForceExact value. Default value is null
- See Also:
-
setComponentId
For requests submitted by aDataBoundComponent
, theCanvas.ID
of the submitting component.This ID will be present for operations including automatic saves by a ListGrid
during editing
, or calls toform.saveData()
. It will not be present for a direct call to a DataSource method such asDataSource.fetchData()
.Note this is the component's String ID - you can retrieve the component itself via
Canvas.getById()
.This property should be used for debugging purposes only - do not use it to trigger differences in server-side behavior, instead, use
operationId
because onlyoperationId
is considered when assessingrequest equivalence
.- Parameters:
componentId
- New componentId value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getComponentId
For requests submitted by aDataBoundComponent
, theCanvas.ID
of the submitting component.This ID will be present for operations including automatic saves by a ListGrid
during editing
, or calls toform.saveData()
. It will not be present for a direct call to a DataSource method such asDataSource.fetchData()
.Note this is the component's String ID - you can retrieve the component itself via
Canvas.getById()
.This property should be used for debugging purposes only - do not use it to trigger differences in server-side behavior, instead, use
operationId
because onlyoperationId
is considered when assessingrequest equivalence
.- Returns:
- Current componentId value. Default value is null
-
setDataProtocol
DataProtocol
for this particular request.Note: Typically developers should use
operation bindings
to specify an explicit data protocol for a request.One exception: advanced developers may wish to have a custom
request transformer
with entirely client-side handling for some requests. This may be achieved by setting the request'sdataProtocol
to"clientCustom"
within transformRequest, and also triggering application code which will fireDataSource.processResponse()
when complete.The
DataSource.getDataProtocol()
method may be used to determine what data protocol will be used to handle a specific request based on this property (if set), otherwise the settings at theoperationBinding
ordataSource
levels.- Parameters:
dataProtocol
- New dataProtocol value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getDataProtocol
DataProtocol
for this particular request.Note: Typically developers should use
operation bindings
to specify an explicit data protocol for a request.One exception: advanced developers may wish to have a custom
request transformer
with entirely client-side handling for some requests. This may be achieved by setting the request'sdataProtocol
to"clientCustom"
within transformRequest, and also triggering application code which will fireDataSource.processResponse()
when complete.The
DataSource.getDataProtocol()
method may be used to determine what data protocol will be used to handle a specific request based on this property (if set), otherwise the settings at theoperationBinding
ordataSource
levels.- Returns:
- Current dataProtocol value. Default value is null
-
setDataSource
DataSource this DSRequest will act on.This property is generally automatically populated, for example when calling
DataSource.fetchData()
the dataSource property is set to the target DataSource.- Parameters:
dataSource
- New dataSource value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getDataSource
DataSource this DSRequest will act on.This property is generally automatically populated, for example when calling
DataSource.fetchData()
the dataSource property is set to the target DataSource.- Returns:
- Current dataSource value. Default value is null
-
setEndRow
End row of requested results, used only with fetch operations.Note that startRow and endRow are zero-based, inclusive at the beginning and exclusive at the end (like substring), so startRow: 0, endRow: 1 is a request for the first record.
- Parameters:
endRow
- New endRow value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getEndRow
End row of requested results, used only with fetch operations.Note that startRow and endRow are zero-based, inclusive at the beginning and exclusive at the end (like substring), so startRow: 0, endRow: 1 is a request for the first record.
- Returns:
- Current endRow value. Default value is null
-
setExportAs
The format in which the data should be exported. Note that 'JSON' is not allowed as a client-side option. SeeExportFormat
for more information.- Parameters:
exportAs
- New exportAs value. Default value is "csv"- Returns:
DSRequest
instance, for chaining setter calls
-
getExportAs
The format in which the data should be exported. Note that 'JSON' is not allowed as a client-side option. SeeExportFormat
for more information.- Returns:
- Current exportAs value. Default value is "csv"
-
setExportCSS
When usingRPCManager.exportContent()
to produce a .pdf from a Smart GWT UI, this property allows dynamic CSS to be passed to the server. Since theexportContent()
system already provides a way to specify a custom skin or additional stylesheet for export,exportCSS
should only be used for small bits of CSS that are necessarily dynamic.For example, when printing a very wide page, such as a grid with many columns or a very wide chart, you could send the string "@page {size: A4 landscape; }" as
exportCSS
to cause the generated PDF to use landscape mode, so that all content fits without clipping.- Parameters:
exportCSS
- New exportCSS value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getExportCSS
When usingRPCManager.exportContent()
to produce a .pdf from a Smart GWT UI, this property allows dynamic CSS to be passed to the server. Since theexportContent()
system already provides a way to specify a custom skin or additional stylesheet for export,exportCSS
should only be used for small bits of CSS that are necessarily dynamic.For example, when printing a very wide page, such as a grid with many columns or a very wide chart, you could send the string "@page {size: A4 landscape; }" as
exportCSS
to cause the generated PDF to use landscape mode, so that all content fits without clipping.- Returns:
- Current exportCSS value. Default value is null
-
setExportData
Only applies to request properties passed toListGrid.exportClientData()
. If specified this property contains an arbitrary set of data to be exported.- Parameters:
exportData
- New exportData value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getExportData
Only applies to request properties passed toListGrid.exportClientData()
. If specified this property contains an arbitrary set of data to be exported.- Returns:
- Current exportData value. Default value is null
-
setExportDatesAsFormattedString
When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces dates to export as a string rather than a true date value.If a date value is provided to a spreadsheet as a string, Excel or other spreadsheet applications may not recognize them as being date values that are valid for use in date-specific functions in formulas, filters, etc.
For this reason, the default behavior of
exportClientData
is to provide date values to the spreadsheet as true date values. IfFormat Strings
are provided via properties likedataSourceField.format
these will be translated to Excel / OpenOffice format strings and used when generating spreadsheets. Other formatting logic, such ascell formatters
, will not be used since they cannot be automatically translated to an Excel format string. If no translatable format string is available, date values will be provided to the spreadsheet with no formatter and the spreadsheet program's default formatting for date values will be used.If
exportDatesAsFormattedString
is set to true, date fields will appear as strings that exactly match the formatting shown in theDataBoundComponent
. As noted above, this means the spreadsheet program will not recognize the value as a date.- Parameters:
exportDatesAsFormattedString
- New exportDatesAsFormattedString value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getExportDatesAsFormattedString
When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces dates to export as a string rather than a true date value.If a date value is provided to a spreadsheet as a string, Excel or other spreadsheet applications may not recognize them as being date values that are valid for use in date-specific functions in formulas, filters, etc.
For this reason, the default behavior of
exportClientData
is to provide date values to the spreadsheet as true date values. IfFormat Strings
are provided via properties likedataSourceField.format
these will be translated to Excel / OpenOffice format strings and used when generating spreadsheets. Other formatting logic, such ascell formatters
, will not be used since they cannot be automatically translated to an Excel format string. If no translatable format string is available, date values will be provided to the spreadsheet with no formatter and the spreadsheet program's default formatting for date values will be used.If
exportDatesAsFormattedString
is set to true, date fields will appear as strings that exactly match the formatting shown in theDataBoundComponent
. As noted above, this means the spreadsheet program will not recognize the value as a date.- Returns:
- Current exportDatesAsFormattedString value. Default value is null
- See Also:
-
setExportDelimiter
The character to use as a field-separator in CSV exports. The default delimiter is comma.- Parameters:
exportDelimiter
- New exportDelimiter value. Default value is ","- Returns:
DSRequest
instance, for chaining setter calls
-
getExportDelimiter
The character to use as a field-separator in CSV exports. The default delimiter is comma.- Returns:
- Current exportDelimiter value. Default value is ","
-
setExportDisplay
Specifies whether the exported data will be downloaded as an attachment or displayed in a new browser window. SeeExportDisplay
for more information.- Parameters:
exportDisplay
- New exportDisplay value. Default value is "download"- Returns:
DSRequest
instance, for chaining setter calls
-
getExportDisplay
Specifies whether the exported data will be downloaded as an attachment or displayed in a new browser window. SeeExportDisplay
for more information.- Returns:
- Current exportDisplay value. Default value is "download"
-
setExportFields
The list of field names to export. If provided, the field list in the exported output is limited and sorted as per the list.If exportFields is not provided:
- If we are exporting via
exportData()
, the field list in the exported output is every non-hidden field defined in the DataSource, in DataSource definition order - If we are exporting via
exportClientData()
and we are not exporting to OOXML, or we are exporting to OOXML but we are notstreaming
, the field list in the exported output is based on the client data sent up, taking every row into account (so if there is a value for field "foo" only in row 57, we will output a column "foo", the cells of which are empty except for row 57) - If we are exporting via
exportClientData()
and we are exporting to OOXML and streaming is in force (the default for OOXML), the field list in the exported output is based on the client data sent up, taking just the first row into account (so if there is a value for field "foo" only in row 57, we will not output a column "foo" at all)
- Parameters:
exportFields
- New exportFields value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
- If we are exporting via
-
getExportFields
The list of field names to export. If provided, the field list in the exported output is limited and sorted as per the list.If exportFields is not provided:
- If we are exporting via
exportData()
, the field list in the exported output is every non-hidden field defined in the DataSource, in DataSource definition order - If we are exporting via
exportClientData()
and we are not exporting to OOXML, or we are exporting to OOXML but we are notstreaming
, the field list in the exported output is based on the client data sent up, taking every row into account (so if there is a value for field "foo" only in row 57, we will output a column "foo", the cells of which are empty except for row 57) - If we are exporting via
exportClientData()
and we are exporting to OOXML and streaming is in force (the default for OOXML), the field list in the exported output is based on the client data sent up, taking just the first row into account (so if there is a value for field "foo" only in row 57, we will not output a column "foo" at all)
- Returns:
- Current exportFields value. Default value is null
- If we are exporting via
-
setExportFilename
The name of the file to save the exported data into. IfexportToFilesystem
is set, this is the name of the file the server creates on its filesystem. IfexportToClient
is set, this is the filename that will appear to the browser.If the exportFilename that you specify does not include an extension, one will be added to it based on the
ExportFormat
specified byexportAs
. Filename is forced to have the correct extension to work around bugs in IE, but if you don't want the filename to be manipulated, use "custom"exportFormat
, see example.- Parameters:
exportFilename
- New exportFilename value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getExportFilename
The name of the file to save the exported data into. IfexportToFilesystem
is set, this is the name of the file the server creates on its filesystem. IfexportToClient
is set, this is the filename that will appear to the browser.If the exportFilename that you specify does not include an extension, one will be added to it based on the
ExportFormat
specified byexportAs
. Filename is forced to have the correct extension to work around bugs in IE, but if you don't want the filename to be manipulated, use "custom"exportFormat
, see example.- Returns:
- Current exportFilename value. Default value is null
- See Also:
-
setExportHeader
Optional text to appear at the beginning of the file.- Parameters:
exportHeader
- New exportHeader value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getExportHeader
Optional text to appear at the beginning of the file.- Returns:
- Current exportHeader value. Default value is null
-
setExportHeaderless
This property allows omitting column names from CSV and Excel exports (no effect on JSON or XML exports).- Parameters:
exportHeaderless
- New exportHeaderless value. Default value is false- Returns:
DSRequest
instance, for chaining setter calls
-
getExportHeaderless
This property allows omitting column names from CSV and Excel exports (no effect on JSON or XML exports).- Returns:
- Current exportHeaderless value. Default value is false
-
setExportImageFormat
The image format in which the SVG graphic should be exported.- Parameters:
exportImageFormat
- New exportImageFormat value. Default value is "png"- Returns:
DSRequest
instance, for chaining setter calls
-
getExportImageFormat
The image format in which the SVG graphic should be exported.- Returns:
- Current exportImageFormat value. Default value is "png"
-
setExportImageQuality
Deprecated.If exporting inJPEG format
, the output JPEG quality level. This is a number from 0 to 1, with 1 representing the best quality and 0 representing the least quality but smallest file size.- Parameters:
exportImageQuality
- New exportImageQuality value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getExportImageQuality
Deprecated.If exporting inJPEG format
, the output JPEG quality level. This is a number from 0 to 1, with 1 representing the best quality and 0 representing the least quality but smallest file size.- Returns:
- Current exportImageQuality value. Default value is null
-
setExportImageQuality
If exporting inJPEG format
, the output JPEG quality level. This is a number from 0 to 1, with 1 representing the best quality and 0 representing the least quality but smallest file size.- Parameters:
exportImageQuality
- New exportImageQuality value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getExportImageQualityAsDouble
If exporting inJPEG format
, the output JPEG quality level. This is a number from 0 to 1, with 1 representing the best quality and 0 representing the least quality but smallest file size.- Returns:
- Current exportImageQuality value. Default value is null
-
setExportNumbersAsFormattedString
When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces numbers to export as a string rather than a true numerical value.If a number is provided to a spreadsheet as a string, Excel or other spreadsheet applications may not recognize them as being numbers that are valid for use in numerical formulas, filters, etc.
For this reason, the default behavior of
exportClientData
is to provide numerical values to the spreadsheet as true numbers. IfFormat Strings
are provided via properties likedataSourceField.format
these will be translated to Excel / OpenOffice format strings and used when generating spreadsheets. Other formatting logic, such ascell formatters
, will not be used since they cannot be automatically translated to an Excel format string. If no translatable format string is available, numbers will be provided to the spreadsheet with no formatter and the spreadsheet program's default formatting for numerical values will be used.If
exportNumbersAsFormattedString
is set to true, numbers will appear as strings that exactly match the formatting shown in theDataBoundComponent
. As noted above, this means the spreadsheet program will not recognize the value as a number.- Parameters:
exportNumbersAsFormattedString
- New exportNumbersAsFormattedString value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getExportNumbersAsFormattedString
When exporting viaListGrid.exportClientData()
to anXLS
orOOXML
spreadsheet, forces numbers to export as a string rather than a true numerical value.If a number is provided to a spreadsheet as a string, Excel or other spreadsheet applications may not recognize them as being numbers that are valid for use in numerical formulas, filters, etc.
For this reason, the default behavior of
exportClientData
is to provide numerical values to the spreadsheet as true numbers. IfFormat Strings
are provided via properties likedataSourceField.format
these will be translated to Excel / OpenOffice format strings and used when generating spreadsheets. Other formatting logic, such ascell formatters
, will not be used since they cannot be automatically translated to an Excel format string. If no translatable format string is available, numbers will be provided to the spreadsheet with no formatter and the spreadsheet program's default formatting for numerical values will be used.If
exportNumbersAsFormattedString
is set to true, numbers will appear as strings that exactly match the formatting shown in theDataBoundComponent
. As noted above, this means the spreadsheet program will not recognize the value as a number.- Returns:
- Current exportNumbersAsFormattedString value. Default value is null
- See Also:
-
setExportPath
IfexportToFilesystem
is set, optionally specifies a path to use when saving the file. This path is relative to the default export path, which is set using theserver.properties
settingexport.location
; this is the project webRoot by default. For example, with the default setting ofexport.location
, anexportPath
of"shared/ds"
and anexportFilename
of"exportedData.csv"
, Smart GWT Server would export to file$webRoot/shared/ds/exportedData.csv
.If you do not specify this property, Smart GWT Server will export to the file indicated by
exportFilename
directly in the default export location.This property is only applicable when
exportToFilesystem
is set.- Parameters:
exportPath
- New exportPath value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getExportPath
IfexportToFilesystem
is set, optionally specifies a path to use when saving the file. This path is relative to the default export path, which is set using theserver.properties
settingexport.location
; this is the project webRoot by default. For example, with the default setting ofexport.location
, anexportPath
of"shared/ds"
and anexportFilename
of"exportedData.csv"
, Smart GWT Server would export to file$webRoot/shared/ds/exportedData.csv
.If you do not specify this property, Smart GWT Server will export to the file indicated by
exportFilename
directly in the default export location.This property is only applicable when
exportToFilesystem
is set.- Returns:
- Current exportPath value. Default value is null
- See Also:
-
setExportPropertyIdentifier
Determines thePropertyIdentifier
to be used in the exported data. This essentially means, should we export internal field names like "countryCode" or "EMPLOYEE_NO", or localized descriptive field titles like "code du pays" or "Employee Number". This setting has a lot in common withexportRawValues
; both are largely dependent on whether the exported data is intended for direct consumption by an end user (in which case it is appropriate to export formatted values and localized field titles), or for interface to some downstream computer system (in which case you probably want raw, unformatted values and internal field names).If this property is not set, the following defaults apply:
- If the export format is a native spreadsheet format (XLS or OOXML), localized field titles are used
- If the
export format is CSV, XML or JSON and this is a client-driven export (ie it was initiated by a call to
exportClientData()
), localized field titles are used - If the export format is CSV, XML or JSON and this is not a client-driven export, internal field names are used
- Parameters:
exportPropertyIdentifier
- New exportPropertyIdentifier value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getExportPropertyIdentifier
Determines thePropertyIdentifier
to be used in the exported data. This essentially means, should we export internal field names like "countryCode" or "EMPLOYEE_NO", or localized descriptive field titles like "code du pays" or "Employee Number". This setting has a lot in common withexportRawValues
; both are largely dependent on whether the exported data is intended for direct consumption by an end user (in which case it is appropriate to export formatted values and localized field titles), or for interface to some downstream computer system (in which case you probably want raw, unformatted values and internal field names).If this property is not set, the following defaults apply:
- If the export format is a native spreadsheet format (XLS or OOXML), localized field titles are used
- If the
export format is CSV, XML or JSON and this is a client-driven export (ie it was initiated by a call to
exportClientData()
), localized field titles are used - If the export format is CSV, XML or JSON and this is not a client-driven export, internal field names are used
- Returns:
- Current exportPropertyIdentifier value. Default value is null
- See Also:
-
setExportRawValues
Whether formatting settings should be applied to data being exported. Default behavior and the effect of setting ofexportRawValues
is described in theExport Formatting overview
.- Parameters:
exportRawValues
- New exportRawValues value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getExportRawValues
Whether formatting settings should be applied to data being exported. Default behavior and the effect of setting ofexportRawValues
is described in theExport Formatting overview
.- Returns:
- Current exportRawValues value. Default value is null
- See Also:
-
setExportResults
When set, causes the results of the DSRequest to be exported to a file, whose name and format are indicated byexportFilename
andexportAs
respectively. When no exportFilename is provided, the default is Results.csv and the default value of exportAs is csv.The export field-list can also be configured, see
exportFields
. Formats for exported date and numeric are controlled by several settings - seeExportFormatting
for an overview.Once the operation completes,
exportDisplay
specifies whether the exported data should be downloaded to the file-system or displayed in a new window. The default value of exportDisplay is "download" which displays the Save As dialog. SeeExportDisplay
for more information.You can configure the style of
line-breaks
to use when generating the output, thedelimiter
to use when exporting to CSV and theseparator-character
to use in field-titles when exporting to XML.Additionally, you can output arbitrary text before and after the exported data by setting
exportHeader
andexportFooter
.Note that for security reasons, an export initiated using dsRequest properties does not provide support for JSON format (see this post for more detail). However, you can use operationBinding.exportAs:"json" in a server-side .ds.xml file to force JSON export to be allowed.
As well as setting dsRequest.exportResults and related properties, exports can be initiated in two other ways, via
OperationBinding
s and via custom server code which sets export-related properties on theDSResponse
. Both of those methods support exporting to JSON format.Format Examples XML format
<List> <Object> <id>10101</id> <displayName>Record 10101</displayName> </Object> </List>
JSON Format[ { id: 10101, displayName: "Record 10101" } ]
CSV Formatid,displayName 10101,"Record 10101"
- Parameters:
exportResults
- New exportResults value. Default value is false- Returns:
DSRequest
instance, for chaining setter calls
-
getExportResults
When set, causes the results of the DSRequest to be exported to a file, whose name and format are indicated byexportFilename
andexportAs
respectively. When no exportFilename is provided, the default is Results.csv and the default value of exportAs is csv.The export field-list can also be configured, see
exportFields
. Formats for exported date and numeric are controlled by several settings - seeExportFormatting
for an overview.Once the operation completes,
exportDisplay
specifies whether the exported data should be downloaded to the file-system or displayed in a new window. The default value of exportDisplay is "download" which displays the Save As dialog. SeeExportDisplay
for more information.You can configure the style of
line-breaks
to use when generating the output, thedelimiter
to use when exporting to CSV and theseparator-character
to use in field-titles when exporting to XML.Additionally, you can output arbitrary text before and after the exported data by setting
exportHeader
andexportFooter
.Note that for security reasons, an export initiated using dsRequest properties does not provide support for JSON format (see this post for more detail). However, you can use operationBinding.exportAs:"json" in a server-side .ds.xml file to force JSON export to be allowed.
As well as setting dsRequest.exportResults and related properties, exports can be initiated in two other ways, via
OperationBinding
s and via custom server code which sets export-related properties on theDSResponse
. Both of those methods support exporting to JSON format.Format Examples XML format
<List> <Object> <id>10101</id> <displayName>Record 10101</displayName> </Object> </List>
JSON Format[ { id: 10101, displayName: "Record 10101" } ]
CSV Formatid,displayName 10101,"Record 10101"
- Returns:
- Current exportResults value. Default value is false
-
setExportShowHeaderSpanTitles
When you erxport aListGrid
that hasheaderSpans
, should headerSpans also be exported. SeeexportSpanTitleSeparator
for details of of what it means to export headerSpans to different export targets.Note that
exportPropertyIdentifier
controls whether field names or titles are appended to the headerSpan titles (and used for fields without headerSpans).- Parameters:
exportShowHeaderSpanTitles
- New exportShowHeaderSpanTitles value. Default value is true- Returns:
DSRequest
instance, for chaining setter calls
-
getExportShowHeaderSpanTitles
When you erxport aListGrid
that hasheaderSpans
, should headerSpans also be exported. SeeexportSpanTitleSeparator
for details of of what it means to export headerSpans to different export targets.Note that
exportPropertyIdentifier
controls whether field names or titles are appended to the headerSpan titles (and used for fields without headerSpans).- Returns:
- Current exportShowHeaderSpanTitles value. Default value is true
-
setExportSpanTitleSeparator
When you export aListGrid
that hasheaderSpans
defined andexportShowHeaderSpanTitles
is true, the behavior is dependent on the export type. Direct exports to Excel formats (both XLS and OOXML) place the headerSpans in merged cells in the spreadsheet, giving the same visual effect as the original ListGrid. This is not possible with exports to CSV format; instead, we alter the exported headers so that they contain the titles of the ancestor headerSpan(s).For example, if you had a field titled "Population" inside a headerSpan titled "National", nested inside another headerSpan titled "Demographics", that would result in the exported field being titled "Demographics - National - Population".
The
exportSpanTitleSeparator
property allows you to override the separator string used when constructing these amalgamated headers.- Parameters:
exportSpanTitleSeparator
- New exportSpanTitleSeparator value. Default value is " - "- Returns:
DSRequest
instance, for chaining setter calls
-
getExportSpanTitleSeparator
When you export aListGrid
that hasheaderSpans
defined andexportShowHeaderSpanTitles
is true, the behavior is dependent on the export type. Direct exports to Excel formats (both XLS and OOXML) place the headerSpans in merged cells in the spreadsheet, giving the same visual effect as the original ListGrid. This is not possible with exports to CSV format; instead, we alter the exported headers so that they contain the titles of the ancestor headerSpan(s).For example, if you had a field titled "Population" inside a headerSpan titled "National", nested inside another headerSpan titled "Demographics", that would result in the exported field being titled "Demographics - National - Population".
The
exportSpanTitleSeparator
property allows you to override the separator string used when constructing these amalgamated headers.- Returns:
- Current exportSpanTitleSeparator value. Default value is " - "
-
setExportStreaming
When exporting to OOXML format (this is the standard file format used by Excel 2007 and later), we default to using streaming mode, for memory efficiency. You can override this for individual exports by setting this flag false. You may wish to do this if you need to grab the spreadsheet object in a DMI and do something with it. The underlying object in use - POI'sSXSSFWorkbook
- is intended for write only and cannot usefully be read.You can switch off Excel streaming altogether by setting "excel.useStreaming" false in
server.properties
.Note, OOXML is the only native Excel format that supports streaming: when exporting to the older XLS format, we build the spreadsheet in its entirety in server-side memory before writing it to disk or returning it to the client. This is unlikely to change: streaming the XLS format is impractical bcause it is a self-referential binary format, and in any case the problem of huge exports overflowing JVM memory is less likely to arise with XLS, because it is innately limited to 65535 rows.
- Parameters:
exportStreaming
- New exportStreaming value. Default value is true- Returns:
DSRequest
instance, for chaining setter calls
-
getExportStreaming
public boolean getExportStreaming()When exporting to OOXML format (this is the standard file format used by Excel 2007 and later), we default to using streaming mode, for memory efficiency. You can override this for individual exports by setting this flag false. You may wish to do this if you need to grab the spreadsheet object in a DMI and do something with it. The underlying object in use - POI'sSXSSFWorkbook
- is intended for write only and cannot usefully be read.You can switch off Excel streaming altogether by setting "excel.useStreaming" false in
server.properties
.Note, OOXML is the only native Excel format that supports streaming: when exporting to the older XLS format, we build the spreadsheet in its entirety in server-side memory before writing it to disk or returning it to the client. This is unlikely to change: streaming the XLS format is impractical bcause it is a self-referential binary format, and in any case the problem of huge exports overflowing JVM memory is less likely to arise with XLS, because it is innately limited to 65535 rows.
- Returns:
- Current exportStreaming value. Default value is true
-
setExportTitleSeparatorChar
The character with which to replace spaces in field-titles when exporting to XML. If not specified in the request, the server uses "".- Parameters:
exportTitleSeparatorChar
- New exportTitleSeparatorChar value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getExportTitleSeparatorChar
The character with which to replace spaces in field-titles when exporting to XML. If not specified in the request, the server uses "".- Returns:
- Current exportTitleSeparatorChar value. Default value is null
-
setExportToClient
If set to true (the default), Smart GWT Server will export data back to the client, either as a file download or as content in a new browser window, depending on the setting ofexportDisplay
.Setting this property to false disables this. This may be useful when developers wish to
export the data to a file on the server fileSystem
, but do not need to display it in the browser in response to the export request.Note that it is perfectly valid to have both this property and
exportToFilesystem
set to true; in this case the data is both exported to a file on the server filesystem, and downloaded to the client. If you specify neither property, the export no-ops.- Parameters:
exportToClient
- New exportToClient value. Default value is true- Returns:
DSRequest
instance, for chaining setter calls
-
getExportToClient
If set to true (the default), Smart GWT Server will export data back to the client, either as a file download or as content in a new browser window, depending on the setting ofexportDisplay
.Setting this property to false disables this. This may be useful when developers wish to
export the data to a file on the server fileSystem
, but do not need to display it in the browser in response to the export request.Note that it is perfectly valid to have both this property and
exportToFilesystem
set to true; in this case the data is both exported to a file on the server filesystem, and downloaded to the client. If you specify neither property, the export no-ops.- Returns:
- Current exportToClient value. Default value is true
-
setExportToFilesystem
If set, Smart GWT Server will export data to a file on the server filesystem. The file we export to is determined by theexportFilename
andexportPath
. Note that filesystem exports are disabled by default, for security reasons. To enable them, setexport.allow.filesystem
to true in yourserver.properties
file. If you enable filesystem exports, you should also consider setting a default export path, as described in theexportPath
documentation.Note that it is perfectly valid to specify both this property and
exportToClient
; in this case the data is both exported to a file on the server filesystem and downloaded to the client. If you specify neither property, the export no-ops.It is possible to redirect the filesystem export to make use of an
OutputStream
you provide. You use this when you want to make some use of the export document other than writing it to a disk file - for example, attaching it to an email or writing it to a database table. See the server-side Javadocs forDSRequest.setExportTo()
.- Parameters:
exportToFilesystem
- New exportToFilesystem value. Default value is false- Returns:
DSRequest
instance, for chaining setter calls
-
getExportToFilesystem
If set, Smart GWT Server will export data to a file on the server filesystem. The file we export to is determined by theexportFilename
andexportPath
. Note that filesystem exports are disabled by default, for security reasons. To enable them, setexport.allow.filesystem
to true in yourserver.properties
file. If you enable filesystem exports, you should also consider setting a default export path, as described in theexportPath
documentation.Note that it is perfectly valid to specify both this property and
exportToClient
; in this case the data is both exported to a file on the server filesystem and downloaded to the client. If you specify neither property, the export no-ops.It is possible to redirect the filesystem export to make use of an
OutputStream
you provide. You use this when you want to make some use of the export document other than writing it to a disk file - for example, attaching it to an email or writing it to a database table. See the server-side Javadocs forDSRequest.setExportTo()
.- Returns:
- Current exportToFilesystem value. Default value is false
-
setExportTZ
For server-side export withExportFormat
"xls" or "ooxml" only, timezone to use when saving values fromFieldType
"datetime" to the spreadsheet.This setting exists because MS Excel™ has no concept of providing a true datetime value that is timezone-independent and will display in the local timezone where the Excel program is launched. This setting sets the timezone of the Excel workbook, so that it will display dates in the same timezone regardless of the local timezone where the Excel program is launched. Alternative approach is to set
exportDatesAsFormattedString=true
telling datetime values must be provided as a rendered string, which implies rendering in a particular timezone when the spreadsheet is generated.exportTZ
can either be specified as a timezone offset in the same format expected by String (for example, "+01:00" for one hour after GMT) or as the special constants "client" (meaning the current client display timezone) or "server" (meaning the timezone of the server).Default if unspecified is "server".
This setting does not affect fields of type "date" or "time", which are timezone-independent values. See
DateFormatAndStorage
for more information on how Smart GWT handles date, time and datetime values.All non-spreadsheet export formats always use UTC. This setting also does not affect client-driven exports (
DataSource.exportClientData()
), which always use client-side time.- Parameters:
exportTZ
- New exportTZ value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getExportTZ
For server-side export withExportFormat
"xls" or "ooxml" only, timezone to use when saving values fromFieldType
"datetime" to the spreadsheet.This setting exists because MS Excel™ has no concept of providing a true datetime value that is timezone-independent and will display in the local timezone where the Excel program is launched. This setting sets the timezone of the Excel workbook, so that it will display dates in the same timezone regardless of the local timezone where the Excel program is launched. Alternative approach is to set
exportDatesAsFormattedString=true
telling datetime values must be provided as a rendered string, which implies rendering in a particular timezone when the spreadsheet is generated.exportTZ
can either be specified as a timezone offset in the same format expected by String (for example, "+01:00" for one hour after GMT) or as the special constants "client" (meaning the current client display timezone) or "server" (meaning the timezone of the server).Default if unspecified is "server".
This setting does not affect fields of type "date" or "time", which are timezone-independent values. See
DateFormatAndStorage
for more information on how Smart GWT handles date, time and datetime values.All non-spreadsheet export formats always use UTC. This setting also does not affect client-driven exports (
DataSource.exportClientData()
), which always use client-side time.- Returns:
- Current exportTZ value. Default value is null
- See Also:
-
setExportValueFields
This flag has a different meaning depending on whether you are doing a client-driven or server-driven export.For
exportClientData()
calls (client-driven), ordinarily any fields that have adisplayField
defined have the value of that displayField exported, rather than the underlying value in thevalueField
. If you set theexportValueFields
property, we export both the underlying value and the displayField value.Again for
exportClientData()
calls, any fields that have avalueMap
defined ordinarily have the mapped value of the field exported, rather than the underlying data value. If you set theexportValueFields
property, we instead export the underlying data value. Note, there is only one field in this scenario, not avalueField
and a separatedisplayField
, so we export either the underlying data value or the mapped value, not both as in thedisplayField
/valueField
case described above.For
exportData()
calls (server-driven), we ordinarily export the underlying data value of all fields. However, if you set theexportValueFields
property explicitly tofalse
, any fields that have a DataSource-definedvalueMap
will have the mapped value exported instead. This is similar to the client-side treatment of valueMaps, except that the defaults are reversed.For
exportData()
calls, if we encounter a field that has an in-recorddisplayField
declared in the DataSource, by default we export both the underlying value and the display value, so you end up with two columns in the exported data for that field. You can influence this by settingexportValueFields
explicitly: if settrue
we export only the value field, and if setfalse
we export only the display field. Note, the reason for the similar but not identical behavior of this flag betweenexportData()
andexportClientData()
is backwards compatibility.- Parameters:
exportValueFields
- New exportValueFields value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getExportValueFields
This flag has a different meaning depending on whether you are doing a client-driven or server-driven export.For
exportClientData()
calls (client-driven), ordinarily any fields that have adisplayField
defined have the value of that displayField exported, rather than the underlying value in thevalueField
. If you set theexportValueFields
property, we export both the underlying value and the displayField value.Again for
exportClientData()
calls, any fields that have avalueMap
defined ordinarily have the mapped value of the field exported, rather than the underlying data value. If you set theexportValueFields
property, we instead export the underlying data value. Note, there is only one field in this scenario, not avalueField
and a separatedisplayField
, so we export either the underlying data value or the mapped value, not both as in thedisplayField
/valueField
case described above.For
exportData()
calls (server-driven), we ordinarily export the underlying data value of all fields. However, if you set theexportValueFields
property explicitly tofalse
, any fields that have a DataSource-definedvalueMap
will have the mapped value exported instead. This is similar to the client-side treatment of valueMaps, except that the defaults are reversed.For
exportData()
calls, if we encounter a field that has an in-recorddisplayField
declared in the DataSource, by default we export both the underlying value and the display value, so you end up with two columns in the exported data for that field. You can influence this by settingexportValueFields
explicitly: if settrue
we export only the value field, and if setfalse
we export only the display field. Note, the reason for the similar but not identical behavior of this flag betweenexportData()
andexportClientData()
is backwards compatibility.- Returns:
- Current exportValueFields value. Default value is null
-
setFieldValueExpressions
A set of key:value pairs, mapping field names to expressions that will be evaluated server-side to derive a value for that field. This property allows for client-drivenTransaction Chaining
, with some restrictions for security reasons:- Normal
server-side Transaction Chaining settings
for a field take precedence over this property, so server-defined rules cannot be overridden from the client - Arbitrary Velocity expressions are not allowed in DSRequests sent from the client
(
fieldValueExpressions
is also a valid property on a server-side DSRequest, and normal Velocity expressions are allowed in that case - see the server-side Javadoc forDSRequest.setFieldValueExpressions()
). For client-originated requests, only the following bindings are allowed - see theVelocity overview
for details of what these values mean:- $currentDate
- $currentDateUTC
- $transactionDate
- $transactionDateUTC
- $userId
- $masterId - see
DSRequestModifier.value
for details - References to specific fields in prior responses, via $responseData.first and
$responseData.last, with or without parameters. For example,
$responseData.first("myDataSource", "fetch")[0].myField. See the
Velocity overview
for details of $responseData - References to certain metadata properties of prior responses, via $responses.first
and $responses.last, with or without parameters. For example,
$responses.last("myDataSource", "fetch").totalRows. Note that the only
properties allowed in a client-driven
fieldValueExpression
are: "startRow", "endRow", "totalRows" and "status"; this restriction does not apply to server-drivenfieldValueExpressions
. See the Velocity overview for details of $responses
- Normal
declarative security rules
apply: if a field is not valid for writing, itsfieldValueExpression
will be ignored. Again, this only applies to client-originated requests.
fieldValueExpression
in client-originated requests by setting a flag in yourserver.properties
file:dataSource.allowClientFieldValueExpressions: false
- Parameters:
fieldValueExpressions
- New fieldValueExpressions value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
- Normal
-
getFieldValueExpressions
A set of key:value pairs, mapping field names to expressions that will be evaluated server-side to derive a value for that field. This property allows for client-drivenTransaction Chaining
, with some restrictions for security reasons:- Normal
server-side Transaction Chaining settings
for a field take precedence over this property, so server-defined rules cannot be overridden from the client - Arbitrary Velocity expressions are not allowed in DSRequests sent from the client
(
fieldValueExpressions
is also a valid property on a server-side DSRequest, and normal Velocity expressions are allowed in that case - see the server-side Javadoc forDSRequest.setFieldValueExpressions()
). For client-originated requests, only the following bindings are allowed - see theVelocity overview
for details of what these values mean:- $currentDate
- $currentDateUTC
- $transactionDate
- $transactionDateUTC
- $userId
- $masterId - see
DSRequestModifier.value
for details - References to specific fields in prior responses, via $responseData.first and
$responseData.last, with or without parameters. For example,
$responseData.first("myDataSource", "fetch")[0].myField. See the
Velocity overview
for details of $responseData - References to certain metadata properties of prior responses, via $responses.first
and $responses.last, with or without parameters. For example,
$responses.last("myDataSource", "fetch").totalRows. Note that the only
properties allowed in a client-driven
fieldValueExpression
are: "startRow", "endRow", "totalRows" and "status"; this restriction does not apply to server-drivenfieldValueExpressions
. See the Velocity overview for details of $responses
- Normal
declarative security rules
apply: if a field is not valid for writing, itsfieldValueExpression
will be ignored. Again, this only applies to client-originated requests.
fieldValueExpression
in client-originated requests by setting a flag in yourserver.properties
file:dataSource.allowClientFieldValueExpressions: false
- Returns:
- Current fieldValueExpressions value. Default value is null
- See Also:
- Normal
-
setGenerateRelatedUpdates
Specifies should related updates have to be generated. If not set (or set tonull
) then related updates will be generated only for "add" and "update" operations. This property has to be explicitly set totrue
to generate related updates for "remove" operation. This functionality loads related objects from database thus affecting operation performance. For "add" and "update" operations related objects are loaded anyway and performance impact is minimal. Simple "remove" operation does not need to load related objects. Depending on database structure performance impact can be significant if this property is set totrue
.Note this feature works only with Hibernate/JPA data sources, see
JPA & Hibernate Relations
for instructions how to set up relations. Table below uses "country -> cities" sample data model.Relation and Operation type Loading complete related objects Loading related IDs Many-to-one (cities -> country): ADD/UPDATE If operation affected country, for example new city added with existing countryId, then relatedUpdate is generated. Otherwise if city is added or updated without countryId set, relatedUpdate is not generated.
Note that if provided countryId does not exist, it is created.Same as with complete related objects, except if provided countryId does not exist, then it is not created, but reset to NULL. Many-to-one (cities -> country): REMOVE Removes record, depending on setting generates or not relatedUpdate for parent record. For example if city record is removed and countryId is sent to the server in remove request, then country record will be generated in relatedUpdates. One-to-many (country -> cities): ADD/UPDATE If add or update operation provides value sets for cities as well as for country, then cities are created/updated if necessary and relatedUpdates are generated.
Note that all fields in cities value sets can be sent to server.Same as with complete related objects, except you can only sent primary key values for cities. One-to-many (country -> cities): REMOVE Removes country, depending on setting returns or not relatedUpdates for the cities of removed country, which can be either REMOVE operations of all cities if cascade enabled, or UPDATE operations setting countryId=null to all cities if cascade is disabled Note that Many-to-Many works the same way as One-to-Many.
- Parameters:
generateRelatedUpdates
- New generateRelatedUpdates value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getGenerateRelatedUpdates
Specifies should related updates have to be generated. If not set (or set tonull
) then related updates will be generated only for "add" and "update" operations. This property has to be explicitly set totrue
to generate related updates for "remove" operation. This functionality loads related objects from database thus affecting operation performance. For "add" and "update" operations related objects are loaded anyway and performance impact is minimal. Simple "remove" operation does not need to load related objects. Depending on database structure performance impact can be significant if this property is set totrue
.Note this feature works only with Hibernate/JPA data sources, see
JPA & Hibernate Relations
for instructions how to set up relations. Table below uses "country -> cities" sample data model.Relation and Operation type Loading complete related objects Loading related IDs Many-to-one (cities -> country): ADD/UPDATE If operation affected country, for example new city added with existing countryId, then relatedUpdate is generated. Otherwise if city is added or updated without countryId set, relatedUpdate is not generated.
Note that if provided countryId does not exist, it is created.Same as with complete related objects, except if provided countryId does not exist, then it is not created, but reset to NULL. Many-to-one (cities -> country): REMOVE Removes record, depending on setting generates or not relatedUpdate for parent record. For example if city record is removed and countryId is sent to the server in remove request, then country record will be generated in relatedUpdates. One-to-many (country -> cities): ADD/UPDATE If add or update operation provides value sets for cities as well as for country, then cities are created/updated if necessary and relatedUpdates are generated.
Note that all fields in cities value sets can be sent to server.Same as with complete related objects, except you can only sent primary key values for cities. One-to-many (country -> cities): REMOVE Removes country, depending on setting returns or not relatedUpdates for the cities of removed country, which can be either REMOVE operations of all cities if cascade enabled, or UPDATE operations setting countryId=null to all cities if cascade is disabled Note that Many-to-Many works the same way as One-to-Many.
- Returns:
- Current generateRelatedUpdates value. Default value is null
-
setGroupBy
List of fields to group by when usingserver-side summarization
.Valid only for an operation of type "fetch". See the
Server Summaries overview
for details and examples of usage.- Parameters:
groupBy
- New groupBy value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getGroupBy
List of fields to group by when usingserver-side summarization
.Valid only for an operation of type "fetch". See the
Server Summaries overview
for details and examples of usage.- Returns:
- Current groupBy value. Default value is null
- See Also:
-
setHeaderData
For DataSources using SOAP messaging with a WSDL web service, data to be serialized to form SOAP headers, as a map from the header part name to the data. SeeWSRequest.headerData
for more information.SOAP headers typically contain request metadata such as a session id for authentication, and so
dsRequest.headerData
is typically populated byDataSource.transformRequest()
, or, for data that applies to every request sent to the server, byWebService.getHeaderData()
.Note that this only applies to SOAP headers. General HTTP headers for requests may be modified using
RPCRequest.httpHeaders
.- Parameters:
headerData
- New headerData value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getHeaderData
For DataSources using SOAP messaging with a WSDL web service, data to be serialized to form SOAP headers, as a map from the header part name to the data. SeeWSRequest.headerData
for more information.SOAP headers typically contain request metadata such as a session id for authentication, and so
dsRequest.headerData
is typically populated byDataSource.transformRequest()
, or, for data that applies to every request sent to the server, byWebService.getHeaderData()
.Note that this only applies to SOAP headers. General HTTP headers for requests may be modified using
RPCRequest.httpHeaders
.- Returns:
- Current headerData value. Default value is null
-
setKeepParentsOnFilter
This property is for advanced use in integrating trees thatload data on demand
using data paging. When this flag is set, a server fetch operation is expected to return all of the tree nodes that either match the provided criteria or have one or more children that match the criteria.A ResultTree with
fetchMode:"paged"
and withkeepParentsOnFilter
enabled will automatically set this property totrue
on all DSRequests that it sends to the server.Currently, no built-in server-side connectors (SQL, JPA, Hibernate) implement support for the keepParentsOnFilter flag.
- Parameters:
keepParentsOnFilter
- New keepParentsOnFilter value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getKeepParentsOnFilter
This property is for advanced use in integrating trees thatload data on demand
using data paging. When this flag is set, a server fetch operation is expected to return all of the tree nodes that either match the provided criteria or have one or more children that match the criteria.A ResultTree with
fetchMode:"paged"
and withkeepParentsOnFilter
enabled will automatically set this property totrue
on all DSRequests that it sends to the server.Currently, no built-in server-side connectors (SQL, JPA, Hibernate) implement support for the keepParentsOnFilter flag.
- Returns:
- Current keepParentsOnFilter value. Default value is null
- See Also:
-
setLineBreakStyle
The style of line-breaks to use in the exported output. SeeLineBreakStyle
for more information.- Parameters:
lineBreakStyle
- New lineBreakStyle value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getLineBreakStyle
The style of line-breaks to use in the exported output. SeeLineBreakStyle
for more information.- Returns:
- Current lineBreakStyle value. Default value is null
-
setLinkDataFetchOperation
For a databoundmulti-link tree
, this is theoperationId
to use for the separate fetch on theResultTree.linkDataSource
that will be generated ifLinkDataFetchMode
is "separate". This property overrides thelinkDataFetchOperation
property onResultTree
, for this fetch only.Ignored if this DSRequest is not a fetch against a multi-link tree.
- Parameters:
linkDataFetchOperation
- New linkDataFetchOperation value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getLinkDataFetchOperation
For a databoundmulti-link tree
, this is theoperationId
to use for the separate fetch on theResultTree.linkDataSource
that will be generated ifLinkDataFetchMode
is "separate". This property overrides thelinkDataFetchOperation
property onResultTree
, for this fetch only.Ignored if this DSRequest is not a fetch against a multi-link tree.
- Returns:
- Current linkDataFetchOperation value. Default value is null
-
setOldValues
For anupdate
orremove
operation, the original values from the record that is being updated or removed.oldValues
is automatically added to DSRequests submitted by DataBound Components. Available on the server viaDSRequest.getOldValues()
.The server can compare the
oldValues
to the most recent stored values in order to detect that the user was looking at stale values when the user submitted changes (NOTE: this means of detecting concurrent edit is sometimes called "optimistic concurrency" or "long transactions").In applications where a policy of "last update wins" is not appropriate when updating certain fields, special UI can be shown for this case. For example, on detecting concurrent edit, the server may send back a special
dsResponse.status
code that the client application detects, offering the user a choice of proceeding with the operation, discarding edits, or reconciling new and old values in a special interface.See the
ConcurrentEdits
overview for more on handling concurrent edits in Smart GWT DataSources.- Parameters:
oldValues
- New oldValues value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getOldValues
For anupdate
orremove
operation, the original values from the record that is being updated or removed.oldValues
is automatically added to DSRequests submitted by DataBound Components. Available on the server viaDSRequest.getOldValues()
.The server can compare the
oldValues
to the most recent stored values in order to detect that the user was looking at stale values when the user submitted changes (NOTE: this means of detecting concurrent edit is sometimes called "optimistic concurrency" or "long transactions").In applications where a policy of "last update wins" is not appropriate when updating certain fields, special UI can be shown for this case. For example, on detecting concurrent edit, the server may send back a special
dsResponse.status
code that the client application detects, offering the user a choice of proceeding with the operation, discarding edits, or reconciling new and old values in a special interface.See the
ConcurrentEdits
overview for more on handling concurrent edits in Smart GWT DataSources.- Returns:
- Current oldValues value. Default value is null
-
setOperationId
When aDataBoundComponent
sends a DSRequest, thedsRequest.operationId
will be automatically picked up from thefetchOperation
,addOperation
, etc properties of the DataBoundComponent.The
operationId
serves as an identifier that you can use to create variations on the 4 basic DataSource operations that are used by different components in different parts of your application. For example, you may be using a standardfetch
operation in one part of your application, however on another screen you want to perform afetch
operation on the same DataSource but interpret search criteria differently (eg full text search).If you declare more than one
OperationBinding
for the sameOperationBinding.operationType
, you can specify anoperationId
on the operationBinding
which will cause that operationBinding to be used for dsRequests containing a matchingoperationId
. This allows all the possible settings of anoperationBinding
, includingwsOperation
orDMI
settings, to be switched on a per-component or per-request basis.For example, by setting the
fetchOperation
on a particular ListGrid, you could cause it to invoke a different server method via DMI, differentdataURL
or differentweb service operation
.The
operationId
can also be directly received by the server in order to affect behavior. When using the Smart GWT Server,operationId
can be accessed via dsRequest.getOperationId(). TheRestDataSource
will also send theoperationId
to the server as part of therequest metadata
.Note that if you
manually invoke
a DataSource operation, you can also specify operationId via therequestProperties
parameter.Note that the
operationId
has special significance in terms of whether two DSRequests are considered equivalent for caching and synchronization purposes - seeDsRequestEquivalence
.- Parameters:
operationId
- New operationId value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getOperationId
When aDataBoundComponent
sends a DSRequest, thedsRequest.operationId
will be automatically picked up from thefetchOperation
,addOperation
, etc properties of the DataBoundComponent.The
operationId
serves as an identifier that you can use to create variations on the 4 basic DataSource operations that are used by different components in different parts of your application. For example, you may be using a standardfetch
operation in one part of your application, however on another screen you want to perform afetch
operation on the same DataSource but interpret search criteria differently (eg full text search).If you declare more than one
OperationBinding
for the sameOperationBinding.operationType
, you can specify anoperationId
on the operationBinding
which will cause that operationBinding to be used for dsRequests containing a matchingoperationId
. This allows all the possible settings of anoperationBinding
, includingwsOperation
orDMI
settings, to be switched on a per-component or per-request basis.For example, by setting the
fetchOperation
on a particular ListGrid, you could cause it to invoke a different server method via DMI, differentdataURL
or differentweb service operation
.The
operationId
can also be directly received by the server in order to affect behavior. When using the Smart GWT Server,operationId
can be accessed via dsRequest.getOperationId(). TheRestDataSource
will also send theoperationId
to the server as part of therequest metadata
.Note that if you
manually invoke
a DataSource operation, you can also specify operationId via therequestProperties
parameter.Note that the
operationId
has special significance in terms of whether two DSRequests are considered equivalent for caching and synchronization purposes - seeDsRequestEquivalence
.- Returns:
- Current operationId value. Default value is null
- See Also:
-
setOperationType
Type of operation being performed: "fetch", "add", "remove", "update" or "custom".This property is generally automatically populated, for example when calling
fetchData()
on a DataSource or DataBound component the operationType is automatically set to "fetch". Note that "custom" operations are never generated automatically, they are always fired by your code.- Parameters:
operationType
- New operationType value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getOperationType
Type of operation being performed: "fetch", "add", "remove", "update" or "custom".This property is generally automatically populated, for example when calling
fetchData()
on a DataSource or DataBound component the operationType is automatically set to "fetch". Note that "custom" operations are never generated automatically, they are always fired by your code.- Returns:
- Current operationType value. Default value is null
-
setOutputs
The list of fields to return in the response, specified as a comma-separated string (eg,"foo, bar, baz"
). You can use this property to indicate to the server that you are only interested in a subset of the fields that would normally be returned.Note that you cannot use this property to request a superset of the fields that would normally be returned, because that would be a security hole. It is possible to configure individual
OperationBinding
s to return extra fields, but this must be done in the server'sDataSource
descriptor; it cannot be altered on the fly from the client side.Also, this setting is overridden by the
DataSourceField.outputWhen
setting, meaning that if a field is listed in request.outputs, but does not match the type of condition of outputWhen setting, it won't be returned to the client.Further, this setting is overridden by the
ListGrid.fetchFields
setting, which will include all visible fields along with any fields it specifies.- Parameters:
outputs
- New outputs value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getOutputs
The list of fields to return in the response, specified as a comma-separated string (eg,"foo, bar, baz"
). You can use this property to indicate to the server that you are only interested in a subset of the fields that would normally be returned.Note that you cannot use this property to request a superset of the fields that would normally be returned, because that would be a security hole. It is possible to configure individual
OperationBinding
s to return extra fields, but this must be done in the server'sDataSource
descriptor; it cannot be altered on the fly from the client side.Also, this setting is overridden by the
DataSourceField.outputWhen
setting, meaning that if a field is listed in request.outputs, but does not match the type of condition of outputWhen setting, it won't be returned to the client.Further, this setting is overridden by the
ListGrid.fetchFields
setting, which will include all visible fields along with any fields it specifies.- Returns:
- Current outputs value. Default value is null
- See Also:
-
getParentNode
For advanced use in integrating trees thatload data on demand
with web services,parentNode
is automatically set in "fetch" DSRequests issued by a databound TreeGrid that is loading children for thatparentNode
.This is sometimes needed if a web service requires that additional properties beyond the ID of the parentNode must be passed in order to accomplished level-by-level loading. A custom implementation of
DataSource.transformRequest()
can access dsRequest.parentNode and add any such properties todata
.parentNode
will also be automatically set by a TreeGrid performing databound reparenting of nodes, as implemented byTreeGrid.folderDrop()
.This property can only be read. There is no meaning to setting this property yourself.
- Returns:
- Current parentNode value. Default value is null
-
setPendingAdd
Indicates that a validation request is being made for a record that will ultimately be saved with an "add" request, as opposed to an "update" request. This context is necessary for some validators because the nature of the validation depends on whether we are adding or updating a record. The system sets this flag when processing interim validations, such as those fired whenDynamicForm.validateOnChange
is in force.- Parameters:
pendingAdd
- New pendingAdd value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getPendingAdd
Indicates that a validation request is being made for a record that will ultimately be saved with an "add" request, as opposed to an "update" request. This context is necessary for some validators because the nature of the validation depends on whether we are adding or updating a record. The system sets this flag when processing interim validations, such as those fired whenDynamicForm.validateOnChange
is in force.- Returns:
- Current pendingAdd value. Default value is null
-
setProgressiveLoading
Setsprogressive loading mode
for this particular request, overriding the OperationBinding- and DataSource-level settings. This setting overrides theprogressiveLoadingThreshold
setting as well, meaning that ifDSRequest.progressiveLoading
is explicitly set tofalse
Smart GWT won't automatically switch to loading data progressively even ifDataSource.progressiveLoadingThreshold
is exceeded.Note that this setting applies only to fetch requests - it has no effect if specified on any other kind of request.
- Parameters:
progressiveLoading
- New progressiveLoading value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getProgressiveLoading
Setsprogressive loading mode
for this particular request, overriding the OperationBinding- and DataSource-level settings. This setting overrides theprogressiveLoadingThreshold
setting as well, meaning that ifDSRequest.progressiveLoading
is explicitly set tofalse
Smart GWT won't automatically switch to loading data progressively even ifDataSource.progressiveLoadingThreshold
is exceeded.Note that this setting applies only to fetch requests - it has no effect if specified on any other kind of request.
- Returns:
- Current progressiveLoading value. Default value is null
- See Also:
-
getRequestId
Automatically generated unique ID for this request. This ID will be required by developers making use of the"clientCustom" dataProtocol
.- Returns:
- Current requestId value. Default value is varies
-
getResultSet
For advanced use in integrating dataset paging with web services, the ResultSet that issued this "fetch" DSRequest is automatically made available as theresultSet
property.This property can only be read. There is no meaning to setting this property yourself.
- Returns:
- Current resultSet value. Default value is null
-
getResultTree
For advanced use in integrating trees thatload data on demand
with web services, the ResultTree that issued this "fetch" DSRequest is automatically made available as theresultTree
property.This property can only be read. There is no meaning to setting this property yourself.
- Returns:
- Current resultTree value. Default value is null
-
setShouldUseCache
This is a per-request flag for explicitly controlling whether the cache is used (bypassing it when not wanted, or using it when settings would indicate otherwise). SeeDataSource.cacheAllData
,DataSource.cacheAllOperationId
andDataSource.cacheAcrossOperationIds
for caching management for all requests of a dataSource.- Parameters:
shouldUseCache
- New shouldUseCache value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getShouldUseCache
This is a per-request flag for explicitly controlling whether the cache is used (bypassing it when not wanted, or using it when settings would indicate otherwise). SeeDataSource.cacheAllData
,DataSource.cacheAllOperationId
andDataSource.cacheAcrossOperationIds
for caching management for all requests of a dataSource.- Returns:
- Current shouldUseCache value. Default value is null
-
setStartRow
Starting row of requested results, used only with fetch operations. If unset, 0 is assumed.Note that startRow and endRow are zero-based, inclusive at the beginning and exclusive at the end (like substring), so startRow: 0, endRow: 1 is a request for the first record.
- Parameters:
startRow
- New startRow value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getStartRow
Starting row of requested results, used only with fetch operations. If unset, 0 is assumed.Note that startRow and endRow are zero-based, inclusive at the beginning and exclusive at the end (like substring), so startRow: 0, endRow: 1 is a request for the first record.
- Returns:
- Current startRow value. Default value is null
-
setStreamResults
If true, results will be streamed on the server, rather than all records being read into server memory at once; this approach is appropriate for retrieving or exporting large datasets without swamping the server.Although this property can be set without any particular concerns (small datasets can be streamed just as readily as large ones), bear in mind that although streaming enables the processing of very large datasets, processing and downloading very large datasets in a normal client/server flow will very rarely give an acceptable user experience. Streaming is of more practical use in a batch setting - for example, a disconnected
export
.Note that streaming requires specific server support; of Smart GWT's built-in DataSource types, only
SQLDataSource
is able to stream results. This property is ignored by other DataSource types. If you wish to implement the necessary server-side behavior to support streaming with a custom DataSource, see the server-side Javadocs forDSResponse.hasNextRecord()
andDSResponse.nextRecordAsObject()
.See also the server-side documentation for
DSResponse
,SQLDataSource
andStreamingResponseIterator
.Note, that streaming results does not support fields with
"concat" summary function
on non-Oracle databases. Such fields will be skipped.- Parameters:
streamResults
- New streamResults value. Default value is false- Returns:
DSRequest
instance, for chaining setter calls
-
getStreamResults
public boolean getStreamResults()If true, results will be streamed on the server, rather than all records being read into server memory at once; this approach is appropriate for retrieving or exporting large datasets without swamping the server.Although this property can be set without any particular concerns (small datasets can be streamed just as readily as large ones), bear in mind that although streaming enables the processing of very large datasets, processing and downloading very large datasets in a normal client/server flow will very rarely give an acceptable user experience. Streaming is of more practical use in a batch setting - for example, a disconnected
export
.Note that streaming requires specific server support; of Smart GWT's built-in DataSource types, only
SQLDataSource
is able to stream results. This property is ignored by other DataSource types. If you wish to implement the necessary server-side behavior to support streaming with a custom DataSource, see the server-side Javadocs forDSResponse.hasNextRecord()
andDSResponse.nextRecordAsObject()
.See also the server-side documentation for
DSResponse
,SQLDataSource
andStreamingResponseIterator
.Note, that streaming results does not support fields with
"concat" summary function
on non-Oracle databases. Such fields will be skipped.- Returns:
- Current streamResults value. Default value is false
-
setTextMatchStyle
For "fetch" operations, how search criteria should be interpreted for text fields: one of "exact" for exact match, "exactCase" for case-sensitive exact match, "startsWith" for matching at the beginning only, or "substring" for substring match. AlltextMatchStyle
settings except "exactCase" are case-insensitive; useAdvancedCriteria
for greater control over matching.This property defaults to the value of
DataSource.defaultTextMatchStyle
if it is not explicitly provided on theDSRequest
. Note, however, that DSRequests issued byListGrid
s and othercomponents
will generally have a setting for textMatchStyle on the component itself (seeListGrid.autoFetchTextMatchStyle
, for example).This setting is respected by the built-in server-side connectors for SQL, JPA and Hibernate. A custom server-side DataSource implementation should generally respect this flag as well, or server-side filtering will not match client-side filtering, which will require
disabling client-side filtering
, a huge performance loss.- Parameters:
textMatchStyle
- New textMatchStyle value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getTextMatchStyle
For "fetch" operations, how search criteria should be interpreted for text fields: one of "exact" for exact match, "exactCase" for case-sensitive exact match, "startsWith" for matching at the beginning only, or "substring" for substring match. AlltextMatchStyle
settings except "exactCase" are case-insensitive; useAdvancedCriteria
for greater control over matching.This property defaults to the value of
DataSource.defaultTextMatchStyle
if it is not explicitly provided on theDSRequest
. Note, however, that DSRequests issued byListGrid
s and othercomponents
will generally have a setting for textMatchStyle on the component itself (seeListGrid.autoFetchTextMatchStyle
, for example).This setting is respected by the built-in server-side connectors for SQL, JPA and Hibernate. A custom server-side DataSource implementation should generally respect this flag as well, or server-side filtering will not match client-side filtering, which will require
disabling client-side filtering
, a huge performance loss.- Returns:
- Current textMatchStyle value. Default value is null
-
setUseFlatFields
WhenuseFlatFields
is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties inrequest.data
will be used as the values for XML elements of the same name, at any level of nesting.useFlatFields
allows you to ignore gratuitous XML message structure, such as extra levels of nested elements, and provides some insulation against changes in the required structure of the input message.For example, given this input message:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>
IfuseFlatFields
were not set, in order to fill out this message correctly,request.data
would need to be:{ searchFor: "search text", Options : { caseSensitive: false, }, IncludeInSearch : { serviceName: true, documentation : true, keywords : true } }
However if useFlatFields were set,request.data
could be just:{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }
useFlatFields
is often set when the input data comes from aDynamicForm
to avoid the cumbersome and fragile process of mapping input fields to an XML structure.OperationBinding.useFlatFields
can also be set to cause all dsRequests of a particular type touseFlatFields
automatically.For
DataBoundComponents
,component.useFlatFields
can be set use "flattened" binding to fields of a WSDL message or XML Schema.Note that
useFlatFields
is not generally recommended for use with XML input messages where multiple simple type fields exist with the same name, however if used in this way, the first field to use a given name wins. "first" means the first field encountered in a depth first search. "wins" means only the first field will be populated in the generated XML message.- Parameters:
useFlatFields
- New useFlatFields value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getUseFlatFields
WhenuseFlatFields
is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties inrequest.data
will be used as the values for XML elements of the same name, at any level of nesting.useFlatFields
allows you to ignore gratuitous XML message structure, such as extra levels of nested elements, and provides some insulation against changes in the required structure of the input message.For example, given this input message:
<FindServices> <searchFor>search text</searchFor> <Options> <caseSensitive>false</caseSensitive> </Options> <IncludeInSearch> <serviceName>true</serviceName> <documentation>true</documentation> <keywords>true</keywords> </IncludeInSearch> </FindServices>
IfuseFlatFields
were not set, in order to fill out this message correctly,request.data
would need to be:{ searchFor: "search text", Options : { caseSensitive: false, }, IncludeInSearch : { serviceName: true, documentation : true, keywords : true } }
However if useFlatFields were set,request.data
could be just:{ searchFor: "search text", caseSensitive: false, serviceName: true, documentation : true, keywords : true }
useFlatFields
is often set when the input data comes from aDynamicForm
to avoid the cumbersome and fragile process of mapping input fields to an XML structure.OperationBinding.useFlatFields
can also be set to cause all dsRequests of a particular type touseFlatFields
automatically.For
DataBoundComponents
,component.useFlatFields
can be set use "flattened" binding to fields of a WSDL message or XML Schema.Note that
useFlatFields
is not generally recommended for use with XML input messages where multiple simple type fields exist with the same name, however if used in this way, the first field to use a given name wins. "first" means the first field encountered in a depth first search. "wins" means only the first field will be populated in the generated XML message.- Returns:
- Current useFlatFields value. Default value is null
-
setUseFlatHeaderFields
Cause theuseFlatFields
XML serialization behavior to be used for all soap headers in the request. See alsoheaderData
.- Parameters:
useFlatHeaderFields
- New useFlatHeaderFields value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls
-
getUseFlatHeaderFields
Cause theuseFlatFields
XML serialization behavior to be used for all soap headers in the request. See alsoheaderData
.- Returns:
- Current useFlatHeaderFields value. Default value is null
-
setUseStrictJSON
Should the HTTP response to this request be formatted using the strict JSON subset of the javascript language? If set to true, responses returned by the server should match the format described here.Only applies to requests sent a server with
DataSource.dataFormat
set to "json" or "iscServer".- Overrides:
setUseStrictJSON
in classRPCRequest
- Parameters:
useStrictJSON
- New useStrictJSON value. Default value is null- Returns:
DSRequest
instance, for chaining setter calls- See Also:
-
getUseStrictJSON
Should the HTTP response to this request be formatted using the strict JSON subset of the javascript language? If set to true, responses returned by the server should match the format described here.Only applies to requests sent a server with
DataSource.dataFormat
set to "json" or "iscServer".- Overrides:
getUseStrictJSON
in classRPCRequest
- Returns:
- Current useStrictJSON value. Default value is null
- See Also:
-
setValidationMode
Mode of validation for entered data.- Parameters:
validationMode
- New validationMode value. Default value is "full"- Returns:
DSRequest
instance, for chaining setter calls
-
getValidationMode
Mode of validation for entered data.- Returns:
- Current validationMode value. Default value is "full"
-
setAttribute
Set a custom attribute value on the DSRequest as an Object. Note that this method converts the Java primitive Object types, Dates and Maps to the underyling JavaScriptObject value. All other object types are set as Object type attributes and users are expected to callDataClass.getAttributeAsObject(String)
in order to retrieve them.These attributes are available for client-side use only - these attributes are not transmitted to the server.
Do not use setAttribute() to set any attribute for which there is a dedicated setter (do not setAttribute("data", data) for example).
If you are looking for a way to send additional data to the server, read
DsRequestEquivalence
for the best approach.- Overrides:
setAttribute
in classDataClass
- Parameters:
property
- the attribute namevalue
- the attribute value.- Returns:
DSRequest
instance, for chaining setter calls
-
setParams
Description copied from class:RPCRequest
Values to be sent as simple HTTP params, as a JavaScript Object where each property/value pair will become an HTTP parameter name and value. These parameters are then accessible on the server, for example, using servletRequest.getParameter(paramName) in Java Servlets.Array-valued parameters will be submitted as multiple instances of the same parameter, similar to an HTML form with a multi-select (?paramName=value1¶mName=value2 ...), accessible as getParameterValues(paramName) in Java Servlets. Any non-atomic type, such as an Object, will be serialized to JSON by the
JSONEncoder
. If this isn't desirable, serialize the data in advance so that the value provided inrpcRequest.params
is a String.Note that this API is primarily used in combination with
useSimpleHttp
- when contacting the Smart GWT Server, usedata
instead, which provides full JavaScript <-> Java translation of arbitrary structures.rpcRequest.params
can also be used with the Smart GWT Server, where it provides an an opportunity to send additional data aside from the maindata
payload. This is useful for adding data to DataSource requests which will be kept separate from the automatically sent DataSource data, or for making parts of the request visible in the URL for HTTP-level logging or layer 4 switches.Note that in contrast to
data
object, the data inrpcRequest.params
is not deserialized by the Smart GWT server, and all values arrive on the server as String type (like HTTP parameters always do).Note: The params are submitted once per http transaction. If you are using
request queuing
to bundle multiple RPCRequests or DSRequests into a single HTTP turnaround, the params from the various RPCRequests will be merged, with the later-queued transactions winning on parameter name collisions. A warning will be logged in the Developer Console if multiple RPCRequests specified params.- Overrides:
setParams
in classRPCRequest
- Parameters:
params
- New params value. Default value is null- Returns:
RPCRequest
instance, for chaining setter calls
-
setCallback
-
setSortBy
Fieldnames to sortBy.- Parameters:
sortSpecifiers
- Default value is null
-
setSortBy
Fieldnames to sortBy.- Parameters:
sortSpecifier
- Default value is null
-
getSortBy
Fieldname to sortBy- Returns:
- SortSpecifier array
-
setSummaryFunctions
A mapping from field names to summary functions to be applied to each field.Valid only for an operation of type "fetch". See the Server Summaries overview in the client-side documentation for details and examples of usage.
NOTE: this feature is supported only in Power Edition or above, and only when using the built-in SQL, JPA or Hibernate connectors.
- Parameters:
summaryFunctions
-Map<String,SummaryFunction>
with field names as keys and summary functions as values.- See Also:
-
DSRequest.setGroupBy(String[])
-
getSummaryFunctions
A mapping from field names to summary functions to be applied to each field.Valid only for an operation of type "fetch". See the Server Summaries overview in the client-side documentation for details and examples of usage.
NOTE: this feature is supported only in Power Edition or above, and only when using the built-in SQL, JPA or Hibernate connectors.
- Returns:
Map<String,SummaryFunction>
with field names as keys and summary functions as values.- See Also:
-
DSRequest.getGroupBy()
-
setRawSummaryFunctions
Same as#setSummaryFunctions()
, but allowing to set any functions, not just ones built into the framework, so that in combination with custom implementation on the server-side you can perform custom aggregation. See the Server Summaries > Custom Aggregation example in the Showcase.NOTE: this feature is supported only in Power Edition or above, and only when using the built-in SQL, JPA or Hibernate connectors.
- Parameters:
rawSummaryFunctions
-Map<String,String>
with field names as keys and summary functions as values.- See Also:
-
DSRequest.setGroupBy()
DSRequest.setSummaryFunctions()
-
getRawSummaryFunctions
Same asgetSummaryFunctions()
, but allowing to get any functions, not just ones built into the framework, so that in combination with custom implementation on the server-side you can perform custom aggregation. See the Server Summaries > Custom Aggregation example in the Showcase.NOTE: this feature is supported only in Power Edition or above, and only when using the built-in SQL, JPA or Hibernate connectors.
- Returns:
Map<String,String>
with field names as keys and summary functions as values.- See Also:
-
DSRequest.setGroupBy()
DSRequest.setSummaryFunctions()
-
setOldValues
For anupdate
orremove
operation, the original values from the record that is being updated or removed.oldValues
is automatically added to DSRequests submitted by DataBound Components. Available on the server viaDSRequest.getOldValues()
.The server can compare the
oldValues
to the most recent stored values in order to detect that the user was looking at stale values when the user submitted changes (NOTE: this means of detecting concurrent edit is sometimes called "optimistic concurrency" or "long transactions").In applications where a policy of "last update wins" is not appropriate when updating certain fields, special UI can be shown for this case. For example, on detecting concurrent edit, the server may send back a special
dsResponse.status
code that the client application detects, offering the user a choice of proceeding with the operation, discarding edits, or reconciling new and old values in a special interface.- Parameters:
oldValues
- oldValues Default value is null
-
setOldValues
For anupdate
orremove
operation, the original values from the record that is being updated or removed.oldValues
is automatically added to DSRequests submitted by DataBound Components. Available on the server viaDSRequest.getOldValues()
.The server can compare the
oldValues
to the most recent stored values in order to detect that the user was looking at stale values when the user submitted changes (NOTE: this means of detecting concurrent edit is sometimes called "optimistic concurrency" or "long transactions").In applications where a policy of "last update wins" is not appropriate when updating certain fields, special UI can be shown for this case. For example, on detecting concurrent edit, the server may send back a special
dsResponse.status
code that the client application detects, offering the user a choice of proceeding with the operation, discarding edits, or reconciling new and old values in a special interface.- Parameters:
oldValues
- oldValues Default value is null
-
getCriteria
Return the Criteria associated with a FETCH operation.Note : This method should only be called during a FETCH operation
- Returns:
- the criteria
- Throws:
IllegalStateException
- if called for a non-fetch operation
-
setSkinName
Set the skin to use. For example: Enterprise- Parameters:
skinName
- the name of the selected skin.
-
setCriteria
This method applies to "fetch" requests only; for update or delete operations pass a Record to setData() which contains primaryKey values as Record attributes.If you need to do a remove with criteria rather than a primary key, the recommended approach is to do it via a
custom operation
. so the intent is clear. You can also do it as a remove, but just useDSRequest.oldValues
as the source for whatever criteria values you need. That covers everything exceptAdvancedCriteria
.- Parameters:
criteria
- the criteria to store.
-
GwtFloatVsDouble