com.arsdigita.cms.ui.authoring
Class PageCreateDynamic

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.FormSection
              extended bycom.arsdigita.cms.ui.authoring.PageCreateDynamic
All Implemented Interfaces:
Cloneable, com.arsdigita.bebop.Component, com.arsdigita.bebop.Container, CreationComponent, EventListener, com.arsdigita.bebop.event.FormInitListener, com.arsdigita.bebop.event.FormProcessListener, com.arsdigita.bebop.event.FormSubmissionListener, com.arsdigita.bebop.event.FormValidationListener, com.arsdigita.util.Lockable

public class PageCreateDynamic
extends com.arsdigita.bebop.FormSection
implements com.arsdigita.bebop.event.FormInitListener, com.arsdigita.bebop.event.FormProcessListener, com.arsdigita.bebop.event.FormValidationListener, com.arsdigita.bebop.event.FormSubmissionListener, CreationComponent

The creation component for user-defined content items TODO: subclass PageCreate now that this no longer extends MetaForm?


Nested Class Summary
static class PageCreateDynamic.ContentItemSelectPrintListener
          A print listener for content item selection -- a select list of all content items of the given type
 
Field Summary
static String LANGUAGE
           
static String LAUNCH_DATE
           
static String NAME
           
static String SECTION_ID
          The state parameter which specifies the content section
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.event.FormSubmissionListener
versionId
 
Fields inherited from interface com.arsdigita.bebop.Container
versionId
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
PageCreateDynamic(ItemSelectionModel itemModel, CreationSelector parent)
          Construct a new PageCreationDynamic component
PageCreateDynamic(ItemSelectionModel itemModel, CreationSelector parent, ContentType useContentType)
          Construct a new PageCreationDynamic component
 
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.
 ContentPage createUDItem(com.arsdigita.bebop.PageState state)
          A utility method that will create a new userdefined content item of the correct object type and tell the selection model to select the new item.
 ItemSelectionModel getItemSelectionModel()
           
 com.arsdigita.bebop.SaveCancelSection getSaveCancelSection()
          Return the save/cancel section for this CreationComponent.
 ApplyWorkflowFormSection getWorkflowSection()
          Return the ApplyWorkflowFormSection associated with this CreationComponent.
 void init(com.arsdigita.bebop.event.FormSectionEvent e)
           
 void process(com.arsdigita.bebop.event.FormSectionEvent e)
          Process: save fields to the database
 void submitted(com.arsdigita.bebop.event.FormSectionEvent e)
          Submission: If the Cancel button was pressed, hide self and show the display component
 void validate(com.arsdigita.bebop.event.FormSectionEvent e)
          Validate: ensure name uniqueness
 void validateNameUniqueness(Folder parent, com.arsdigita.bebop.event.FormSectionEvent e)
          Ensure that the name of an item is unique within a folder.
 
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, generateXML, 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.cms.ui.authoring.CreationComponent
removeProcessListener
 
Methods inherited from interface com.arsdigita.bebop.Container
contains, get, indexOf, isEmpty, size
 
Methods inherited from interface com.arsdigita.bebop.Component
children, generateXML, getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked, lock
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

TITLE

public static final String TITLE
See Also:
Constant Field Values

LAUNCH_DATE

public static final String LAUNCH_DATE
See Also:
Constant Field Values

LANGUAGE

public static final String LANGUAGE
See Also:
Constant Field Values

SECTION_ID

public static final String SECTION_ID
The state parameter which specifies the content section

See Also:
Constant Field Values
Constructor Detail

PageCreateDynamic

public PageCreateDynamic(ItemSelectionModel itemModel,
                         CreationSelector parent)
Construct a new PageCreationDynamic component

Parameters:
itemModel - The ItemSelectionModel which will be responsible for loading the current item
parent - The CreationSelector parent. This class should call either the CreationSelector.redirectBack(PageState) or CreationSelector.editItem(PageState, ContentItem) methods on the parent eventually

PageCreateDynamic

public PageCreateDynamic(ItemSelectionModel itemModel,
                         CreationSelector parent,
                         ContentType useContentType)
Construct a new PageCreationDynamic component

Parameters:
itemModel - The ItemSelectionModel which will be responsible for loading the current item
parent - The CreationSelector parent. This class should call either the CreationSelector.redirectBack(PageState) or CreationSelector.editItem(PageState, ContentItem) methods on the parent eventually
useContentType - The content type to use for choosing dynamic components (if one UDCT inherits from another, type-specific attributes will be in separate steps).
Method Detail

addWidgets

protected void addWidgets()
Add various widgets to the form. Child classes should override this method to perform all their widget-adding needs adds both the name and titlle widgets and the persistent widgets stored in the persistent form associated with this content item


getItemSelectionModel

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

addSaveCancelSection

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

Specified by:
addSaveCancelSection in interface CreationComponent

getSaveCancelSection

public com.arsdigita.bebop.SaveCancelSection getSaveCancelSection()
Description copied from interface: CreationComponent
Return the save/cancel section for this CreationComponent.

Specified by:
getSaveCancelSection in interface CreationComponent
Returns:
the save/cancel section for this form

getWorkflowSection

public ApplyWorkflowFormSection getWorkflowSection()
Return the ApplyWorkflowFormSection associated with this CreationComponent.

Specified by:
getWorkflowSection in interface CreationComponent
Returns:
the ApplyWorkflowFormSection associated with this CreationComponent.

init

public void init(com.arsdigita.bebop.event.FormSectionEvent e)
          throws com.arsdigita.bebop.FormProcessException
Specified by:
init in interface com.arsdigita.bebop.event.FormInitListener
Throws:
com.arsdigita.bebop.FormProcessException

submitted

public void submitted(com.arsdigita.bebop.event.FormSectionEvent e)
               throws com.arsdigita.bebop.FormProcessException
Submission: If the Cancel button was pressed, hide self and show the display component

Specified by:
submitted in interface com.arsdigita.bebop.event.FormSubmissionListener
Throws:
com.arsdigita.bebop.FormProcessException

validate

public void validate(com.arsdigita.bebop.event.FormSectionEvent e)
              throws com.arsdigita.bebop.FormProcessException
Validate: ensure name uniqueness

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

process

public void process(com.arsdigita.bebop.event.FormSectionEvent e)
             throws com.arsdigita.bebop.FormProcessException
Process: save fields to the database

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

validateNameUniqueness

public void validateNameUniqueness(Folder parent,
                                   com.arsdigita.bebop.event.FormSectionEvent e)
                            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
e - 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.

createUDItem

public ContentPage createUDItem(com.arsdigita.bebop.PageState state)
                         throws com.arsdigita.bebop.FormProcessException
A utility method that will create a new userdefined content item of the correct object type and tell the selection model to select the new item.

Parameters:
state - the current page state
Returns:
the new content item (or a proper subclass thereof)
Throws:
com.arsdigita.bebop.FormProcessException

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