org.sandev.basics.util
Interface UIFormOwner

All Superinterfaces:
AuthUserLookup, IDLookup, NameLookup, UIFileLocator, UIFormAdaptorCallback

public interface UIFormOwner
extends AuthUserLookup, UIFormAdaptorCallback

Callback interface implemented by classes that use UIFormManager. The UIFormManager cannot provide generic query and persistence capability so it calls back through these methods to provide the necessary processing.


Field Summary
static java.lang.String ACTION_REFRESH_GLOBAL_DATA
          Used to indicate shared data has changed.
 
Method Summary
 UIFormContext doAction(java.lang.String actionName, UIFormContext uifc, UserWorkLog uwl)
          Do the named action using the information in the form context given.
 java.lang.String forgotPassword(java.lang.String primary, java.lang.String secondary)
          Do what processing is needed to handle this user forgetting their password, and return a notification message.
 SandCollectionMessage formFind(SandQueryMessage msg, UIFormContext uifc)
          Process the given query and return the result.
 void formHelp(UIFormContext uifc)
          The user has requested help.
 void formSave(UIFormContext uifc)
          Save the form editMsg to persistent storage.
 AuthFilter getAuthFilter()
          Return an AuthFilter implementation for use in form processing.
 java.lang.String getDeploymentPrefix()
          Return the deployment prefix currently in use.
 java.lang.String getTechSupportEmailAddress()
          Return the email address that stack trace info should be sent to.
 UserWorkLog getUserWorkLog()
          Return a new user log message accumulator or null if not supported.
 boolean isActive(java.lang.String actionName, UIFormContext uifc, boolean defaultValue)
          Return true if the named action is supported given the form context.
 void trackFormProcessCall(UIFormContext uifc)
          Called from UIFormManager processForm to allow the form owner to track processing.
 
Methods inherited from interface org.sandev.basics.util.AuthUserLookup
getUserForID, getUserFromLogin
 
Methods inherited from interface org.sandev.basics.util.UIFormAdaptorCallback
doActionAddHook, doActionCancelHook, doActionDeleteHook, doActionDisplayHook, doActionEditHook, doActionFindHook, filterDisplayText, filterInputParameters, getFieldPrintname, getSelectionValues, log, verifyDefaultAction
 
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
 

Field Detail

ACTION_REFRESH_GLOBAL_DATA

static final java.lang.String ACTION_REFRESH_GLOBAL_DATA
Used to indicate shared data has changed. When a form makes changes to data that may be shared by other forms, those other forms may need to be refreshed to form a consistent display. This action name is passed to the doAction method by the UI processing to allow for multiple forms in a display to remain synchronized.

See Also:
Constant Field Values
Method Detail

getAuthFilter

AuthFilter getAuthFilter()
                         throws UIFormManagerException
Return an AuthFilter implementation for use in form processing.

Throws:
UIFormManagerException

getUserWorkLog

UserWorkLog getUserWorkLog()
Return a new user log message accumulator or null if not supported.


getDeploymentPrefix

java.lang.String getDeploymentPrefix()
Return the deployment prefix currently in use. This may return the empty string, but should not return null.


getTechSupportEmailAddress

java.lang.String getTechSupportEmailAddress()
Return the email address that stack trace info should be sent to. This may return the empty string, but should not return null.

In the event of an exception not being handled by the app, and falling through to the framework error handling, there is an option to mail the resulting stack trace info for analysis. This is the email address this information should be mailed to.


formFind

SandCollectionMessage formFind(SandQueryMessage msg,
                               UIFormContext uifc)
                               throws UIFormManagerException
Process the given query and return the result. This method is called by a UIFormManager in response to a find action.

Throws:
UIFormManagerException

formSave

void formSave(UIFormContext uifc)
              throws UIFormManagerException
Save the form editMsg to persistent storage. The type of the message will depend on the UIFormManager being used, typically it is either an AggregateUpdate or a plain struct message. Refer to documentation on the specific UIFormManager being used for details.

At the successful conclusion of this method, pendingEdits is set to false. On failure, pendingEdits is left as true, the update message corresponding to the instance being edited is cleaned up, and the message text is set to provide information about the problem. Exceptions should not be thrown under recoverable processing conditions.

Throws:
UIFormManagerException

formHelp

void formHelp(UIFormContext uifc)
              throws UIFormManagerException
The user has requested help. A typical simple implementation would be to pop up another window with the generated documentation for the current message class (either the default project docs or custom generated documentation). If help is not supported, the help action should be disabled before calling the UIFormAdaptor.

Throws:
UIFormManagerException

trackFormProcessCall

void trackFormProcessCall(UIFormContext uifc)
Called from UIFormManager processForm to allow the form owner to track processing. This can be used for statistics, monitoring or other side effects.


doAction

UIFormContext doAction(java.lang.String actionName,
                       UIFormContext uifc,
                       UserWorkLog uwl)
                       throws UIFormManagerException
Do the named action using the information in the form context given. If the action is not understood, then throw.

Throws:
UIFormManagerException

isActive

boolean isActive(java.lang.String actionName,
                 UIFormContext uifc,
                 boolean defaultValue)
Return true if the named action is supported given the form context. Otherwise return false. The default value is based on the action declaration and should be returned in the absence of specific activation/deactivation logic.


forgotPassword

java.lang.String forgotPassword(java.lang.String primary,
                                java.lang.String secondary)
                                throws UIFormManagerException
Do what processing is needed to handle this user forgetting their password, and return a notification message. The returned message should be the same regardless of whether the username exists or not, and it should not contain any information about the user. Something like "Your password has been reset and your new login information has been sent to the email address you specified for your account".

This method should not throw if the user was not found. It should not be possible for an automated agent to repeatedly query the "forgot password" function to discover valid account names.

The first parameter holds whatever value the user entered for the primary field (usually their username), which they were prompted for if "forgot password" processing is enabled. The second parameter holds the value of the secondary prompt if specified.

Throws:
UIFormManagerException