com.arsdigita.cms.ui.authoring
Class BasicItemForm

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.FormSection
              extended bycom.arsdigita.cms.ui.authoring.BasicItemForm
All Implemented Interfaces:
Cloneable, com.arsdigita.bebop.Component, com.arsdigita.bebop.Container, EventListener, com.arsdigita.bebop.event.FormInitListener, com.arsdigita.bebop.event.FormProcessListener, com.arsdigita.bebop.event.FormValidationListener, com.arsdigita.util.Lockable
Direct Known Subclasses:
BasicPageForm, ContentGroupPropertyForm, FolderForm, TemplateCreate

public abstract class BasicItemForm
extends com.arsdigita.bebop.FormSection
implements com.arsdigita.bebop.event.FormInitListener, com.arsdigita.bebop.event.FormProcessListener, com.arsdigita.bebop.event.FormValidationListener

A form for editing subclasses of ContentItem. This is just a convenience class.

Version:
$Revision: #12 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Stanislav Freidin (stas@arsdigita.com)

Field Summary
static String LANGUAGE
           
static String NAME
           
static String TITLE
           
 
Fields inherited from class com.arsdigita.bebop.FormSection
m_formModel, m_panel, versionId
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.event.FormInitListener
versionId
 
Fields inherited from interface com.arsdigita.bebop.event.FormProcessListener
versionId
 
Fields inherited from interface com.arsdigita.bebop.event.FormValidationListener
versionId
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
BasicItemForm(String formName, com.arsdigita.bebop.ColumnPanel columnPanel, ItemSelectionModel itemModel)
          Construct a new BasicItemForm with nothing on it
BasicItemForm(String formName, ItemSelectionModel itemModel)
          Construct a new BasicItemForm
 
Method Summary
 void add(com.arsdigita.bebop.Component pc)
          Adds a component to this container.
 void add(com.arsdigita.bebop.Component pc, int constraints)
          Adds a component with the specified layout constraints to this container.
 void addSaveCancelSection()
          instanciate and add the save/cancel section for this form
protected  void addWidgets()
          Add various widgets to the form.
 void generateXML(com.arsdigita.bebop.PageState ps, com.arsdigita.xml.Element parent)
           
static Collection getAllVersionIDs(ContentItem item)
           
 ItemSelectionModel getItemSelectionModel()
           
 com.arsdigita.bebop.SaveCancelSection getSaveCancelSection()
           
abstract  void init(com.arsdigita.bebop.event.FormSectionEvent e)
          Perform form initialization.
abstract  void process(com.arsdigita.bebop.event.FormSectionEvent e)
          Process the form.
 void validate(com.arsdigita.bebop.event.FormSectionEvent e)
          Validate the form.
 void validateNameUniqueness(Folder parent, com.arsdigita.bebop.event.FormSectionEvent event)
          Ensure that the name of an item is unique within a folder.
 void validateNameUniquenessWithinCategory(com.arsdigita.bebop.event.FormSectionEvent event, BigDecimal id)
          Ensure that the name of an item is unique within a category.
 
Methods inherited from class com.arsdigita.bebop.FormSection
addCancelListener, addInitListener, addProcessListener, addSubmissionListener, addValidationListener, children, contains, createInitListener, createProcessListener, createSubmissionListener, createValidationListener, fireCancel, fireInit, fireProcess, fireSubmitted, fireValidate, forwardInit, forwardProcess, forwardSubmission, forwardValidation, get, getModel, getPanel, indexOf, isEmpty, lock, process, register, removeCancelListener, removeInitListener, removeProcessListener, removeSubmissionListener, removeValidationListener, respond, size
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, register, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

TITLE

public static final String TITLE
See Also:
Constant Field Values

LANGUAGE

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

BasicItemForm

public BasicItemForm(String formName,
                     ItemSelectionModel itemModel)
Construct a new BasicItemForm

Parameters:
formName - the name of this form
itemModel - The ItemSelectionModel which will be responsible for loading the current item

BasicItemForm

public BasicItemForm(String formName,
                     com.arsdigita.bebop.ColumnPanel columnPanel,
                     ItemSelectionModel itemModel)
Construct a new BasicItemForm with nothing on it

Parameters:
formName - the name of this form
columnPanel - the columnpanel of the form
itemModel - The ItemSelectionModel which will be responsible for loading the current item
Method Detail

addSaveCancelSection

public void addSaveCancelSection()
instanciate and add the save/cancel section for this form


addWidgets

protected void addWidgets()
Add various widgets to the form. Child classes should override this method to perform all their widget-adding needs


generateXML

public void generateXML(com.arsdigita.bebop.PageState ps,
                        com.arsdigita.xml.Element parent)
Specified by:
generateXML in interface com.arsdigita.bebop.Component

getItemSelectionModel

public ItemSelectionModel getItemSelectionModel()
Returns:
the item selection model used in this form

getSaveCancelSection

public com.arsdigita.bebop.SaveCancelSection getSaveCancelSection()
Returns:
the save/cancel section for this form

init

public abstract void init(com.arsdigita.bebop.event.FormSectionEvent e)
                   throws com.arsdigita.bebop.FormProcessException
Perform form initialization. Children should override this this method to pre-fill the widgets with data, instantiate the content item, etc.

Specified by:
init in interface com.arsdigita.bebop.event.FormInitListener
Throws:
com.arsdigita.bebop.FormProcessException

process

public abstract void process(com.arsdigita.bebop.event.FormSectionEvent e)
                      throws com.arsdigita.bebop.FormProcessException
Process the form. Children should override this method to save the user's changes to the database.

Specified by:
process in interface com.arsdigita.bebop.event.FormProcessListener
Throws:
com.arsdigita.bebop.FormProcessException

validate

public void validate(com.arsdigita.bebop.event.FormSectionEvent e)
              throws com.arsdigita.bebop.FormProcessException
Validate the form. Children should override this method to provide custom form validation.

Specified by:
validate in interface com.arsdigita.bebop.event.FormValidationListener
Throws:
com.arsdigita.bebop.FormProcessException

validateNameUniqueness

public void validateNameUniqueness(Folder parent,
                                   com.arsdigita.bebop.event.FormSectionEvent event)
                            throws com.arsdigita.bebop.FormProcessException
Ensure that the name of an item is unique within a folder. A "New item" form should call this method in the validation listener.

Parameters:
parent - the folder in which to check
event - the FormSectionEvent which was passed to the validation listener
Throws:
com.arsdigita.bebop.FormProcessException - if the folder already contains an item with the name the user provided on the input form.

validateNameUniquenessWithinCategory

public void validateNameUniquenessWithinCategory(com.arsdigita.bebop.event.FormSectionEvent event,
                                                 BigDecimal id)
                                          throws com.arsdigita.bebop.FormProcessException
Ensure that the name of an item is unique within a category. This should only be called from the validation listener of an "edit" form.

Parameters:
event - the FormSectionEvent which was passed to the validation listener
id - The id of the item that is being checked. This must no be null.
Throws:
com.arsdigita.bebop.FormProcessException - if the folder already contains an item with the name the user provided on the input form.

getAllVersionIDs

public static Collection getAllVersionIDs(ContentItem item)

add

public void add(com.arsdigita.bebop.Component pc)
Adds a component to this container.

Specified by:
add in interface com.arsdigita.bebop.Container
Parameters:
pc - the component to add to this BasicPageForm

add

public void add(com.arsdigita.bebop.Component pc,
                int constraints)
Adds a component with the specified layout constraints to this container. Layout constraints are defined in each layout container as static ints. Use a bitwise OR to specify multiple constraints.

Specified by:
add in interface com.arsdigita.bebop.Container
Parameters:
pc - the component to add to this container
constraints - layout constraints (a bitwise OR of static ints in the particular layout)


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