|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ragic.s3.service.workflow.ScriptBDBSmartWorker
public class ScriptBDBSmartWorker
ScriptBDBSmartWorker is an essential class when manipulating database. It provides several functions to register new values and access current values of existing fields. Also, the function to create a new record is also included in this class.
Try to imagine the whole database as a graph. The main task of BDBSmartWorker is to work on this great graph for you. Each value you creates is a new node on this graph. Therefore each node has a distinct node ID to be identified. All nodes associated with a certain field are connected and are regarded as a group, just like how graphs work. Thus field ID is also important when finding and manipulating a node.
Make sure to keep above words in mind. They are pretty useful when working with these functions.
Constructor Summary | |
---|---|
ScriptBDBSmartWorker(java.lang.String apname)
|
Method Summary | |
---|---|
int |
addFieldSelectionValue(int rootDomainId,
int rootNodeId,
int fieldDomainId,
java.lang.String value)
Extend a new choice of the given selection-typed field when field ID and node ID of root field are provided. |
int |
addFieldSelectionValue(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId,
java.lang.String value)
Extend a new choice of the given selection-typed field when field ID and value of root field are provided. |
int[] |
addRecord(int[] domainIds,
java.lang.String[] values,
boolean[] ifMerge)
Register a new record by providing serial field IDs, corresponding values and an array of boolean values indicating if these new nodes should be merged with old values or not. |
int |
getFieldNodeId(int rootDomainId,
int rootNodeId,
int fieldDomainId)
Returns node ID of the given field when node ID of root field is provided. |
int |
getFieldNodeId(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId)
Returns node ID of the given field when value of root field is provided. |
java.util.List<java.lang.Integer> |
getFieldNodeIds(int rootDomainId,
int rootNodeId,
int fieldDomainId)
Returns a list of string-typed value of the given selection-typed field when node ID of root field is provided. |
java.util.List<java.lang.Integer> |
getFieldNodeIds(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId)
Returns a list of string-typed node ID of the given selection-typed field when the value of root field is provided. |
java.lang.String |
getFieldValue(int rootDomainId,
int rootNodeId,
int fieldDomainId)
Returns string-typed value of the given field when node ID of root field is provided. |
java.lang.String |
getFieldValue(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId)
Returns string-typed value of the given field when value of root field is provided. |
java.util.List<java.lang.String> |
getFieldValues(int rootDomainId,
int rootNodeId,
int fieldDomainId)
Returns a list of string-typed value of the given selection-typed field when node ID of root field is provided. |
java.util.List<java.lang.String> |
getFieldValues(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId)
Returns a list of string-typed value of the given selection-typed field when value of root field is provided. |
java.lang.String |
getFieldValuesString(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId)
Returns a joined string of values of the given selection-typed field when value of root field is provided. |
int |
setFieldSelectionValue(int rootDomainId,
int rootNodeId,
int fieldDomainId,
java.lang.String value)
Register the first choice to the given selection-typed field when field ID and node ID of root field are provided. |
int |
setFieldSelectionValue(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId,
java.lang.String value)
Register the first choice to the given selection-typed field when field ID and value of root field are provided. |
int[] |
setFieldSelectionValues(int rootDomainId,
int rootNodeId,
int fieldDomainId,
java.util.List<java.lang.String> values)
Register a list of all choices to the given selection-typed field when field ID and node ID of root field are provided. |
int[] |
setFieldSelectionValues(int rootDomainId,
int rootNodeId,
int fieldDomainId,
java.lang.String[] values)
Register an array of all choices to the given selection-typed field when field ID and node ID of root field are provided. |
int[] |
setFieldSelectionValues(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId,
java.util.List<java.lang.String> values)
Register a list of all choices to the given selection-typed field when ID and value of root field are provided. |
int[] |
setFieldSelectionValues(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId,
java.lang.String[] values)
Register an array of all choices to the given selection-typed field when ID and value of root field are provided. |
void |
setFieldValue(int rootDomainId,
int rootNodeId,
int fieldDomainId,
java.lang.String value)
Register a new value to the given field when field ID and node ID of root field are provided. |
void |
setFieldValue(int rootDomainId,
java.lang.String keyValue,
int fieldDomainId,
java.lang.String value)
Register a new value to the given field when field ID and value of root field are provided. |
void |
setValue(int domainId,
java.lang.String keyValue,
java.lang.String newValue)
Register a new value to the given field when current value of this field is provided. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptBDBSmartWorker(java.lang.String apname)
Method Detail |
---|
public java.lang.String getFieldValue(int rootDomainId, java.lang.String keyValue, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of root field ID (first parameter).fieldDomainId
- field ID of the one of interest.
public java.lang.String getFieldValue(int rootDomainId, int rootNodeId, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of root field (first parameter).fieldDomainId
- field ID of the one of interest.
public java.util.List<java.lang.String> getFieldValues(int rootDomainId, int rootNodeId, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of root field (first parameter).fieldDomainId
- field ID of the one of interest.
public java.util.List<java.lang.String> getFieldValues(int rootDomainId, java.lang.String keyValue, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of root field ID (first parameter).fieldDomainId
- field ID of the one of interest.
public java.lang.String getFieldValuesString(int rootDomainId, java.lang.String keyValue, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of root field ID (first parameter).fieldDomainId
- field ID of the one of interest.
public int getFieldNodeId(int rootDomainId, int rootNodeId, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of this root field (first parameter).fieldDomainId
- field ID of the one of interest.
public int getFieldNodeId(int rootDomainId, java.lang.String keyValue, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of root field ID (first parameter).fieldDomainId
- field ID of the one of interest.
public java.util.List<java.lang.Integer> getFieldNodeIds(int rootDomainId, int rootNodeId, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of this root field (first parameter).fieldDomainId
- field ID of the one of interest.
public java.util.List<java.lang.Integer> getFieldNodeIds(int rootDomainId, java.lang.String keyValue, int fieldDomainId)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of this root field (first parameter).fieldDomainId
- field ID of the one of interest.
public void setValue(int domainId, java.lang.String keyValue, java.lang.String newValue)
domainId
- field ID whose value is to be updated.keyValue
- current value of this field.newValue
- new value of this field.public void setFieldValue(int rootDomainId, java.lang.String keyValue, int fieldDomainId, java.lang.String value)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of this root field (first parameter).fieldDomainId
- field ID whose value is to be set.value
- new value of this field.public void setFieldValue(int rootDomainId, int rootNodeId, int fieldDomainId, java.lang.String value)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of this root field (first parameter).fieldDomainId
- field ID whose value is to be set.value
- new value of this field.public int setFieldSelectionValue(int rootDomainId, int rootNodeId, int fieldDomainId, java.lang.String value)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of this root field (first parameter).fieldDomainId
- field ID whose value is to be set.value
- first choice of this selection-typed field.
public int setFieldSelectionValue(int rootDomainId, java.lang.String keyValue, int fieldDomainId, java.lang.String value)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of this root field (first parameter).fieldDomainId
- field ID whose value is to be set.value
- first choice of this selection-typed field.
public int[] setFieldSelectionValues(int rootDomainId, int rootNodeId, int fieldDomainId, java.util.List<java.lang.String> values)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of this root field (first parameter).fieldDomainId
- field ID whose value is to be set.values
- a list of all choices to be set in this selection-typed field.
public int[] setFieldSelectionValues(int rootDomainId, java.lang.String keyValue, int fieldDomainId, java.util.List<java.lang.String> values)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of this root field (first parameter).fieldDomainId
- field ID whose values are to be set.values
- a list of all choices of this selection-typed field.
public int[] setFieldSelectionValues(int rootDomainId, java.lang.String keyValue, int fieldDomainId, java.lang.String[] values)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of this root field (first parameter).fieldDomainId
- field ID whose values are to be set.values
- an array of all choices of this selection-typed field.
public int[] setFieldSelectionValues(int rootDomainId, int rootNodeId, int fieldDomainId, java.lang.String[] values)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of this root field (first parameter).fieldDomainId
- field ID whose values are to be set.values
- an array of all choices of this selection-typed field.
public int addFieldSelectionValue(int rootDomainId, int rootNodeId, int fieldDomainId, java.lang.String value)
rootDomainId
- root field ID of this form or this subtable.rootNodeId
- node ID of this root field (first parameter).fieldDomainId
- field ID whose value are to be extended.value
- the value of the new choice.
public int addFieldSelectionValue(int rootDomainId, java.lang.String keyValue, int fieldDomainId, java.lang.String value)
rootDomainId
- root field ID of this form or this subtable.keyValue
- value of this root field (first parameter).fieldDomainId
- field ID whose value are to be extended.value
- the value of the new choice.
public int[] addRecord(int[] domainIds, java.lang.String[] values, boolean[] ifMerge)
domainIds
- serial field IDs to hold values of this new record.values
- corresponding values to be set on these field IDs (first parameter).ifMerge
- controller which decides each new node should be created as a new one or merged with old value.true
, new node will be merged with an old one if the node possess the same value already exists.
if false
, new node wil be still created.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |