com.arsdigita.cms.ui.authoring
Class CreationSelector
java.lang.Object
com.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.FormSection
com.arsdigita.bebop.Form
com.arsdigita.bebop.MetaForm
com.arsdigita.cms.ui.authoring.CreationSelector
- All Implemented Interfaces:
- com.arsdigita.bebop.util.BebopConstants, Cloneable, com.arsdigita.bebop.Component, com.arsdigita.bebop.Container, com.arsdigita.util.Lockable
- public class CreationSelector
- extends com.arsdigita.bebop.MetaForm
An invisible component which contains all the possible creation
components. The components are loaded from the database at
construction time. The selector uses a SingleSelectionModel
in order to get the ID of the current content type.
Important: This component is passed in the
constructor to every authoring kit creation component (such as
PageCreate
). The creation component is supposed to follow
the following pattern:
// The member variable m_parent points to the CreationSelector
SomeContentItem item = somehowCreateTheItem(state);
item.setParent(m_parent.getFolder(state));
m_parent.editItem(state, item);
If the creation component wishes to cancel the creation process,
it should call
m_parent.redirectBack(state);
The component may also call
m_parent.getContentSection(state);
in order to get the current content section.
- Version:
- $Id: //cms/dev/src/com/arsdigita/cms/ui/authoring/CreationSelector.java#17 $
Fields inherited from class com.arsdigita.bebop.Form |
GET, POST |
Fields inherited from class com.arsdigita.bebop.FormSection |
m_formModel, m_panel |
Fields inherited from class com.arsdigita.bebop.SimpleComponent |
m_attr |
Fields inherited from interface com.arsdigita.bebop.util.BebopConstants |
BEBOP_BORDER, BEBOP_BOXPANEL, BEBOP_CELL, BEBOP_CHECKBOX, BEBOP_CHECKBOXGROUP, BEBOP_COLUMNPANEL, BEBOP_DATE, BEBOP_DATETIME, BEBOP_DHTMLEDITOR, BEBOP_FORMERRORS, BEBOP_FORMWIDGET, BEBOP_GRIDPANEL, BEBOP_LIST, BEBOP_MULTISELECT, BEBOP_OPTION, BEBOP_PAD, BEBOP_PADFRAME, BEBOP_PANELROW, BEBOP_PORTAL, BEBOP_PORTLET, BEBOP_RADIO, BEBOP_RADIOGROUP, BEBOP_SEG_BODY, BEBOP_SEG_HEADER, BEBOP_SEG_PANEL, BEBOP_SEGMENT, BEBOP_SELECT, BEBOP_TABLE, BEBOP_TABLEBODY, BEBOP_TABLEROW, BEBOP_TEXTAREA |
Fields inherited from interface com.arsdigita.bebop.Component |
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE |
Methods inherited from class com.arsdigita.bebop.MetaForm |
add, addMagicTag, generateXMLSansState, getDynamicForm, getFormData, getPanel, process, rebuildForm |
Methods inherited from class com.arsdigita.bebop.Form |
excludeParameterFromExport, generateErrors, generateXML, getAction, getName, getProcessInvisible, isRedirecting, respond, setAction, setEncType, setFormData, setMethod, setName, setOnReset, setOnSubmit, setProcessInvisible, setRedirecting, toString, traverse |
Methods inherited from class com.arsdigita.bebop.FormSection |
add, addCancelListener, addInitListener, addProcessListener, addSubmissionListener, addValidationListener, children, contains, createInitListener, createProcessListener, createSubmissionListener, createValidationListener, fireCancel, fireInit, fireProcess, fireSubmitted, fireValidate, forwardInit, forwardProcess, forwardSubmission, forwardValidation, get, getModel, indexOf, isEmpty, lock, register, removeCancelListener, removeInitListener, removeProcessListener, removeSubmissionListener, removeValidationListener, size |
Methods inherited from class com.arsdigita.bebop.SimpleComponent |
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible |
Methods inherited from class com.arsdigita.bebop.Completable |
addCompletionListener, fireCompletionEvent |
Methods inherited from interface com.arsdigita.bebop.Component |
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible |
Methods inherited from interface com.arsdigita.util.Lockable |
isLocked |
versionId
public static final String versionId
- See Also:
- Constant Field Values
ITEM_ID
public static final String ITEM_ID
- See Also:
- Constant Field Values
BUNDLE_ID
public static final String BUNDLE_ID
- See Also:
- Constant Field Values
CreationSelector
public CreationSelector(com.arsdigita.bebop.SingleSelectionModel typeModel,
FolderSelectionModel folderModel)
- Constructs a new
CreationSelector
. Load all the
possible creation components from the database and stick them
in the Map.
- Parameters:
typeModel
- the SingleSelectionModel
which will
supply a BigDecimal ID of the content type to instantiatefolderModel
- the FolderSelectionModel
containing
the folder in which new items are to be created
buildForm
public com.arsdigita.bebop.Form buildForm(com.arsdigita.bebop.PageState state)
register
public void register(com.arsdigita.bebop.Page p)
instantiateKitComponent
protected com.arsdigita.bebop.Component instantiateKitComponent(AuthoringKit kit,
ContentType type)
getFolder
public final Folder getFolder(com.arsdigita.bebop.PageState s)
- Return the currently selected folder. Creation components will place
new items in this folder.
- Parameters:
s
- represents the current request
- Returns:
- the currently selected folder, in which new items should be
placed.
getContentSection
public final ContentSection getContentSection(com.arsdigita.bebop.PageState s)
- Return the currently selected content section. New items created by
creation components will belong to this section. This is the content
section to which the folder returned by
getFolder
belongs.
- Parameters:
s
- represents the current request
- Returns:
- the currently selected content section.
editItem
public void editItem(com.arsdigita.bebop.PageState s,
ContentItem item)
- Forward to the item editing UI. The creation component of an authoring
kit may call this method to indicate that the creation process is
complete.
- Parameters:
s
- the page stateitem
- the newly created item
redirectBack
public void redirectBack(com.arsdigita.bebop.PageState state)
- Cancel item editing and go back to where the user came from
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC