Package overit.geocall.basic.ui.control
Class InputPassword
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.control.Input
overit.geocall.basic.ui.control.InputPassword
- All Implemented Interfaces:
Serializable,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,Arrangeable,Badgeable,ValueValidator,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
@Component
@Configurable
@Ignore("FILTER_CRITERION")
public class InputPassword
extends Input
implements Arrangeable
This class implements an input field that hides the characters while the user types in his password.
This input offers additional potential for validation; in fact, it is possible to insert in the configuration file some rules (minimum length, presence of particular characters, different value against the username, and other constraints) which will be validated during the form submission.
It is also possible to create a couple of InputPassword fields to force the user to reinsert the password, avoiding possbile typing errors and verifying the password consistency
This input offers additional potential for validation; in fact, it is possible to insert in the configuration file some rules (minimum length, presence of particular characters, different value against the username, and other constraints) which will be validated during the form submission.
It is also possible to create a couple of InputPassword fields to force the user to reinsert the password, avoiding possbile typing errors and verifying the password consistency
- See Also:
- GCApi:
- component
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefine the source against with the constraints validation must be performedNested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Booleanprotected Stringprotected InputPassword.ValidationModeFields inherited from class overit.geocall.basic.ui.control.Input
_autofocus, _da, _dao, _dao0, _defaultFocus, _event, _eventicon, _eventmsg, _eventparam, _eventprompt, _eventsnumber, _eventtitle, _ff, _fullSize, _hidden, _hinter, _hints, _hintsCache, _key, _label2, _letterCase, _maxlength, _msg, _msgCampoObbligatorio, _msgErroreCampo, _notnull, _numeric, _placeholder, _query, _roevent, _size, _value, autocomplete, configuredFullSize, configuredNotNull, configuredSize, FILTER_CRITERION_ATTRIBUTE, filterCriteria, FULL_SIZE_ATTRIBUTE, NOT_NULL_ATTRIBUTE, promptEmpty, SIZE_ATTRIBUTEFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttributes(org.apache.ecs.html.Input i) voidEvery component can add a script to the StringBuilder, script executed when the component is displayed.voidEvery component can add a script to the StringBuilder, script executed when the component is created.org.apache.ecs.ElementgetContentHtml(Object generationhandle, EntitySet es) Implements the interfaceArrangeable.org.apache.ecs.ElementgetDescriptionHtml(Object generationhandle, EntitySet es) Implements the interfaceArrangeable.Implements the interfaceArrangeableorg.apache.ecs.ElementgetHiddenHtml(Object generationhandle, EntitySet es) Implements the interfaceArrangeable.org.apache.ecs.ElementReturns the html of the Input elementstatic HashGettergetPasswordValidationAttribute(Identity identity, boolean validation, String minlength, String maxlength) Returns the password validation attributesstatic StringgetRegExList(HashGetter hg, List<String> constraintIds, Teacher t) Return a string containing the list of regular expressionsstatic StringgetRegExList(Identity identity, List<String> constraintIds, Teacher t) Return a string containing the list of regular expressionsprotected booleanprotected Stringprotected Stringprotected StringprepareValue(String name, String def) voidsetPASSWORDALGORITHM(String passwordAlgorithm) Sets forcibly, for this specific password field, the algorithm used to crypt te password.protected voidsetup()Setup the ComponentvoidSets the string containing the reference at the name of the username field.voidDefines if the field verifies that the password value respects the password constraints defined in the configuration's filevoidSets the string containing the validation mode of the InputPassword.voidSets the string containing the name of the InputPassword whose value must matches in order to pass the validation.protected voidprotected voidvalidateNotNull(String name, Object value, boolean strong, Map arriving) protected voidvalidateUnchangingValue(String name, Object value, Object published, boolean strong, Map arriving) Methods inherited from class overit.geocall.basic.ui.control.Input
addEventButtons, addHint, addHint, addHintsButton, ajaxQuery, connect, control, getClassStyle, getConfigurableProperties, getDefaultValue, getFilterCriteriaToRemove, getFullSize, getHIDDEN, getHintsEventButton, getHintsFieldName, getInsideEventButton, getInsideEventButton, getLetterCase, getNOTNULL, getSize, getVisibleDescriptionHtml, isImportant, isNotNull, isValueIgnoredByCriterion, prepareName, queryHints, registerValidators, setAUTOCOMPLETE, setAUTOFOCUS, setConfiguredProperty, setDA, setDAO, setDAO0, setDEFAULTFOCUS, setEVENT, setEVENTMSG, setEVENTPARAM, setEVENTPROMPT, setEVENTTITLE, setFILTERCRITERIA, setFULLSIZE, setHIDDEN, setHints, setHINTS, setHINTSCACHE, setICON, setIMPORTANT, setKEY, setLABEL2, setLETTERCASE, setMAXLENGTH, setModelProperties, setMSG, setNAME, setNOTNULL, setNUMERIC, setPARAM, setPLACEHOLDER, setPROMPT, setPROMPTEMPTY, setQUERY, setROEVENT, setSIZE, setupAutocomplete, setVALUE, validateChangingValue, validateConcreteValue, validateValueMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getBLANK, getCleaner, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getRO, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setDBLINK, setENABLED, setFUNCTION, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, appendAttribute, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBASIC, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setIdentity, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIcon
-
Field Details
-
_cryptalgoritm
-
_passwordAlgoritm
-
_userFieldRegistry
-
_verify
-
_msgPasswordNonCoincidono
-
_msgInserireAlmeno
-
_validation
-
_hadContent
protected boolean _hadContent -
validationMode
-
-
Constructor Details
-
InputPassword
public InputPassword()Creates an InputPassword
-
-
Method Details
-
buildDisplayScript
Every component can add a script to the StringBuilder, script executed when the component is displayed. The method add the script that manage the password verification field- Overrides:
buildDisplayScriptin classInput- Parameters:
sb- The StringBuilder on which we want to add the script
-
setPASSWORDALGORITHM
Sets forcibly, for this specific password field, the algorithm used to crypt te password. The hashing is done during the submit phase either from the client, or from the server depending on the configuration of the web context. If not defined, the algorithm will be readed from the configuration file- Parameters:
passwordAlgorithm- The string that defines one of the cryptation algorithm. Possible values are:
HEX_MD5, B64_MD5, HEX_SHA1, B64_SHA1, HEX_SHA256, B64_SHA256, HEX_SHA512, B64_SHA512
-
setVALIDATION
Defines if the field verifies that the password value respects the password constraints defined in the configuration's file- Parameters:
s- A string that represents a boolean value ("true" or "1", "false" or "0").
If the string is not recognized as a boolean value, it will be used the default value, that istrue
-
setUSERFIELDREGISTRY
Sets the string containing the reference at the name of the username field. If specified, the hashing is done considering the password and the username values, otherwise the hashing is limited to the password's value. By activating this mode, safety is improved and possible attempts to force the password are more difficult, longer and complex.- Parameters:
s- The string containing the reference at the name of the username field
-
setVERIFY
Sets the string containing the name of the InputPassword whose value must matches in order to pass the validation. This attribute allows a second InputPassword to be used as a verification field in order to force the user to reinsert the password, avoiding possible typing errors- Parameters:
s- The name of the InputPassword used to verify the password consistency
-
setVALIDATIONMODE
Sets the string containing the validation mode of the InputPassword. Possible value are:formoridentityIf the validation mode isformthen the values inside the form will be used to validate the password of the user. If the validation mode isidentitythen the values of the currently logged-in user will be used to validate the password.identityis the default option.- Parameters:
s- The string containing the validation mode. Possible value are:formoridentity.
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
validate
-
buildSetupScript
Description copied from class:ComponentEvery component can add a script to the StringBuilder, script executed when the component is created.- Overrides:
buildSetupScriptin classComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-
prepareValue
- Overrides:
prepareValuein classInput
-
prepareValue
-
prepareDAValue
-
getContentHtml
Description copied from class:InputImplements the interfaceArrangeable. It returns the html code that represents the active part of the input field, i.e. the field and the validation scripts- Specified by:
getContentHtmlin interfaceArrangeable- Overrides:
getContentHtmlin classInput- Parameters:
generationhandle- The handle of the generationes- TheEntitySetto which the element belongs- Returns:
- The html code of the input field or null if the field don't have a graphical representation
-
addAttributes
protected void addAttributes(org.apache.ecs.html.Input i) -
hadContent
protected boolean hadContent() -
getDescriptionHtml
Description copied from class:InputImplements the interfaceArrangeable. It returns the html code that represents the component description i.e. the formatted label of the field- Specified by:
getDescriptionHtmlin interfaceArrangeable- Overrides:
getDescriptionHtmlin classInput- Parameters:
generationhandle- The handle of the generationes- TheEntitySetto which the element belongs- Returns:
- The html code of the label, or null if the field don't have it or is hidden
-
getHiddenHtml
Description copied from class:InputImplements the interfaceArrangeable. It returns the hidden but active html part of an hidden input field.- Specified by:
getHiddenHtmlin interfaceArrangeable- Overrides:
getHiddenHtmlin classInput- Parameters:
generationhandle- The handle of the generationes- TheEntitySetto which the element belongs- Returns:
- The html code of the hidden part of the field or null if the field is visible.
-
getGenerationHandle
Description copied from class:InputImplements the interfaceArrangeable- Specified by:
getGenerationHandlein interfaceArrangeable- Overrides:
getGenerationHandlein classInput- Returns:
- null
-
getHtml
Description copied from class:InputReturns the html of the Input element -
getRegExList
Return a string containing the list of regular expressions- Parameters:
identity- The identityconstraintIds- list of the password constraints idst- Object used to translate- Returns:
- A string containing the list of regular expressions
-
getRegExList
Return a string containing the list of regular expressions- Parameters:
hg- The HashGetter containing the identity informationconstraintIds- list of the password constraints idst- Object used to translate- Returns:
- A string containing the list of regular expressions
-
getPasswordValidationAttribute
public static HashGetter getPasswordValidationAttribute(Identity identity, boolean validation, String minlength, String maxlength) Returns the password validation attributes- Parameters:
identity- The identityvalidation- Boolean value that defines if the field verifies that the password value respects the password constraints defined in the configuration's fileminlength- of the passwordmaxlength- of the password- Returns:
- An
HashGetterwith the validation attributes
-
validateUnchangingValue
protected void validateUnchangingValue(String name, Object value, Object published, boolean strong, Map arriving) throws ValidationException - Overrides:
validateUnchangingValuein classInput- Throws:
ValidationException
-
validateNotNull
protected void validateNotNull(String name, Object value, boolean strong, Map arriving) throws ValidationException - Overrides:
validateNotNullin classInput- Throws:
ValidationException
-