org.sandev.basics.util
Interface UIFormAdaptorCallback

All Superinterfaces:
IDLookup, NameLookup, UIFileLocator
All Known Subinterfaces:
UIFormOwner

public interface UIFormAdaptorCallback
extends IDLookup, NameLookup, UIFileLocator

Callback interface for UIFormAdaptor providing IDLookup, NameLookup, and dynamic form processing functions.


Method Summary
 void doActionAddHook(UIFormContext uifc)
          Given the UIFormContext which will be used to present a new form for the user to fill out, preprocess as needed before returning control to the UIFormManager.
 void doActionEditHook(UIFormContext uifc)
          Given the UIFormContext which will be used to present a form for editing an existing instance, preprocess as needed before returning control to the UIFormManager.
 void doActionFindHook(UIFormContext uifc)
          Given the UIFormContext reconstructed on an ACTION_FIND, preprocess as needed before returning control to the UIFormManager.
 java.lang.String filterDisplayText(java.lang.String text)
          Given the source text for display, perform any alterations that are necessary and return the result.
 java.util.Map filterInputParameters(java.lang.String prefix, java.util.Map params, java.lang.StringBuffer outText)
          Given a map of input parameters, filter as necessary and return the result.
 ArrayAssociation getSelectionValues(SandInstanceMessage msg, java.lang.String fieldname, AuthUser user)
          Return a matched set of arrays to be used for selecting a field value for the given field name in the given SandInstanceMessage.
 void log(int severity, java.lang.String msg)
          Log the given text at the given Logger severity level.
 
Methods inherited from interface org.sandev.basics.util.IDLookup
getInstance
 
Methods inherited from interface org.sandev.basics.util.NameLookup
getInstance
 
Methods inherited from interface org.sandev.basics.util.UIFileLocator
getInboundFilesDir, getInboundFilesLink, getOutboundFilesDir, getOutboundFilesLink, setInboundFilesLink, setOutboundFilesLink
 

Method Detail

getSelectionValues

public ArrayAssociation getSelectionValues(SandInstanceMessage msg,
                                           java.lang.String fieldname,
                                           AuthUser user)
Return a matched set of arrays to be used for selecting a field value for the given field name in the given SandInstanceMessage. Returns null if no translation is available. The keyValues in the array are the actual assignment values, while the transValues are the values for the selection display.

A UIFormAdaptor will render the field selection for editing using the display text. On reconstruction, the message field value will be set by looking up the corresponding real value for the selected display text value. If this method returns null, then the default rendering/reconstruction for that field type is used.


doActionFindHook

public void doActionFindHook(UIFormContext uifc)
Given the UIFormContext reconstructed on an ACTION_FIND, preprocess as needed before returning control to the UIFormManager.


doActionAddHook

public void doActionAddHook(UIFormContext uifc)
Given the UIFormContext which will be used to present a new form for the user to fill out, preprocess as needed before returning control to the UIFormManager.


doActionEditHook

public void doActionEditHook(UIFormContext uifc)
Given the UIFormContext which will be used to present a form for editing an existing instance, preprocess as needed before returning control to the UIFormManager.


filterDisplayText

public java.lang.String filterDisplayText(java.lang.String text)
Given the source text for display, perform any alterations that are necessary and return the result. If you don't need to do any filtering of text, then just return the given value.

This method is intended to support things like remapping of URLs within text, filtering of words in descriptions and other similar low level text manipulation as required. It is not intended for general display level presentation remapping, use template transformation for that.


filterInputParameters

public java.util.Map filterInputParameters(java.lang.String prefix,
                                           java.util.Map params,
                                           java.lang.StringBuffer outText)
                                    throws UIFormAdaptorException
Given a map of input parameters, filter as necessary and return the result. If you don't need to do any filtering of the input, then just return the given map. Appending any text to the outText buffer will signal a soft processing error. In the event of a hard processing error this method should throw. Parameters are keyed off prefix + name (interned). There is one call to this method for each top level message load in the UIFormContext. The prefix varies accordingly.

This method is not intended for general display level presentation parsing, it exists to provide a hook for specific parameters that may need to be rationalized or sanitized for normal processing.

Throws:
UIFormAdaptorException

log

public void log(int severity,
                java.lang.String msg)
Log the given text at the given Logger severity level.