com.sun.portal.providers.containers.jsp.tab
Class JSPTabContainerProvider

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.tab.JSPTabContainerProvider
All Implemented Interfaces:
ContainerProvider, Provider, ProviderEditTypes, ProviderWidths, TabContainer

public class JSPTabContainerProvider
extends JSPContainerProviderAdapter
implements TabContainer

This class provides the implementation for JSPTabContainerProvider and extends JSPContainerProviderAdapter and implements TabContainer A TabContainer provider is a container provider that generates its views primarily by being a client of table container objects.The Tab Container displays one of its contained channels at a time. The tab container allows table containers to be arranged onto virtual pages. The container can then switch between these pages allowing them to be physically viewed one at a time. It allows the user to switch logically separate row-column displays. Viewing this with container glasses on, each page is a table container. The tab container then contains multiple table containers, one for each page. Each tab in tab container corresponds to a table container. Here, a Tab container provider is defined as a container provider that has a selected and available channels list, and allows getting and setting of these lists. Tab container uses the selected channels list to hold the names of the tabs that the user has configured on their desktop. The available channels list is used to hold the list of tab topics, or the tabs that the user can add to their desktop. This does not adhere to the semantics of the getSelectedChannels defined in ContainerProvider. Selected Tabs are the container channels that are considered "active" on the portal page. Available Tabs are those that are available to be added to the portal page from the edit page.

See Also:
TabContainer, JSPContainerProviderAdapter

Field Summary
 
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
JSPTabContainerProvider()
           
 
Method Summary
 void addTab(java.lang.String name, java.lang.String title)
          Adds the tab back to the desktop that has been removed before
 java.util.List getAvailableChannels()
          Gets the list of tab topics that are available to be added to the portal page.
 java.util.List getAvailableTabs()
          Gets the List of available tab topics.
 java.lang.StringBuffer getContent(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Gets the provider's content by executing a JSP.
 java.net.URL getContentURL(ModifiableTab tab, javax.servlet.http.HttpServletRequest req)
          Gets the ContentPage URL.
 UnmodifiableTab getMakeTab()
          Gets the make tab, the tab spec to be used for 'Make My Own tab' creation by the user .
 java.lang.String getMakeTabName()
          Gets the make tab channel Name, the tab spec to be used for 'Make My Own tab' creation by the user .
 java.lang.String getMakeTabProviderName()
          Gets the make tab provider Name, the tab spec to be used for 'Make My Own tab' creation by the user .
 int getMaxTabs()
          Gets the maximum number of tabs allowed on the user's desktop.
 java.util.List getSelectedChannels()
          Gets the list of tab names that are available on the portal page.
 UnmodifiableTab getSelectedTab()
          Gets the selected tab, the current selected tab in the user's session .
 java.lang.String getSelectedTabName()
          Gets the selected tab Name, the current selected tab in the user's session .
 java.util.List getSelectedTabs()
          Gets the List of selected tabs.
 UnmodifiableTab getStartTab()
          Gets the start tab, the tab to be displayed when the user logs in.
 java.lang.String getStartTabName()
          Gets the start tab Name, the name of the tab to be displayed when the user logs in.
 int[] getSupportedWindowStates()
          Gets the supported window states.
 UnmodifiableTab getTab(java.lang.String name)
          Gets a tab.
 java.net.URL getTabURL(UnmodifiableTab tab, javax.servlet.http.HttpServletRequest req)
          Gets the Tab URL.
 int getWindowState(java.lang.String channelName)
          Gets the window state of the channel.
 void init(java.lang.String n, javax.servlet.http.HttpServletRequest req)
          Initializes the TabContainerProvider.
 java.net.URL processEdit(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Process a form for this provider.
 void removeTab(java.lang.String name)
          Removes the tab.
 void setAvailableChannels(java.util.List avail)
          Sets the list of available channel names.
 void setSelectedChannels(java.util.List sel)
          Sets the list of selected channel names.
 void setSelectedTab(ModifiableTab t)
          Sets the selected tab Name in the session.
 void setSelectedTabName(java.lang.String tabName)
          Sets the selected tab Name in the session
 void setStartTabName()
          Sets the start tab Name, the name of the tab to be displayed when the user logs in.
 void setStartTabName(java.lang.String name)
          Sets the start tab Name, the name of the tab to be displayed when the user logs in.
 void setStartTabName(UnmodifiableTab t)
          Sets the start tab Name, the name of the tab to be displayed when the user logs in.
 void setTab(ModifiableTab t)
          Sets a tab.
 void setTab(ModifiableTab t, boolean selected)
          Sets a tab.
 void setWindowState(java.lang.String channelName, int windowState)
          Sets the window state of a channel.
 
Methods inherited from class com.sun.portal.providers.containers.JSPContainerProviderAdapter
getAvailableAndUserDefinedChannels, getContainerProviderContext, getRefreshTime
 
Methods inherited from class com.sun.portal.providers.jsp.JSPProvider
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
 

Constructor Detail

JSPTabContainerProvider

public JSPTabContainerProvider()
Method Detail

init

public void init(java.lang.String n,
                 javax.servlet.http.HttpServletRequest req)
          throws ProviderException
Initializes the TabContainerProvider. This method must be called by clients of the TabContainerProvider object when the provider object is created (after it is constructed, or before the object is used). This method should not be called more than once per object.

Specified by:
init in interface Provider
Overrides:
init in class JSPProvider
Parameters:
n - Unique name identifying this TabContainerprovider. This value should always be returned from getName().
req - The HTTP request object corresponding to the HTTP request that caused this provider object ot be created. This request may be used to extract session or user information that could be used to gain access to external resources.
Throws:
ProviderException - If there was an error initializing the TabContainerProvider. How this exception is handled is up to the client of the TabContainerProvider object.
See Also:
Provider.getName()

getSelectedChannels

public java.util.List getSelectedChannels()
                                   throws ProviderException
Gets the list of tab names that are available on the portal page. The semantics of this method are different than getSelectedChannels() in ContainerProvider. This method returns the names of the tabs that the user has configured on their desktop.

Specified by:
getSelectedChannels in interface ContainerProvider
Overrides:
getSelectedChannels in class JSPContainerProviderAdapter
Returns:
The list of selected channel names, a list of string names.
Throws:
ProviderException - If the list of channel names cannot be returned.

getAvailableChannels

public java.util.List getAvailableChannels()
                                    throws ProviderException
Gets the list of tab topics that are available to be added to the portal page.

Specified by:
getAvailableChannels in interface ContainerProvider
Overrides:
getAvailableChannels in class JSPContainerProviderAdapter
Returns:
The list of available channel names, a list of string names.
Throws:
ProviderException - If the list of channel names cannot be returned.

setSelectedChannels

public void setSelectedChannels(java.util.List sel)
                         throws ProviderException
Sets the list of selected channel names. This method sets the available tabs on the portal page.

Specified by:
setSelectedChannels in interface ContainerProvider
Overrides:
setSelectedChannels in class JSPContainerProviderAdapter
Parameters:
sel - The new list of channel names.
Throws:
ProviderException - If the list of channel names cannot be set.

setAvailableChannels

public void setAvailableChannels(java.util.List avail)
                          throws ProviderException
Sets the list of available channel names. This method sets the available tab topics ussed by the user to configure the portal desktop.

Specified by:
setAvailableChannels in interface ContainerProvider
Overrides:
setAvailableChannels in class JSPContainerProviderAdapter
Parameters:
avail - The new list of channel names.
Throws:
ProviderException - If the list of channel names cannot be set.

getMaxTabs

public int getMaxTabs()
               throws ProviderException
Gets the maximum number of tabs allowed on the user's desktop.

Specified by:
getMaxTabs in interface TabContainer
Returns:
The maximum number of tabs.
Throws:
ProviderException - If the maximum number of tabs cannot be returned.

getSelectedTabs

public java.util.List getSelectedTabs()
                               throws ProviderException
Gets the List of selected tabs.

Specified by:
getSelectedTabs in interface TabContainer
Returns:
The list of selected tabs, a list of UnmodifiableTabs.
Throws:
ProviderException - If the list of selected tabs cannot be returned.
See Also:
UnmodifiableTab

getAvailableTabs

public java.util.List getAvailableTabs()
                                throws ProviderException
Gets the List of available tab topics.

Specified by:
getAvailableTabs in interface TabContainer
Returns:
The list of available tabs, a list of UnmodifiableTabs.
Throws:
ProviderException - If the list of available tabs cannot be returned.
See Also:
UnmodifiableTab

getStartTab

public UnmodifiableTab getStartTab()
                            throws ProviderException
Gets the start tab, the tab to be displayed when the user logs in.

Specified by:
getStartTab in interface TabContainer
Returns:
The start tab, UnmodifiableTab.
Throws:
ProviderException - If the start tab cannot be returned.
See Also:
UnmodifiableTab

getStartTabName

public java.lang.String getStartTabName()
                                 throws ProviderException
Gets the start tab Name, the name of the tab to be displayed when the user logs in.

Specified by:
getStartTabName in interface TabContainer
Returns:
The start tab name as a String.
Throws:
ProviderException - If the start tab name cannot be returned.

getMakeTab

public UnmodifiableTab getMakeTab()
                           throws ProviderException
Gets the make tab, the tab spec to be used for 'Make My Own tab' creation by the user .

Specified by:
getMakeTab in interface TabContainer
Returns:
The make tab, UnmodifiableTab .
Throws:
ProviderException - If the make tab cannot be returned.
See Also:
UnmodifiableTab

getMakeTabName

public java.lang.String getMakeTabName()
                                throws ProviderException
Gets the make tab channel Name, the tab spec to be used for 'Make My Own tab' creation by the user .

Specified by:
getMakeTabName in interface TabContainer
Returns:
The make tab channel name as a String.
Throws:
ProviderException - If the make tab name cannot be returned.

getMakeTabProviderName

public java.lang.String getMakeTabProviderName()
                                        throws ProviderException
Gets the make tab provider Name, the tab spec to be used for 'Make My Own tab' creation by the user .

Specified by:
getMakeTabProviderName in interface TabContainer
Returns:
The make tab provider name as a String.
Throws:
ProviderException - If the make tab provider name cannot be returned.

getSelectedTabName

public java.lang.String getSelectedTabName()
                                    throws ProviderException
Gets the selected tab Name, the current selected tab in the user's session .

Specified by:
getSelectedTabName in interface TabContainer
Returns:
The selected tab name as a String.
Throws:
ProviderException - If the selected tab name cannot be returned.

getSelectedTab

public UnmodifiableTab getSelectedTab()
                               throws ProviderException
Gets the selected tab, the current selected tab in the user's session . This method implements the semantics of getSelectedChannels() in ContainerProvider and gets the active tab on the portal page.

Specified by:
getSelectedTab in interface TabContainer
Returns:
The selected tab, UnmodifiableTab.
Throws:
ProviderException - If the selected tab cannot be returned.
See Also:
UnmodifiableTab, ContainerProvider

getTab

public UnmodifiableTab getTab(java.lang.String name)
                       throws ProviderException
Gets a tab. This method returns an instance of the UnmodifiableTab for the named channel.

Specified by:
getTab in interface TabContainer
Parameters:
name - The name of the channel for which the tab Object is requested.
Returns:
The tab, UnmodifiableTab.
Throws:
ProviderException - If the tab cannot be returned.
See Also:
UnmodifiableTab

setTab

public void setTab(ModifiableTab t)
            throws ProviderException
Sets a tab.

Specified by:
setTab in interface TabContainer
Throws:
ProviderException - If the tab cannot be set
See Also:
UnmodifiableTab, ModifiableTab

setTab

public void setTab(ModifiableTab t,
                   boolean selected)
            throws ProviderException
Sets a tab.

Specified by:
setTab in interface TabContainer
Parameters:
selected - If true sets the tab to the current selected tab on the user's desktop. This method adds the ModifiableTab to the selected tabs list
Throws:
ProviderException - If the tab cannot be set
See Also:
UnmodifiableTab, ModifiableTab

setStartTabName

public void setStartTabName()
                     throws ProviderException
Sets the start tab Name, the name of the tab to be displayed when the user logs in. This method sets the current selected tab name in the user's session to the start tab.

Specified by:
setStartTabName in interface TabContainer
Throws:
ProviderException - If the start tab name cannot be returned.

setStartTabName

public void setStartTabName(UnmodifiableTab t)
                     throws ProviderException
Sets the start tab Name, the name of the tab to be displayed when the user logs in.

Specified by:
setStartTabName in interface TabContainer
Parameters:
t - A UnmodifiableTab Whose tab name needs to be set as the start tab name. This method sets the start tab name to the name of UnmodifiableTab that was passed in.
Throws:
ProviderException - If the start tab name cannot be set
See Also:
UnmodifiableTab

setStartTabName

public void setStartTabName(java.lang.String name)
                     throws ProviderException
Sets the start tab Name, the name of the tab to be displayed when the user logs in.

Specified by:
setStartTabName in interface TabContainer
Parameters:
name - The name of the channel which needs to be set as the start tab. This method sets the start tab to the name passed in..
Throws:
ProviderException - If the start tab name cannot be set.

setSelectedTab

public void setSelectedTab(ModifiableTab t)
                    throws ProviderException
Sets the selected tab Name in the session.

Specified by:
setSelectedTab in interface TabContainer
Parameters:
t - A ModifiableTab.Whose tab name needs to be set as the selected tab name. This method sets the current selected tab name to the name of ModifiableTab that was passed in.
Throws:
ProviderException - If the start tab name cannot be set
See Also:
ModifiableTab

setSelectedTabName

public void setSelectedTabName(java.lang.String tabName)
                        throws ProviderException
Sets the selected tab Name in the session

Specified by:
setSelectedTabName in interface TabContainer
Parameters:
tabName - The name of the channel which needs to be set as the selected tab. This method sets the current selected tab on the user's desktop to the name passed in..
Throws:
ProviderException - If the selected tab name cannot be set.

getContent

public java.lang.StringBuffer getContent(javax.servlet.http.HttpServletRequest req,
                                         javax.servlet.http.HttpServletResponse res)
                                  throws ProviderException
Description copied from class: JSPProvider
Gets the provider's content by executing a JSP. If the contentPage attribute has a value, it is used as the name of a JSP to execute per the search algorithm defined above. The body of the response is returned as the value for the method. If the contentPage attribute is blank, the superclass method is called. The following values from the request are passed on to the JSP servlet:

Specified by:
getContent in interface Provider
Overrides:
getContent in class JSPProvider
Returns:
StringBuffer holding the channel content.
Throws:
ProviderException - If there was an error generating the content. Upon catching this error, the desktop application will attempt to fetch a cached copy of the content. If a cached copy does not exist, then an error message will be displayed in the body of the provider.
See Also:
ProviderAdapter.getContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

processEdit

public java.net.URL processEdit(javax.servlet.http.HttpServletRequest req,
                                javax.servlet.http.HttpServletResponse res)
                         throws ProviderException
Process a form for this provider. This method is called to process form data associated with the tab container provider. Typically, this method is called to process the edit page generated from the getEdit() method. Usually, the client calling this method on a provider object is the desktop servlet.

Form data, passed into this method in the request, has been decoded into Unicode.

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 edit form. How this exception is handled is up to the client of the provider object.
See Also:
Provider.getEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), Provider.isEditable(), InvalidEditFormDataException, DesktopServlet

getTabURL

public java.net.URL getTabURL(UnmodifiableTab tab,
                              javax.servlet.http.HttpServletRequest req)
                       throws ProviderException
Gets the Tab URL. This method gets the tab url used to switch the selected tab on the user's desktop.

Parameters:
req - An HttpServletRequest that contains information related to this request for content.
Returns:
The URL that is used for tab switching on the desktop.
Throws:
ProviderException - If the Tab URL cannot be generated.

removeTab

public void removeTab(java.lang.String name)
               throws ProviderException
Removes the tab.

Throws:
ProviderException - If the tab cannot be removed.

addTab

public void addTab(java.lang.String name,
                   java.lang.String title)
            throws ProviderException
Adds the tab back to the desktop that has been removed before

Throws:
ProviderException - If the tab cannot be added.

getContentURL

public java.net.URL getContentURL(ModifiableTab tab,
                                  javax.servlet.http.HttpServletRequest req)
                           throws ProviderException
Gets the ContentPage URL.

Parameters:
req - An HttpServletRequest that contains information related to this request for content.
Returns:
The URL that the desktop will redirect to when the user is making a tab from scratch in the Make New Tab Page.
Throws:
ProviderException - If the ContentPage URL cannot be generated.

getWindowState

public int getWindowState(java.lang.String channelName)
                   throws ProviderException
Gets the window state of the channel. This method just returns ProviderWindowStates.NORMAL.

Specified by:
getWindowState in interface ContainerProvider
Overrides:
getWindowState in class JSPContainerProviderAdapter
Parameters:
channelName - channel for which the window state is requested.
Returns:
window state
Throws:
ProviderException
See Also:
ProviderWindowStates.NORMAL

setWindowState

public void setWindowState(java.lang.String channelName,
                           int windowState)
                    throws UnsupportedWindowStateException
Sets the window state of a channel. This method currently has no effect and throws UnsupportedWindowStateException if windowState passed is not ProviderWindowStates#NORMAL. Subclasses that wish to allow setting a WindowState should override this method.

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
Throws:
UnsupportedWindowStateException.
UnsupportedWindowStateException

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.NORMAL
Throws:
ProviderException - If the window states cannot be returned.
See Also:
ProviderWindowStates.NORMAL, com.sun.portal.providers.containers.jsp.tab.JSPTabContainerProvider#getWindowState(), com.sun.portal.providers.containers.jsp.tab.JSPTabContainerProvider#setWindowState()