|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sri.emo.dbobj.AbstractAttributeHandler com.sri.emo.dbobj.AbstractMatrixHandler
public abstract class AbstractMatrixHandler
base class for custom handler for a matrix
Field Summary | |
---|---|
static String |
CELL_ID
|
static String |
NAME
|
static String |
PARAM_PREFIX
|
static String |
ROW
XML tag names |
static String |
SM_VAR_ID
|
static String |
SM_VAR_NAME
|
Fields inherited from class com.sri.emo.dbobj.AbstractAttributeHandler |
---|
OBSERVABLE_ID_XMLTAG |
Fields inherited from interface com.sri.emo.dbobj.IPartHandler |
---|
FULL_XML, NO_PARAMETERS |
Constructor Summary | |
---|---|
AbstractMatrixHandler(String attribName,
Class editorClass,
String viewState,
String promptEditState)
|
Method Summary | |
---|---|
static void |
clearMatrix(HashMap columnHash)
note: this call is done during 'validate' (which any reader can do), so it uses superuser priv. |
void |
clone(Attribute existing,
Attribute clone)
clone data from existing to clone |
HashMap |
collateMatrix(List celllist)
from list of cells, determine lists of columns |
static Attribute |
createAttrib(Node node,
String type)
Important: we use the ID of the owner of the node in order to add an attribute here. |
protected abstract MatrixCell[] |
createColumn(Attribute attrib,
String colId,
Object[] columns,
Object[] rows)
|
void |
delete(Attribute attribute)
Delete a part. |
Attribute |
getAttribute(Node node)
find single attribute, warning if > 1 are found. |
protected abstract String |
getColumnID(Object columnObject)
|
protected abstract Object[] |
getColumnObjects(Node node)
|
String[] |
getInsertStatements(AbstractNodeExportSupport treeExporter,
DBObject obj)
|
MatrixCell[][] |
getMatrix(Node matrixOwnerNode)
get matrix, creating it from scratch if necessary |
protected Node |
getOrigOV(Node[] ovs,
Map allNodesByXML_ID)
|
protected Comparator |
getRowComparator(Node node)
ASSUMES that rows are nodes. |
protected abstract String |
getRowID(Object rowObject)
|
protected abstract Object[] |
getRowObjects(Node node)
|
protected static Node |
getSMV_fromXML(String smvID,
Map allNodesByXML_ID,
org.dom4j.Element elem,
ControllerRequest request)
|
boolean |
isNeededInFullXML()
used especially with matrix items that need default values if not set |
protected void |
sortMatrixRows(HashMap columnHash,
Comparator rowCompare)
|
protected void |
validateMatrix(HashMap colHashInNeedOfValidation,
Attribute attrib,
Object[] columns,
Object[] rowObjects)
note: this call is done as 'validate' (which any reader can do), so it uses superuser priv. |
Methods inherited from class com.sri.emo.dbobj.AbstractAttributeHandler |
---|
addIDs, clone, copyParams, getAttribName, getEditTransition, getLogger, getParentAttrib, getViewComment, getViewTransition, saveInput, setParentAttrib, validate |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sri.emo.dbobj.IPartHandler |
---|
addXML, parseXML |
Field Detail |
---|
public static final String ROW
public static final String NAME
public static final String SM_VAR_ID
public static final String SM_VAR_NAME
public static final String CELL_ID
public static final String PARAM_PREFIX
Constructor Detail |
---|
public AbstractMatrixHandler(String attribName, Class editorClass, String viewState, String promptEditState)
Method Detail |
---|
protected abstract String getColumnID(Object columnObject) throws DBException
DBException
protected abstract String getRowID(Object rowObject) throws DBException
DBException
protected abstract Object[] getRowObjects(Node node) throws DBException
DBException
protected abstract Object[] getColumnObjects(Node node) throws DBException
DBException
public MatrixCell[][] getMatrix(Node matrixOwnerNode) throws DBException
matrixOwnerNode
- node which owns matrix attribute
DBException
protected abstract MatrixCell[] createColumn(Attribute attrib, String colId, Object[] columns, Object[] rows) throws DBException
DBException
protected void sortMatrixRows(HashMap columnHash, Comparator rowCompare)
public Attribute getAttribute(Node node) throws DBException
DBException
public static void clearMatrix(HashMap columnHash) throws DBException
DBException
protected Comparator getRowComparator(Node node) throws DBException
DBException
protected void validateMatrix(HashMap colHashInNeedOfValidation, Attribute attrib, Object[] columns, Object[] rowObjects) throws DBException
colHashInNeedOfValidation
- hash of all columns in matrix now--may be incomplete, or have items that are obsoletecolumns
- canonical list of columnsrowObjects
- canonical list of rows
DBException
public HashMap collateMatrix(List celllist) throws DBException
DBException
public void clone(Attribute existing, Attribute clone) throws DBException
existing
- The source attribute.clone
- The target Attribute.
DBException
- upon database error.public void delete(Attribute attribute) throws DBException
IPartHandler
attribute
- Attribute the attribute to delete.
DBException
- upon database error.protected static Node getSMV_fromXML(String smvID, Map allNodesByXML_ID, org.dom4j.Element elem, ControllerRequest request) throws DBException
DBException
- if smv not found w/i map, or w/i system if external IDs are allowedprotected Node getOrigOV(Node[] ovs, Map allNodesByXML_ID) throws DBException
DBException
public static Attribute createAttrib(Node node, String type) throws DBException
DBException
public boolean isNeededInFullXML()
AbstractAttributeHandler
isNeededInFullXML
in interface IPartHandler
isNeededInFullXML
in class AbstractAttributeHandler
public String[] getInsertStatements(AbstractNodeExportSupport treeExporter, DBObject obj) throws DBException
DBException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |