com.arsdigita.cms.ui.util
Class UniqueStringValidationListener

java.lang.Object
  extended bycom.arsdigita.cms.ui.util.UniqueStringValidationListener
All Implemented Interfaces:
EventListener, com.arsdigita.bebop.event.FormValidationListener
Direct Known Subclasses:
UniqueItemNameValidationListener

public abstract class UniqueStringValidationListener
extends Object
implements com.arsdigita.bebop.event.FormValidationListener

Validates that the string value of the widget is unique.

Version:
$Revision: #5 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Michael Pih (pihman@arsdigita.com)

Field Summary
static String versionId
           
 
Constructor Summary
UniqueStringValidationListener(com.arsdigita.bebop.form.Widget widget)
          Constructor.
UniqueStringValidationListener(com.arsdigita.bebop.form.Widget widget, String errorMsg)
          Constructor.
 
Method Summary
protected abstract  boolean isUnique(com.arsdigita.bebop.PageState state, String value)
          Returns true if the string value is unique, false otherwise.
 void validate(com.arsdigita.bebop.event.FormSectionEvent event)
          Ensure that the name of the item is unique by resolving the would-be URL of the item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

UniqueStringValidationListener

public UniqueStringValidationListener(com.arsdigita.bebop.form.Widget widget)
Constructor.


UniqueStringValidationListener

public UniqueStringValidationListener(com.arsdigita.bebop.form.Widget widget,
                                      String errorMsg)
Constructor.

Parameters:
widget - The form widget
errorMsg - An error message
Method Detail

validate

public final void validate(com.arsdigita.bebop.event.FormSectionEvent event)
                    throws com.arsdigita.bebop.FormProcessException
Ensure that the name of the item is unique by resolving the would-be URL of the item. If an item "exists" at the URL already, then the name is invalid.

Specified by:
validate in interface com.arsdigita.bebop.event.FormValidationListener
Parameters:
event - The form section event
Throws:
com.arsdigita.bebop.FormProcessException

isUnique

protected abstract boolean isUnique(com.arsdigita.bebop.PageState state,
                                    String value)
Returns true if the string value is unique, false otherwise.

Parameters:
state - The page state
value - The submitted string value
Returns:
true if the string value is unique, false otherwise


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC