ariba.util.http.multitab
Interface MultiTabSupport

All Known Implementing Classes:
NoMultiTabSupport

public interface MultiTabSupport

This interface defines a new functionality for MultiTab support. These methods exposes hooks into AW application that let you implement your own multi tab functionality.


Nested Class Summary
static class MultiTabSupport.Instance
          This is replacement of the AWApplication supposed to hold current instance of MultiTabSupport.
 
Method Summary
 java.lang.String defaultTabPrefix()
          Returns a string that help us differentiate between Tabbed and non Tabbed URI.
 MultiTabHandler handlerClassForName(java.lang.String name)
           
 MultiTabHandler initHandler(RequestProcessor requestProcessor, javax.servlet.http.HttpServletRequest request)
          creates request specific handler.
 java.lang.String insertTabInUri(java.lang.String untabbedUrl, int tabIndex, boolean isNotZero)
          Inserts the tab into the untabbedUrl, if a tab was found in tabbedUrl.
 boolean isMultiTabEnabled()
          Provides information if the multitab is enabled in the system
 int maximumNumberOfTabs()
          Defines max number of tabs system allows to be opened at the same time
 void processRequest(MultiTabHandler.RequestInfo data, MultiTabHandler multiTabHandlerCallback)
          Determine the state of the request and return what multi-tab related action should be taken by the caller.
 void registerHandlerClassForName(java.lang.String name, java.lang.Class<? extends MultiTabHandler> handler)
          Factory methods to register a handler and to retrieve.
 java.lang.String stripTabFromUri(java.lang.String uri)
          Removes the tab # from the URI.
 java.lang.String tabNumberToUri(java.lang.String servletName, java.lang.String applicationNameSuffix, int tabIndex, java.lang.String uri)
          If the tab index is more than ZERO, apply your customer naming scheme to identify your tab URI
 int uriToTabNumber(java.lang.String uri, int defaultTab)
          Attempts to parse the tab number from the provided URI.
 

Method Detail

insertTabInUri

java.lang.String insertTabInUri(java.lang.String untabbedUrl,
                                int tabIndex,
                                boolean isNotZero)
Inserts the tab into the untabbedUrl, if a tab was found in tabbedUrl. Noop, if onlyWhenPositive is true and tabIndex is zero.

Parameters:
untabbedUrl - An untabbed relative or absolute request URI.
tabIndex - The tab to insert.
isNotZero - Only calls replace when the tabIndex is not ZERO.
Returns:
The modified URI.

stripTabFromUri

java.lang.String stripTabFromUri(java.lang.String uri)
Removes the tab # from the URI.

Parameters:
uri - The URI to evaluate.
Returns:
A URI without any tab info.

maximumNumberOfTabs

int maximumNumberOfTabs()
Defines max number of tabs system allows to be opened at the same time

Returns:
Max defined number of tabs.

uriToTabNumber

int uriToTabNumber(java.lang.String uri,
                   int defaultTab)
Attempts to parse the tab number from the provided URI. Returns tab defaultTab if UnexpectedTabException was thrown.

Parameters:
uri - The URI to evaluate.
defaultTab - The default tab, when an exception happens.
Returns:
The tab number, default, or 0.

tabNumberToUri

java.lang.String tabNumberToUri(java.lang.String servletName,
                                java.lang.String applicationNameSuffix,
                                int tabIndex,
                                java.lang.String uri)
If the tab index is more than ZERO, apply your customer naming scheme to identify your tab URI

Parameters:
servletName - The name of the servlet.
applicationNameSuffix - Usually, "/", but allows for modifications to the servlet name.
tabIndex - The tab index to evaluate.
uri -
Returns:
The concatenated tab-aware servlet-name.

isMultiTabEnabled

boolean isMultiTabEnabled()
Provides information if the multitab is enabled in the system

Returns:
true if MultiTab is enabled

processRequest

void processRequest(MultiTabHandler.RequestInfo data,
                    MultiTabHandler multiTabHandlerCallback)
                    throws java.io.IOException
Determine the state of the request and return what multi-tab related action should be taken by the caller.

Parameters:
data - A data wrapper.
multiTabHandlerCallback - A class implementing MultiTab.
Throws:
java.io.IOException

defaultTabPrefix

java.lang.String defaultTabPrefix()
Returns a string that help us differentiate between Tabbed and non Tabbed URI.

Returns:

initHandler

MultiTabHandler initHandler(RequestProcessor requestProcessor,
                            javax.servlet.http.HttpServletRequest request)
                            throws java.io.IOException
creates request specific handler. This method stores current handler in the ThreadLocal which is not the best way how to handle temp info for the request. Probably next task will be some refactoring to this. Especially for servlet 3.0 where the same thread can be reused for processing another concurrent request. something like NIO.

Throws:
java.io.IOException

registerHandlerClassForName

void registerHandlerClassForName(java.lang.String name,
                                 java.lang.Class<? extends MultiTabHandler> handler)
Factory methods to register a handler and to retrieve. We had to introduce this due to the package dependencies. Therefore we have a common place usually in the APP that registers handlers and one place we do lookup.


handlerClassForName

MultiTabHandler handlerClassForName(java.lang.String name)


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.