com.arsdigita.cms.ui.templates
Class ItemTemplatesListing

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.Table
                      extended bycom.arsdigita.toolbox.ui.DataTable
                          extended bycom.arsdigita.cms.ui.templates.TemplatesListing
                              extended bycom.arsdigita.cms.ui.templates.ItemTemplatesListing
All Implemented Interfaces:
com.arsdigita.bebop.util.BebopConstants, Cloneable, com.arsdigita.bebop.Component, com.arsdigita.util.Lockable, com.arsdigita.bebop.PaginationModelBuilder
Direct Known Subclasses:
ItemTemplates.ItemTemplatesListingImpl

public abstract class ItemTemplatesListing
extends com.arsdigita.cms.ui.templates.TemplatesListing

Displays all templates assigned to a content item. Allows the ability to unassign templates. Provides a link which should lead to some UI that will assign a new template to an item in the specified use context; it is up to the container of this class to actually implement this UI.

Version:
$Id: //cms/dev/src/com/arsdigita/cms/ui/templates/ItemTemplatesListing.java#12 $
Author:
Stanislav Freidin (sfreidin@arsdigita.com)

Nested Class Summary
protected static class ItemTemplatesListing.AssignCellRenderer
          Render the "assign" link/label
protected static class ItemTemplatesListing.ItemTemplatesListingModelBuilder
          This class allows us to use a compound key of context plus mimeType instead of only context
protected static class ItemTemplatesListing.ItemTemplatesListingTableModel
           
protected  class ItemTemplatesListing.PreviewCellRenderer
          Render the "preview" link/label
protected static class TemplatesListing.AbstractQueryBuilder
          Builds up a DataQuery from the collection
protected static class TemplatesListing.TemplateNameCellRenderer
          Renders the name of the template as a link
 
Nested classes inherited from class com.arsdigita.toolbox.ui.DataTable
com.arsdigita.toolbox.ui.DataTable.DataBuilderAdapter, com.arsdigita.toolbox.ui.DataTable.DataQueryTableModel, com.arsdigita.toolbox.ui.DataTable.DataTableColumnModel, com.arsdigita.toolbox.ui.DataTable.GlobalizedHeaderCellRenderer, com.arsdigita.toolbox.ui.DataTable.SortableTableColumn
 
Nested classes inherited from class com.arsdigita.bebop.Table
com.arsdigita.bebop.Table.MatrixTableModelBuilder
 
Field Summary
static String FULL_KEY
           
static String SEP_CHAR
           
 
Fields inherited from class com.arsdigita.toolbox.ui.DataTable
ASCENDING, DESCENDING, DIRECTION, ORDER, versionId
 
Fields inherited from class com.arsdigita.bebop.Table
CELL_EVENT, EMPTY_MODEL, SEP
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
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
 
Constructor Summary
ItemTemplatesListing(ItemSelectionModel itemModel)
          Construct a new SectionTemplatesListing
 
Method Summary
protected  void addRemoveColumn()
          Append a "remove" column to this table.
protected abstract  void assignLinkClicked(com.arsdigita.bebop.PageState s, ContentItem item, String useContext)
          Redirect to some template assignment UI which will assign a new template to the current item
protected static String buildKey(String useContext, String id, com.arsdigita.mimetypes.MimeType mimeType)
          this builds the key that can be decoded using the getUseContextFromKey getObjectIDFromKey, and getMimeTypeFromKey methods
 com.arsdigita.bebop.table.TableColumn getAssignColumn()
          Retrieve the "assign" column
protected  com.arsdigita.kernel.ui.ACSObjectSelectionModel getMappingModel()
          Return the ACSObjectSelectionModel used to select the current mapping
static com.arsdigita.mimetypes.MimeType getMimeTypeFromKey(String key)
          This takes in a key that is used to identify a row in the table and will return the encoded mime type or null if it is not specified
static String getObjectIDFromKey(String key)
          This takes in a key that is used to identify a row in the table and will return the encoded object id or null if it is not specified
 com.arsdigita.bebop.table.TableColumn getPreviewColumn()
          Retrieve the "previvew" column
 com.arsdigita.bebop.table.TableColumn getRemoveColumn()
          Return the TableColumn which will contain the "remove" link.
protected  TemplateCollection getTemplateCollection(com.arsdigita.bebop.PageState s)
          Get the templates for the current content section and type
static String getUseContextFromKey(String key)
          This takes in a key that is used to identify a row in the table and will return the encoded useContext or null if it is not specified
protected  void removeTemplate(com.arsdigita.bebop.PageState s, TemplateMapping m)
          Remove the current template
 
Methods inherited from class com.arsdigita.toolbox.ui.DataTable
addColumn, addColumn, addColumn, addColumn, addColumn, addQueryListener, fireQueryPending, generateExtraXMLAttributes, getDataQuery, getDataQueryBuilder, getDefaultOrder, getOrder, getOrderDirection, getOrderSelectionModel, getPaginator, getQuerySizeLocal, getResourceBundle, getTotalSize, globalize, lock, register, removeQueryListener, setDataQueryBuilder, setDefaultOrder, setOrder, setOrderDirection, setOrderSelectionModel, setPaginator, setResourceBundle, toggleOrderDirection
 
Methods inherited from class com.arsdigita.bebop.Table
addTableActionListener, children, clearSelection, createTableActionListener, fireCellSelected, fireHeadSelected, generateXML, getBorder, getCellPadding, getCellSpacing, getColumn, getColumnModel, getColumnSelectionModel, getControler, getDefaultCellRenderer, getEmptyView, getHeader, getModelBuilder, getRowSelectionModel, getStriped, getTableModel, getWidth, isSelectedCell, isSelectedColumn, isSelectedRow, removeTableActionListener, respond, setBorder, setCellPadding, setCellSpacing, setColumn, setColumnModel, setColumnSelectionModel, setDefaultCellRenderer, setEmptyView, setHeader, setModelBuilder, setRowSelectionModel, setStriped, setWidth
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
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.PaginationModelBuilder
isVisible
 

Field Detail

FULL_KEY

public static final String FULL_KEY
See Also:
Constant Field Values

SEP_CHAR

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

ItemTemplatesListing

public ItemTemplatesListing(ItemSelectionModel itemModel)
Construct a new SectionTemplatesListing

Parameters:
itemModel - The ItemSelectionModel that will supply the current content item to this component
Method Detail

getAssignColumn

public final com.arsdigita.bebop.table.TableColumn getAssignColumn()
Retrieve the "assign" column


getPreviewColumn

public final com.arsdigita.bebop.table.TableColumn getPreviewColumn()
Retrieve the "previvew" column


getTemplateCollection

protected TemplateCollection getTemplateCollection(com.arsdigita.bebop.PageState s)
Get the templates for the current content section and type

Returns:
the collection of all templates in the listing

removeTemplate

protected void removeTemplate(com.arsdigita.bebop.PageState s,
                              TemplateMapping m)
Remove the current template

Parameters:
m - the template mapping to be removed
s - the current page state
See Also:
TemplatesListing.addRemoveColumn()

assignLinkClicked

protected abstract void assignLinkClicked(com.arsdigita.bebop.PageState s,
                                          ContentItem item,
                                          String useContext)
Redirect to some template assignment UI which will assign a new template to the current item

Parameters:
s - the current page state
item - the current item

getMimeTypeFromKey

public static com.arsdigita.mimetypes.MimeType getMimeTypeFromKey(String key)
This takes in a key that is used to identify a row in the table and will return the encoded mime type or null if it is not specified


getObjectIDFromKey

public static String getObjectIDFromKey(String key)
This takes in a key that is used to identify a row in the table and will return the encoded object id or null if it is not specified


getUseContextFromKey

public static String getUseContextFromKey(String key)
This takes in a key that is used to identify a row in the table and will return the encoded useContext or null if it is not specified


buildKey

protected static String buildKey(String useContext,
                                 String id,
                                 com.arsdigita.mimetypes.MimeType mimeType)
this builds the key that can be decoded using the getUseContextFromKey getObjectIDFromKey, and getMimeTypeFromKey methods


getMappingModel

protected final com.arsdigita.kernel.ui.ACSObjectSelectionModel getMappingModel()
Return the ACSObjectSelectionModel used to select the current mapping


getRemoveColumn

public final com.arsdigita.bebop.table.TableColumn getRemoveColumn()
Return the TableColumn which will contain the "remove" link.

Returns:
the column that contains the "remove" link, or null if TemplatesListing.addRemoveColumn() has not been called yet
See Also:
TemplatesListing.addRemoveColumn()

addRemoveColumn

protected final void addRemoveColumn()
Append a "remove" column to this table. Child classes can call this method at construction time to add the "remove" column. The column is not added by default since this component can potentially be used for purely informational purposes.

The "remove" column will contain the current template as the value.



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