org.sandev.ui.util
Class UIActionHandlerBase

java.lang.Object
  extended by org.sandev.ui.util.UIActionHandlerBase

public class UIActionHandlerBase
extends java.lang.Object

Base class for handling SANDUI actions. This is just a collection of useful utilities which are commonly needed.


Field Summary
protected  org.sandev.basics.util.InstanceClassEnumerator classEnum
          Our InstanceClassEnumerator.
protected static int LOGDEBUG
           
protected static int LOGERROR
           
protected static int LOGINFO
           
protected static int LOGWARN
           
 
Constructor Summary
UIActionHandlerBase()
           
 
Method Summary
protected  boolean drivenByURLParameters(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UserWorkLog uwl, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user)
          Read the URL parameters and initialize the uifc if specified.
 org.sandev.basics.util.InstanceClassEnumerator getClassEnum()
          accessor for classEnum
static org.sandev.basics.structs.SandPersistMessage getSpecifiedInstance(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user)
          Get specified instance.
protected  boolean hasClassQueryAccess(java.lang.String classname, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user)
          Returns true if this user has unrestricted access to the query form of the specified message class.
protected  void initCollectionDisplay(org.sandev.basics.util.UIFormContext uifc, java.lang.String dispClass, org.sandev.basics.structs.SandCollectionMessage coll)
          This method factors the calls for the standard form context settings used during initialization of a listing display.
 org.sandev.basics.util.UIFormContext refreshGlobalDataAction(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UserWorkLog uwl, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user)
           
protected  void resetContextToCollection(org.sandev.basics.util.UIFormContext uifc)
          This method factors the calls needed to nuke whatever context is captured in the uifc, in preparation for initializing it with a collection display.
 void setClassEnum(org.sandev.basics.util.InstanceClassEnumerator val)
          mutator for classEnum
protected  org.sandev.basics.util.UIFormContext setContextFromQuery(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user, java.lang.String shortStructClassName, org.sandev.basics.structs.SandAttrVal[] matchInfo)
          Given the short form of a struct message class, call the formFind method of the owner with the corresponding query message to get an initial collection for display.
protected  org.sandev.basics.util.UIFormContext setContextFromQuery(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UIFormOwner owner, org.sandev.basics.util.AuthUser user, java.lang.String shortStructClassName, org.sandev.basics.structs.SandAttrVal[] matchInfo, int ordering)
          Given the short form of a struct message class, call the formFind method of the owner with the corresponding query message to get an initial collection for display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGDEBUG

protected static final int LOGDEBUG
See Also:
Constant Field Values

LOGINFO

protected static final int LOGINFO
See Also:
Constant Field Values

LOGWARN

protected static final int LOGWARN
See Also:
Constant Field Values

LOGERROR

protected static final int LOGERROR
See Also:
Constant Field Values

classEnum

protected org.sandev.basics.util.InstanceClassEnumerator classEnum
Our InstanceClassEnumerator. Used for retrieving the full name for a class. An extending class must initialize this value.

Constructor Detail

UIActionHandlerBase

public UIActionHandlerBase()
Method Detail

getClassEnum

public org.sandev.basics.util.InstanceClassEnumerator getClassEnum()
accessor for classEnum


setClassEnum

public void setClassEnum(org.sandev.basics.util.InstanceClassEnumerator val)
mutator for classEnum


refreshGlobalDataAction

public org.sandev.basics.util.UIFormContext refreshGlobalDataAction(org.sandev.basics.util.UIFormContext uifc,
                                                                    org.sandev.basics.util.UserWorkLog uwl,
                                                                    org.sandev.basics.util.UIFormOwner owner,
                                                                    org.sandev.basics.util.AuthUser user)
                                                             throws org.sandev.basics.util.UIFormManagerException
Throws:
org.sandev.basics.util.UIFormManagerException

resetContextToCollection

protected void resetContextToCollection(org.sandev.basics.util.UIFormContext uifc)
This method factors the calls needed to nuke whatever context is captured in the uifc, in preparation for initializing it with a collection display.


initCollectionDisplay

protected void initCollectionDisplay(org.sandev.basics.util.UIFormContext uifc,
                                     java.lang.String dispClass,
                                     org.sandev.basics.structs.SandCollectionMessage coll)
This method factors the calls for the standard form context settings used during initialization of a listing display.


getSpecifiedInstance

public static org.sandev.basics.structs.SandPersistMessage getSpecifiedInstance(org.sandev.basics.util.UIFormContext uifc,
                                                                                org.sandev.basics.util.UIFormOwner owner,
                                                                                org.sandev.basics.util.AuthUser user)
Get specified instance. If we are given "class" and "id" values in the parameters, then we are being asked to display a specific instance. This method retrieves that instance so that forms can support appropriate displays.

This method does not throw. If anything goes wrong, it simply returns null. It is public and static to allow for use from the ActionDispatcher.


hasClassQueryAccess

protected boolean hasClassQueryAccess(java.lang.String classname,
                                      org.sandev.basics.util.UIFormOwner owner,
                                      org.sandev.basics.util.AuthUser user)
Returns true if this user has unrestricted access to the query form of the specified message class. At a minimum, this means they must have AUTH_UNRESTRICTED access message class itself, but it also means that providing for a general query capability of this type is appropriate.


setContextFromQuery

protected org.sandev.basics.util.UIFormContext setContextFromQuery(org.sandev.basics.util.UIFormContext uifc,
                                                                   org.sandev.basics.util.UIFormOwner owner,
                                                                   org.sandev.basics.util.AuthUser user,
                                                                   java.lang.String shortStructClassName,
                                                                   org.sandev.basics.structs.SandAttrVal[] matchInfo)
                                                            throws org.sandev.basics.util.UIFormManagerException
Given the short form of a struct message class, call the formFind method of the owner with the corresponding query message to get an initial collection for display.

Throws:
org.sandev.basics.util.UIFormManagerException

setContextFromQuery

protected org.sandev.basics.util.UIFormContext setContextFromQuery(org.sandev.basics.util.UIFormContext uifc,
                                                                   org.sandev.basics.util.UIFormOwner owner,
                                                                   org.sandev.basics.util.AuthUser user,
                                                                   java.lang.String shortStructClassName,
                                                                   org.sandev.basics.structs.SandAttrVal[] matchInfo,
                                                                   int ordering)
                                                            throws org.sandev.basics.util.UIFormManagerException
Given the short form of a struct message class, call the formFind method of the owner with the corresponding query message to get an initial collection for display.

Throws:
org.sandev.basics.util.UIFormManagerException

drivenByURLParameters

protected boolean drivenByURLParameters(org.sandev.basics.util.UIFormContext uifc,
                                        org.sandev.basics.util.UserWorkLog uwl,
                                        org.sandev.basics.util.UIFormOwner owner,
                                        org.sandev.basics.util.AuthUser user)
                                 throws org.sandev.basics.util.UIFormManagerException
Read the URL parameters and initialize the uifc if specified. Return true if the uifc was set from the params, false otherwise.

Throws:
org.sandev.basics.util.UIFormManagerException