planetj.dataengine
Class TabManager

java.lang.Object
  extended byplanetj.dataengine.TabManager

public class TabManager
extends java.lang.Object


Field Summary
static java.lang.String CURRENT_TAB
           
static java.lang.String EDITABLE_TABS
           
static java.lang.String GENERATING_TAB_LINKS
           
static java.lang.String GENERATING_TAB_PARENT
           
static java.lang.String HIDE_TAB_RC
           
static java.lang.String TABS_JSPS_PV_KEY
           
 
Constructor Summary
TabManager()
           
 
Method Summary
static java.lang.Object getCommonTabData(java.lang.Object key, HttpServletRequest req)
          Gets previously stored common tab data.
static java.lang.String getCurrentTab(HttpServletRequest req)
          Gets the name of the current tab for the current tabbed operation, or null if none exists
static java.lang.String getCurrentTab(Operation op, HttpServletRequest req)
          Deprecated. Pass in a tabbed operation instead
static java.lang.String getCurrentTab(TabbedOperation op, HttpServletRequest req)
          Gets the name of the current tab for the specified operation, or null if none exists
static Row getCurrentTabParent(boolean refresh, HttpServletRequest req)
          Deprecated. You no longer should be passing in a refresh variable. Tab parent rows never need to be refreshed at this point - instead they have their values altered if necessary when a equivalent Row is updateded.
static Row getCurrentTabParent(HttpServletRequest req)
          Gets the current parent row for the tabs.
static java.lang.String getTabBody(HttpServletRequest req)
          Gets the JSP which should be used as the tab body
static java.lang.String getTabBodyOverride(HttpServletRequest req)
          Gets the JSP which has been set as the tab body override.
protected static java.util.List getTabFields(Row tabParent, HttpServletRequest req)
          Get the tab fields as defined by the tabs property group
static boolean isCurrentTabParent(Row row, HttpServletRequest req)
          Tests if the specified row is the current tab parent
static boolean isGeneratingTabParent(HttpServletRequest req)
          Tests if the tab parent is currently being generated
static boolean isTabField(java.lang.String fieldName, HttpServletRequest req)
          Tests if the field with the specified name should be rendered as a tab
protected static boolean isTabField(java.lang.String fieldName, Row tabParent, HttpServletRequest req)
          Tests if the field with the specified name should be rendered as a tab
static java.lang.String prepareTabs(LayoutDisplayPropertyGroup layout, HttpServletRequest req)
          Prepares the system for displaying tabs, returning the body JSP which should be displayed.
static java.lang.String prepareTabs(java.lang.String bodyJsp, HttpServletRequest req)
          Deprecated. You need to pass in the whole layout display property group
static java.lang.Object setCommonTabData(java.lang.Object key, java.lang.Object data, HttpServletRequest req)
          Sets an object as common tab data.
static void setCurrentTab(java.lang.String tab, HttpServletRequest req)
          Sets the name of the current tab for the current tabbed operation.
static void setCurrentTab(java.lang.String tab, Operation op, HttpServletRequest req)
          Sets the name of the current tab for the specified operation.
static void setCurrentTabParent(Row tabParent, HttpServletRequest req)
          Sets the current parent row for the tabs
static void setTabBodyOverride(java.lang.String override, HttpServletRequest req)
          Deprecated. Instead of the tab body override use the override ability on a magic request
static void showTab(java.lang.String tab, HttpServletRequest req, HttpServletResponse res)
          Shows the specified tab.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_TAB

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

EDITABLE_TABS

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

TABS_JSPS_PV_KEY

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

GENERATING_TAB_PARENT

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

GENERATING_TAB_LINKS

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

HIDE_TAB_RC

public static final java.lang.String HIDE_TAB_RC
See Also:
Constant Field Values
Constructor Detail

TabManager

public TabManager()
Method Detail

getCommonTabData

public static java.lang.Object getCommonTabData(java.lang.Object key,
                                                HttpServletRequest req)
Gets previously stored common tab data. Common tab data is data which is specific to a particular user and tab parent, but is shared among all the tabs of the tab parent. Changing which tab is the currently displayed tab does not affect the common tab data. When the tab parent changes, all common tab data is discarded.

Parameters:
key - The key which identifies a piece of common tab data
req - The HttpServletRequest
Returns:
The common tab data which is associated with the key

getCurrentTab

public static java.lang.String getCurrentTab(HttpServletRequest req)
Gets the name of the current tab for the current tabbed operation, or null if none exists


getCurrentTab

public static java.lang.String getCurrentTab(Operation op,
                                             HttpServletRequest req)
Deprecated. Pass in a tabbed operation instead

Gets the name of the current tab for the specified operation, or null if none exists


getCurrentTab

public static java.lang.String getCurrentTab(TabbedOperation op,
                                             HttpServletRequest req)
Gets the name of the current tab for the specified operation, or null if none exists


getCurrentTabParent

public static Row getCurrentTabParent(HttpServletRequest req)
Gets the current parent row for the tabs. A null result indicates there should be no tabs currently displayed, a non-null result means we should be showing some tabs.


getCurrentTabParent

public static Row getCurrentTabParent(boolean refresh,
                                      HttpServletRequest req)
                               throws CMException
Deprecated. You no longer should be passing in a refresh variable. Tab parent rows never need to be refreshed at this point - instead they have their values altered if necessary when a equivalent Row is updateded.

Gets the current parent row for the tabs. A null result indicates there should be no tabs currently displayed, a non-null result means we should be showing some tabs.

Throws:
CMException

getTabBody

public static java.lang.String getTabBody(HttpServletRequest req)
Gets the JSP which should be used as the tab body


getTabBodyOverride

public static java.lang.String getTabBodyOverride(HttpServletRequest req)
Gets the JSP which has been set as the tab body override. Normally the TabManager will examine the current layout properties and determine which JSP should be used as the tab body, however if the tab body override has been set then that JSP will be used to display the tab body


getTabFields

protected static java.util.List getTabFields(Row tabParent,
                                             HttpServletRequest req)
                                      throws CMException
Get the tab fields as defined by the tabs property group

Throws:
CMException

isCurrentTabParent

public static boolean isCurrentTabParent(Row row,
                                         HttpServletRequest req)
Tests if the specified row is the current tab parent


isGeneratingTabParent

public static boolean isGeneratingTabParent(HttpServletRequest req)
Tests if the tab parent is currently being generated


isTabField

public static boolean isTabField(java.lang.String fieldName,
                                 HttpServletRequest req)
                          throws CMException
Tests if the field with the specified name should be rendered as a tab

Throws:
CMException

isTabField

protected static boolean isTabField(java.lang.String fieldName,
                                    Row tabParent,
                                    HttpServletRequest req)
                             throws CMException
Tests if the field with the specified name should be rendered as a tab

Throws:
CMException

prepareTabs

public static java.lang.String prepareTabs(java.lang.String bodyJsp,
                                           HttpServletRequest req)
Deprecated. You need to pass in the whole layout display property group

Prepares the system for displaying tabs, returning the body JSP which should be displayed If tabs are not currently showing, then this will be the same body JSP that is passed in


prepareTabs

public static java.lang.String prepareTabs(LayoutDisplayPropertyGroup layout,
                                           HttpServletRequest req)
Prepares the system for displaying tabs, returning the body JSP which should be displayed. If tabs are not currently showing, then this will be the same body JSP that is passed in layout JSP (but only when appropriate)


setCommonTabData

public static java.lang.Object setCommonTabData(java.lang.Object key,
                                                java.lang.Object data,
                                                HttpServletRequest req)
Sets an object as common tab data. Common tab data is data which is specific to a particular user and tab parent, but is shared among all the tabs of the tab parent. Changing which tab is the currently displayed tab does not affect the common tab data. When the tab parent changes, all common tab data is discarded.

Parameters:
key - The key which identifies this piece of common tab data
req - The HttpServletRequest
Returns:
The old common tab data which was associated with the key

setCurrentTab

public static void setCurrentTab(java.lang.String tab,
                                 HttpServletRequest req)
Sets the name of the current tab for the current tabbed operation. This will not automatically display the specified tab. To do that, use the showTab() method.


setCurrentTab

public static void setCurrentTab(java.lang.String tab,
                                 Operation op,
                                 HttpServletRequest req)
Sets the name of the current tab for the specified operation. This will not automatically display the specified tab. To do that, use the showTab() method.


setCurrentTabParent

public static void setCurrentTabParent(Row tabParent,
                                       HttpServletRequest req)
                                throws CMException
Sets the current parent row for the tabs

Throws:
CMException

setTabBodyOverride

public static void setTabBodyOverride(java.lang.String override,
                                      HttpServletRequest req)
Deprecated. Instead of the tab body override use the override ability on a magic request

Sets the JSP which has been set as the tab body override. Normally the TabManager will examine the current layout properties and determine which JSP should be used as the tab body, however if the tab body override has been set then that JSP will be used to display the tab body


showTab

public static void showTab(java.lang.String tab,
                           HttpServletRequest req,
                           HttpServletResponse res)
                    throws CMException
Shows the specified tab. This will cause the operation associated with that tab to be run. If the specified tab doesn't exist in the current tab parent, an exception is thrown.

Throws:
CMException