com.arsdigita.bebop
Class AbstractPortlet

java.lang.Object
  extended bycom.arsdigita.bebop.AbstractPortlet
All Implemented Interfaces:
BebopConstants, Portlet

public abstract class AbstractPortlet
extends Object
implements Portlet, BebopConstants

An abstract implementation of Portlet that captures default behavior for portlets defined by users of the Portal component.

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. Programmers looking to implement a Portlet should extend this class and override generateBodyXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element).

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/AbstractPortlet.java#10 $
Author:
Justin Ross, James Parsons
See Also:
Portal, PortalModel, PortalModelBuilder, Portlet

Field Summary
static String NARROW_PROFILE
          The narrow profile type.
static String versionId
           
static String WIDE_PROFILE
          The wide profile type.
 
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
 
Constructor Summary
AbstractPortlet()
           
 
Method Summary
protected abstract  void generateBodyXML(PageState pageState, Element parentElement)
          Generates XML for the body (not the frame) of this Portlet.
 void generateXML(PageState pageState, Element parentElement)
          An implementation of Portlet.generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element) that provides a default Portlet mini-schema.
 int getCellNumber()
          Gets the cell number of this portlet.
 String getProfile()
          Gets the profile of this portlet, which describes the form factor of this portlet.
 int getSortKey()
          Gets the sort key of this portlet.
 String getTitle()
          Gets the title of this portlet.
 void setCellNumber(int cellNumber)
          Sets the cell number of this portlet.
 void setProfile(String profile)
          Sets the profile of this portlet.
 void setSortKey(int sortKey)
          Sets the sort key of this portlet.
 void setTitle(String title)
          Sets the title of this portlet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

AbstractPortlet

public AbstractPortlet()
Method Detail

generateXML

public final void generateXML(PageState pageState,
                              Element parentElement)
An implementation of Portlet.generateXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element) that provides a default Portlet mini-schema. Portlet implementers cannot override this method, as it is meant to give the Portal stylesheet something to grab on to. If you really want to go your own way, implement Portlet instead of extending AbstractPortlet.
 <bebop:portlet title="A Portlet" cellNumber="1" profile="narrow">
   <!-- XML defined in generateBodyXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element) -->
 </bebop:portlet>
 

Specified by:
generateXML in interface Portlet
Parameters:
pageState - the PageState representing the current request
parentElement - the Element to which to attach the XML that this method produces

generateBodyXML

protected abstract void generateBodyXML(PageState pageState,
                                        Element parentElement)
Generates XML for the body (not the frame) of this Portlet. It's the primary intention of this class that programmers override this particular method.

Parameters:
pageState - the PageState representing the current request
parentElement - the Element to which to attach the XML that this method produces

getCellNumber

public final int getCellNumber()
Gets 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, or 1 if the cell number is not set.

setCellNumber

public final void setCellNumber(int cellNumber)
Sets 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 final int getSortKey()
Gets 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, or 0 if the sort key is not set.

setSortKey

public final void setSortKey(int sortKey)
Sets 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 final String getProfile()
Gets the profile of this portlet, which describes the form factor of this portlet. There are two profiles, wide and narrow.

Returns:
the profile of this portlet, or an empty string if the profile is not set.

setProfile

public final void setProfile(String profile)
Sets the profile of this portlet. Profile describes the form factor of this portlet. 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 final String getTitle()
Gets the title of this portlet.

Returns:
the title of this portlet, or an empty string if the title is not set.

setTitle

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

Returns:
the title of this portlet.


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