com.dhtmlx.connector
Class DataAction

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

public class DataAction
extends java.lang.Object

The Class DataAction. Class wraps DB operation. It contains all related data from incoming request and status of operation, after its execution.


Field Summary
private  java.util.ArrayList<java.lang.String> addf
          The array of additional fields
private  java.util.HashMap<java.lang.String,java.lang.String> attrs
          The attributes of response
private  java.util.HashMap<java.lang.String,java.lang.String> data
          The data of record
private  java.util.ArrayList<java.lang.String> delf
          The array of fields to be ignored
private  java.lang.String id
          The id of record
private  java.lang.String nid
          The new id of record
private  java.lang.String output
          The output buffer
private  boolean ready
          Flag of operation complete
private  java.lang.String status
          The status of operation
 
Constructor Summary
DataAction(java.lang.String status, java.lang.String id, java.util.HashMap<java.lang.String,java.lang.String> data)
          Instantiates a new data action.
 
Method Summary
 void add_field(java.lang.String name, java.lang.String value)
          Add new field
 void error()
          Mark operation as incorrect
 java.util.HashMap<java.lang.String,java.lang.String> get_data()
          Gets the data hash of the record
 java.lang.String get_id()
          Gets the id of the record
 java.lang.String get_new_id()
          Gets the new id New Id may differ from original one in case of Insert operation
 java.lang.String get_status()
          Gets the status of action
 java.lang.String get_userdata_value(java.lang.String name)
          Gets the _userdata_value.
 java.lang.String get_value(java.lang.String name)
          Gets the value of named field
 void invalid()
          Mark operation as invalid
 boolean is_ready()
          Checks if is operation is complete
 void remove_field(java.lang.String name)
          Remove existing field.
 void set_response_attributes(java.lang.String name, java.lang.String value)
          Sets an attribute of the response
 void set_response_text(java.lang.String text)
          Sets the response text.
 void set_response_xml(java.lang.String xml_text)
          Sets the response xml.
 void set_status(java.lang.String status)
          Set current status of the action
 void set_userdata_value(java.lang.String name, java.lang.String value)
          Set extra data value.
 java.lang.String set_value(java.lang.String name, java.lang.String value)
          Sets value of named field
 void success()
          Mark operation as successfully completed
 void success(java.lang.String new_id)
          Mark operation as successfully completed
 void sync_config(DataConfig config)
          Sync config between data action and data config object
 java.lang.String to_xml()
          Convert data action to xml string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

status

private java.lang.String status
The status of operation


id

private java.lang.String id
The id of record


nid

private java.lang.String nid
The new id of record


data

private java.util.HashMap<java.lang.String,java.lang.String> data
The data of record


attrs

private java.util.HashMap<java.lang.String,java.lang.String> attrs
The attributes of response


output

private java.lang.String output
The output buffer


ready

private boolean ready
Flag of operation complete


addf

private java.util.ArrayList<java.lang.String> addf
The array of additional fields


delf

private java.util.ArrayList<java.lang.String> delf
The array of fields to be ignored

Constructor Detail

DataAction

public DataAction(java.lang.String status,
                  java.lang.String id,
                  java.util.HashMap<java.lang.String,java.lang.String> data)
Instantiates a new data action.

Parameters:
status - the status of action
id - the id of record
data - the data hash of record
Method Detail

add_field

public void add_field(java.lang.String name,
                      java.lang.String value)
Add new field

Parameters:
name - the name
value - the value

remove_field

public void remove_field(java.lang.String name)
Remove existing field.

Parameters:
name - the name

sync_config

public void sync_config(DataConfig config)
                 throws ConnectorConfigException
Sync config between data action and data config object

Parameters:
config - the data config
Throws:
ConnectorConfigException - the connector configuration exception

get_value

public java.lang.String get_value(java.lang.String name)
Gets the value of named field

Parameters:
name - the name of field
Returns:
the value of field

set_value

public java.lang.String set_value(java.lang.String name,
                                  java.lang.String value)
Sets value of named field

Parameters:
name - the name of field
value - the value of field
Returns:
the previous value

get_id

public java.lang.String get_id()
Gets the id of the record

Returns:
the id of the record

get_data

public java.util.HashMap<java.lang.String,java.lang.String> get_data()
Gets the data hash of the record

Returns:
the data hash of the record

get_userdata_value

public java.lang.String get_userdata_value(java.lang.String name)
Gets the _userdata_value.

Parameters:
name - the name
Returns:
the _userdata_value

set_userdata_value

public void set_userdata_value(java.lang.String name,
                               java.lang.String value)
Set extra data value.

Parameters:
name - the name
value - the value

get_status

public java.lang.String get_status()
Gets the status of action

Returns:
the status of action

set_response_text

public void set_response_text(java.lang.String text)
Sets the response text.

Parameters:
text - the new response text

set_response_xml

public void set_response_xml(java.lang.String xml_text)
Sets the response xml.

Parameters:
xml_text - the new response text as xml string

set_response_attributes

public void set_response_attributes(java.lang.String name,
                                    java.lang.String value)
Sets an attribute of the response

Parameters:
name - the name
value - the value

is_ready

public boolean is_ready()
Checks if is operation is complete

Returns:
true, if is complete

get_new_id

public java.lang.String get_new_id()
Gets the new id New Id may differ from original one in case of Insert operation

Returns:
the new id of the record

error

public void error()
Mark operation as incorrect


invalid

public void invalid()
Mark operation as invalid


success

public void success(java.lang.String new_id)
Mark operation as successfully completed

Parameters:
new_id - the new id

success

public void success()
Mark operation as successfully completed


to_xml

public java.lang.String to_xml()
Convert data action to xml string

Returns:
the string

set_status

public void set_status(java.lang.String status)
Set current status of the action

Parameters:
status - the new status