com.sun.portal.providers.containers.jsp.table
Class JSPTableContainerProvider

java.lang.Object
  |
  +--com.sun.portal.providers.ProviderAdapter
        |
        +--com.sun.portal.providers.ProfileProviderAdapter
              |
              +--com.sun.portal.providers.jsp.JSPProvider
                    |
                    +--com.sun.portal.providers.containers.JSPContainerProviderAdapter
                          |
                          +--com.sun.portal.providers.containers.jsp.table.JSPTableContainerProvider
All Implemented Interfaces:
ContainerProvider, Provider, ProviderEditTypes, com.sun.portal.providers.util.ProviderProperties, ProviderWidths

public class JSPTableContainerProvider
extends JSPContainerProviderAdapter
implements com.sun.portal.providers.util.ProviderProperties

This class provides the implementation for JSPTableContainerProvider and extends JSPContainerProviderAdapter The table container facilitates the aggregation of multiple channels into a single display. JSPTableContainerProvider aggregates channels into HTML rows and Columns.

See Also:
JSPContainerProviderAdapter

Field Summary
static int BOTTOM
          Bottom Row in the TableContainerProvider
static int CENTER
          Center column in the TableContainerProvider
static int LEFT
          Left column in the TableContainerProvider
static int RIGHT
          Right column in the TableContainerProvider
static int TOP
          Top Row in the TableContainerProvider
 
Fields inherited from interface com.sun.portal.providers.util.ProviderProperties
ARRANGE_PROVIDER_JS, BANNER, BANNER_TEMPLATE, BANNER_TEMPLATE_NOCONTEXT, BARE_PROVIDER_WRAPPER_TEMPLATE, BG_COLOR, BGCOLOR, BORDER_COLOR, BORDER_SIZE, BORDER_WIDTH, BORDERLESS_CHANNELS, BULLET_COLOR, BULLET_COLOR_JS, CHANNELS_BACKGROUND_COLOR, CHANNELS_COLUMN, CHANNELS_HAS_FRAME, CHANNELS_IS_DETACHABLE, CHANNELS_IS_DETACHED, CHANNELS_IS_MINIMIZABLE, CHANNELS_IS_MINIMIZED, CHANNELS_IS_MOVABLE, CHANNELS_IS_REMOVABLE, CHANNELS_ROW, CHANNELS_WIDTH, CONTENT, CONTENT_BAR_IN_CONTENT, CONTENT_BAR_IN_CONTENT_TEMPLATE, CONTENT_BAR_IN_LAYOUT, CONTENT_BAR_IN_LAYOUT_TEMPLATE, CONTENT_LAYOUT, CONTENT_LAYOUT_TEMPLATE, CONTENT_TEMPLATE, DEFAULT_BORDERLESS_CHANNEL, DEFAULT_CHANNEL_COLUMN, DEFAULT_CHANNEL_HAS_FRAME, DEFAULT_CHANNEL_IS_DETACHABLE, DEFAULT_CHANNEL_IS_DETACHED, DEFAULT_CHANNEL_IS_MINIMIZABLE, DEFAULT_CHANNEL_IS_MINIMIZED, DEFAULT_CHANNEL_IS_MOVABLE, DEFAULT_CHANNEL_IS_REMOVABLE, DEFAULT_CHANNEL_ROW, DEFAULT_CHANNEL_WIDTH, DESKTOP_URL, EDIT_CONTAINER_NAME, EDIT_PROVIDER_TEMPLATE, EDIT_TEMPLATE, ERR_MESSAGE, ERROR_TEMPLATE, ERROR_TEMPLATE_NOCONTEXT, FONT_COLOR, FONT_FACE, FONT_FACE1, FRONT_CONTAINER_NAME, FULLWIDTH_POPUP_HEIGHT, FULLWIDTH_POPUP_WIDTH, HAS_FRAME, HELP_ICON, HELP_LINK, HELP_TAG, HELP_URL, HELP_URLS, INLINE_ERROR, INLINE_ERROR_TEMPLATE, LAST_CHANNEL_NAME, LAUNCH_POPUP, LAUNCH_POPUP_JS, LAYOUT, LAYOUT_FULL_BOTTOM_TEMPLATE, LAYOUT_FULL_TOP_TEMPLATE, LAYOUT1_TEMPLATE, LAYOUT2_TEMPLATE, LAYOUT3_TEMPLATE, LAYOUT4_TEMPLATE, LOCALE_STRING, LOGOUT_URL, MENUBAR, MENUBAR_TEMPLATE, MINIMIZED_TEMPLATE, NO_CACHE, NO_CACHE_TEMPLATE, OPENURL_INPARENT_JS, OPTIONS_TEMPLATE, OVERLOAD_TEMPLATE, PARALLEL_CHANNELS_INIT, PARENT_CONTAINER_NAME, PARENT_TAB_CONTAINER, PERFORM_COLUMN_SUBSTITUTION_JS, PERFORM_SUBSTITUTION_JS, POPUP_MENUBAR_TEMPLATE, POPUP_TEMPLATE, PRODUCT_NAME, PROVIDER_CMDS, PROVIDER_NAME, PROVIDER_TITLE, PROVIDER_WRAPPER_TEMPLATE, REFRESH_PARENT_CONTAINER_ONLY, REMOVE_PROVIDER_JS, SELECT_ALL_JS, SELECTED_TAB_NAME, SIZE, STACK_TRACE, STATIC_CONTENT, SWITCH_COLUMNS_JS, THEME_CHANNEL, THICK_POPUP_HEIGHT, THICK_POPUP_WIDTH, THIN_POPUP_HEIGHT, THIN_POPUP_WIDTH, TIMEOUT, TITLE, TITLE_BAR_COLOR, TOOLBAR_ROLLOVER, TOOLBAR_ROLLOVER_JS, USER_TEMPLATE
 
Fields inherited from interface com.sun.portal.providers.ProviderWidths
WIDTH_FULL_BOTTOM, WIDTH_FULL_TOP, WIDTH_THICK, WIDTH_THIN
 
Fields inherited from interface com.sun.portal.providers.ProviderEditTypes
EDIT_COMPLETE, EDIT_SUBSET
 
Constructor Summary
JSPTableContainerProvider()
           
 
Method Summary
 void genMinimizedContent(Map channelsIsMinimized, List nonMinimizedList, Map content, boolean dIsMinimized)
          Generates the minimized content for the channels that are minimized This method puts an empty stringbuffer in the content Map for the channels that are minimized in the table container.
 String getColumn(javax.servlet.http.HttpServletRequest req, String channel)
          Gets the column in which this channel should be displayed in.
 int getLayout()
          Gets the layout for this container.
 int getPopupWindowHeight(javax.servlet.http.HttpServletRequest req, String channelName)
          gets the popup window height for the detach window when a channel is detached
 int getPopupWindowWidth(javax.servlet.http.HttpServletRequest req, String channelName)
          Gets the popup window width for the detach window when a channel is detached
 String getRow(javax.servlet.http.HttpServletRequest req, String channel)
          Gets the row in which this channel should be displayed in.
 int getTimeout()
          Gets the timeout for this container, in seconds.
 int getWidths(int column)
          Gets table's left,center,right width based of the table container's layout property.
 String getWindowName(String channelName)
          Gets the window name for the detach window when a channel is detached
 void init(String n, javax.servlet.http.HttpServletRequest httpreq)
          Initializes the JSPTableContainerProvider.
 URL processEdit(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Processes data for this container.
 void setColumn(javax.servlet.http.HttpServletRequest req, String channel, int column)
          Sets the column for this channel to be displayed in.
 void setLayout(int lo)
          Sets the layout for this container.
 void setRow(javax.servlet.http.HttpServletRequest req, String channel, int row)
          Sets the row for this channel to be displayed in.
 Map setupColumns(javax.servlet.http.HttpServletRequest req)
          Constructs the channel into three columns, the left column, the center column, and the right column.
 
Methods inherited from class com.sun.portal.providers.containers.JSPContainerProviderAdapter
getAvailableChannels, getContainerProviderContext, getRefreshTime, getSelectedChannels, setAvailableChannels, setSelectedChannels
 
Methods inherited from class com.sun.portal.providers.jsp.JSPProvider
getContent, getEdit, isPresentable
 
Methods inherited from class com.sun.portal.providers.ProfileProviderAdapter
existsBooleanProperty, existsIntegerProperty, existsListProperty, existsListProperty, existsStringProperty, existsStringProperty, getBooleanProperty, getBooleanProperty, getClientProperty, getIntegerProperty, getIntegerProperty, getListProperty, getListProperty, getMapProperty, getMapProperty, getMapProperty, getMapProperty, getStringAttribute, getStringProperty, getStringProperty, getStringProperty, getStringProperty, getTemplate, getTemplate, isAllowed, setBooleanProperty, setClientProperty, setIntegerProperty, setListProperty, setMapProperty, setStringAttribute, setStringProperty
 
Methods inherited from class com.sun.portal.providers.ProviderAdapter
getContent, getDescription, getEdit, getEditType, getHelp, getHelp, getName, getProviderContext, getResourceBundle, getResourceBundle, getTitle, getWidth, isEditable, processEdit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Left column in the TableContainerProvider

RIGHT

public static final int RIGHT
Right column in the TableContainerProvider

CENTER

public static final int CENTER
Center column in the TableContainerProvider

TOP

public static final int TOP
Top Row in the TableContainerProvider

BOTTOM

public static final int BOTTOM
Bottom Row in the TableContainerProvider
Constructor Detail

JSPTableContainerProvider

public JSPTableContainerProvider()
Method Detail

init

public void init(String n,
                 javax.servlet.http.HttpServletRequest httpreq)
          throws ProviderException
Initializes the JSPTableContainerProvider.
Overrides:
init in class JSPProvider
Parameters:
n - The unique indentifying name for this channel.
httpreq - The servlet request.
Throws:
ProviderException - if JSPProvider.init throws an exception
See Also:
JSPProvider.init(java.lang.String, javax.servlet.http.HttpServletRequest)

getLayout

public int getLayout()
              throws ProviderException
Gets the layout for this container. The desktop calls this method when the front page is drawn, and when the layout page is drawn.
Returns:
The layout; either LAYOUT_THIN_THICK or LAYOUT_THICK_THIN or LAYOUT_THIN_THICK_THIN or LAYOUT_UNKNOWN
See Also:
Layout.LAYOUT_THIN_THICK, Layout.LAYOUT_THICK_THIN, Layout.LAYOUT_THIN_THICK_THIN, Layout.LAYOUT_UNKNOWN, setLayout(int)

setLayout

public void setLayout(int lo)
               throws ProviderException
Sets the layout for this container. The desktop calls this method when the user changes the layout in the layout page.
Parameters:
lo; - new layout either LAYOUT_THIN_THICK or LAYOUT_THICK_THIN or LAYOUT_THIN_THICK_THIN or LAYOUT_UNKNOWN
See Also:
Layout.LAYOUT_THIN_THICK, Layout.LAYOUT_THICK_THIN, Layout.LAYOUT_THIN_THICK_THIN, Layout.LAYOUT_UNKNOWN, setLayout(int)

getTimeout

public int getTimeout()
               throws ProviderException
Gets the timeout for this container, in seconds. The number of seconds to wait to fetch the content for the selected channels when the front page is drwan.
Returns:
The number of seconds the front page should wait before displaying a Content Not available message for a channel

setupColumns

public Map setupColumns(javax.servlet.http.HttpServletRequest req)
                 throws ProviderException
Constructs the channel into three columns, the left column, the center column, and the right column. Channel names are put into each column list and the list objects are put in a Map.
Parameters:
req - An HttpServletRequest that contains information related to this request for content.
Returns:
Map. Map of left, center, right, fullTop and fullBottom lists Each list contains the channel names in that column.
Throws:
ProviderException - If the columns Map cannot be returned

getWidths

public int getWidths(int column)
              throws ProviderException
Gets table's left,center,right width based of the table container's layout property.
Parameters:
column. - column for which the width is requested. either LEFT or RIGHT or Center
Returns:
Column width. either left or right or center width.
Throws:
ProviderException - If the column width cannot be returned

getColumn

public String getColumn(javax.servlet.http.HttpServletRequest req,
                        String channel)
                 throws ProviderException
Gets the column in which this channel should be displayed in. The desktop calls this method when the front page is drawn, and when the layout page is drawn.
Parameters:
req - An HttpServletRequest that contains information related to this request for content.
channel - Channel for which the column is requested
Returns:
The column for this channel; either "1", "2", or "3".
See Also:
setColumn(javax.servlet.http.HttpServletRequest, java.lang.String, int)

getRow

public String getRow(javax.servlet.http.HttpServletRequest req,
                     String channel)
              throws ProviderException
Gets the row in which this channel should be displayed in. The desktop calls this method when the front page is drawn, and when the layout page is drawn.
Parameters:
req - An HttpServletRequest that contains information related to this request for content.
channel - Channel for which the row is requested
Returns:
The row for this channel; either "1", "2", ....
See Also:
setRow(javax.servlet.http.HttpServletRequest, java.lang.String, int)

setColumn

public void setColumn(javax.servlet.http.HttpServletRequest req,
                      String channel,
                      int column)
               throws ProviderException
Sets the column for this channel to be displayed in. Either 1, 2, or 3. The desktop calls this method when the user changes the channel's display column from the layout page.
Parameters:
req - An HttpServletRequest that contains information related to this request for content.
channel - Channel for which the column is to be set
column - The new column.
See Also:
getColumn(javax.servlet.http.HttpServletRequest, java.lang.String)

setRow

public void setRow(javax.servlet.http.HttpServletRequest req,
                   String channel,
                   int row)
            throws ProviderException
Sets the row for this channel to be displayed in. Either 1, 2,... The desktop calls this method when the user changes the channel's display row from the layout page.
Parameters:
req - An HttpServletRequest that contains information related to this request for content.
channel - Channel for which the row is to be set
row - The new row.
See Also:
getRow(javax.servlet.http.HttpServletRequest, java.lang.String)

processEdit

public URL processEdit(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse res)
                throws ProviderException
Processes data for this container. This method is called to process data associated with the provider.

When the desktop servlet receives a request where the action is "process", it looks at the parameters to identify which provider will handle the action, through this method. The request passed in contains the parameters.

After calling this method, the desktop servlet will re-direct to the URL returned from this method. Therefore, the result of a provider post can be any desktop serlvet action, or the content of an arbitrary URL. For more information on constructing desktop serlvet URLs, see DesktopSerlvet.

Overrides:
processEdit in class JSPProvider
Parameters:
request - An HttpServletRequest that contains information related to this request for content.
response - An HttpServletResponse that allows the provider to influence the overall response for the desktop page (besides generating the content).
Returns:
The URL that the iPS desktop will re-direct to. A value of null should indicate to the client that it should return to its default view.
Throws:
ProviderException - If there was an error processing the data. How this exception is handled is up to the client of the provider object.
See Also:
DesktopServlet

getWindowName

public String getWindowName(String channelName)
Gets the window name for the detach window when a channel is detached
Parameters:
channelName - Name of the channel for which the detach window name is requested.
Returns:
String The window name as a string

getPopupWindowWidth

public int getPopupWindowWidth(javax.servlet.http.HttpServletRequest req,
                               String channelName)
                        throws ProviderException
Gets the popup window width for the detach window when a channel is detached
Parameters:
request - An HttpServletRequest that contains information related to this request for content.
channelName - Name of the channel for which the detach window width is requested.
Returns:
int The detach window width as an int based on the channel width
See Also:
ProviderWidths.WIDTH_THIN, ProviderWidths.WIDTH_THICK, ProviderWidths.WIDTH_FULL_TOP, ProviderWidths.WIDTH_FULL_BOTTOM

getPopupWindowHeight

public int getPopupWindowHeight(javax.servlet.http.HttpServletRequest req,
                                String channelName)
                         throws ProviderException
gets the popup window height for the detach window when a channel is detached
Parameters:
request - An HttpServletRequest that contains information related to this request for content.
channelName. - name of the channel for which the detach window height is requested.
Returns:
int. The detach window height as an int based on the channel width
See Also:
ProviderWidths.WIDTH_THIN, ProviderWidths.WIDTH_THICK, ProviderWidths.WIDTH_FULL_TOP, ProviderWidths.WIDTH_FULL_BOTTOM

genMinimizedContent

public void genMinimizedContent(Map channelsIsMinimized,
                                List nonMinimizedList,
                                Map content,
                                boolean dIsMinimized)
                         throws ProviderException
Generates the minimized content for the channels that are minimized This method puts an empty stringbuffer in the content Map for the channels that are minimized in the table container.
Parameters:
channelsIsMinimized - Map of channelNames which are minimized.
nonMinimizedList - List of channel names which are nonminimized.
content - Map of channel contents, a map of StringBuffers.
dIsMinimized - Default value for isMinimized property.