com.arsdigita.bebop.portal
Class Portlet

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.SimpleContainer
                      extended bycom.arsdigita.bebop.portal.Portlet
All Implemented Interfaces:
BebopConstants, Cloneable, Component, Container, Lockable, PortletRenderer
Direct Known Subclasses:
AbstractPortletRenderer

public class Portlet
extends SimpleContainer
implements PortletRenderer, BebopConstants

A Portlet is the basic unit that Portals are constructed out of. All children of non-model backed Portals must be Portlets.

The generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element) method in this class provides a default XML dressing around a portlet. This dressing is used by Portal's stylesheet rules to generate a title and frame around each portlet. Each child of the Portlet will have its XML generated within this title/frame.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/portal/Portlet.java#9 $
Author:
Justin Ross, James Parsons, Bill Schneider
See Also:
Portal

Field Summary
static String NARROW_PROFILE
          The narrow profile type.
static String versionId
           
static String WIDE_PROFILE
          The wide profile type.
 
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
Portlet()
           
 
Method Summary
 void generateXML(PageState pageState, Element parentElement)
          An implementation of generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element) that provides a default Portlet mini-schema.
 Object getCacheKey()
           
 int getCellNumber()
          Get the cell number of this portlet.
 String getProfile()
          Get the profile of this portlet.
 int getSortKey()
          Get the sort key of this portlet.
 String getTitle()
          Get the title of this portlet.
 boolean isDirty()
           
 void setCellNumber(int cellNumber)
          Set the cell number of this portlet.
 void setPortletAttribute(String name, String value)
           
 void setProfile(String profile)
          Set the profile of this portlet.
 void setSortKey(int sortKey)
          Set the sort key of this portlet.
 void setTitle(String title)
          Set the title of this portlet.
 
Methods inherited from class com.arsdigita.bebop.SimpleContainer
add, add, children, contains, generateChildrenXML, generateParent, get, getNamespace, getTag, indexOf, isEmpty, setNamespace, setTag, size
 
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, lock, register, register, respond, 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, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked, lock
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

WIDE_PROFILE

public static final String WIDE_PROFILE
The wide profile type.

See Also:
Constant Field Values

NARROW_PROFILE

public static final String NARROW_PROFILE
The narrow profile type.

See Also:
Constant Field Values
Constructor Detail

Portlet

public Portlet()
Method Detail

setPortletAttribute

public void setPortletAttribute(String name,
                                String value)

generateXML

public void generateXML(PageState pageState,
                        Element parentElement)
An implementation of generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element) that provides a default Portlet mini-schema.
 <bebop:portlet title="A Portlet" cellNumber="1" profile="narrow">
   <!-- XML defined by children -->
 </bebop:portlet>
 

Specified by:
generateXML in interface PortletRenderer
Overrides:
generateXML in class SimpleContainer
Parameters:
pageState - the PageState representing the current request.
parentElement - the Element to which to attach the XML this method produces.
See Also:
SimpleContainer.setTag(String), SimpleContainer.setNamespace(String)

getCellNumber

public int getCellNumber()
Get the cell number of this portlet. A cell is one of several distinct regions, often columns, in a portal's layout.

Returns:
the cell number of this portlet. If the cell number is not set, returns 1.

setCellNumber

public void setCellNumber(int cellNumber)
Set the cell number of this portlet. A cell is one of several distinct regions, often columns, in a portal's layout.

Parameters:
cellNumber - the cell number of this portlet.

getSortKey

public int getSortKey()
Get the sort key of this portlet. The sort key is used to order the portlets in a given cell.

Returns:
the sort key of this portlet. If unset, returns 0;

setSortKey

public void setSortKey(int sortKey)
Set the sort key of this portlet. The sort key is used to order the portlets in a given cell.

Parameters:
sortKey - the sort key of this portlet.

getProfile

public String getProfile()
Get the profile of this portlet. Profile describes the form factor of this portlet. Right now there are two profiles, wide and narrow.

Returns:
the profile of this portlet. If profile is not set, returns empty string.

setProfile

public void setProfile(String profile)
Set the profile of this portlet. Profile describes the form factor of this portlet. Right now there are two profiles, wide and narrow. Use WIDE_PROFILE or NARROW_PROFILE to specify the profile type.

Parameters:
profile - the profile of this portlet.

getTitle

public String getTitle()
Get the title of this portlet.

Returns:
the title of this portlet. If title is not set, returns empty string.

setTitle

public void setTitle(String title)
Set the title of this portlet.

Returns:
the title of this portlet.

isDirty

public boolean isDirty()
Specified by:
isDirty in interface PortletRenderer

getCacheKey

public Object getCacheKey()
Specified by:
getCacheKey in interface PortletRenderer


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