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

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.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

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(String name, String title)
          Adds the tab back to the desktop that has been removed before
 List getAvailableChannels()
          Gets the list of tab topics that are available to be added to the portal page.
 List getAvailableTabs()
          Gets the List of available tab topics.
 StringBuffer getContent(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Gets the provider's content by executing a JSP.
 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 .
 String getMakeTabName()
          Gets the make tab channel Name, the tab spec to be used for 'Make My Own tab' creation by the user .
 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.
 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 .
 String getSelectedTabName()
          Gets the selected tab Name, the current selected tab in the user's session .
 List getSelectedTabs()
          Gets the List of selected tabs.
 UnmodifiableTab getStartTab()
          Gets the start tab, the tab to be displayed when the user logs in.
 String getStartTabName()
          Gets the start tab Name, the name of the tab to be displayed when the user logs in.
 UnmodifiableTab getTab(String name)
          Gets a tab.
 URL getTabURL(UnmodifiableTab tab, javax.servlet.http.HttpServletRequest req)
          Gets the Tab URL.
 void init(String n, javax.servlet.http.HttpServletRequest req)
          Initializes the TabContainerProvider.
 URL processEdit(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Process a form for this provider.
 void removeTab(String name)
          Removes the tab.
 void setAvailableChannels(List avail)
          Sets the list of available channel names.
 void setSelectedChannels(List sel)
          Sets the list of selected channel names.
 void setSelectedTab(ModifiableTab t)
          Sets the selected tab Name in the session.
 void setSelectedTabName(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(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.
 
Methods inherited from class com.sun.portal.providers.containers.JSPContainerProviderAdapter
getContainerProviderContext, getRefreshTime
 
Methods inherited from class com.sun.portal.providers.jsp.JSPProvider
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
 

Constructor Detail

JSPTabContainerProvider

public JSPTabContainerProvider()
Method Detail

init

public void init(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.
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 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.
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 List getAvailableChannels()
                          throws ProviderException
Gets the list of tab topics that are available to be added to the portal page.
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(List sel)
                         throws ProviderException
Sets the list of selected channel names. This method sets the available tabs on the portal page.
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(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.
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 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 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 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 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 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 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(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
Parameters:
ModifiableTab. - Tab that needs to be set. This method adds the ModifiableTab to the selected tabs list.
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:
ModifiableTab. - Tab that needs to be set.
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:
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(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:
ModifiableTab.Whose - tab name needs to be set as the selected tab name. This method sets the active tab name on the user's desktop 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(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 active tab on the user's desktop to the name passed in..
Throws:
ProviderException - If the selected tab name cannot be set.

getContent

public 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:
Overrides:
getContent in class JSPProvider
Following copied from class: com.sun.portal.providers.jsp.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:
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 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.

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 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 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:
UnmodifiableTab - tab. The tab used in generating the URL to be used to switch the selected tab to the passed in tab on the user's desktop.
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(String name)
               throws ProviderException
Removes the tab.
Parameters:
name. - Name of the tab to be removed. This method removes the tab from the selected channels list if predefined and removes the tab from the selected and available lists and deletes the corresponding table container if user created.
Throws:
ProviderException - If the tab cannot be removed.

addTab

public void addTab(String name,
                   String title)
            throws ProviderException
Adds the tab back to the desktop that has been removed before
Parameters:
name. - Name of the tab.
title. - displayname of the tab.
Throws:
ProviderException - If the tab cannot be added.

getContentURL

public URL getContentURL(ModifiableTab tab,
                         javax.servlet.http.HttpServletRequest req)
                  throws ProviderException
Gets the ContentPage URL.
Parameters:
ModifiableTab - tab. The tab used in generating the URL to be used to redirect to when the user is making a tab from scratch in the Make New Tab Page..
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.