com.dhtmlx.connector
Class DataRequest

java.lang.Object
  extended by com.dhtmlx.connector.DataRequest

public class DataRequest
extends java.lang.Object

The Class DataRequest. Contains info about specific rules of current data request


Field Summary
private  java.lang.String count
          The count of requested records
private  java.lang.String fieldset
          The list of used fields
private  java.util.ArrayList<FilteringRule> filters
          The set of filtering rules
private  java.lang.String relation
          The relation id
private  java.util.ArrayList<SortingRule> sort_by
          The set of sorting rules
private  java.lang.String source
          The source table
private  java.lang.String start
          The start position of selection
 
Constructor Summary
DataRequest()
          Instantiates a new data request.
DataRequest(DataRequest source)
          Instantiates a new data request ( copy constructor )
 
Method Summary
 void copy(DataRequest original)
          Copy data from existing request object
 java.lang.String get_count()
          Gets the requested count.
 java.lang.String get_fieldset()
          Gets the list of used fields.
 java.util.ArrayList<FilteringRule> get_filters()
          Gets the set of filter rules
 java.lang.String get_relation()
          Gets the relation id
 java.util.ArrayList<SortingRule> get_sort_by()
          Gets the set of applied sorting rules
 java.lang.String get_source()
          Gets the name of source table
 java.lang.String get_start()
          Gets the start position
 void parse_sql(java.lang.String sql)
          Parse SQL string, extract table name, list of fields, list of rules
 void set_fieldset(java.lang.String value)
          Sets the list of used fields
 void set_filter(java.lang.String sql)
          Sets the filtering rule
 void set_filter(java.lang.String field, java.lang.String value)
          Set the filtering rule.
 void set_filter(java.lang.String field, java.lang.String value, java.lang.String rule)
          Set_filter.
 void set_limit(int start, int count)
          Sets selection limit
 void set_limit(java.lang.String start, java.lang.String count)
          Sets selection limit
 void set_relation(java.lang.String relation)
          Sets the name of relation id field
 void set_sort(java.lang.String column)
          Sets the sorting order
 void set_sort(java.lang.String column, java.lang.String direction)
          Sets sorting order for selection
 void set_source(java.lang.String name)
          Sets the name of source table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filters

private java.util.ArrayList<FilteringRule> filters
The set of filtering rules


sort_by

private java.util.ArrayList<SortingRule> sort_by
The set of sorting rules


start

private java.lang.String start
The start position of selection


count

private java.lang.String count
The count of requested records


relation

private java.lang.String relation
The relation id


source

private java.lang.String source
The source table


fieldset

private java.lang.String fieldset
The list of used fields

Constructor Detail

DataRequest

public DataRequest()
Instantiates a new data request.


DataRequest

public DataRequest(DataRequest source)
Instantiates a new data request ( copy constructor )

Parameters:
source - the source requets object
Method Detail

copy

public void copy(DataRequest original)
Copy data from existing request object

Parameters:
original - the source request object

get_source

public java.lang.String get_source()
Gets the name of source table

Returns:
the source table

get_start

public java.lang.String get_start()
Gets the start position

Returns:
the index of first element in selection, which was requested by client side code

get_count

public java.lang.String get_count()
Gets the requested count.

Returns:
the count of records, which was requested by client side code

get_fieldset

public java.lang.String get_fieldset()
Gets the list of used fields.

Returns:
the list of used fields

get_filters

public java.util.ArrayList<FilteringRule> get_filters()
Gets the set of filter rules

Returns:
the set of filter rules

get_relation

public java.lang.String get_relation()
Gets the relation id

Returns:
the name of relation id field

get_sort_by

public java.util.ArrayList<SortingRule> get_sort_by()
Gets the set of applied sorting rules

Returns:
the set of sorting rules

set_fieldset

public void set_fieldset(java.lang.String value)
Sets the list of used fields

Parameters:
value - the list of used fields

set_filter

public void set_filter(java.lang.String field,
                       java.lang.String value,
                       java.lang.String rule)
Set_filter.

Parameters:
field - the field by which filtering will be applied
value - the value
rule - the sql compatible rule

set_filter

public void set_filter(java.lang.String field,
                       java.lang.String value)
Set the filtering rule. ( LIKE )

Parameters:
field - the field by which filtering will be applied
value - the value

set_filter

public void set_filter(java.lang.String sql)
Sets the filtering rule

Parameters:
sql - the sql string with the filtering rule

set_sort

public void set_sort(java.lang.String column)
Sets the sorting order

Parameters:
column - the name of column by which selection will be sorted (asc order)

set_sort

public void set_sort(java.lang.String column,
                     java.lang.String direction)
Sets sorting order for selection

Parameters:
column - the column by which sorting will be executed
direction - the direction of sorting

set_limit

public void set_limit(java.lang.String start,
                      java.lang.String count)
Sets selection limit

Parameters:
start - the start position
count - the count of records to be selected

set_limit

public void set_limit(int start,
                      int count)
Sets selection limit

Parameters:
start - the start position
count - the count of records to be selected

set_source

public void set_source(java.lang.String name)
                throws ConnectorConfigException
Sets the name of source table

Parameters:
name - the source table name
Throws:
ConnectorConfigException - the connector config exception

set_relation

public void set_relation(java.lang.String relation)
Sets the name of relation id field

Parameters:
relation - the new _relation

parse_sql

public void parse_sql(java.lang.String sql)
               throws ConnectorConfigException
Parse SQL string, extract table name, list of fields, list of rules

Parameters:
sql - the sql string
Throws:
ConnectorConfigException - the connector config exception