com.sri.emo.dbobj
Interface IPartHandler

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AbstractAttributeHandler, AbstractMatrixHandler, AbstractSettingHandler

public interface IPartHandler
extends Cloneable

Interface for custom handling of parts, when display and storage of a part is out of the ordinary. possible to generalize to a customization for relations, but right now is focused on custom owned attributes

Author:
Larry Hamel

Field Summary
static String FULL_XML
          constant for indicating that default XML should be generated for all custom parts if they have no saved settings
static Map NO_PARAMETERS
          Special Case for functions that take no parameters as an alternative for passing in null.
 
Method Summary
 void addXML(Attribute attrib, org.dom4j.Element root, ControllerRequest request)
          Add any necessary xml attributes and elements to root for this attribute.
 Object clone()
          Public implementation of the Clone object.
 void clone(Attribute existing, Attribute clone)
          Clone data from existing to clone.
 void delete(Attribute attribute)
          Delete a part.
 Transition getEditTransition(Map params)
          Get the part 'edit' transition.
 String[] getInsertStatements(AbstractNodeExportSupport support, DBObject attribute)
           
 Output getViewComment(Map params)
          Retrieve the view comment as an output.
 Transition getViewTransition(Map params)
          Get the View Transition.
 boolean isNeededInFullXML()
          flag as to whether this attribute is required to make sense of XML.
 void parseXML(org.dom4j.Element elem, Attribute attrib, Map allNodeMap, ControllerRequest request)
          Parse xml into this attribute format.
 void saveInput(Input key)
          given an input, save the value in the custom manner.
 boolean validate(String key, String value)
           
 

Field Detail

NO_PARAMETERS

static final Map NO_PARAMETERS
Special Case for functions that take no parameters as an alternative for passing in null.


FULL_XML

static final String FULL_XML
constant for indicating that default XML should be generated for all custom parts if they have no saved settings

See Also:
Constant Field Values
Method Detail

getViewTransition

Transition getViewTransition(Map params)
                             throws DBException
Get the View Transition.

Parameters:
params - map of ControllerRequest params.
Returns:
the transition for viewing this part
Throws:
DBException - upon error.

getEditTransition

Transition getEditTransition(Map params)
                             throws DBException
Get the part 'edit' transition.

Parameters:
params - map of ControllerRequest params.
Returns:
the transition for editing this part
Throws:
DBException - upon error.

getViewComment

Output getViewComment(Map params)
                      throws DBException
Retrieve the view comment as an output.

Parameters:
params - map of ControllerRequest params.
Returns:
Output the resulting comment.
Throws:
DBException - upon Output construction error.

addXML

void addXML(Attribute attrib,
            org.dom4j.Element root,
            ControllerRequest request)
            throws DBException
Add any necessary xml attributes and elements to root for this attribute.

Parameters:
request - ControllerRequest the ControllerRequest object.
attrib - The attribute value for the part.
root - The XML Element to add for the part.
Throws:
DBException - upon database error.

parseXML

void parseXML(org.dom4j.Element elem,
              Attribute attrib,
              Map allNodeMap,
              ControllerRequest request)
              throws DBException
Parse xml into this attribute format.

Parameters:
request - ControllerRequest the ControllerRequest object.
allNodeMap - ?
attrib - the specifying format.
elem - The XML Element we're parsing.
Throws:
DBException - upon database error.

clone

void clone(Attribute existing,
           Attribute clone)
           throws DBException
Clone data from existing to clone.

Parameters:
existing - The source attribute.
clone - The target Attribute.
Throws:
DBException - upon database error.

delete

void delete(Attribute attribute)
            throws DBException
Delete a part.

Parameters:
attribute - Attribute the attribute to delete.
Throws:
DBException - upon database error.

clone

Object clone()
             throws CloneNotSupportedException
Public implementation of the Clone object.

Returns:
Object
Throws:
CloneNotSupportedException
See Also:
Object.clone()

validate

boolean validate(String key,
                 String value)
Returns:
true if this value is correct with respect to menu (category) limitations

saveInput

void saveInput(Input key)
               throws DBException
given an input, save the value in the custom manner.

Throws:
DBException

getInsertStatements

String[] getInsertStatements(AbstractNodeExportSupport support,
                             DBObject attribute)
                             throws DBException
Returns:
an array of SQL Insert statements that are equivalent to the contents of this attribute; can be empty but never null
Throws:
DBException

isNeededInFullXML

boolean isNeededInFullXML()
flag as to whether this attribute is required to make sense of XML. If true, the handler should output a default matrix or whatever even if there has been no saved values from user.



Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.