com.arsdigita.cms.ui
Class UniqueItemNameValidationListener

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

public class UniqueItemNameValidationListener
extends UniqueStringValidationListener

Ensures that the name of the item is unique by resolving the would-be URL of the item. If an item already "exists" at the URL in the current context, then the name is invalid.

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

Field Summary
static String versionId
           
 
Constructor Summary
UniqueItemNameValidationListener(com.arsdigita.bebop.form.Widget widget)
          Constructor.
UniqueItemNameValidationListener(com.arsdigita.bebop.form.Widget widget, String errorMsg)
          Constructor.
 
Method Summary
protected  ContentSection getContentSection(com.arsdigita.bebop.PageState state)
          Fetch the current content section.
protected  boolean isUnique(com.arsdigita.bebop.PageState state, String value)
          Returns true if the string value is unique, false otherwise.
 
Methods inherited from class com.arsdigita.cms.ui.util.UniqueStringValidationListener
validate
 
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

UniqueItemNameValidationListener

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

Parameters:
widget - The widget that contains the name of the item.

UniqueItemNameValidationListener

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

Parameters:
widget - The widget that contains the name of the item.
errorMsg - The error message
Method Detail

isUnique

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

Specified by:
isUnique in class UniqueStringValidationListener
Parameters:
state - The page state
value - The submitted string value
Returns:
true if the string value is unique, false otherwise

getContentSection

protected ContentSection getContentSection(com.arsdigita.bebop.PageState state)
Fetch the current content section.

Parameters:
state - The page state
Returns:
The current content section


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