public class DSRequestModifier
extends java.lang.Object
com.smartgwt.client.docs.serverds
for how to use this documentation.Some elements of this feature are only available with Power or better licenses. See smartclient.com/product for details.
An object that
modifies a dsRequest based on several available values, including preceding responses from the
same queue. You provide a list of DSRequestModifiers as the OperationBinding.criteria
or
OperationBinding.values
of an
OperationBinding
. The ability to modify a request based on
responses to earlier requests in the same queue is called TransactionChaining
.
A DSRequestModifier consists of a fieldName
, usually a value
and possibly an operator
and start
and/or end
values (applicable to advanced
criteria only). The value, start and end settings can be static, or - with Power or better
licenses - they can be expressions in the Velocity template language, which will be resolved
at runtime, immediately before the DSRequest is executed.
Modifier and Type | Field and Description |
---|---|
java.lang.String |
end
The value to use for the end of a range.
|
java.lang.String |
fieldName
The name of the field to add or replace on the DSRequest - whether this appears in the
DSRequest's values or criteria depends on whether this is part of a
OperationBinding.values or OperationBinding.criteria
attribute. |
java.lang.String |
operator
The name of the operator to apply when constructing criteria.
|
java.lang.String |
start
The value to use for the start of a range.
|
java.lang.String |
value
The value to assign to the field named by
fieldName . |
Constructor and Description |
---|
DSRequestModifier() |
public java.lang.String end
OperationBinding.values
attribute, or for an inapplicable operator type. The same rules
apply to this attribute as apply to value
, so you can use Velocity
expressions if you have a Power or better license.
Default value is null
public java.lang.String value
fieldName
. This value can be
static, and for Pro licenses that is the only option. With Power and better licenses, this
value can be an expression in the Velocity template language. In this latter case, there are
a number of context variables available to you: VelocitySupport
). The most interesting of these is the last. An example of when this might be useful would be a queued batch of "add" operations for an order header and its details - the detail additions need to know the unique primary key that was assigned to the order. This value will be in the response to the DSRequest that added the order header. See this example: Master/Detail Add Example.
You can obtain the responseData of prior responses using the following Velocity syntax:
$responseData.first.myField
is
the myField property of the first response in the queue
$responseData.first('order').myField
is the myField property of the first response
to an operation (any operation) on the "order" DataSource
$responseData.first('order', 'add').myField
is the myField property of the first
response to an "add" operation on the "order" DataSource
All of these syntactic variations
are also available on the $responseData.last
object - "last" here meaning the
most recent response matching the DataSource and operation type (if applicable). Please see
the server-side Javadoc for the com.isomorphic.velocity.ResponseDataHandler
class.
Default value is null
public java.lang.String fieldName
OperationBinding.values
or OperationBinding.criteria
attribute.
Default value is null
public java.lang.String operator
OperationBinding.values
attribute.
Default value is null
public java.lang.String start
OperationBinding.values
attribute,
or for an inapplicable operator type. The same rules apply to this attribute as apply to
value
, so you can use
Velocity expressions if you have a Power or better license.
Default value is null