|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface UIFormAdaptor
Renders/reconstructs a UIFormContext to/from a user interface.
Implementations of UIFormAdaptor adapt specific user interface
technologies to standard application processing, while providing
for override customization. Implementations provide default
rendering capabilities, which can then be customized via
Most implementations will initialize and re-use a singleton processing class to reduce memory overhead. To support this, implementing classes must:
The UIFormAdaptor is intended to be technology neutral, and although
intermediate display code representations such as HTML map clearly, the
intention is to map to GUI displays, and even non-visual interfaces,
with the same application logic. Since forms in most interface
technologies can be converted to a parameter Map (the
essential job of a UIRenderInput object), and most display
technologies follow a setup/write-contents/close rendering paradigm,
the UIFormAdaptor interface can adapt most UI technologies. Not
all implementations will support all variants of UIRenderOutput
although they must support at least one. The UIFormAdaptor provides input
reconstruction through getFormContext and output rendering
via the dump* methods.
conventions:
Specific field tags (such as enumint, decimalize, flags, metatype, ref, range etc) may define their own rendering conventions. In the absence of specific overriding guidelines, a UIFormAdaptor implementation should follow these general conventions:
int, long) numeric types
are typically displayed in their native toString form
for a simple adaptor implementation. A more sophisticated general
implementation will take into account locale, and an adaptor tuned
for a specific application may also take into account units and/or
metatype information. An application may choose to handle units
and metatype translations via template transforms, or via
extension of the UIFormAdaptor, whichever is easier.
Date display
typically follows the default java.text.DateFormat
conversions. More sophisticated implementations may utilize
locale information, user preferances, screen constraints,
calendars and other intelligent controls.
http://thisapp/ScreenName?myParam=myValinto a clickable link leading to the corresponding screen display. The "http://" character sequence signals the need for a link, the the "thisapp" character sequence signals the need for a translation into the UI framework link processing, regardless of the display technology being adapted. The ScreenName is a defined Screen instance in the SandUI. The "scr" parameter name is reserved for post-translation use by the SAND UI processing.
| Field Summary | |
|---|---|
static java.lang.String |
SANDUILINK_REGEXP
An regular expression which can be used to match SAND UI links in report text. |
| Method Summary | |
|---|---|
boolean |
allowEditReadOnly()
Returns false unless immutable SAND message fields should be displayed as editable. |
void |
dumpFormOutput(UIRenderOutput uiro,
java.lang.String formName,
UIFormContext uifc,
UIFormAdaptorCallback callback,
AuthUser user,
AuthFilter filter)
Translate the given UIFormContext into a display, via the given UIRenderOutput. |
void |
dumpPageFooter(UIRenderOutput uiro,
java.lang.String closure)
If the form display must be terminated with closing output, then this method dumps that output. |
void |
dumpPageHeader(UIRenderOutput uiro,
java.lang.String title,
UIFormOwner owner,
java.lang.Object context)
If the form display must be preceded by setup output, then this method dumps that output. |
boolean[] |
getActionSupportMap()
Returns the current actionSupportMap |
boolean[] |
getDefaultActionSupportMap()
Returns a default actionSupportMap |
UIFormContext |
getFormContext(UIRenderInput uiri,
java.lang.String formName,
UIFormContext uifc,
UIFormAdaptorCallback callback)
Given a map of our current parameter names and values, reconstruct the UIFormContext and return it. |
java.lang.String |
getHiddenFieldValue()
When a field is accessible, but it's value in a particular instance is not, then something must still be displayed. |
InstanceClassEnumerator |
getInstanceClassEnumerator()
Return an InstanceClassEnumerator for the UIFormManager or other caller to use. |
UIRenderInput |
getUIRenderInput()
Return a UIRenderInput instance appropriate for this adaptor. |
UIRenderOutputDirect |
getUIRenderOutputDirect()
Return a UIRenderOutputDirect instance appropriate for this adaptor. |
UIRenderOutputStream |
getUIRenderOutputStream()
Return a UIRenderOutputStream instance appropriate for this adaptor. |
UIRenderOutputString |
getUIRenderOutputString()
Return a UIRenderOutput instance appropriate for this adaptor, where the result can be accessed as a String. |
SandInstanceMessage |
newInstanceMessage(java.lang.String classtype)
Given the short class name of a SandInstanceMessage, return a new object instance of that class. |
void |
setActionSupportMap(boolean[] actionFlags)
Sets the array of boolean flags describing which top level actions are supported. |
void |
setAllowEditReadOnly(boolean val)
Sets the value returned by the allowEditReadOnly method. |
void |
setHiddenFieldValue(java.lang.String val)
Sets the value to be returned by getHiddenFieldValue. |
| Field Detail |
|---|
static final java.lang.String SANDUILINK_REGEXP
groups:
| Method Detail |
|---|
UIRenderInput getUIRenderInput()
UIRenderOutputDirect getUIRenderOutputDirect()
UIRenderOutputStream getUIRenderOutputStream()
UIRenderOutputString getUIRenderOutputString()
UIFormContext getFormContext(UIRenderInput uiri,
java.lang.String formName,
UIFormContext uifc,
UIFormAdaptorCallback callback)
throws UIFormAdaptorException
If not null, the given form context is used as the working space into which the display values are loaded, so the values in it function as defaults. If null, a new UIFormContext is allocated.
UIFormAdaptorException
void dumpFormOutput(UIRenderOutput uiro,
java.lang.String formName,
UIFormContext uifc,
UIFormAdaptorCallback callback,
AuthUser user,
AuthFilter filter)
throws UIFormAdaptorException
A display will access referenced objects to provide for reasonable linkage descriptions using the instance field values. To do this, it must have access to instance lookup utils.
An adaptor may remove action buttons and/or filter the display of fields and values to avoid presenting scenarios that will be rejected in authorization processing. To do this, the adaptor requires a user and an AuthFilter. If either of these is null or otherwise invalid, then the adaptor will not be able to provide this filtering capability.
Note that it is up to the caller to deal with class level authorization hiding. When the adaptor is called with a given class, it doesn't have much choice except to render a form for it. The adaptor can filter at the field/value/button level only.
UIFormAdaptorException
void dumpPageHeader(UIRenderOutput uiro,
java.lang.String title,
UIFormOwner owner,
java.lang.Object context)
throws UIFormAdaptorException
The owner is provided to allow for callback processing. The context provides additional information for the callback to use, depending on the interface implementation.
UIFormAdaptorException
void dumpPageFooter(UIRenderOutput uiro,
java.lang.String closure)
throws UIFormAdaptorException
UIFormAdaptorException
void setActionSupportMap(boolean[] actionFlags)
throws UIFormAdaptorException
An action is enabled if:
UIFormContext modePath
During processing, the UIFormContext is first initialized
with a copy of this actionSupportMap. Then actions which are not
relevant to the current mode, or which the user is not authorized
for, are disabled.
Note that this mapping array is for top level actions only. Field-level actions (add/delete or find/remove) are determined solely based on the context and user authorization.
UIFormAdaptorExceptionboolean[] getActionSupportMap()
boolean[] getDefaultActionSupportMap()
java.lang.String getHiddenFieldValue()
void setHiddenFieldValue(java.lang.String val)
boolean allowEditReadOnly()
uniqueID are
usually read-only, but may need to be hand edited in some cases
(such as specifying initial data for a deployment configuration).
If no value has been explicitely set using setAllowEditReadOnly,
then this method returns false. This mechanism is intentionally separate from displaying fields as read-only based on authorization. If a user is not authorized to view or edit a message field, then it is up to the UI to filter the resulting display.
void setAllowEditReadOnly(boolean val)
SandInstanceMessage newInstanceMessage(java.lang.String classtype)
throws UIFormAdaptorException
UIFormAdaptorExceptionInstanceClassEnumerator getInstanceClassEnumerator()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||