com.plumtree.portalpages.browsing.myportal
Class MyPortalContentView

java.lang.Object
  extended by com.plumtree.portalpages.browsing.myportal.MyPortalContentView
All Implemented Interfaces:
IManagedObject, IMVCObject, IView

public class MyPortalContentView
extends java.lang.Object
implements IView

CUSTOMIZABLE - If you want to customize the my page and community page layouts, subclass this class with a new class and customize the code in that new file. Do not alter the code this class at all. You only need to override the methods that you want to customize. Your new class will override MyPortalContentView through Dynamic Discovery. Please read the section on Dynamic Discovery in the UI Guide. The variables and methods in MyPortalContentView that you can customize in your new class are bounded by the comments BEGIN CUSTOMIZABLE CODE and END CUSTOMIZABLE CODE. Each customizable variable and method is also marked as such in its javadoc comments. The structure of how MyPortalContentView displays a mypage or community page is as follows. Display determines whether to call OneColumn, TwoColumns, ThreeColumns based upon whether the PageType of a page is a one, two, or three column layout. OneColumn, TwoColumns, and ThreeColumns determine whether or not there is a content canvas area to be displayed, where that content canvas area gets displayed, and they call PageColumnTable for each column in the layout. If the content canvas area spans more than one portlet column, then it gets a call to PageColumnTable for itself. PageColumnTable determines whether it needs to display a content canvas area above the portlets in the column it is displaying, and makes a call to PortletContent for that content canvas portlet. Then PageColumnTable makes a call to PortletHeader and PortletContent for each portlet in the column. PortletContent returns the content of the portlet, it should not under normal circumstances need to be customized. PortletHeader delegates the display of the portlet header to com.plumtree.portaluiinfrastructure.htmlconstructs.PTPortletTitleBar. If you want to customize the portlet header, make your own version of PTPortletTitleBar (with a different name) and have PortletHeader use that instead. PortletHeader calls GetPortletActions and passes the return value to PTPortletTitleBar. GetPortletActions puts the list of buttons to be displayed in the portlet header (other than the help button) into an array and returns that array. You can add more buttons to this array, or you can remove some of the default buttons. GetLayoutTable, GetNarrowColumn, GetWideColumn, GetPortletVerticalPadding, GetPortletVerticalPaddingRow, and GetPortletHorizontalPadding are the glue used to bind the portlets together and in most circumstances should not need to be customized.

Author:
MichaelD

Field Summary
protected  HTMLScript m_prefsDropDownInitializers
           
static int N_NARROW_COL_WIDTH
          CUSTOMIZABLE - The width of a narrow column.
static int N_PORTLET_PADDING
          CUSTOMIZABLE - The width of the padding between portlet columns and between portlets.
static java.lang.String STR_MVC_CLASS_NAME
          Object Name
static java.lang.String STR_NARROW_COL_WIDTH
          Narrow Column Width - String
static java.lang.String STR_PORTLET_PADDING
          Padding between Portlet Columns and between portlets - String
static java.lang.String strDisplayBlock
           
static java.lang.String strDisplayNone
           
static java.lang.String strExpandedDiv
           
static java.lang.String strMoreInfoDiv
          These strings are used when composing links for showing additional error information.
static java.lang.String strRefreshJSFunctionBegin
          These strings are used when composing the refresh link for the portlet.
static java.lang.String strRefreshJSFunctionEnd
           
static java.lang.String strReturnFalse
           
static java.lang.String strToggleJSFunctionBegin
           
static java.lang.String strToggleJSFunctionEnd
           
 
Constructor Summary
MyPortalContentView()
           
 
Method Summary
protected  void Add508AccessKeyAnchor(java.lang.String strPortletName, int nPortletIndex, HTMLTableCell cell)
          Given a cell and an int (a portlet index) adds HTML for an access anchor corresponding to that int, the title is set to the portlet name.
protected  void AddPTConstantsToPageScript(HTMLScript script)
          CUSTOMIZABLE Method AddPTConstantsToPageScript.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
 HTMLElement Display()
          CUSTOMIZABLE The Display() method's main function is to take the PageType of the page and determine whether the page has a one, two, or three column layout.
 HTMLScript DisplayJavascript()
          This method returns the HTMLScript that encompasses the Javascript on the page.
 HTMLElementCollection DisplaySinglePortlet(int nColumnID, int portletIndex)
          CUSTOMIZABLE
 HTMLElementCollection DisplaySinglePortletContent(int nColumnID, int portletIndex)
          CUSTOMIZABLE
protected  HTMLAnchor GetCollapseOrExpandAnchor(int nPortletIndex, java.lang.String strControl, PTImageType imgType, java.lang.String strTitle)
           
 HTMLTable GetLayoutTable(java.lang.String _strTableSummary)
          CUSTOMIZABLE Method GetLayoutTable.
 java.lang.String GetName()
          Return the name of the MVC object.
protected  HTMLTableCell GetNarrowColumn()
          CUSTOMIZABLE Method GetNarrowColumn.
protected  HTMLTableCell GetPortletButtonsCell(int nPortletIndex)
          CUSTOMIZABLE
protected  HTMLSpan GetPortletCollapseExpandAction(int nPortletIndex, java.lang.String strOnclickFunction)
          Obtain the collapse button from the portlet header given the portlet index.
 HTMLElementCollection GetPortletCollapseExpandButtonContent(int nPortletIndex)
          CUSTOMIZABLE
 HTMLElementCollection GetPortletCollapseExpandButtonContent(int nPortletIndex, java.lang.String strOnclickFunction)
           
 HTMLElementCollection GetPortletHelpButtonContent(int nPortletIndex)
          CUSTOMIZABLE
protected  HTMLTableCell GetPortletHorizontalPaddingCell()
          CUSTOMIZABLE Method GetPortletHorizontalPaddingCell.
protected  HTMLTableCell GetPortletHorizontalPaddingCell(java.lang.String _strColumnID)
          CUSTOMIZABLE Method GetPortletHorizontalPaddingCell.
protected  HTMLTableCell GetPortletNameCell(int nPortletIndex, int nColumnID)
          CUSTOMIZABLE
protected  HTMLSpan[] GetPortletPreferenceAction(int nPortletIndex)
          Obtain the Preference Button from the portlet header given the portlet index.
 HTMLElementCollection GetPortletPreferenceButtonContent(int nPortletIndex)
          CUSTOMIZABLE
 HTMLElementCollection GetPortletRefreshButtonContent(int nPortletIndex)
          CUSTOMIZABLE
protected  HTMLSpan GetPortletRemoveAction(int nPortletIndex)
           
 HTMLElementCollection GetPortletRemoveButtonContent(int nPortletIndex)
           
 HTMLTable GetPortletVerticalPadding()
          CUSTOMIZABLE Method GetPortletVerticalPadding.
protected  HTMLTableRow GetPortletVerticalPaddingRow(java.lang.String _colSpan)
          CUSTOMIZABLE Method GetPortletVerticalPadding.
protected  HTMLAnchor GetRemoveAnchor(int nPortletIndex, java.lang.String strControl, PTImageType imgType, java.lang.String strTitle)
           
protected  HTMLTableCell GetWideColumn()
          CUSTOMIZABLE Method GetWideColumn.
 void Init(IModelRO model, AActivitySpace parent)
          This method initializes the View with the read only model interface it is supposed to draw it's data from as well as it's parent ActivitySpace (necessary to create URLS).
protected  HTMLTable OneColumn(int nPageType)
          CUSTOMIZABLE
protected  HTMLElement PageColumnTable(int _nColumnID, boolean _bContainsFreeFormContent)
          CUSTOMIZABLE PortletContent must always be called before PortletHeader for a portlet.
 HTMLDiv PortletContent(int nPortletIndex, int nColumnID)
          // CR ROB: This file is customizable by users so add in useful descriptions of method and arguments
protected  HTMLTableRow PortletHeader(int nPortletIndex, int nColumnID)
          CUSTOMIZABLE
protected  HTMLTable ThreeColumns(int _nPageType)
          CUSTOMIZABLE
protected  HTMLTable TwoColumns(int _nPageType, PortletColumnConstants _narrowColumnToDisplay, boolean _bIsOuterTwoColumns)
          CUSTOMIZABLE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

N_NARROW_COL_WIDTH

public static final int N_NARROW_COL_WIDTH
CUSTOMIZABLE - The width of a narrow column.

See Also:
Constant Field Values

N_PORTLET_PADDING

public static final int N_PORTLET_PADDING
CUSTOMIZABLE - The width of the padding between portlet columns and between portlets.

See Also:
Constant Field Values

strRefreshJSFunctionBegin

public static final java.lang.String strRefreshJSFunctionBegin
These strings are used when composing the refresh link for the portlet.

See Also:
Constant Field Values

strRefreshJSFunctionEnd

public static final java.lang.String strRefreshJSFunctionEnd
See Also:
Constant Field Values

m_prefsDropDownInitializers

protected HTMLScript m_prefsDropDownInitializers

strMoreInfoDiv

public static final java.lang.String strMoreInfoDiv
These strings are used when composing links for showing additional error information.

See Also:
Constant Field Values

strExpandedDiv

public static final java.lang.String strExpandedDiv
See Also:
Constant Field Values

strToggleJSFunctionBegin

public static final java.lang.String strToggleJSFunctionBegin
See Also:
Constant Field Values

strToggleJSFunctionEnd

public static final java.lang.String strToggleJSFunctionEnd
See Also:
Constant Field Values

strReturnFalse

public static final java.lang.String strReturnFalse
See Also:
Constant Field Values

strDisplayNone

public static final java.lang.String strDisplayNone
See Also:
Constant Field Values

strDisplayBlock

public static final java.lang.String strDisplayBlock
See Also:
Constant Field Values

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
Object Name

See Also:
Constant Field Values

STR_NARROW_COL_WIDTH

public static final java.lang.String STR_NARROW_COL_WIDTH
Narrow Column Width - String


STR_PORTLET_PADDING

public static final java.lang.String STR_PORTLET_PADDING
Padding between Portlet Columns and between portlets - String

Constructor Detail

MyPortalContentView

public MyPortalContentView()
Method Detail

Display

public HTMLElement Display()
CUSTOMIZABLE The Display() method's main function is to take the PageType of the page and determine whether the page has a one, two, or three column layout. Although the page types THREE_COLUMN_NARROW_WIDENARROW_WFFC and THREE_COLUMN_NARROWWIDE_WFFC_NARROW are three column layout, we use the TwoColumns() method and create a nested table inside one of the columns that has two columns as well. TwoColumns() method uses the nPageType passed into it to determine this.

Specified by:
Display in interface IView

OneColumn

protected HTMLTable OneColumn(int nPageType)
                       throws HTMLException
CUSTOMIZABLE

Parameters:
nPageType -
Returns:
and HTMLTable that is the page layout of a one column page.
Throws:
HTMLException

ThreeColumns

protected HTMLTable ThreeColumns(int _nPageType)
                          throws HTMLException
CUSTOMIZABLE

Parameters:
nPageType -
Returns:
a HTMLTable that is the page layout of a three column page.
Throws:
HTMLException

TwoColumns

protected HTMLTable TwoColumns(int _nPageType,
                               PortletColumnConstants _narrowColumnToDisplay,
                               boolean _bIsOuterTwoColumns)
                        throws HTMLException
CUSTOMIZABLE

Parameters:
nPageType -
Returns:
a HTMLTable that is the layout of a two column page, or the outer and inner tables of the THREE_COLUMN_NARROW_WIDENARROW_WFFC and THREE_COLUMN_NARROWWIDE_WFFC_NARROW layouts.
Throws:
HTMLException

PageColumnTable

protected HTMLElement PageColumnTable(int _nColumnID,
                                      boolean _bContainsFreeFormContent)
                               throws HTMLException
CUSTOMIZABLE PortletContent must always be called before PortletHeader for a portlet. The portlet header might come from the portlet server, so we need to get the portlet content before getting the header. Returns a page column for the MyPage. Structure is: column 0 = narrow, left; column 1 = wide, center; column 2 = narrow, right.

Parameters:
nColumnID -
bContainsFreeFormContent -
Returns:
HTMLTable
Throws:
HTMLException

DisplaySinglePortlet

public HTMLElementCollection DisplaySinglePortlet(int nColumnID,
                                                  int portletIndex)
CUSTOMIZABLE

Parameters:
nColumnID - The ID of the column this portlet is currently in.
nPortletIndex -
Returns:
a HTMLElementCollection containing the entire portlet including the portlet header and content.

DisplaySinglePortletContent

public HTMLElementCollection DisplaySinglePortletContent(int nColumnID,
                                                         int portletIndex)
CUSTOMIZABLE

Parameters:
nColumnID - The ID of the column this portlet is currently in.
nPortletIndex -
Returns:
a HTMLElementCollection containing the portlet body/content.

PortletHeader

protected HTMLTableRow PortletHeader(int nPortletIndex,
                                     int nColumnID)
                              throws HTMLException
CUSTOMIZABLE

Parameters:
nPortletIndex -
nColumnID - The ID of the column this portlet is currently in.
Returns:
a HTMLTableRow containing the portlet header.
Throws:
HTMLException

GetPortletButtonsCell

protected HTMLTableCell GetPortletButtonsCell(int nPortletIndex)
CUSTOMIZABLE

Parameters:
nPortletIndex -
Returns:
A HTMLTableCell containing all the action buttons to be displayed in the portlet header.

GetPortletRefreshButtonContent

public HTMLElementCollection GetPortletRefreshButtonContent(int nPortletIndex)
CUSTOMIZABLE

Parameters:
nPortletIndex -
Returns:
a HTMLElementCollection containing the refresh button for the portlet header.

GetPortletHelpButtonContent

public HTMLElementCollection GetPortletHelpButtonContent(int nPortletIndex)
CUSTOMIZABLE

Parameters:
nPortletIndex -
Returns:
a HTMLElementCollection containing the help button for the portlet header.

GetPortletPreferenceButtonContent

public HTMLElementCollection GetPortletPreferenceButtonContent(int nPortletIndex)
CUSTOMIZABLE

Parameters:
nPortletIndex -
Returns:
a HTMLElementCollection containing the preference button for the portlet header.

GetPortletCollapseExpandButtonContent

public HTMLElementCollection GetPortletCollapseExpandButtonContent(int nPortletIndex)
CUSTOMIZABLE

Parameters:
nPortletIndex -
Returns:
a HTMLElementCollection containing the collapse/expand button for the portlet header.

GetPortletCollapseExpandButtonContent

public HTMLElementCollection GetPortletCollapseExpandButtonContent(int nPortletIndex,
                                                                   java.lang.String strOnclickFunction)

GetPortletRemoveButtonContent

public HTMLElementCollection GetPortletRemoveButtonContent(int nPortletIndex)

GetPortletNameCell

protected HTMLTableCell GetPortletNameCell(int nPortletIndex,
                                           int nColumnID)
CUSTOMIZABLE

Parameters:
nPortletIndex -
nColumnID - The ID of the column this portlet is currently in.
Returns:
a HTMLTableCell containing the portlet's name.

Add508AccessKeyAnchor

protected void Add508AccessKeyAnchor(java.lang.String strPortletName,
                                     int nPortletIndex,
                                     HTMLTableCell cell)
Given a cell and an int (a portlet index) adds HTML for an access anchor corresponding to that int, the title is set to the portlet name.

Parameters:
strPortletName -
nPortletIndex -
cell -

GetPortletPreferenceAction

protected HTMLSpan[] GetPortletPreferenceAction(int nPortletIndex)
Obtain the Preference Button from the portlet header given the portlet index.

Parameters:
nPortletIndex -
Returns:
Preference HTML button. NOTE: May contain null elements

GetPortletCollapseExpandAction

protected HTMLSpan GetPortletCollapseExpandAction(int nPortletIndex,
                                                  java.lang.String strOnclickFunction)
Obtain the collapse button from the portlet header given the portlet index.

Parameters:
nPortletIndex -
strOnclickFunction - - name of javascript function to call if there is one, null otherwise
Returns:
Collapse/Expand HTML button. NOTE: May contain null elements

GetPortletRemoveAction

protected HTMLSpan GetPortletRemoveAction(int nPortletIndex)

GetCollapseOrExpandAnchor

protected HTMLAnchor GetCollapseOrExpandAnchor(int nPortletIndex,
                                               java.lang.String strControl,
                                               PTImageType imgType,
                                               java.lang.String strTitle)
Parameters:
nPortletIndex -
strCollapseOrExpandControl -
imgType -
strTitle -
Returns:
anchor for collapsing or expanding the portlet

GetRemoveAnchor

protected HTMLAnchor GetRemoveAnchor(int nPortletIndex,
                                     java.lang.String strControl,
                                     PTImageType imgType,
                                     java.lang.String strTitle)
Parameters:
nPortletIndex -
strControl -
imgType -
strTitle -
Returns:
anchor for Removing Portlet.

GetLayoutTable

public HTMLTable GetLayoutTable(java.lang.String _strTableSummary)
CUSTOMIZABLE Method GetLayoutTable.

Parameters:
_strTableSummary - Summary of the table.
Returns:
HTMLTable

GetNarrowColumn

protected HTMLTableCell GetNarrowColumn()
CUSTOMIZABLE Method GetNarrowColumn.

Returns:
HTMLTableCell - has no width

GetWideColumn

protected HTMLTableCell GetWideColumn()
CUSTOMIZABLE Method GetWideColumn.

Returns:
HTMLTableCell - has 100% width

GetPortletVerticalPadding

public HTMLTable GetPortletVerticalPadding()
CUSTOMIZABLE Method GetPortletVerticalPadding. Gets a table with a spacer image to put padding between each portlet from top to bottom.

Returns:
HTMLTable

GetPortletVerticalPaddingRow

protected HTMLTableRow GetPortletVerticalPaddingRow(java.lang.String _colSpan)
CUSTOMIZABLE Method GetPortletVerticalPadding. Gets a row with a spacer image to put padding between each portlet from top to bottom.

Parameters:
_colSpan -

GetPortletHorizontalPaddingCell

protected HTMLTableCell GetPortletHorizontalPaddingCell()
CUSTOMIZABLE Method GetPortletHorizontalPaddingCell. Returns a cell with a spacer image in it to put padding between portlet columns.


GetPortletHorizontalPaddingCell

protected HTMLTableCell GetPortletHorizontalPaddingCell(java.lang.String _strColumnID)
CUSTOMIZABLE Method GetPortletHorizontalPaddingCell. Returns a cell with a spacer image in it to put padding between portlet columns.

Returns:
HTMLTableCell

AddPTConstantsToPageScript

protected void AddPTConstantsToPageScript(HTMLScript script)
CUSTOMIZABLE Method AddPTConstantsToPageScript. Adds the PTConstants JavaScript object to the portal page, Initializing the values properly. The script argument is a reference to the script object being passed in from the DisplayJavascript method.


Create

public java.lang.Object Create()
Description copied from interface: IManagedObject
This method is used by the ASManager to return new instances of managed objects.

Specified by:
Create in interface IManagedObject
Returns:
A new instance of the managed class (i.e. return new Foo();)
See Also:
IManagedObject.Create()

DisplayJavascript

public HTMLScript DisplayJavascript()
This method returns the HTMLScript that encompasses the Javascript on the page.

Specified by:
DisplayJavascript in interface IView
Returns:
HTMLScript
See Also:
IView.DisplayJavascript()

GetName

public java.lang.String GetName()
Description copied from interface: IMVCObject
Return the name of the MVC object.

Specified by:
GetName in interface IMVCObject
Returns:
the name of the object.
See Also:
com.plumtree.xpshared.activityspace.IView#GetName()

Init

public void Init(IModelRO model,
                 AActivitySpace parent)
Description copied from interface: IView
This method initializes the View with the read only model interface it is supposed to draw it's data from as well as it's parent ActivitySpace (necessary to create URLS).

Specified by:
Init in interface IView
See Also:
com.plumtree.xpshared.activityspace.IView#Init(IModel, AActivitySpace)

PortletContent

public HTMLDiv PortletContent(int nPortletIndex,
                              int nColumnID)
                       throws HTMLException
// CR ROB: This file is customizable by users so add in useful descriptions of method and arguments

Parameters:
nPortletIndex -
nColumnID - NOT USED
Returns:
an HTMLTable containing the portlet content or an error message telling why the portlet content was not displayed.
Throws:
HTMLException



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.