jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.htform
Class CheckPasswordWidget

java.lang.Object
  extended byuk.co.weft.htform.ResourceConsumerImpl
      extended byuk.co.weft.domutil.NodeGeneratorImpl
          extended byuk.co.weft.htform.Widget
              extended byuk.co.weft.htform.CheckPasswordWidget
All Implemented Interfaces:
java.lang.Cloneable, NodeGenerator, ResourceConsumer

public class CheckPasswordWidget
extends Widget

A control for adding a new, or changing an old, password. If changing an old the context must contain sufficient information to authenticate the user using the old password - but then, it should anyway. Must be in an AuthenticatedForm.

Since:
Jacquard 1.9
Version:
$Revision: 1.8.4.4 $
Author:
Simon Brooke (simon

Field Summary
static java.lang.String FIRSTSUFFIX
          a suffix we will add to the widget name to store the first new value in the context
static int MINPASSWORDLENGTH
          the minimmum acceptable length of a password
static java.lang.String OLDSUFFIX
          a suffix we will add to the widget name to store the old password value in the context
static java.lang.String SECONDSUFFIX
          a suffix we will add to the widget name to store the second new value in the context
 boolean showOld
          whether or not to show a widget for the old password.
 
Fields inherited from class uk.co.weft.htform.Widget
ACTIONCSSCLASS, akprompt, attrs, CONTEXTATTRIBUTESSUFFIX, cssClass, DANGEROUSCSSCLASS, debug, DEFAULTTOKEN, dflt, form, generateAs, GENERATEASHTML, GENERATEASXFORM, GENERATEASXML, help, HELPTOKEN, immutable, ISIMMUTABLETOKEN, ISMANDATORYTOKEN, mandatory, MANDATORYCSSCLASS, maxVisibleSize, name, NAMETOKEN, OPTIONALCSSCLASS, PREVIOUSVALUESUFFIX, prompt, PROMPTTOKEN, size, SIZETOKEN, type, TYPETOKEN
 
Fields inherited from class uk.co.weft.domutil.NodeGeneratorImpl
namespaceURI
 
Fields inherited from class uk.co.weft.htform.ResourceConsumerImpl
resourceBundleName
 
Fields inherited from interface uk.co.weft.domutil.NodeGenerator
NAMESPACEURIMAGICTOKEN
 
Fields inherited from interface uk.co.weft.htform.ResourceConsumer
RESOURCEBUNDLEMAGICTOKEN
 
Constructor Summary
CheckPasswordWidget()
          If you use this constructor, you are strongly advised to use the init() method.
CheckPasswordWidget(java.lang.String name, java.lang.String prompt, java.lang.String help)
          Basic initialisation
 
Method Summary
 int getTabPlaces(Context context)
          How many tab places do I wish to use up in this context?
 void layout(Context context, int tabIndex)
          layout just the widget, without prompt, help, or surrounding context.
protected  void layoutPassInput(Context context, javax.servlet.ServletOutputStream out, java.lang.String subname, java.lang.String subprompt)
          Deprecated. use variant with tabIndex
protected  void layoutPassInput(Context context, javax.servlet.ServletOutputStream out, java.lang.String subname, java.lang.String subprompt, int tabIndex)
          layout one of the actual HTML input controls which make up part of this widget
protected  void layoutValue(Context context)
          Show only 'set' or 'unset'.
protected  void preProcess(Context context)
          if first and second values are available in the context, and non null, and equal to one another, then put that value on my name in the context.
 void setRealPassToken(java.lang.String string)
          Set my real password token to this value.
 
Methods inherited from class uk.co.weft.htform.Widget
clone, generate, generateAttributes, generateAttributes, generateHTML, generateHTMLPrompt, generateInnerHTML, generateValue, generateXML, getContextAttribute, getCssClass, getHeight, getHelp, getName, getPrompt, getType, getWidth, init, layout, layout, layout, layoutAttribute, layoutAttributes, makeReady, maybeLayout, maybeLayout, onloadRequest, onloadRequest, postProcess, scriptRequest, scriptRequest, setAttribute, setContextAttribute, setCssClass, setDebug, setDefault, setHelp, setImmutable, setMandatory, setMandatory, setName, setPrompt, setSize, setType
 
Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl
getNamespaceURI, setNamespaceURI
 
Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OLDSUFFIX

public static final java.lang.String OLDSUFFIX
a suffix we will add to the widget name to store the old password value in the context

See Also:
Constant Field Values

FIRSTSUFFIX

public static final java.lang.String FIRSTSUFFIX
a suffix we will add to the widget name to store the first new value in the context

See Also:
Constant Field Values

SECONDSUFFIX

public static final java.lang.String SECONDSUFFIX
a suffix we will add to the widget name to store the second new value in the context

See Also:
Constant Field Values

MINPASSWORDLENGTH

public static final int MINPASSWORDLENGTH
the minimmum acceptable length of a password

See Also:
Constant Field Values

showOld

public boolean showOld
whether or not to show a widget for the old password. Note that if you set this to true the widget can only be used to change the password for the currently logged in user.

Constructor Detail

CheckPasswordWidget

public CheckPasswordWidget()
If you use this constructor, you are strongly advised to use the init() method.

See Also:
Widget.init(Context)

CheckPasswordWidget

public CheckPasswordWidget(java.lang.String name,
                           java.lang.String prompt,
                           java.lang.String help)
Basic initialisation

Method Detail

setRealPassToken

public void setRealPassToken(java.lang.String string)
Set my real password token to this value.

Parameters:
string - the new token

getTabPlaces

public int getTabPlaces(Context context)
Description copied from class: Widget
How many tab places do I wish to use up in this context?

Overrides:
getTabPlaces in class Widget
Parameters:
context - the service context
Returns:
the number of tab places I require
See Also:
Widget.getTabPlaces(uk.co.weft.dbutil.Context)

layout

public void layout(Context context,
                   int tabIndex)
            throws DataStoreException,
                   javax.servlet.ServletException,
                   java.io.IOException
layout just the widget, without prompt, help, or surrounding context. One argument, the context in which I am to be laid out

Overrides:
layout in class Widget
Parameters:
context - the service context
tabIndex - the tabindex to use, ot the tab index of my first sub-widget if I have more than one
Throws:
DataStoreException - I don't, but things which specialise me may
javax.servlet.ServletException - I don't, but things which specialise me may
java.io.IOException - if can't write to the output stream

layoutPassInput

protected void layoutPassInput(Context context,
                               javax.servlet.ServletOutputStream out,
                               java.lang.String subname,
                               java.lang.String subprompt)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Deprecated. use variant with tabIndex

Throws:
javax.servlet.ServletException
java.io.IOException

layoutPassInput

protected void layoutPassInput(Context context,
                               javax.servlet.ServletOutputStream out,
                               java.lang.String subname,
                               java.lang.String subprompt,
                               int tabIndex)
                        throws javax.servlet.ServletException,
                               java.io.IOException
layout one of the actual HTML input controls which make up part of this widget

Parameters:
context - the context in which to lay it out
out - the stream on which to lay it out
subname - the name of the subwidget to lay out
subprompt - the prompt of the subwidget to lay out
tabIndex - the tab index to use
Throws:
javax.servlet.ServletException - if layoutAttributes fails
java.io.IOException - if for some reason we can;t write to the stream

layoutValue

protected void layoutValue(Context context)
                    throws DataFormatException,
                           javax.servlet.ServletException,
                           java.io.IOException
Show only 'set' or 'unset'. For security reasons, do not pass the value through in a hidden widget.

Overrides:
layoutValue in class Widget
Throws:
DataFormatException
javax.servlet.ServletException
java.io.IOException

preProcess

protected void preProcess(Context context)
                   throws DataStoreException,
                          javax.servlet.ServletException
if first and second values are available in the context, and non null, and equal to one another, then put that value on my name in the context.

Overrides:
preProcess in class Widget
Parameters:
context - the Context of the service in which I'm called
Throws:
javax.servlet.ServletException - if the thing itself breaks
DataStoreException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks