com.filenet.wcm.toolkit.server.base
Class WcmController

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.base.WcmDpContainer
      extended bycom.filenet.wcm.toolkit.server.base.WcmController
All Implemented Interfaces:
WcmControllerBehaviorInterface
Direct Known Subclasses:
ConfigurableController

public abstract class WcmController
extends WcmDpContainer
implements WcmControllerBehaviorInterface

This is the framework controller base class. It is abstract, therefore it must be subclassed and have the required methods implemented in order to be useful.
Framework pages instantiate an implemented controller, and register their modules with it and call the handleEvent method wich will in turn do the following steps:

  1. Call the initialize() method in each module (pseudo constructor).
  2. If eventTarget and eventName are defined in the request string, dispatch the event to its target UI module.
  3. Broadcast the "StartPage" event to all UI modules.
Sample:

(This would be a code fragment from pageEvent.jsp)
      ...
      <%-- CONTROLLER --%>
      <jsp:useBean
         id="controller"
         class="com.filenet.wcm.toolkit.server.controller.WcmWorkplaceController"
         scope="request"/>
      ...
      <%
      ...
      controller.configurePage(application, request);
      controller.registerModule(myBean);
      controller.registerModule(testBean);
      controller.handleEvent(application, request, response, true);
      %>
    


Nested Class Summary
protected  class WcmController.GetWriterResponse
          This is a wrapping of HttpServletResponse, so that we can intercept calls to sendRedirect.
 class WcmController.WcmEventRequest
          This is a wrapping of HttpServletRequest so that we can intercept calls to getParameter...
 class WcmController.WindowProperties
          This object provides access to the controller properties of the windowId that it was constructed for.
 class WcmController.WorkplacePrintWriter
          This is a wrapping of PrintWriter, Special to add flush to write calls.
 
Field Summary
protected static long ALL_FLAGS_MASK
           
protected  javax.servlet.ServletContext application
           
protected static WcmBootstrapPrefs bootstrap
           
static java.lang.String BOOTSTRAP_PROPERTIES_KEY
           
protected static long COMPAT_FLAGS_MASK
           
protected static java.util.HashMap controllerEvents
           
static long CREATE_INLINE
          For use as a WcmParameter.WINDOW_ID_MODE request parameter only.
static java.lang.String CREATE_INLINE_KEY
           
static long CREATE_POPUP
          For use as a WcmParameter.WINDOW_ID_MODE request parameter only.
static java.lang.String CREATE_POPUP_KEY
           
protected static long CREATE_PRIVATE_FLAG
           
static long CREATE_WINDOW_ID
          Deprecated. - use CREATE_POPUP as a windowIdMode request parameter.
static java.lang.String CREDENTIALS_BEAN_KEY
           
static java.lang.String CURRENT_MODULE_KEY
          Default value for heading mode.
protected  javax.servlet.http.HttpServletRequest currentRequest
           
protected  javax.servlet.http.HttpServletResponse currentResponse
           
protected  WcmDataStore dataStore
           
protected static java.lang.String DEFER_REWRITE_KEY
           
protected  int deferPostThreshold
           
protected  boolean deferRedirect
           
protected  java.lang.String deferredURL
           
protected static boolean DISABLE_BROWSER_CACHING
           
protected static boolean DUMP_DATASTORE_KEYS
           
protected static java.lang.String FIRST_WINDOWID_KEY
          Deprecated. Use get/setFirstWindowId signatures.
protected static long FLAGS_MASK
           
protected static long HASH_PRIVATE_FLAG
           
static java.lang.String HEADER_MODULE
          The name of the header rendering module
static java.lang.String HEADER_MODULE_NAME
          When an instance of WcmHeaderModuleInterface is registered with the controller, its module name is forced to this value.
protected static java.lang.String HELP_CONTEXT_KEY
           
protected static java.lang.String HELP_PAGE_KEY
           
protected static WcmHelpMap helpMap
           
static java.lang.String HOME_KEY
          Deprecated. use set/getHome signatures.
static long IGNORE_WINDOW_ID
          IGNORE_WINDOW_ID can be passed as a third parameter to configurePage.
protected  UserTokenPolicyInterface internalTokenPolicy
           
protected  java.lang.Exception lastTokenException
           
protected  boolean loginEnabled
           
static java.lang.String MAIN_WINDOW
          Defines the default windowId value when not in a popup.
static java.lang.String NAMED_CONTROLLERS_KEY
          Defines an attribute key/value on the request object (HttpServletRequest) Where controllers will register themselves by name into a hash map to verify that no two are dups if multiple are created during the course of a single request.
protected  boolean newPageParams
           
static long NO_EXPIRE_FLAG
           
protected static long NO_REWRITE_PRIVATE_FLAG
           
static long NO_WINDOW_ID
          NO_WINDOW_ID can be passed as a third parameter to configurePage.
protected  boolean noRequestParams
           
protected static WcmException noWindowIdError
           
protected  boolean okToRedirect
           
protected  boolean okToRegister
           
protected  java.lang.String pageName
           
static long POPUP_FLAG
           
protected static java.lang.String POPUP_KEY
          Deprecated. No longer used.
protected static int popWindowIDCycleMax
           
protected static boolean popWindowIDUsePageName
           
protected static java.util.HashMap preControllerEvents
           
protected static long PRIVATE_FLAGS_MASK
           
static long PROPAGATE_WINDOW_ID
          PROPOGATE_WINDOW_ID (DEFAULT) can be passed as a third parameter to configurePage.
protected static long PROPOGATE_ID
           
protected static long PROPOGATE_MASK
           
protected static long PROPOGATE_NONE
           
static long PROPOGATE_WINDOW_ID
          Deprecated. - use PROPAGATE_WINDOW_ID
protected static long PUSH_PREV_PRIVATE_FLAG
           
protected static java.lang.String REDIRECT
           
protected static long REQUIRE_ID
           
protected static long REQUIRE_MASK
          windowIdMode components...
static long REQUIRE_WINDOW_ID
          REQUIRE_WINDOW_ID can be passed as a third parameter to configurePage.
protected  boolean sendRedirectCalled
           
protected static java.lang.String SESSION_COUNT
           
protected  WcmSignInPolicyInterface signInPolicy
           
static java.lang.String SSL_PROTOCOL
          Defines the protocol portion of the URL for SSL.
protected  WcmSSLInfo sslInfo
           
protected  java.util.Map tempProperties
           
protected  WindowIDFactory widFactory
           
protected static java.lang.String WINDOW_SIGNED_IN_KEY
          Deprecated. Use isPopupSignedIn.
protected  boolean windowIdAssigned
           
protected  boolean windowIdCreated
           
protected  long windowIdMode
           
protected  java.lang.String[] windowIdParams
          Deprecated.  
protected  boolean windowIdRecovered
           
protected static WcmString wsPopupSessionExpired
           
 
Constructor Summary
WcmController()
           
 
Method Summary
protected  void assignWindowId(WindowID newWindowId, WindowID currentWindowId, boolean popupCreated)
          Assigns the window ID.
protected  boolean catchPopupExceptions()
          Override to customize WcmController behavior.
 boolean checkLogin(java.lang.String currentUrl, javax.servlet.http.HttpServletRequest request)
          Checks to see if the session has valid credentials.
protected  void checkName(javax.servlet.http.HttpServletRequest request)
           
 void cleanupWindowId(java.lang.String windowId)
          Schedules a cleanup of the storage allocated to the specified windowId, to occur in one minute from the time the call is made.
 void cleanupWindowId(java.lang.String windowId, long timeout)
          Schedules a cleanup of the storage allocated to the specified windowId, to occur in specified interval.
 boolean closeWindow()
          Call this method to close the current browser window.
 boolean closeWindow(javax.servlet.http.HttpServletResponse response)
          Call this method to close the current browser window.
 void configureDataProviders()
          No root-level data providers are defined in WcmWorkplaceController.
 void configureHeaderModule()
          Configures the default toolkit implementation - WcmHeaderModule.
 void configurePage(javax.servlet.ServletContext applicationValue, javax.servlet.http.HttpServletRequest request)
          Call this before making any calls to registerModule.
 void configurePage(javax.servlet.ServletContext applicationValue, javax.servlet.http.HttpServletRequest request, boolean windowIdRequired)
          Deprecated. Use configurePage(application, request, long windowIdMode).
 void configurePage(javax.servlet.ServletContext applicationValue, javax.servlet.http.HttpServletRequest request, int windowIdMode)
          Deprecated. use configurePage(ServletContext, HttpServletRequest, long)
 void configurePage(javax.servlet.ServletContext applicationValue, javax.servlet.http.HttpServletRequest request, int windowIdMode, java.lang.String[] windowIdParams)
          Deprecated.  
 void configurePage(javax.servlet.ServletContext applicationValue, javax.servlet.http.HttpServletRequest request, long windowIdMode)
          Call this before making any calls to registerModule.
protected  void configurePageName(javax.servlet.http.HttpServletRequest request)
           
protected  java.lang.String constructTargetUrl(javax.servlet.http.HttpServletRequest request, boolean dropWindowId)
           
protected  WindowID createWindowId(long createValue, javax.servlet.http.HttpServletRequest request, long flags)
           
 java.lang.String encodeUserToken(java.lang.String url)
          Appends user token to the url if tokens are enabled
protected  java.lang.String encodeWindowId(java.lang.String url)
           
protected  java.lang.String executeModel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean skipEventProcessing, java.lang.String eventTarget)
          executeModel takes care of module initialization and event routing.
protected  boolean forceSignInToDefaultPage()
          Override and return true to cause all logins to go to the configured default page.
 java.lang.String generateUserToken()
          Generates user token if tokens are enabled.
 java.io.InputStream getApplicationResource(java.lang.String path)
           
protected  java.lang.String getBaseURL()
          Deprecated. - use getWebappRootURL()
protected  java.lang.String getBootstrapFile()
           
 java.lang.String getClientCharacterEncoding()
          Return the client's character encoding value for the current request.
 java.util.Locale getClientLocale()
          Return the client locale value of the current request.
 java.util.TimeZone getClientTimeZone()
          Gets the TimeZone object used to convert date values from ISO to UI display, and back to ISO again.
protected  javax.servlet.http.HttpServletRequest getCurrentRequest()
          Returns the current HttpServletRequest object.
 WcmDataStore getDataStore()
          Returns the instance of WcmDataStore.
protected  WcmDataStore getDataStore(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request)
          Returns the instance of WcmDataStore.
 boolean getDebugTrace()
          Returns true or false whether debug tracing is enabled in web.xml.
 java.lang.String getEncodedSessionId()
          Get the Java/JSP session id.
 WcmErrorMessageBox getErrorMessageBox(java.lang.Throwable t)
          Factory method.
static boolean getErrorTrace()
          Return whether or not error tracing is currently turned on.
protected  java.lang.String getEventBaseURL()
           
protected  java.lang.String getFirstWindowId()
           
 WcmHeaderModuleInterface getHeaderModule()
          Get the registered header module.
 java.lang.String getHelpContext()
          Get the supplemental help context value

In the WcmController "Help" event, a help HTML file name is calculated based on the current page id, concatenated with the help context value in the form:

http://docServer/helpRootPath/yourpageid [ _helpcontext ] .html
 java.lang.String getHelpPage()
          Get the help page id value

In the WcmController "Help" event, a help HTML file name is calculated based on the current page id (or user-defined value), concatenated with the help context value in the form:

http://docServer/helpRootPath/ [ helppageid ] _helpcontext.html
static java.lang.String getHelpURL(java.lang.String baseUrl, java.lang.String helpPage, java.lang.String helpContext)
          Static method to get the context sensitive help URL for the current page.
protected  java.lang.String getHomeURL()
          Get the home URL for the current controller windowId value.
protected  java.lang.String getHomeURL(java.lang.String windowId)
          Get the home URL for the specified windowId value.
protected  java.lang.String getHomeURLKey(java.lang.String windowId)
          Deprecated. Use the accessors instead.
 java.lang.String getInitParameter(java.lang.String key)
          Gets an init parameter from the servlet Descriptor.
 boolean getInitParameter(java.lang.String key, boolean defaultValue)
          Gets an init parameter from the servlet Descriptor.
 long getInitParameter(java.lang.String key, long defaultValue)
          Gets an init parameter from the servlet Descriptor.
 java.lang.String getInitParameter(java.lang.String key, java.lang.String defaultValue)
          Gets an init parameter from the servlet Descriptor.
 boolean getInitParameterBoolean(java.lang.String key)
          Gets an init parameter from the servlet Descriptor.
 UserTokenPolicyInterface getInternalTokenPolicy()
           
 java.lang.Exception getLastTokenException()
           
 java.lang.String getLocalIP()
          Returns the local IP number for the machine where this page is running.
 java.lang.String getLoginRoutingInfo()
          For thick clients, return the information necessary so that they know how to set credentials in the session.
protected static java.lang.reflect.Method getMethod(java.lang.Class c, java.lang.String methodName, java.lang.Class[] paramList)
           
 java.lang.String getName()
          Get the controller name.
 java.lang.String getNewPageParameter(java.lang.String key)
          When a page is loaded with a request string that specifies parameters but no eventTarget/eventName, the request parameters are stored away by the controller.
 java.lang.String getPageId()
          Returns the current page ID relative to the application root, which is of the form [ [path/] path/ ]page.jsp.
 java.lang.String getPageName()
          Returns the current page name relative to the application root, which is of the form [ [path/] path/ ]page.jsp.
 java.lang.String getPageParameter(java.lang.String key)
          When a page is loaded with a request string that specifies parameters but no eventTarget/eventName, the request parameters are stored away by the controller.
 java.util.Enumeration getPageParameterNames()
           
 java.util.Hashtable getPageParameters()
          Gets a Hashtable instance containing a copy of all the current page parameters.
 java.lang.String[] getPageParameters(java.lang.String key)
          When a page is loaded with a request string that specifies parameters but no eventTarget/eventName, the request parameters are stored away by the controller.
 java.lang.String getPageParameterString(java.lang.String key)
           
protected  java.lang.String getParameter(java.util.Map map, java.lang.String key)
           
protected  java.lang.String[] getParameters(java.util.Map map, java.lang.String key)
           
protected  java.lang.Exception getPopupException(java.lang.Exception e)
          Construct the popup wrapper exception.
 int getPOSTThreshold()
           
 java.lang.Object getProperty(java.lang.String key)
          Get the controller property - from the DataStore scoped to the page.
 java.lang.Object getRequestAttribute(java.lang.String key)
          Get a request attribute from the request that this controller is referencing.
 javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
          Get the request dispatcher from the ServletContext that this controller is referencing.
 java.util.Locale getRequestedClientLocale()
          Return the primary locale of the current request.
static java.lang.String getRequestHash(javax.servlet.http.HttpServletRequest request)
           
protected  WcmServerCredentials getServerCredentials()
           
 javax.servlet.ServletContext getServletContext()
          Returns the ServletContext (application)
 java.lang.String getSessionId()
          Get the Java™ or Java™Server Pages session id.
 WcmSignInPolicyInterface getSignInPolicy()
          Factory method.
protected  WcmSSLInfo getSSLInfo()
          Singleton factory method.
 StaticInitializerInterface getStaticInitializer()
          getStaticInitializer.
 WcmSystem getSystemInfo()
          Factory method.
 java.lang.Object getTemporaryProperty(java.lang.String key)
          Gets a property that is scoped to this controller instance.
static java.lang.String getTime(java.lang.String key)
          Retrieves average time of execution of the specified instrumented segment of code.
static java.lang.Object[] getTimerKeys()
          Get an array of all of the timer keys currently present.
 java.lang.String getUIRoot()
          Returns the relative path to the root location of the UI jsp's.
 UserAgent getUserAgent()
          Return the UserAgent object for the current request.
 WcmUserInformationInterface getUserInfo()
          Return the singleton instance of WcmUserInformationInterface if it is currently defined in the session.
 UserTokenPolicyInterface getUserTokenPolicy()
           
 java.lang.String getWebappRootURL()
          Gets the context root URL for the current user session.
 java.lang.String getWindowId()
          Returns the current windowId hash value, or the keyword "mainWindow" if there is not a current windowId in effect.
static java.lang.String getWindowId(javax.servlet.http.HttpServletRequest request)
          Returns the windowId from the request, if present.
protected  boolean getWindowIdCompatibility()
           
protected  WindowIDFactory getWindowIDFactory()
          Get the widFactory instance to use to create a new window ID.
static java.lang.String getWindowIdFromReferer(javax.servlet.http.HttpServletRequest request)
          Retreives the window ID from the referer URL.
static java.lang.String getWindowIdFromReferer(java.util.Map popups, java.lang.String referer)
          Deprecated. use getWindowIdFromURL(url, baseUrl)
static java.lang.String getWindowIdFromURL(java.lang.String url, java.lang.String baseUrl)
          Returns a windowId based on the referer URL and the current popups list.
protected  long getWindowIdModeValue(java.lang.String symbolicMode)
           
protected  long getWindowIdModeValue(java.lang.String symbolicMode, boolean noExpireFlag)
           
 WindowID getWindowIdObject()
          Returns the current windowId hash value, or the keyword "mainWindow" if there is not a current windowId in effect.
protected  ControllerUtilities.PropertiesMap getWindowMap()
          Returns an instance of the current windowMap.
 WcmController.WindowProperties getWindowProperties(java.lang.String windowId)
          Get an instance of the controller window properties for the specified windowId.
 java.lang.Object getWindowProperty(java.lang.String key)
          Get the controller property - from the DataStore scoped globally to the window.
 java.io.Writer getWriterAndStop()
           
 boolean handleEvent(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This is the base handleEvent method.
 void handleEvent(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean autoRedirect)
          This is the autoRedirect version of the handleEvent method.
 void handleEvent(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String uiPageName)
          Like auto redirect, but redirect to the specified page.
 java.lang.String initializeModules(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean thinClient, boolean doCleanup)
          Handles module initialization, credentials check and event routing.
 java.lang.String initializeModules(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean skipPreControllerEvents, boolean sendNotSignedInXML, boolean skipEventProcessing, boolean skipStartPageEvent, boolean skipPrepareResponse, boolean doCleanup)
          Handles module initialization.
 void initializeStaticClasses()
          Initializes static classes that require ServletContext information.
static boolean invokeNamedEvent(java.lang.String eventName, GlobalEventModule geModule, GlobalEvent evt)
          Invoke a global event handler on the specified UI module.
static boolean invokeNamedEvent(java.lang.String eventName, WcmUiModuleInterface uiModule, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Invoke an event handler on the specified UI module.
 boolean isBootstrapRequired()
          Returns true if required bootstrap options have not already been set by an administrator.
 boolean isControllerEvent(java.lang.String eventName)
          Return true if the named event is a valid controller event (optional).
protected  boolean isEventRequest()
           
static boolean isForcedToken(javax.servlet.http.HttpServletRequest request)
          Check for user token being passed w/ WcmParameter.USER_TOKEN_FORCE set to true.
protected  boolean isGlobalEventRequest()
           
protected  boolean isGuest()
          Returns true if the current signed in user is a guest.
protected  boolean isNewWindowIdRequired(javax.servlet.http.HttpServletRequest request)
          Deprecated.  
static boolean isNonReturnableBookmark(javax.servlet.http.HttpServletRequest req)
           
 boolean isPopup()
          Return whether or not this controller is running in popup mode (when windowId is being carried on the request).
static boolean isPopup(javax.servlet.http.HttpServletRequest request)
          Determine if this request represents a popup window.
static boolean isPopup(java.lang.String windowId)
          Determine if this request represents a popup window.
 boolean isPopupSignedIn()
          Returns whether or not this pop-up went through sign-in.
static boolean isPopupSignedIn(javax.servlet.http.HttpServletRequest request, WcmDataStore ds)
          Returns whether or not this pop-up went through sign-in.
static boolean isPopupSignedIn(java.lang.String windowIdValue, WcmDataStore ds)
          Returns whether or not this pop-up went through sign-in.
 boolean isPreControllerEvent(java.lang.String eventName)
          Return true if the named event is a valid "pre" controller event (optional).
 boolean isRegistered(WcmModuleInterface module)
          Test to see if the module is registered.
 boolean isSSOConfigured()
           
static boolean isSSOConfigured(javax.servlet.http.HttpServletRequest request)
           
 boolean isSSOFilterConfigured()
          Returns true if an SSO filter is configured, regardless of whether or not it is true SSO or container-managed authentication.
static boolean isSSOFilterConfigured(javax.servlet.http.HttpServletRequest request)
          Returns true if an SSO filter is configured, regardless of whether or not it is true SSO or container-managed authentication.
 boolean onChangeApp(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The onChangePage controller event handler.
 boolean onChangePage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The onChangePage controller event handler.
 boolean onCloseWindow(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The onCloseWindow controller event handler.
 boolean onHelp(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The onHelp controller event handler.
 boolean onHome(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The onHome controller event handler.
 boolean onSignIn(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The onSignIn controller event handler.
 boolean onSignOut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The onSignOut controller event handler.
 void openPopup(java.lang.String destinationUrl)
          Use this to open a popup to a new page.
 void openPopup(java.lang.String destinationUrl, java.lang.String windowName, int width, int height)
          Use this to open a popup to a new page.
 void openPopup(java.lang.String destinationUrl, java.lang.String windowName, int width, int height, boolean showStatusBar)
          Open a popup window with control over whether or not to show the status bar.
 void openPopupViaPOST(java.lang.String destinationUrl, java.util.Map postParameters, java.lang.String windowName, int width, int height, boolean showStatusBar)
          Open a popup window with control over whether or not to show the status bar.
 boolean peekEvent(WcmUiModule uiModule, java.lang.String uiEventName)
          Returns true if the targeted event is queued.
 boolean peekGlobalEvent(java.lang.String uiEventName)
          Returns true if the targeted global event is queued.
 boolean peekNewPageParameters()
          Returns true if there are new page parameters defined on the current request.
 boolean peekNoRequestParameters()
          Returns true are no request parameters on the current request.
 java.lang.Object popPageParameter(java.lang.String key)
          Allows a mechanism to discard page parameters.
protected  void postProcessWindowId(WindowID assignedWindowId, WindowID requestWindowId, WindowID refererWindowId, boolean idCreated, boolean idSet, boolean idRecovered, boolean isPopupMode, boolean isStackedMode)
          A subclass of WcmController may override this method if there is a need to track windowId related activity for application-specific purposes.
static long postTime(java.lang.String key, java.util.Date startTime, java.util.Date endTime)
          Call this method to record time intervals for areas of code to be instrumented.
protected  void prepareResponse(javax.servlet.http.HttpServletResponse response, java.lang.String contentType, boolean disableBrowserCaching)
          Sets headers in the response object in preparation for rendering a page back to the browser.
 void registerGlobalEvent(java.lang.String eventName)
          Deprecated. - Registering global events is no longer necessary.
 void registerModule(WcmModuleInterface module)
          Register UI and DP modules with the controller.
protected  void registerModule(WcmModuleInterface module, boolean initialize)
          Overload of registerModule.
 void registerModule(WcmModuleInterface module, java.lang.String name)
          Register UI and DP modules with the controller.
protected  void sendCloseWindow(javax.servlet.http.HttpServletResponse response)
          Writes some javascript to the browser telling it to close itself.
 boolean sendRedirect(javax.servlet.http.HttpServletResponse response, java.lang.String baseURL, java.lang.String targetURL, int postThreshold)
          Redirect to another page.
 boolean sendRedirect(java.lang.String destinationUrl)
          Use this to do a framework page switch that cleans up the current page.
 boolean sendRedirect(java.lang.String destinationUrl, int postThreshold)
          Use this to do a framework page switch that cleans up the current page.
 void serverSideInclude(java.lang.String path, java.io.Writer w)
          Include the specified URL writing its output to the current Writer object.
 void setAutoFixWindowId(boolean value)
          Deprecated. - use configurePage(servletContext, request, windowIdMode).
 void setException(java.lang.Throwable exc, boolean redirect)
          Specify an exception to be displayed by WcmError.jsp, and optionally re-direct to WcmError.jsp to show the error.
protected  void setFirstWindowId(java.lang.String wid)
           
 void setHelpContext(java.lang.Object o)
          Set a supplemental help context based on an object's unqualified class name.
 void setHelpContext(java.lang.String contextValue)
          Set a supplemental help context string.
 void setHelpPage(java.lang.String pageValue)
          Set a non-default help page value.
protected  void setHomeURL(ControllerUtilities.PropertiesMap windowIdMap, java.lang.String url)
           
protected  void setHomeURL(java.lang.String url)
          Set the home URL for the current controller windowId value.
protected  void setHomeURL(java.lang.String windowId, java.lang.String url)
          Set the home URL for the specified windowId value.
 void setLocale(java.util.Locale locale)
          Call setLocale to set the client locale.
 void setLoginEnabled(boolean value)
          Set whether or not to auto-redirect to WcmSignIn.jsp, if WcmServerCredentials is not found in the DataStore.
 void setName(java.lang.String nameValue)
          Set the name of the controller.
 void setProperty(java.lang.String key, java.lang.Object value)
          Set the controller property in the DataStore.
 java.lang.Object setRequestAttribute(java.lang.String key, java.lang.Object value)
          Set a request attribute on the request that this controller is referencing.
 java.lang.Object setTemporaryProperty(java.lang.String key, java.lang.Object value)
          Sets a property that lives for the duration of this controller instance.
 void setWindowIDFactory(WindowIDFactory widFactory)
          Specify the windowId factory instance to use here...
 void setWindowProperty(java.lang.String key, java.lang.Object value)
          Set the controller property in the DataStore, scoped globally to the current windowId.
protected  void subscribeGlobalEvent(GlobalEventModule eventModule, java.lang.String eventName)
           
protected  void subscribeGlobalEvent(GlobalEventModule eventModule, java.lang.String eventName, boolean register)
          Deprecated. - Use subscribeGlobalEvent(eventModule, eventName)
protected  java.util.Hashtable transferPageParameters(javax.servlet.http.HttpServletRequest request)
          transferPageParameters - retrieves the page parameters from the request object and copies them to a new hashtable.
protected  boolean tryEncodedCredentials(javax.servlet.http.HttpServletRequest request)
           
 void unRegisterModule(WcmModuleInterface module)
          Un-register the module from the controller's internal hashtable.
 
Methods inherited from class com.filenet.wcm.toolkit.server.base.WcmDpContainer
addDataProvider, addDataProvider, queryDataProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.filenet.wcm.toolkit.server.base.WcmControllerBehaviorInterface
getBootstrapPage, getConfiguration, getConfiguredHome, getDefaultPage, getErrorPage, getRouters, getSignInPage, isStickyPage, isValidHome
 

Field Detail

BOOTSTRAP_PROPERTIES_KEY

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

wsPopupSessionExpired

protected static final WcmString wsPopupSessionExpired

pageName

protected java.lang.String pageName

dataStore

protected WcmDataStore dataStore

currentRequest

protected javax.servlet.http.HttpServletRequest currentRequest

currentResponse

protected javax.servlet.http.HttpServletResponse currentResponse

application

protected javax.servlet.ServletContext application

signInPolicy

protected WcmSignInPolicyInterface signInPolicy

internalTokenPolicy

protected UserTokenPolicyInterface internalTokenPolicy

sslInfo

protected WcmSSLInfo sslInfo

newPageParams

protected boolean newPageParams

noRequestParams

protected boolean noRequestParams

loginEnabled

protected boolean loginEnabled

okToRegister

protected boolean okToRegister

okToRedirect

protected boolean okToRedirect

deferRedirect

protected boolean deferRedirect

deferredURL

protected java.lang.String deferredURL

deferPostThreshold

protected int deferPostThreshold

sendRedirectCalled

protected boolean sendRedirectCalled

windowIdMode

protected long windowIdMode

windowIdAssigned

protected boolean windowIdAssigned

windowIdRecovered

protected boolean windowIdRecovered

windowIdCreated

protected boolean windowIdCreated

widFactory

protected WindowIDFactory widFactory

windowIdParams

protected java.lang.String[] windowIdParams
Deprecated.  


tempProperties

protected java.util.Map tempProperties

bootstrap

protected static WcmBootstrapPrefs bootstrap

helpMap

protected static WcmHelpMap helpMap

popWindowIDCycleMax

protected static int popWindowIDCycleMax

popWindowIDUsePageName

protected static boolean popWindowIDUsePageName

lastTokenException

protected java.lang.Exception lastTokenException

NAMED_CONTROLLERS_KEY

public static final java.lang.String NAMED_CONTROLLERS_KEY
Defines an attribute key/value on the request object (HttpServletRequest) Where controllers will register themselves by name into a hash map to verify that no two are dups if multiple are created during the course of a single request.

See Also:
Constant Field Values

SSL_PROTOCOL

public static final java.lang.String SSL_PROTOCOL
Defines the protocol portion of the URL for SSL.

See Also:
Constant Field Values

MAIN_WINDOW

public static final java.lang.String MAIN_WINDOW
Defines the default windowId value when not in a popup.

See Also:
Constant Field Values

HOME_KEY

public static final java.lang.String HOME_KEY
Deprecated. use set/getHome signatures.

See Also:
Constant Field Values

HEADER_MODULE

public static final java.lang.String HEADER_MODULE
The name of the header rendering module

See Also:
Constant Field Values

CURRENT_MODULE_KEY

public static final java.lang.String CURRENT_MODULE_KEY
Default value for heading mode.

See Also:
Constant Field Values

HEADER_MODULE_NAME

public static final java.lang.String HEADER_MODULE_NAME
When an instance of WcmHeaderModuleInterface is registered with the controller, its module name is forced to this value. Only one header module is allowed to be registered by a page.

See Also:
Constant Field Values

REQUIRE_MASK

protected static final long REQUIRE_MASK
windowIdMode components...

See Also:
Constant Field Values

REQUIRE_ID

protected static final long REQUIRE_ID
See Also:
Constant Field Values

PROPOGATE_MASK

protected static final long PROPOGATE_MASK
See Also:
Constant Field Values

PROPOGATE_ID

protected static final long PROPOGATE_ID
See Also:
Constant Field Values

PROPOGATE_NONE

protected static final long PROPOGATE_NONE
See Also:
Constant Field Values

PRIVATE_FLAGS_MASK

protected static final long PRIVATE_FLAGS_MASK
See Also:
Constant Field Values

FLAGS_MASK

protected static final long FLAGS_MASK
See Also:
Constant Field Values

PUSH_PREV_PRIVATE_FLAG

protected static final long PUSH_PREV_PRIVATE_FLAG
See Also:
Constant Field Values

CREATE_PRIVATE_FLAG

protected static final long CREATE_PRIVATE_FLAG
See Also:
Constant Field Values

HASH_PRIVATE_FLAG

protected static final long HASH_PRIVATE_FLAG
See Also:
Constant Field Values

NO_REWRITE_PRIVATE_FLAG

protected static final long NO_REWRITE_PRIVATE_FLAG
See Also:
Constant Field Values

POPUP_FLAG

public static final long POPUP_FLAG
See Also:
Constant Field Values

NO_EXPIRE_FLAG

public static final long NO_EXPIRE_FLAG
See Also:
Constant Field Values

ALL_FLAGS_MASK

protected static final long ALL_FLAGS_MASK
See Also:
Constant Field Values

COMPAT_FLAGS_MASK

protected static final long COMPAT_FLAGS_MASK
See Also:
Constant Field Values

NO_WINDOW_ID

public static final long NO_WINDOW_ID
NO_WINDOW_ID can be passed as a third parameter to configurePage. When this value is specified, the page will not use window IDs, if you come from a referer in the same application that has a window ID on it, it will be dropped. If the current request has a windowId on it, the request URL will be rewritten with no windowId parameter present.

See Also:
Constant Field Values

IGNORE_WINDOW_ID

public static final long IGNORE_WINDOW_ID
IGNORE_WINDOW_ID can be passed as a third parameter to configurePage. When this value is specified, the page will not use window IDs, if you come from a referer in the same application that has a window ID on it, it will be dropped. If the current request has a windowId on it, it will be ignored.

See Also:
Constant Field Values

PROPAGATE_WINDOW_ID

public static final long PROPAGATE_WINDOW_ID
PROPOGATE_WINDOW_ID (DEFAULT) can be passed as a third parameter to configurePage. A page with this parameter set, when accessed via a page in the same application, that has a window ID on it, will pick up and use that window ID. This is the default mode if not specified.

See Also:
Constant Field Values

PROPOGATE_WINDOW_ID

public static final long PROPOGATE_WINDOW_ID
Deprecated. - use PROPAGATE_WINDOW_ID

See Also:
Constant Field Values

REQUIRE_WINDOW_ID

public static final long REQUIRE_WINDOW_ID
REQUIRE_WINDOW_ID can be passed as a third parameter to configurePage. This is equivalent to passing "true" as the third boolean parameter on the deprecated version of configurePage. A page with this parameter set, initially must be either accessed with new page parameters (URL addressable), or accessed using a window ID encoded URL. When accessed via a page in the same application, that has a window ID on it, will pick up and use that window ID.

See Also:
Constant Field Values

CREATE_WINDOW_ID

public static final long CREATE_WINDOW_ID
Deprecated. - use CREATE_POPUP as a windowIdMode request parameter.

See Also:
Constant Field Values

CREATE_POPUP

public static final long CREATE_POPUP
For use as a WcmParameter.WINDOW_ID_MODE request parameter only. Do not pass this mode value through configurePage. Stacks a popup windowId on the current windowId.

See Also:
Constant Field Values

CREATE_POPUP_KEY

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

CREATE_INLINE

public static final long CREATE_INLINE
For use as a WcmParameter.WINDOW_ID_MODE request parameter only. Do not pass this mode value through configurePage. Stacks a non-popup, non-object windowId on the current windowId.

See Also:
Constant Field Values

CREATE_INLINE_KEY

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

POPUP_KEY

protected static final java.lang.String POPUP_KEY
Deprecated. No longer used.

See Also:
Constant Field Values

FIRST_WINDOWID_KEY

protected static final java.lang.String FIRST_WINDOWID_KEY
Deprecated. Use get/setFirstWindowId signatures.

See Also:
Constant Field Values

SESSION_COUNT

protected static final java.lang.String SESSION_COUNT
See Also:
Constant Field Values

HELP_PAGE_KEY

protected static final java.lang.String HELP_PAGE_KEY
See Also:
Constant Field Values

HELP_CONTEXT_KEY

protected static final java.lang.String HELP_CONTEXT_KEY
See Also:
Constant Field Values

WINDOW_SIGNED_IN_KEY

protected static final java.lang.String WINDOW_SIGNED_IN_KEY
Deprecated. Use isPopupSignedIn.

See Also:
Constant Field Values

DISABLE_BROWSER_CACHING

protected static final boolean DISABLE_BROWSER_CACHING
See Also:
Constant Field Values

DUMP_DATASTORE_KEYS

protected static final boolean DUMP_DATASTORE_KEYS
See Also:
Constant Field Values

REDIRECT

protected static final java.lang.String REDIRECT
See Also:
Constant Field Values

CREDENTIALS_BEAN_KEY

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

preControllerEvents

protected static java.util.HashMap preControllerEvents

controllerEvents

protected static java.util.HashMap controllerEvents

noWindowIdError

protected static final WcmException noWindowIdError

DEFER_REWRITE_KEY

protected static final java.lang.String DEFER_REWRITE_KEY
See Also:
Constant Field Values
Constructor Detail

WcmController

public WcmController()
Method Detail

setAutoFixWindowId

public void setAutoFixWindowId(boolean value)
Deprecated. - use configurePage(servletContext, request, windowIdMode).


setName

public void setName(java.lang.String nameValue)
Set the name of the controller. A default name is provided, and this call is only required when multiple controllers are being used within a single request (HttpServletRequest). In a typical web application, this should rarely, if ever need to be called.

Parameters:
nameValue - - The name to use.

getName

public java.lang.String getName()
Get the controller name.

Returns:
Either the default controller name or the value set in setName.

setLocale

public void setLocale(java.util.Locale locale)
               throws java.lang.Exception
Call setLocale to set the client locale.

Specified by:
setLocale in interface WcmControllerBehaviorInterface
Parameters:
locale - The client locale.
Throws:
java.lang.Exception

postTime

public static long postTime(java.lang.String key,
                            java.util.Date startTime,
                            java.util.Date endTime)
Call this method to record time intervals for areas of code to be instrumented.

Parameters:
key - - A key value uniquely identifying your timer.
startTime - - Timestamp representing the start of the code being timed.
endTime - - Timestamp representing the end of the code being timed.
Returns:
The difference in milliseconds between startTime and endTime.

getTime

public static java.lang.String getTime(java.lang.String key)
Retrieves average time of execution of the specified instrumented segment of code. With resourceTrace is enabled in the servlet descriptor (web.xml), this will be called automatically for all timers at regular intervals, with reports logged to standard output.
Calling this routine removes all recorded times for the specified key, so that it can be populated with the next group of timings.
Results are returned as a String in the format "time in milliseconds"("total samples").

Parameters:
key - - A key value uniquely identifying your timer.
Returns:
The average time in milliseconds, and the number of samples recorded.

getTimerKeys

public static java.lang.Object[] getTimerKeys()
Get an array of all of the timer keys currently present.

Returns:
An object array of the keys.

isEventRequest

protected boolean isEventRequest()

isGlobalEventRequest

protected boolean isGlobalEventRequest()

getWebappRootURL

public java.lang.String getWebappRootURL()
Gets the context root URL for the current user session.

Returns:
Base URL (i.e. http://host:port/Workplace)

getBaseURL

protected java.lang.String getBaseURL()
Deprecated. - use getWebappRootURL()


getFirstWindowId

protected java.lang.String getFirstWindowId()

setFirstWindowId

protected void setFirstWindowId(java.lang.String wid)

encodeWindowId

protected java.lang.String encodeWindowId(java.lang.String url)

getEventBaseURL

protected java.lang.String getEventBaseURL()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

sendCloseWindow

protected void sendCloseWindow(javax.servlet.http.HttpServletResponse response)
                        throws java.lang.Exception
Writes some javascript to the browser telling it to close itself.

Throws:
java.lang.Exception

setRequestAttribute

public java.lang.Object setRequestAttribute(java.lang.String key,
                                            java.lang.Object value)
Set a request attribute on the request that this controller is referencing.

Parameters:
key - - The attribute key.
value - - The attribute value.
Returns:
The previous value for the key, if it exists, otherwise null.

getRequestAttribute

public java.lang.Object getRequestAttribute(java.lang.String key)
Get a request attribute from the request that this controller is referencing.

Parameters:
key - - The attribute key.
Returns:
The value for the key, if it exists, otherwise null.

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
Get the request dispatcher from the ServletContext that this controller is referencing.

Parameters:
path - - The URL path that this dispatcher will reference.
Returns:
The request dispatcher.

closeWindow

public boolean closeWindow()
                    throws java.lang.Exception
Call this method to close the current browser window. Should only be used in popups.

Returns:
true if the window was closed (as far as the server knows).
Throws:
WcmException; - closeIllegalState - If the close is attempted after onStartPage.
java.lang.Exception

closeWindow

public boolean closeWindow(javax.servlet.http.HttpServletResponse response)
                    throws java.lang.Exception
Call this method to close the current browser window. Should only be used in popups.

Returns:
true if the window was closed (as far as the server knows).
Throws:
WcmException; - closeIllegalState - If the close is attempted after onStartPage.
java.lang.Exception

openPopup

public void openPopup(java.lang.String destinationUrl)
               throws java.lang.Exception
Use this to open a popup to a new page.

Parameters:
destinationUrl - The destination URL.
Throws:
WcmException; - closeIllegalState - If the close is attempted after onStartPage.
java.lang.Exception

openPopup

public void openPopup(java.lang.String destinationUrl,
                      java.lang.String windowName,
                      int width,
                      int height)
               throws java.lang.Exception
Use this to open a popup to a new page.

Parameters:
destinationUrl - The destination URL.
windowName - The browser window name to use. If it contains blanks, they will be changed to '_'
width -
height -
Throws:
WcmException; - closeIllegalState - If the close is attempted after onStartPage.
java.lang.Exception

getWriterAndStop

public java.io.Writer getWriterAndStop()
                                throws java.lang.Exception
Throws:
java.lang.Exception

openPopup

public void openPopup(java.lang.String destinationUrl,
                      java.lang.String windowName,
                      int width,
                      int height,
                      boolean showStatusBar)
               throws java.lang.Exception
Open a popup window with control over whether or not to show the status bar.

Parameters:
destinationUrl - The destination URL.
windowName - The browser window name to use. If it contains blanks, they will be changed to '_'
width -
height -
showStatusBar -
Throws:
java.lang.Exception

openPopupViaPOST

public void openPopupViaPOST(java.lang.String destinationUrl,
                             java.util.Map postParameters,
                             java.lang.String windowName,
                             int width,
                             int height,
                             boolean showStatusBar)
                      throws java.lang.Exception
Open a popup window with control over whether or not to show the status bar.

Parameters:
destinationUrl - The destination URL.
postParameters - The parameters to be used in the POST action.
windowName - The browser window name to use. If it contains blanks, they will be changed to '_'
width -
height -
showStatusBar -
Throws:
java.lang.Exception

sendRedirect

public boolean sendRedirect(java.lang.String destinationUrl)
                     throws java.lang.Exception
Use this to do a framework page switch that cleans up the current page. To do a re-direct without cleanup, call response.sendRedirect(...).

Parameters:
destinationUrl - The destination URL.
Returns:
true if the window was closed (as far as the server knows).
Throws:
WcmException; - closeIllegalState - If the close is attempted after onStartPage.
java.lang.Exception

getInitParameter

public java.lang.String getInitParameter(java.lang.String key)
Gets an init parameter from the servlet Descriptor.

Parameters:
key -
Returns:
String

getInitParameter

public java.lang.String getInitParameter(java.lang.String key,
                                         java.lang.String defaultValue)
Gets an init parameter from the servlet Descriptor.

Parameters:
key -
defaultValue -
Returns:
String

getInitParameter

public boolean getInitParameter(java.lang.String key,
                                boolean defaultValue)
Gets an init parameter from the servlet Descriptor.

Parameters:
key -
defaultValue -
Returns:
boolean

getInitParameter

public long getInitParameter(java.lang.String key,
                             long defaultValue)
Gets an init parameter from the servlet Descriptor.

Parameters:
key -
defaultValue -
Returns:
lon g

getInitParameterBoolean

public boolean getInitParameterBoolean(java.lang.String key)
Gets an init parameter from the servlet Descriptor.

Parameters:
key -
Returns:
boolean

getPOSTThreshold

public int getPOSTThreshold()

sendRedirect

public boolean sendRedirect(java.lang.String destinationUrl,
                            int postThreshold)
                     throws java.lang.Exception
Use this to do a framework page switch that cleans up the current page. To do a re-direct without cleanup, call response.sendRedirect(...).

Parameters:
destinationUrl - The destination URL.
postThreshold - Specify the post threshold. If 0 or less is specified, this method will never redirect via POST.
Returns:
true if the window was closed (as far as the server knows).
Throws:
WcmException; - closeIllegalState - If the close is attempted after onStartPage.
java.lang.Exception

sendRedirect

public boolean sendRedirect(javax.servlet.http.HttpServletResponse response,
                            java.lang.String baseURL,
                            java.lang.String targetURL,
                            int postThreshold)
                     throws java.io.IOException
Redirect to another page. This is typically accomplished via response.sendRedirect(). In the case of redirection to the getContent servlet, the redirect is done via a Refresh meta tag written out in the response. This is a workaround for a bug found in IE5. When postThreshold is specified as a non-zero positive int value, and the length of targetURL is greater than this value, the redirect is done via a form with hidden fields that is written to the browser and posted via JavaScript.

Parameters:
response -
baseURL -
targetURL -
postThreshold - Specify the post threshold. If 0 or less is specified, this method will never redirect via POST.
Returns:
Whether or not the redirect was accomplished.
Throws:
java.io.IOException

setException

public void setException(java.lang.Throwable exc,
                         boolean redirect)
                  throws java.lang.Exception
Specify an exception to be displayed by WcmError.jsp, and optionally re-direct to WcmError.jsp to show the error.

Parameters:
exc - The exception to display.
redirect - Set to true to re-direct immediately to WcmError.jsp.
Throws:
java.lang.Exception

setLoginEnabled

public void setLoginEnabled(boolean value)
Set whether or not to auto-redirect to WcmSignIn.jsp, if WcmServerCredentials is not found in the DataStore. This should always be set to true, and is true by default.

Setting to false should only be used for testing - where an instance of WcmServerCredentials is not required by any modules on the page. Use only on pages that create objects that don't rely on credentials being present. When set to false, you do not connect to the Content Engine.

Parameters:
value - true or false.

getPageName

public java.lang.String getPageName()
Returns the current page name relative to the application root, which is of the form [ [path/] path/ ]page.jsp. The path would represent any directory structure below the application root.

Returns:
the String value

getPageId

public java.lang.String getPageId()
Returns the current page ID relative to the application root, which is of the form [ [path/] path/ ]page.jsp. The path would represent any directory structure below the application root.

The page ID is the page name with the filename extension (ex: .jsp) dropped.

Returns:
the String value

getWindowId

public java.lang.String getWindowId()
Returns the current windowId hash value, or the keyword "mainWindow" if there is not a current windowId in effect.

If the return value is anything other than "mainWindow" (WcmController.MAIN_WINDOW), the value needs to be included when generating anchor links or form submits on the current page.

The getEventUrl(...)/getFormSubmitUrl(...) methods in WcmUiModule (base) will do this for you automatically.

Returns:
the String value

getWindowIdObject

public WindowID getWindowIdObject()
Returns the current windowId hash value, or the keyword "mainWindow" if there is not a current windowId in effect.

If the return value is anything other than "mainWindow" (WcmController.MAIN_WINDOW), the value needs to be included when generating anchor links or form submits on the current page.

The getEventUrl(...)/getFormSubmitUrl(...) methods in WcmUiModule (base) will do this for you automatically.

Returns:
the String value

getSessionId

public java.lang.String getSessionId()
Get the Java™ or Java™Server Pages session id.

Returns:
The session id.

getEncodedSessionId

public java.lang.String getEncodedSessionId()
Get the Java/JSP session id.

Returns:
The encoded session id in the format ";jsessionid=...".

registerGlobalEvent

public void registerGlobalEvent(java.lang.String eventName)
                         throws java.lang.Exception
Deprecated. - Registering global events is no longer necessary.

Throws:
java.lang.Exception

subscribeGlobalEvent

protected void subscribeGlobalEvent(GlobalEventModule eventModule,
                                    java.lang.String eventName)
                             throws java.lang.Exception
Throws:
java.lang.Exception

subscribeGlobalEvent

protected void subscribeGlobalEvent(GlobalEventModule eventModule,
                                    java.lang.String eventName,
                                    boolean register)
                             throws java.lang.Exception
Deprecated. - Use subscribeGlobalEvent(eventModule, eventName)

Throws:
java.lang.Exception

registerModule

public void registerModule(WcmModuleInterface module)
                    throws java.lang.Exception
Register UI and DP modules with the controller. Every module on a page should be registered with the controller.

Parameters:
module - A reference to a module (Java Bean)
Throws:
java.lang.Exception

registerModule

public void registerModule(WcmModuleInterface module,
                           java.lang.String name)
                    throws java.lang.Exception
Register UI and DP modules with the controller. Every module on a page should be registered with the controller.

Parameters:
module - A reference to a module (Java Bean)
name - The name to use to register this module
Throws:
java.lang.Exception

registerModule

protected void registerModule(WcmModuleInterface module,
                              boolean initialize)
                       throws java.lang.Exception
Overload of registerModule. For internal use only.

Throws:
java.lang.Exception

isRegistered

public boolean isRegistered(WcmModuleInterface module)
Test to see if the module is registered.

Parameters:
module - The module to check
Returns:
true if the module is registered, false if not.

isPopup

public boolean isPopup()
Return whether or not this controller is running in popup mode (when windowId is being carried on the request).

Returns:
true or false

isNonReturnableBookmark

public static boolean isNonReturnableBookmark(javax.servlet.http.HttpServletRequest req)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

getErrorTrace

public static boolean getErrorTrace()
Return whether or not error tracing is currently turned on.

Returns:
true or false

unRegisterModule

public void unRegisterModule(WcmModuleInterface module)
                      throws java.lang.Exception
Un-register the module from the controller's internal hashtable. The persist and cleanup methods of the module are called.

Parameters:
module - a reference to the module to un-register.
Throws:
java.lang.Exception

transferPageParameters

protected java.util.Hashtable transferPageParameters(javax.servlet.http.HttpServletRequest request)
transferPageParameters - retrieves the page parameters from the request object and copies them to a new hashtable. This is overrideable in subclasses, in case there is a need to initialize the page parameters in a custom way.

Parameters:
request -
Returns:
The new, populated hashtable.

popPageParameter

public java.lang.Object popPageParameter(java.lang.String key)
Allows a mechanism to discard page parameters.

Parameters:
key - - key identifier for the parameter to be removed
Returns:
- value of the parameter removed

getWindowIdFromReferer

public static java.lang.String getWindowIdFromReferer(javax.servlet.http.HttpServletRequest request)
Retreives the window ID from the referer URL.
It is recommended to avoid use of this call whenever possible. Use instance signature of getWindowId to get the valid windowId value instead.

Parameters:
request -
Returns:
String

getWindowIdFromReferer

public static java.lang.String getWindowIdFromReferer(java.util.Map popups,
                                                      java.lang.String referer)
Deprecated. use getWindowIdFromURL(url, baseUrl)


getWindowIdFromURL

public static java.lang.String getWindowIdFromURL(java.lang.String url,
                                                  java.lang.String baseUrl)
Returns a windowId based on the referer URL and the current popups list.

Parameters:
url - The URL.
baseUrl - The base URL for the current running webapp.
Returns:
The String value for the window ID, if identified.

getWindowId

public static java.lang.String getWindowId(javax.servlet.http.HttpServletRequest request)
Returns the windowId from the request, if present. The results of this call are not as reliable as calling the instance version getWindowId().
It is recommended to use the instance signature whenever possible, instead of this static signature.

Parameters:
request -
Returns:
The String value for the window ID, if identified.

configurePageName

protected void configurePageName(javax.servlet.http.HttpServletRequest request)

isNewWindowIdRequired

protected boolean isNewWindowIdRequired(javax.servlet.http.HttpServletRequest request)
Deprecated.  


getRequestHash

public static java.lang.String getRequestHash(javax.servlet.http.HttpServletRequest request)

createWindowId

protected WindowID createWindowId(long createValue,
                                  javax.servlet.http.HttpServletRequest request,
                                  long flags)
                           throws WcmException
Throws:
WcmException

getWindowIDFactory

protected WindowIDFactory getWindowIDFactory()
Get the widFactory instance to use to create a new window ID. Currently, this is used for popups only.


setWindowIDFactory

public void setWindowIDFactory(WindowIDFactory widFactory)
Specify the windowId factory instance to use here...


assignWindowId

protected void assignWindowId(WindowID newWindowId,
                              WindowID currentWindowId,
                              boolean popupCreated)
Assigns the window ID. Called from configureWindowId. Required for every page hit.

Parameters:
newWindowId -
currentWindowId -
popupCreated -

getWindowIdModeValue

protected long getWindowIdModeValue(java.lang.String symbolicMode)
                             throws WcmException
Throws:
WcmException

getWindowIdModeValue

protected long getWindowIdModeValue(java.lang.String symbolicMode,
                                    boolean noExpireFlag)
                             throws WcmException
Throws:
WcmException

postProcessWindowId

protected void postProcessWindowId(WindowID assignedWindowId,
                                   WindowID requestWindowId,
                                   WindowID refererWindowId,
                                   boolean idCreated,
                                   boolean idSet,
                                   boolean idRecovered,
                                   boolean isPopupMode,
                                   boolean isStackedMode)
                            throws java.lang.Exception
A subclass of WcmController may override this method if there is a need to track windowId related activity for application-specific purposes.

Parameters:
assignedWindowId - - The currently set windowId.
requestWindowId - - The windowId that was found on the request (if any).
refererWindowId - - The windowId that was found on the referer (if any).
idCreated - - True if a new windowId was created.
idSet - - True if a new windowId was defined via the setWindowId request parameter.
idRecovered - - True if a windowId was dropped, and will be rewritten to the URL as part of this request.
isPopupMode - - True if a new popup windowId was created.
isStackedMode - - True if a new stacked windowId was created.
Throws:
WcmException
java.lang.Exception

configurePage

public void configurePage(javax.servlet.ServletContext applicationValue,
                          javax.servlet.http.HttpServletRequest request)
                   throws java.lang.Exception
Call this before making any calls to registerModule. This call performs initialization on DataStore globals, as well as initialization of the Controller.

Parameters:
applicationValue - The current ServletContext object.
request - The current HttpServletRequest.
Throws:
java.lang.Exception

configurePage

public void configurePage(javax.servlet.ServletContext applicationValue,
                          javax.servlet.http.HttpServletRequest request,
                          int windowIdMode,
                          java.lang.String[] windowIdParams)
                   throws java.lang.Exception
Deprecated.  

Throws:
java.lang.Exception

getWindowIdCompatibility

protected boolean getWindowIdCompatibility()

checkName

protected void checkName(javax.servlet.http.HttpServletRequest request)
                  throws java.lang.Exception
Throws:
java.lang.Exception

configurePage

public void configurePage(javax.servlet.ServletContext applicationValue,
                          javax.servlet.http.HttpServletRequest request,
                          boolean windowIdRequired)
                   throws java.lang.Exception
Deprecated. Use configurePage(application, request, long windowIdMode).

Call this before making any calls to registerModule. This call performs initialization on DataStore globals, as well as initialization of the Controller.

Specified by:
configurePage in interface WcmControllerBehaviorInterface
Parameters:
applicationValue - The current ServletContext object.
request - The current HttpServletRequest.
windowIdRequired - This page requires a window ID in the request string.
Throws:
java.lang.Exception

configurePage

public void configurePage(javax.servlet.ServletContext applicationValue,
                          javax.servlet.http.HttpServletRequest request,
                          int windowIdMode)
                   throws java.lang.Exception
Deprecated. use configurePage(ServletContext, HttpServletRequest, long)

Throws:
java.lang.Exception

configurePage

public void configurePage(javax.servlet.ServletContext applicationValue,
                          javax.servlet.http.HttpServletRequest request,
                          long windowIdMode)
                   throws java.lang.Exception
Call this before making any calls to registerModule. This call performs initialization on DataStore globals, as well as initialization of the Controller.

Parameters:
applicationValue - The current ServletContext object.
request - The current HttpServletRequest.
windowIdMode - The window ID mode - NO_WINDOW_ID, PROPOGATE_WINDOW_ID (default), REQUIRE_WINDOW_ID, or NEW_WINDOW_ID.
Throws:
java.lang.Exception

cleanupWindowId

public void cleanupWindowId(java.lang.String windowId)
Schedules a cleanup of the storage allocated to the specified windowId, to occur in one minute from the time the call is made. Calling this method a second time within the one minute period of an initial call will reset the scheduled time to one minute.

Parameters:
windowId -

cleanupWindowId

public void cleanupWindowId(java.lang.String windowId,
                            long timeout)
Schedules a cleanup of the storage allocated to the specified windowId, to occur in specified interval. Calling this method a second time within the specified period of an initial call will reset the scheduled time to the timeout period.

Parameters:
windowId -
timeout - long new window timeout interval

getHomeURLKey

protected java.lang.String getHomeURLKey(java.lang.String windowId)
Deprecated. Use the accessors instead.

This call returns the dataStore global key pointing to the home URL for the specified windowID


setHomeURL

protected void setHomeURL(java.lang.String url)
                   throws WcmException
Set the home URL for the current controller windowId value. This only works after calling configurePage.

Parameters:
url -
Throws:
WcmException

setHomeURL

protected void setHomeURL(java.lang.String windowId,
                          java.lang.String url)
                   throws FrameworkException,
                          WcmException
Set the home URL for the specified windowId value.

Parameters:
windowId -
url -
Throws:
WcmException
FrameworkException

setHomeURL

protected void setHomeURL(ControllerUtilities.PropertiesMap windowIdMap,
                          java.lang.String url)
                   throws WcmException
Throws:
WcmException

getHomeURL

protected java.lang.String getHomeURL(java.lang.String windowId)
                               throws FrameworkException,
                                      WcmException
Get the home URL for the specified windowId value.

Parameters:
windowId -
Returns:
WindowState object
Throws:
FrameworkException
WcmException

getHomeURL

protected java.lang.String getHomeURL()
Get the home URL for the current controller windowId value. This only works after calling configurePage.


getHeaderModule

public WcmHeaderModuleInterface getHeaderModule()
Get the registered header module. The header module is automatically configured by the controller, and can be retreived by other modules to specify things to be included in the HTML header for the current page.

Specified by:
getHeaderModule in interface WcmControllerBehaviorInterface
Returns:
An instance of WcmHeaderModuleInterface.

getBootstrapFile

protected java.lang.String getBootstrapFile()

initializeStaticClasses

public void initializeStaticClasses()
                             throws java.lang.Exception
Initializes static classes that require ServletContext information.

Specified by:
initializeStaticClasses in interface WcmControllerBehaviorInterface
Throws:
java.lang.Exception

getStaticInitializer

public StaticInitializerInterface getStaticInitializer()
                                                throws java.lang.Exception
getStaticInitializer. Optionally returns an instance of static initializer interface. If non-null is returned, this is called instead of calling controller.initializeStaticClasses() to initialize static classes. The base implementation returns null.

Throws:
java.lang.Exception

configureHeaderModule

public void configureHeaderModule()
                           throws java.lang.Exception
Configures the default toolkit implementation - WcmHeaderModule.

Specified by:
configureHeaderModule in interface WcmControllerBehaviorInterface
Throws:
java.lang.Exception

configureDataProviders

public void configureDataProviders()
                            throws java.lang.Exception
No root-level data providers are defined in WcmWorkplaceController. This method is stubbed.

Specified by:
configureDataProviders in interface WcmControllerBehaviorInterface
Throws:
java.lang.Exception

getLastTokenException

public java.lang.Exception getLastTokenException()

tryEncodedCredentials

protected boolean tryEncodedCredentials(javax.servlet.http.HttpServletRequest request)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

checkLogin

public boolean checkLogin(java.lang.String currentUrl,
                          javax.servlet.http.HttpServletRequest request)
                   throws java.lang.Exception
Checks to see if the session has valid credentials.

Parameters:
currentUrl - - The URL for the current page.
request - - The HttpServletRequest for the current page.
Returns:
true if the session has valid credentials. Otherwise, false.
Throws:
java.lang.Exception

forceSignInToDefaultPage

protected boolean forceSignInToDefaultPage()
Override and return true to cause all logins to go to the configured default page. (No bookmarks, homes or sticky pages).

Returns:
true or false

isPopup

public static boolean isPopup(java.lang.String windowId)
Determine if this request represents a popup window.

Parameters:
windowId - The window ID represented by WcmParameter.WINDOW_ID on the request.
Returns:
boolean true or false.

isPopup

public static boolean isPopup(javax.servlet.http.HttpServletRequest request)
Determine if this request represents a popup window.

Parameters:
request - A reference to the current HttpServletRequest.
Returns:
boolean true or false.

isPopupSignedIn

public static boolean isPopupSignedIn(javax.servlet.http.HttpServletRequest request,
                                      WcmDataStore ds)
Returns whether or not this pop-up went through sign-in.

Parameters:
request - - The HttpServletRequest that represents the popup.
ds - - The associated session data store.
Returns:
true or false.

isPopupSignedIn

public static boolean isPopupSignedIn(java.lang.String windowIdValue,
                                      WcmDataStore ds)
Returns whether or not this pop-up went through sign-in.

Parameters:
windowIdValue - - The windowId to check on.
ds - - The associated session data store.
Returns:
true or false.

handleEvent

public void handleEvent(javax.servlet.ServletContext application,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        boolean autoRedirect)
                 throws java.io.IOException,
                        javax.servlet.ServletException,
                        java.lang.Exception
This is the autoRedirect version of the handleEvent method. It dispatches events to target modules.

Parameters:
application - The JSP application object
request - The JSP request object
response - The JSP response object
autoRedirect - When set to true, calculate UI jsp and server-side include to it if appropriate.
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.Exception

handleEvent

public void handleEvent(javax.servlet.ServletContext application,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        java.lang.String uiPageName)
                 throws java.io.IOException,
                        javax.servlet.ServletException,
                        java.lang.Exception
Like auto redirect, but redirect to the specified page.

Parameters:
application - The JSP application object
request - The JSP request object
response - The JSP response object
uiPageName - The ui JSP page name relative to <>/jsp/ui to use.
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.Exception

handleEvent

public boolean handleEvent(javax.servlet.ServletContext application,
                           javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
                    throws java.io.IOException,
                           javax.servlet.ServletException,
                           java.lang.Exception
This is the base handleEvent method. It dispatches events to target modules.

Parameters:
application - The JSP application object
request - The JSP request object
response - The JSP response object
Returns:
boolean - true if its OK to server-side redirect to a UI JSP.
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.Exception

getLoginRoutingInfo

public java.lang.String getLoginRoutingInfo()
                                     throws java.lang.Exception
For thick clients, return the information necessary so that they know how to set credentials in the session.

Returns:
String the routing info in XML format.
Throws:
java.lang.Exception

initializeModules

public java.lang.String initializeModules(javax.servlet.ServletContext application,
                                          javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          boolean thinClient,
                                          boolean doCleanup)
                                   throws java.io.IOException,
                                          javax.servlet.ServletException,
                                          java.lang.Exception
Handles module initialization, credentials check and event routing. thinClient==true means that you want redirects to login page, and event routing.

Possible return values
Return ValuethinClient==truethinClient==false
nullall went well
non-null Credentials are required. XML is returned describing the parameters needed to connect to the credentials servlet. The keyword WcmController.REDIRECT to indicate that a redirect to WcmController.LOGIN_URL was performed.

Parameters:
application - The JSP application object
request - The JSP request object
response - The JSP response object
thinClient - Set to "false" if you are not a web browser.
doCleanup - Set to "true" if you want to persist/cleanup the configured Modules.
Returns:
String.
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.Exception

catchPopupExceptions

protected boolean catchPopupExceptions()
Override to customize WcmController behavior. By default, popup window exceptions are caught, packaged into the exception object returned from getPopupException and rethrown. This allows for control over behavior on the error page for an exception.

Returns:
boolean

getPopupException

protected java.lang.Exception getPopupException(java.lang.Exception e)
Construct the popup wrapper exception. This method is only called when catchPopupExceptions is returning true. Default behavior for popups is to return an instance of WcmException with the return URL fixed to go back to the popup windowId from where the exception was thrown.

Parameters:
e -
Returns:
Exception

initializeModules

public java.lang.String initializeModules(javax.servlet.ServletContext application,
                                          javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          boolean skipPreControllerEvents,
                                          boolean sendNotSignedInXML,
                                          boolean skipEventProcessing,
                                          boolean skipStartPageEvent,
                                          boolean skipPrepareResponse,
                                          boolean doCleanup)
                                   throws java.io.IOException,
                                          javax.servlet.ServletException,
                                          java.lang.Exception
Handles module initialization.

Possible return values are null, the keyword WcmController.REDIRECT, and XML representing the information required to perform a signin via the credentials servlet.

Parameters:
application - The JSP application object
request - The JSP request object
response - The JSP response object
skipPreControllerEvents - Specify whether or not to ignore pre-controller events.
sendNotSignedInXML - If true, return XML for signin. Otherwise perfrom the signin process as defined by the sign-in policy.
skipEventProcessing - Specify whether or not to process events (other than pre-controller events).
skipStartPageEvent - Specify whether or not to broadcast the StartPage event to all modules (indicating that rendering will follow).
skipPrepareResponse - Specify whether or not to call prepareResponse to set headers for content type and caching.
doCleanup - Set to "true" if you want to persist/cleanup the configured Modules.
Returns:
See possible responses above.
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.Exception

prepareResponse

protected void prepareResponse(javax.servlet.http.HttpServletResponse response,
                               java.lang.String contentType,
                               boolean disableBrowserCaching)
Sets headers in the response object in preparation for rendering a page back to the browser.

Parameters:
response - The current response object.
contentType - The content type header value to use (ex: text/html;charset=UTF-8)
disableBrowserCaching - Specify boolean true to tell the browser not to cache the page.

executeModel

protected java.lang.String executeModel(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        boolean skipEventProcessing,
                                        java.lang.String eventTarget)
                                 throws java.io.IOException,
                                        javax.servlet.ServletException,
                                        java.lang.Exception
executeModel takes care of module initialization and event routing. Exposed for customization in subclasses.

Parameters:
request -
response -
skipEventProcessing -
eventTarget -
Returns:
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.Exception

constructTargetUrl

protected java.lang.String constructTargetUrl(javax.servlet.http.HttpServletRequest request,
                                              boolean dropWindowId)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

setHelpPage

public void setHelpPage(java.lang.String pageValue)
                 throws java.lang.Exception
Set a non-default help page value. In the WcmController "Help" event, a help HTML file name is calculated based on the current page id, concatenated with the help context value in the form:

http://docServer/helpRootPath/ [ helppageid ] _helpcontext.html

This method allows you to override the current page id with a custom value.

Parameters:
pageValue - the help context String value, or null to use the current page name.
Throws:
java.lang.Exception

setHelpContext

public void setHelpContext(java.lang.String contextValue)
                    throws java.lang.Exception
Set a supplemental help context string. In the WcmController "Help" event, a help HTML file name is calculated based on the current page id, concatenated with the help context value in the form:

http://docServer/helpRootPath/helppageid [ _helpcontext ] .html

Parameters:
contextValue - the help context String value.
Throws:
java.lang.Exception

setHelpContext

public void setHelpContext(java.lang.Object o)
                    throws java.lang.Exception
Set a supplemental help context based on an object's unqualified class name. In the WcmController "Help" event, a help HTML file name is calculated based on the current page id, concatenated with the help context value in the form:

http://docServer/helpRootPath/yourpageid [ _helpcontext ] .html

Parameters:
o - the object whose class name to use
Throws:
java.lang.Exception

isPopupSignedIn

public boolean isPopupSignedIn()
Returns whether or not this pop-up went through sign-in.

Returns:
true or false.

getUIRoot

public java.lang.String getUIRoot()
Returns the relative path to the root location of the UI jsp's.

By default the return value is "WEB-INF/jsp/ui", but a different location can be specified in the web.xml servlet descriptor.

This method should be called by JSP pages that are explicitly doing server-side re-direct from an event JSP to a UI jsp.

Returns:
the ui root.

getDebugTrace

public boolean getDebugTrace()
Returns true or false whether debug tracing is enabled in web.xml.

Returns:
boolean true or false.

getClientLocale

public java.util.Locale getClientLocale()
Return the client locale value of the current request.

Returns:
the locale value.

getRequestedClientLocale

public java.util.Locale getRequestedClientLocale()
Return the primary locale of the current request. For example, the top entry set within IE's Tools->Internet Options->Languages setting.

Returns:
a Locale object

getClientTimeZone

public java.util.TimeZone getClientTimeZone()
                                     throws java.lang.Exception
Gets the TimeZone object used to convert date values from ISO to UI display, and back to ISO again.
The browser timezone may be retrieved by writing the timezone related hidden form fields into the browser, with the JavaScript which populates the hidden fields. The methods to support this can be found in ControllerUtilities.
The controller representing a request where these hidden fields are specified can call ControllerUtilities.configureClientTimeZone(...) to configure the client timezone based on the submitted values.
It is up to the application to determine whether or not it will retrieve the client timezone. If it has not been configured, this method will return the server TimeZone object.
The toolkit WcmSignInModule UI module will configure the client TimeZone, provided that the content of WcmSignInModule.getHiddenFields() and WcmSignInModule.getCaptureTimeZoneScript() are included as appropriate on the sign-in page.

Returns:
The TimeZone object if defined, otherwise null.
Throws:
java.lang.Exception

getApplicationResource

public java.io.InputStream getApplicationResource(java.lang.String path)

getClientCharacterEncoding

public java.lang.String getClientCharacterEncoding()
Return the client's character encoding value for the current request.

Returns:
the character encoding value.

getUserAgent

public UserAgent getUserAgent()
Return the UserAgent object for the current request.

Returns:
the UserAgent of the current request

getHelpContext

public java.lang.String getHelpContext()
                                throws java.lang.Exception
Get the supplemental help context value

In the WcmController "Help" event, a help HTML file name is calculated based on the current page id, concatenated with the help context value in the form:

http://docServer/helpRootPath/yourpageid [ _helpcontext ] .html

Returns:
the current help context value
Throws:
java.lang.Exception

getHelpPage

public java.lang.String getHelpPage()
                             throws java.lang.Exception
Get the help page id value

In the WcmController "Help" event, a help HTML file name is calculated based on the current page id (or user-defined value), concatenated with the help context value in the form:

http://docServer/helpRootPath/ [ helppageid ] _helpcontext.html

Returns:
the current help page id.
Throws:
java.lang.Exception

getHelpURL

public static java.lang.String getHelpURL(java.lang.String baseUrl,
                                          java.lang.String helpPage,
                                          java.lang.String helpContext)
Static method to get the context sensitive help URL for the current page.

Parameters:
baseUrl - - The documentation server URL, either the local machine, or as configured in bootstrap.properties.
helpPage - - The pageId of the page for which context sensitive help is desired.
helpContext - - The help context (based on what's currently being displayed on the page) if specified or null.
Returns:
The help URL mapped via help_map.properties.

onHome

public boolean onHome(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws java.lang.Exception
The onHome controller event handler.

Parameters:
request - - The current HttpServletRequest.
response - - The current HttpServletResponse.
Returns:
true if a redirect was done, otherwise false.
Throws:
java.lang.Exception

onChangePage

public boolean onChangePage(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws java.lang.Exception
The onChangePage controller event handler.

Parameters:
request - - The current HttpServletRequest.
response - - The current HttpServletResponse.
Returns:
true if a redirect was done, otherwise false.
Throws:
java.lang.Exception

onChangeApp

public boolean onChangeApp(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
                    throws java.lang.Exception
The onChangePage controller event handler.

Parameters:
request - - The current HttpServletRequest.
response - - The current HttpServletResponse.
Returns:
true if a redirect was done, otherwise false.
Throws:
java.lang.Exception

generateUserToken

public java.lang.String generateUserToken()
                                   throws java.lang.Exception
Generates user token if tokens are enabled. Otherwise, throws an exception.

Returns:
Throws:
java.lang.Exception

encodeUserToken

public java.lang.String encodeUserToken(java.lang.String url)
                                 throws java.lang.Exception
Appends user token to the url if tokens are enabled

Parameters:
url -
Returns:
Throws:
java.lang.Exception

onHelp

public boolean onHelp(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws java.lang.Exception
The onHelp controller event handler.

Parameters:
request - - The current HttpServletRequest.
response - - The current HttpServletResponse.
Returns:
true if a redirect was done, otherwise false.
Throws:
java.lang.Exception

onSignIn

public boolean onSignIn(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws java.lang.Exception
The onSignIn controller event handler.

Parameters:
request - - The current HttpServletRequest.
response - - The current HttpServletResponse.
Returns:
true if a redirect was done, otherwise false.
Throws:
java.lang.Exception

onSignOut

public boolean onSignOut(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.lang.Exception
The onSignOut controller event handler.

Parameters:
request - - The current HttpServletRequest.
response - - The current HttpServletResponse.
Returns:
true if a redirect was done, otherwise false.
Throws:
java.lang.Exception

onCloseWindow

public boolean onCloseWindow(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws java.lang.Exception
The onCloseWindow controller event handler.

Parameters:
request - - The current HttpServletRequest.
response - - The current HttpServletResponse.
Returns:
true if a redirect was done, otherwise false.
Throws:
java.lang.Exception

isPreControllerEvent

public boolean isPreControllerEvent(java.lang.String eventName)
Description copied from interface: WcmControllerBehaviorInterface
Return true if the named event is a valid "pre" controller event (optional).

Specified by:
isPreControllerEvent in interface WcmControllerBehaviorInterface
Parameters:
eventName - The name of the event.

isControllerEvent

public boolean isControllerEvent(java.lang.String eventName)
Description copied from interface: WcmControllerBehaviorInterface
Return true if the named event is a valid controller event (optional).

Specified by:
isControllerEvent in interface WcmControllerBehaviorInterface
Parameters:
eventName - The name of the event.

invokeNamedEvent

public static boolean invokeNamedEvent(java.lang.String eventName,
                                       WcmUiModuleInterface uiModule,
                                       javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
                                throws java.lang.Exception
Invoke an event handler on the specified UI module.

If an event handler (i.e. onEventName) is defined for the eventName specified, it will be called.

Parameters:
eventName - The event name to invoke (ex: "Click" would invoke the method named "onClick(...)".
uiModule - The UI module to invoke the event on.
request - The current HttpServletRequest instance.
response - The current HttpServletResponse instance.
Returns:
true - if the event handler was found and called.
Throws:
java.lang.Exception

invokeNamedEvent

public static boolean invokeNamedEvent(java.lang.String eventName,
                                       GlobalEventModule geModule,
                                       GlobalEvent evt)
                                throws java.lang.Exception
Invoke a global event handler on the specified UI module.

If a global event handler ( i.e. onEventName(globalEvent) ) is defined for the eventName specified, it will be called.

Parameters:
eventName - The event name to invoke (ex: "Click" would invoke the method named "onClick(...)".
geModule - The UI module to invoke the event on.
evt - The global event object
Returns:
true - if the event handler was found and called.
Throws:
java.lang.Exception

getMethod

protected static java.lang.reflect.Method getMethod(java.lang.Class c,
                                                    java.lang.String methodName,
                                                    java.lang.Class[] paramList)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
                 throws java.lang.Exception
Set the controller property in the DataStore. These are scoped to the JSP page/controller name.

Parameters:
key - The key to store a value into.
value - The value to store.
Throws:
java.lang.Exception

setTemporaryProperty

public java.lang.Object setTemporaryProperty(java.lang.String key,
                                             java.lang.Object value)
Sets a property that lives for the duration of this controller instance.

Parameters:
key -
value -
Returns:
The previous value, if defined or null.

getTemporaryProperty

public java.lang.Object getTemporaryProperty(java.lang.String key)
Gets a property that is scoped to this controller instance.

Parameters:
key -
Returns:
Object

getProperty

public java.lang.Object getProperty(java.lang.String key)
                             throws java.lang.Exception
Get the controller property - from the DataStore scoped to the page.

Parameters:
key - The key to retrieve a value for.
Returns:
Object reference or null if none is defined.
Throws:
java.lang.Exception

setWindowProperty

public void setWindowProperty(java.lang.String key,
                              java.lang.Object value)
                       throws java.lang.Exception
Set the controller property in the DataStore, scoped globally to the current windowId. These are scoped to the JSP page.

Parameters:
key - The key to store a value into.
value - The value to store.
Throws:
java.lang.Exception

getWindowProperty

public java.lang.Object getWindowProperty(java.lang.String key)
                                   throws java.lang.Exception
Get the controller property - from the DataStore scoped globally to the window.

Parameters:
key - The key to retrieve a value for.
Returns:
Object reference or null if none is defined.
Throws:
java.lang.Exception

getPageParameter

public java.lang.String getPageParameter(java.lang.String key)
When a page is loaded with a request string that specifies parameters but no eventTarget/eventName, the request parameters are stored away by the controller.

This method returns any of those page parameters for the duration of a page. The parameters are thrown away on a ChangePage event.

Parameters:
key - The key to retrieve a value for.
Returns:
String value or null if none is defined.

getPageParameterString

public java.lang.String getPageParameterString(java.lang.String key)

getPageParameters

public java.lang.String[] getPageParameters(java.lang.String key)
When a page is loaded with a request string that specifies parameters but no eventTarget/eventName, the request parameters are stored away by the controller.

This method returns any of those page parameters for the duration of a page. The parameters are thrown away on a ChangePage event.

Parameters:
key - The key to retrieve a value for.
Returns:
String value or null if none is defined.

getPageParameterNames

public java.util.Enumeration getPageParameterNames()

getParameter

protected java.lang.String getParameter(java.util.Map map,
                                        java.lang.String key)

getParameters

protected java.lang.String[] getParameters(java.util.Map map,
                                           java.lang.String key)

getPageParameters

public java.util.Hashtable getPageParameters()
Gets a Hashtable instance containing a copy of all the current page parameters.

Returns:
a read-only copy of the page parameters.

getNewPageParameter

public java.lang.String getNewPageParameter(java.lang.String key)
When a page is loaded with a request string that specifies parameters but no eventTarget/eventName, the request parameters are stored away by the controller.

This method returns any of those page parameters if they are newly defined on the current request.

Parameters:
key - The key to retrieve a value for.
Returns:
String value or null if none is defined.

peekGlobalEvent

public boolean peekGlobalEvent(java.lang.String uiEventName)
Returns true if the targeted global event is queued.

Parameters:
uiEventName - The event name to invoke (ex: "Click" would invoke the method named "onClick(GlobalEvent e)".
Returns:
true if the event is queued.

peekEvent

public boolean peekEvent(WcmUiModule uiModule,
                         java.lang.String uiEventName)
Returns true if the targeted event is queued.

Parameters:
uiModule - The UI module to invoke the event on.
uiEventName - The event name to invoke (ex: "Click" would invoke the method named "onClick(...)".
Returns:
true if the event is queued.

getLocalIP

public java.lang.String getLocalIP()
                            throws java.lang.Exception
Returns the local IP number for the machine where this page is running.

Returns:
The local IP number in String format.
Throws:
java.lang.Exception

peekNewPageParameters

public boolean peekNewPageParameters()
Returns true if there are new page parameters defined on the current request.

Returns:
true or false

peekNoRequestParameters

public boolean peekNoRequestParameters()
Returns true are no request parameters on the current request.

Returns:
true or false

getWindowMap

protected ControllerUtilities.PropertiesMap getWindowMap()
Returns an instance of the current windowMap. This is intended mainly to make module registration and properties scoping access more efficient. There should be no need to use this directly.


getDataStore

public WcmDataStore getDataStore()
Returns the instance of WcmDataStore.

Returns:
WcmDataStore

isSSOFilterConfigured

public boolean isSSOFilterConfigured()
Returns true if an SSO filter is configured, regardless of whether or not it is true SSO or container-managed authentication.

Returns:
boolean

isSSOConfigured

public boolean isSSOConfigured()
Returns:
true if credentials were supplied by an SSO authentication filter.

isSSOFilterConfigured

public static boolean isSSOFilterConfigured(javax.servlet.http.HttpServletRequest request)
Returns true if an SSO filter is configured, regardless of whether or not it is true SSO or container-managed authentication.

Returns:
boolean

isSSOConfigured

public static boolean isSSOConfigured(javax.servlet.http.HttpServletRequest request)
Returns:
true if credentials were supplied by an SSO authentication filter.

isForcedToken

public static boolean isForcedToken(javax.servlet.http.HttpServletRequest request)
Check for user token being passed w/ WcmParameter.USER_TOKEN_FORCE set to true.

Parameters:
request -
Returns:
boolean

getDataStore

protected WcmDataStore getDataStore(javax.servlet.ServletContext application,
                                    javax.servlet.http.HttpServletRequest request)
Returns the instance of WcmDataStore. Initializes global keys if they have not been initialized yet.

Returns:
WcmDataStore

getServletContext

public javax.servlet.ServletContext getServletContext()
Returns the ServletContext (application)

Returns:
ServletContext

getCurrentRequest

protected javax.servlet.http.HttpServletRequest getCurrentRequest()
Returns the current HttpServletRequest object.

Returns:
The HttpServletRequest object.

getErrorMessageBox

public WcmErrorMessageBox getErrorMessageBox(java.lang.Throwable t)
Factory method. Get an error message box in order to display an exception.

Parameters:
t - - instance of Throwable
Returns:
WcmErrorMessageBox

getSignInPolicy

public WcmSignInPolicyInterface getSignInPolicy()
                                         throws java.lang.Exception
Factory method. Returns the singleton instance of WcmSignInPolicyInterface used with this controller implementation.

Specified by:
getSignInPolicy in interface WcmControllerBehaviorInterface
Returns:
The instance of WcmSignInPolicyInterface.
Throws:
java.lang.Exception

getInternalTokenPolicy

public UserTokenPolicyInterface getInternalTokenPolicy()
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getUserTokenPolicy

public UserTokenPolicyInterface getUserTokenPolicy()
                                            throws java.lang.Exception
Throws:
java.lang.Exception

getUserInfo

public WcmUserInformationInterface getUserInfo()
                                        throws java.lang.Exception
Description copied from interface: WcmControllerBehaviorInterface
Return the singleton instance of WcmUserInformationInterface if it is currently defined in the session.

Specified by:
getUserInfo in interface WcmControllerBehaviorInterface
Throws:
java.lang.Exception

isBootstrapRequired

public boolean isBootstrapRequired()
Returns true if required bootstrap options have not already been set by an administrator. This method is called by the getSignInPolicy method. If you're not using a bootstrap page, implement the getBootstrapPage method to return null.

Specified by:
isBootstrapRequired in interface WcmControllerBehaviorInterface
Returns:
boolean true or false.

isGuest

protected boolean isGuest()
                   throws java.lang.Exception
Returns true if the current signed in user is a guest.

Returns:
boolean true or false.
Throws:
java.lang.Exception

getServerCredentials

protected WcmServerCredentials getServerCredentials()
                                             throws java.lang.Exception
Throws:
java.lang.Exception

getSSLInfo

protected WcmSSLInfo getSSLInfo()
                         throws java.lang.Exception
Singleton factory method. Returns the singleton instance of WcmSSLInfo.

Returns:
The instance of WcmSSLInfo.
Throws:
java.lang.Exception

getSystemInfo

public WcmSystem getSystemInfo()
                        throws java.lang.Exception
Factory method. Returns the singleton instance of WcmSystem used with this controller implementation.

Specified by:
getSystemInfo in interface WcmControllerBehaviorInterface
Returns:
The instance of WcmSystem.
Throws:
java.lang.Exception

serverSideInclude

public void serverSideInclude(java.lang.String path,
                              java.io.Writer w)
                       throws java.io.IOException,
                              javax.servlet.ServletException
Include the specified URL writing its output to the current Writer object.

Parameters:
path - - The path to the URL to include.
w - - The Writer which will be flushed prior to the include.
Throws:
java.io.IOException
javax.servlet.ServletException

getWindowProperties

public WcmController.WindowProperties getWindowProperties(java.lang.String windowId)
                                                   throws java.lang.Exception
Get an instance of the controller window properties for the specified windowId. If window properties are not found, returns null.

Parameters:
windowId -
Returns:
Throws:
java.lang.Exception


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.