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

java.lang.Object
  extended bycom.sun.portal.providers.ProviderAdapter
      extended bycom.sun.portal.providers.ProfileProviderAdapter
          extended bycom.sun.portal.providers.jsp.JSPProvider
              extended bycom.sun.portal.providers.containers.JSPContainerProviderAdapter
                  extended bycom.sun.portal.providers.containers.jsp.table.JSPTableContainerProvider
All Implemented Interfaces:
ContainerProvider, Provider, ProviderEditTypes, ProviderWidths

public class JSPTableContainerProvider
extends JSPContainerProviderAdapter

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.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[] getSupportedWindowStates()
          Gets the supported window states.
 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 detached window.
 int getWindowState(String channelName)
          Gets the window state of the channel.
 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.
 void setWindowState(String channelName, int windowState)
          Sets the window state of a channel.
 
Methods inherited from class com.sun.portal.providers.containers.JSPContainerProviderAdapter
getAvailableAndUserDefinedChannels, getAvailableChannels, getContainerProviderContext, getRefreshTime, getSelectedChannels, setAvailableChannels, setSelectedChannels
 
Methods inherited from class com.sun.portal.providers.jsp.JSPProvider
getCompiledJSPPath, getContent, getContentPage, getEdit, getEditPage, getExistingJSPPath, getMostSpecificJSPPath, getProcessPage, includeJspPage, isPresentable
 
Methods inherited from class com.sun.portal.providers.ProfileProviderAdapter
existsBooleanProperty, existsIntegerProperty, existsListProperty, existsListProperty, existsStringProperty, existsStringProperty, getBooleanProperty, getBooleanProperty, getBooleanProperty, getBooleanProperty, getClientProperty, getIntegerProperty, getIntegerProperty, getIntegerProperty, getIntegerProperty, getListProperty, getListProperty, getMapProperty, getMapProperty, getMapProperty, getMapProperty, getMapProperty, getMapProperty, getStringAttribute, getStringProperty, getStringProperty, getStringProperty, getStringProperty, getStringProperty, getStringProperty, getTemplate, getTemplate, getTemplatePath, 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, isPresentable, processEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Left column in the TableContainerProvider

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Right column in the TableContainerProvider

See Also:
Constant Field Values

CENTER

public static final int CENTER
Center column in the TableContainerProvider

See Also:
Constant Field Values

TOP

public static final int TOP
Top Row in the TableContainerProvider

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Bottom Row in the TableContainerProvider

See Also:
Constant Field Values
Constructor Detail

JSPTableContainerProvider

public JSPTableContainerProvider()
Method Detail

init

public void init(String n,
                 javax.servlet.http.HttpServletRequest httpreq)
          throws ProviderException
Initializes the JSPTableContainerProvider.

Specified by:
init in interface Provider
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
Throws:
ProviderException
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.

Throws:
ProviderException
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
Throws:
ProviderException

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.

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".
Throws:
ProviderException
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", ....
Throws:
ProviderException
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.
Throws:
ProviderException
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.
Throws:
ProviderException
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.

Specified by:
processEdit in interface Provider
Overrides:
processEdit in class JSPProvider
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 detached window. The detached window name is used for naming browser windows for detached channels. The detached window name is guaranteed to end with "_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:
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
Throws:
ProviderException
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

Returns:
int. The detach window height as an int based on the channel width
Throws:
ProviderException
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.
Throws:
ProviderException

getWindowState

public int getWindowState(String channelName)
                   throws ProviderException
Gets the window state of the channel.

Specified by:
getWindowState in interface ContainerProvider
Overrides:
getWindowState in class JSPContainerProviderAdapter
Parameters:
channelName - channel for which the window state is requested.
Returns:
window state either ProviderWindowStates.Maximize or ProviderWindowStates.Minimize or ProviderWindowStates.NORMAL
Throws:
ProviderException
See Also:
com.sun.portal.providers.containers.ProviderWindowStates#Minimize, com.sun.portal.providers.containers.ProviderWindowStates#Maximize, ProviderWindowStates.NORMAL, com.sun.portal.providers.containers.JSPTableContainerProvider#getWindowState

setWindowState

public void setWindowState(String channelName,
                           int windowState)
                    throws UnsupportedWindowStateException
Sets the window state of a channel.

Specified by:
setWindowState in interface ContainerProvider
Overrides:
setWindowState in class JSPContainerProviderAdapter
Parameters:
channelName - channel for which the window state needs to be set
windowState - The new window state either ProviderWindowStates.Maximize or ProviderWindowStates.Minimize or ProviderWindowStates.NORMAL
Throws:
UnsupportedWindowStateException - if the window state passed in is not in supported window states list.
See Also:
com.sun.portal.providers.containers.ProviderWindowStates#Minimize, com.sun.portal.providers.containers.ProviderWindowStates#Maximize, ProviderWindowStates.NORMAL, com.sun.portal.providers.containers.JSPTableContainerProvider#getWindowState, com.sun.portal.providers.containers.JSPTableContainerProvider#getSupportedWindowStates()

getSupportedWindowStates

public int[] getSupportedWindowStates()
                               throws ProviderException
Gets the supported window states.

Specified by:
getSupportedWindowStates in interface ContainerProvider
Overrides:
getSupportedWindowStates in class JSPContainerProviderAdapter
Returns:
Supported Window States as an integer array containing ProviderWindowStates.Maximize, ProviderWindowStates.Minimize, ProviderWindowStates.NORMAL
Throws:
ProviderException - If the window states cannot be returned.
See Also:
com.sun.portal.providers.containers.ProviderWindowStates#Minimize, com.sun.portal.providers.containers.ProviderWindowStates#Maximize, ProviderWindowStates.NORMAL, com.sun.portal.providers.containers.ContainerProvider#getWindowState(), com.sun.portal.providers.containers.ContainerProvider#setWindowState()