com.smartgwt.client.docs.serverds

## Class DSRequestModifier

- java.lang.Object
- - com.smartgwt.client.docs.serverds.DSRequestModifier

-     public class DSRequestModifier
      extends java.lang.Object

  This class is not meant to be created and used, it is actually documentation of settings allowed in a DataSource descriptor (.ds.xml file). See `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.

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `DSRequestModifier()`

  - ### Method Summary

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### end

          public java.lang.String end

      The value to use for the end of a range. This property only applies to criteria, and it only applies to operators of type "rangeCheck" - for example, the "between" operator. It is ignored if specified as part of a `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

      See Also:
        `TransactionChaining overview and related methods`

    - #### value

          public java.lang.String value

      The value to assign to the field named by `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:
      - dsRequest. The DSRequest object being processed
      - servletRequest. The HttpServletRequest object representing the queue of requests sent from the client
      - responseData. The data member of a DSResponse object associated with an earlier DSRequest in the same queue
      (Note that the standard Velocity context variables provided by Smart GWT Server are also available to you - see `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

      See Also:
        `TransactionChaining overview and related methods`

    - #### fieldName

          public 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.

      Default value is null

    - #### operator

          public java.lang.String operator

      The name of the operator to apply when constructing criteria. This property only applies to criteria; it is ignored if specified as part of a `OperationBinding.values` attribute.

      Default value is null

    - #### start

          public java.lang.String start

      The value to use for the start of a range. This property only applies to criteria, and it only applies to operators of type "rangeCheck" - for example, the "between" operator. It is ignored if specified as part of a `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

      See Also:
        `TransactionChaining overview and related methods`

  - ### Constructor Detail

    - #### DSRequestModifier

          public DSRequestModifier()