Esri Geoportal Server
1.0

com.esri.gpt.catalog.schema
Class Input

java.lang.Object
  extended by com.esri.gpt.catalog.schema.Component
      extended by com.esri.gpt.catalog.schema.UiComponent
          extended by com.esri.gpt.catalog.schema.Input
Direct Known Subclasses:
InputMap, InputSelectManyCheckbox, InputSelectOneMenu, InputText

public abstract class Input
extends UiComponent

Super-class for an input component associated with a metadata schema.


Field Summary
static String INPUTTYPE_DELIMITEDTEXTAREA
          Delimited text area input type = "delimitedTextArea"
static String INPUTTYPE_MAP
          Interactive map input type = "map"
static String INPUTTYPE_SELECTMANYCHECKBOX
          Select many checkbox input type = "selectManyCheckbox"
static String INPUTTYPE_SELECTONEMEMU
          Select one menu input type = "selectOneMenu"
static String INPUTTYPE_SELECTWITHOTHER
          Select one menu with an "Other" option for inputting text = "selectWithOther"
static String INPUTTYPE_TEXT
          Text input type = "text"
static String INPUTTYPE_TEXTAREA
          Text area input type = "textArea"
static String INPUTTYPE_TEXTARRAY
          Text array input type = "textArray"
static String INPUTTYPE_UNKNOWN
          Unknown input type = "unknown"
 
Constructor Summary
Input()
          Default constructor.
Input(Input objectToDuplicate)
          Construct by duplicating an existing object.
 
Method Summary
protected  UIComponent applyHint(UiContext context, UIComponent inputComponent)
          Applies a hint to an input component if a hint resource key was configured.
 void configure(CfgContext context, Node node, NamedNodeMap attributes)
          Configures the object based upon a node loaded from a schema configuration XML.
abstract  Input duplicate()
          Produces a deep clone of the object.
 void echo(StringBuffer sb)
          Appends property information for the component to a StringBuffer.
protected  String evaluateDefault(UiContext context, String currentValue)
          Evaluates the default value for the input component.
protected  UIInput findInputComponent(UiContext context, UIComponent editorForm)
          Finds the associated Faces UIInput component.
protected  String formatValue(Parameter parameter, String value)
          Formats a value associated with a parameter.
 String getDefaultValue()
          Gets the default value.
 boolean getEditable()
          Gets the editable status.
 String getFacesId()
          Gets the Faces ID for the component.
 String getHintMode()
          Gets the mode for an optional hint ("inline","tip","toggle").
 String getHintResourceKey()
          Gets the UI property bundle resource key for a hint associated with the component.
protected  String getInputValue(UIInput input)
          Returns the String value for a Faces UIInput component.
 String getOnChange()
          Gets the Javascript associated with the onchange event.
 String getOnClick()
          Gets the Javascript associated with the onclick event.
 String getTestResourceKey()
          Gets the UI property bundle resource key for a test link button associated with the component.
abstract  UIComponent makeInputComponent(UiContext context, Section section, Parameter parameter)
          Makes the Faces UI input component for a parameter.
 UIComponent makeOutputComponent(UiContext context, Section section, Parameter parameter)
          Makes the Faces UI output component for a parameter.
 void setComponentValue(UiContext context, UIInput input, Parameter parameter)
          Sets the value for an input component.
 void setDefaultValue(String value)
          Sets the default value.
 void setEditable(boolean editable)
          Sets the editable status.
 void setFacesId(String id)
          Sets the Faces ID for the component.
 void setHintMode(String mode)
          Sets the mode for an optional hint ("inline","tip","toggle").
 void setHintResourceKey(String key)
          Sets the UI property bundle resource key for a hint associated with the component.
 void setOnChange(String js)
          Sets the Javascript associated with the onclick event.
 void setOnClick(String js)
          Sets the Javascript associated with the onclick event.
 void setTestResourceKey(String key)
          Sets the UI property bundle resource key for a test link button associated with the component.
 void unBind(UiContext context, UIComponent editorForm, Parameter parameter)
          Triggered on the save event from the metadata editor.
 
Methods inherited from class com.esri.gpt.catalog.schema.UiComponent
getStyleClass, makeBR, makeNBSP, setStyleClass
 
Methods inherited from class com.esri.gpt.catalog.schema.Component
getKey, setKey, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INPUTTYPE_DELIMITEDTEXTAREA

public static final String INPUTTYPE_DELIMITEDTEXTAREA
Delimited text area input type = "delimitedTextArea"

See Also:
Constant Field Values

INPUTTYPE_MAP

public static final String INPUTTYPE_MAP
Interactive map input type = "map"

See Also:
Constant Field Values

INPUTTYPE_SELECTMANYCHECKBOX

public static final String INPUTTYPE_SELECTMANYCHECKBOX
Select many checkbox input type = "selectManyCheckbox"

See Also:
Constant Field Values

INPUTTYPE_SELECTONEMEMU

public static final String INPUTTYPE_SELECTONEMEMU
Select one menu input type = "selectOneMenu"

See Also:
Constant Field Values

INPUTTYPE_SELECTWITHOTHER

public static final String INPUTTYPE_SELECTWITHOTHER
Select one menu with an "Other" option for inputting text = "selectWithOther"

See Also:
Constant Field Values

INPUTTYPE_TEXT

public static final String INPUTTYPE_TEXT
Text input type = "text"

See Also:
Constant Field Values

INPUTTYPE_TEXTAREA

public static final String INPUTTYPE_TEXTAREA
Text area input type = "textArea"

See Also:
Constant Field Values

INPUTTYPE_TEXTARRAY

public static final String INPUTTYPE_TEXTARRAY
Text array input type = "textArray"

See Also:
Constant Field Values

INPUTTYPE_UNKNOWN

public static final String INPUTTYPE_UNKNOWN
Unknown input type = "unknown"

See Also:
Constant Field Values
Constructor Detail

Input

public Input()
Default constructor.


Input

public Input(Input objectToDuplicate)
Construct by duplicating an existing object.

Parameters:
objectToDuplicate - the object to duplicate
Method Detail

getDefaultValue

public String getDefaultValue()
Gets the default value.

Returns:
the default value

setDefaultValue

public void setDefaultValue(String value)
Sets the default value.
The value is trimmed.
Null values are treated a empty strings.

Parameters:
value - the default value

getEditable

public boolean getEditable()
Gets the editable status.

Returns:
true if this input component is editable

setEditable

public void setEditable(boolean editable)
Sets the editable status.

Parameters:
editable - true if this input component is editable

getFacesId

public String getFacesId()
Gets the Faces ID for the component.

Returns:
the Faces ID

setFacesId

public void setFacesId(String id)
Sets the Faces ID for the component.
The '.' character will be replaced with the '.' character.

Parameters:
id - Faces ID

getHintMode

public String getHintMode()
Gets the mode for an optional hint ("inline","tip","toggle").

Returns:
the hint mode

setHintMode

public void setHintMode(String mode)
Sets the mode for an optional hint ("inline","tip","toggle"). associated with the component.

Parameters:
mode - the hint mode

getHintResourceKey

public String getHintResourceKey()
Gets the UI property bundle resource key for a hint associated with the component.

Returns:
the hint resource key

setHintResourceKey

public void setHintResourceKey(String key)
Sets the UI property bundle resource key for a hint associated with the component.
The key will be trimmed.
A null key is treated as an empty string.

Parameters:
key - the hint resource key

getOnChange

public String getOnChange()
Gets the Javascript associated with the onchange event.

Returns:
the Javascript

setOnChange

public void setOnChange(String js)
Sets the Javascript associated with the onclick event.

Parameters:
js - the Javascript

getOnClick

public String getOnClick()
Gets the Javascript associated with the onclick event.

Returns:
the Javascript

setOnClick

public void setOnClick(String js)
Sets the Javascript associated with the onclick event.

Parameters:
js - the Javascript

getTestResourceKey

public String getTestResourceKey()
Gets the UI property bundle resource key for a test link button associated with the component.

Returns:
the hint resource key

setTestResourceKey

public void setTestResourceKey(String key)
Sets the UI property bundle resource key for a test link button associated with the component.
The key will be trimmed.
A null key is treated as an empty string.

Parameters:
key - the hint resource key

applyHint

protected UIComponent applyHint(UiContext context,
                                UIComponent inputComponent)
Applies a hint to an input component if a hint resource key was configured.

If a hintResourceKey was configured, the supplied inputComponent and an HtmlOutputText representing the hint will be wrapped within an HtmlPanelGroup and the HtmlPanelGroup will be returned.

If a hintResourceKey was not configured, the supplied inputComponent will be returned.

Parameters:
context - the UI context
inputComponent - the subject input component
Returns:
the resultant UI component

configure

public void configure(CfgContext context,
                      Node node,
                      NamedNodeMap attributes)
Configures the object based upon a node loaded from a schema configuration XML.
The super.configure method should be invoked prior to any sub-class configuration.

The following attributes are configured:
defaultValue editable hintResourceKey hintMode onchange onclick testResourceKey

Overrides:
configure in class UiComponent
Parameters:
context - the configuration context
node - the configuration node
attributes - the attributes of the configuration node

duplicate

public abstract Input duplicate()
Produces a deep clone of the object.

The typical approach is to invoke a duplication constructor.
Example: return new InputText(this);

Specified by:
duplicate in class Component

echo

public void echo(StringBuffer sb)
Appends property information for the component to a StringBuffer.
The method is intended to support "FINEST" logging.
super.echo should be invoked prior appending any local information.

Overrides:
echo in class UiComponent
Parameters:
sb - the StringBuffer to use when appending information

evaluateDefault

protected String evaluateDefault(UiContext context,
                                 String currentValue)
Evaluates the default value for the input component.

Parameters:
context - the UI context
currentValue - the current value of the component
Returns:
the default or current value

findInputComponent

protected UIInput findInputComponent(UiContext context,
                                     UIComponent editorForm)
                              throws SchemaException
Finds the associated Faces UIInput component.

The Faces UIInput component is located using the supplied editorForm and the Faces ID for this Input instance, example:
editorForm.findComponent(getFacesId());

Parameters:
context - the UI context
editorForm - the Faces HtmlForm for the metadata editor
Throws:
SchemaException - if the associated Faces UIInput component cannot be located

formatValue

protected String formatValue(Parameter parameter,
                             String value)
Formats a value associated with a parameter.

Currently, only Date type values are formatted.

Parameters:
parameter - the associated parameter
value - the value to format

getInputValue

protected String getInputValue(UIInput input)
Returns the String value for a Faces UIInput component.

If the associated value is null or not a String, an empty String is returned.

Parameters:
input - the Faces input component whose value will be returned

makeInputComponent

public abstract UIComponent makeInputComponent(UiContext context,
                                               Section section,
                                               Parameter parameter)
Makes the Faces UI input component for a parameter.

It is the responsibility of the sub-class to instantiate the Faces UIComponent, set the id and bind to a parameter value.

Parameters:
context - the UI context
section - the parent section
parameter - the associated parameter
Returns:
the UI input component

makeOutputComponent

public UIComponent makeOutputComponent(UiContext context,
                                       Section section,
                                       Parameter parameter)
Makes the Faces UI output component for a parameter.

The output component is suitable for display on the metadata details page.

Parameters:
context - the UI context
section - the parent section
parameter - the associated parameter
Returns:
the UI input component

setComponentValue

public void setComponentValue(UiContext context,
                              UIInput input,
                              Parameter parameter)
Sets the value for an input component.

The value set is based upon the supplied parameter's singleValue.

Default values are evaluated if applicable. Date type values are formatted.

Parameters:
context - the UI context
input - the Faces input component
parameter - the associated parameter

unBind

public void unBind(UiContext context,
                   UIComponent editorForm,
                   Parameter parameter)
            throws SchemaException
Triggered on the save event from the metadata editor.

The intent is to give input objects an opportunity to propagate local component value(s) back into the parameter's value(s).

One example is the propagation of the input HtmlInputText value into the parameter's singleValue for an InputText component.

There is no default behavior.

Parameters:
context - the UI context
editorForm - the Faces HtmlForm for the metadata editor
parameter - the associated parameter
Throws:
SchemaException - if an associated Faces UIComponent cannot be located

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.