Enum DSProtocol
- All Implemented Interfaces:
ValueEnum
,Serializable
,Comparable<DSProtocol>
,Constable
OperationBinding.dataProtocol
affects how the data in
the DSRequest (DSRequest.data
)
is sent to the DataSource.dataURL
. Listed below are the valid
values for
OperationBinding.dataProtocol
and their behavior.
Note that, when using the Smart GWT server, data is automatically translated from
JavaScript to Java according to the rules described here
;
dataProtocol does not apply and is ignored.
If you are integrating with a REST
server that requires the more
obscure RPCRequest.httpMethod
s of "PUT", "DELETE" or "HEAD",
you can specify these
httpMethod settings via OperationBinding.requestProperties
. dataProtocol settings
that mention "GET" or "POST" are compatible with these additional HTTP methods as well.
Typical operationBindings
for a REST server that uses
"PUT" and "DELETE" are as follows:
operationBindings:[ {operationType:"fetch", dataProtocol:"getParams"}, {operationType:"add", dataProtocol:"postParams"}, {operationType:"remove", dataProtocol:"getParams", requestProperties:{httpMethod:"DELETE"}}, {operationType:"update", dataProtocol:"postParams", requestProperties:{httpMethod:"PUT"}} ],
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThis setting entirely bypasses the Smart GWT comm system.Data is added to the dataURL, with each property in the data becoming an HTTP parameter, eg http://service.com/search?keyword=fooData is serialized as a JSON string and POST'd to the dataURL.dsRequest.data is assumed to be a String set up byDataSource.transformRequest()
and is POST'd as the HTTP request body.Data is POST'd to the dataURL, with each property becoming an HTTP parameter, exactly as an HTML form would submit them if it had one input field per property in the data.Data is serialized as XML viaDataSource.xmlSerialize()
and POST'd as the HTTP request body with contentType "text/xml".Data is serialized as XML viaDataSource.xmlSerialize()
, wrapped in a SOAP envelope, and POST'd as the HTTP request body with contentType "text/xml". -
Method Summary
Modifier and TypeMethodDescriptiongetValue()
static DSProtocol
Returns the enum constant of this type with the specified name.static DSProtocol[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
GETPARAMS
Data is added to the dataURL, with each property in the data becoming an HTTP parameter, eg http://service.com/search?keyword=fooIf this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "getParams". -
POSTPARAMS
Data is POST'd to the dataURL, with each property becoming an HTTP parameter, exactly as an HTML form would submit them if it had one input field per property in the data.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "postParams". -
POSTJSON
Data is serialized as a JSON string and POST'd to the dataURL.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "postJSON". -
POSTXML
Data is serialized as XML viaDataSource.xmlSerialize()
and POST'd as the HTTP request body with contentType "text/xml".If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "postXML". -
SOAP
Data is serialized as XML viaDataSource.xmlSerialize()
, wrapped in a SOAP envelope, and POST'd as the HTTP request body with contentType "text/xml". Generally only used in connection with aWSDL web service
.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "soap". -
POSTMESSAGE
dsRequest.data is assumed to be a String set up byDataSource.transformRequest()
and is POST'd as the HTTP request body.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "postMessage". -
CLIENTCUSTOM
This setting entirely bypasses the Smart GWT comm system. Instead of the DataSource sending an HTTP request to a URL, the developer is expected to implementDataSource.transformRequest()
to perform their own custom logic, and then callDataSource.processResponse()
to handle the results of this action. ThisdataProtocol
setting can be used to implement access to in-browser resources such as HTML5 "localStorage", native APIs available to applicationspackaged as native applications
, or to implement theDataSource Facade pattern
.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "clientCustom".
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
-