com.dhtmlx.connector
Class DataAction

java.lang.Object
  extended by com.dhtmlx.connector.DataAction
Direct Known Subclasses:
CommonDataAction

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.


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_id(java.lang.String id)
           
 void set_new_id(java.lang.String nid)
           
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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_id

public void set_id(java.lang.String id)

set_new_id

public void set_new_id(java.lang.String nid)

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