Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2008 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.netuix.servlets.controls.application.backing
Class DesktopBackingContext

    java.lang.Object
      com.bea.netuix.servlets.controls.ControlContext
          com.bea.netuix.servlets.controls.BackingContext
              com.bea.netuix.servlets.controls.application.backing.DesktopBackingContext

All Implemented Interfaces
  Serializable

    public class DesktopBackingContext

extends BackingContext

The `DesktopBackingContext` is used to interact with the underlying Desktop control. This is the BackingContext for a Desktop. This `BackingContext` can only be referenced from a backing file. If you need to reference this from a JSP you should use `DesktopPresentationContext` instead.

To get a handle to the BackingContext just call the following:
DesktopBackingContext.getDesktopBackingContext(request); Note: most methods for retrieving child contexts do not work if called from the `init()` method of a backing file. This is because the portal tree has not been fully initialized. You may have to call the method from the `preRender()` or `handlePostbackData` method.

See Also
  Serialized Form

Nested Class Summary
`static class` | `DesktopBackingContext.AsyncModeType` Valid values for `asyncMode` attribute on the desktop element.

Field Summary
`protected static String` | `CLASS_NAME`

Method Summary
`DesktopBackingContext.AsyncModeType` | `getAsyncMode()` Return the current async mode setting on the desktop.
`BookBackingContext` | `getBookBackingContext()` Retrieve the main book (top level) backing context.
`BookBackingContext` | `getBookBackingContextRecursive(String definitionLabel)` Return a book searching the entire tree recursively.
`BookBackingContext[]` | `getBookBackingContextsByMeta(MetaData[] metaData, int limit)` Return a set of books matching the supplied metadata search criteria.
`String` | `getDefinitionLabel()` Get definition label as defined in the portal file.
`static DesktopBackingContext` | `getDesktopBackingContext(javax.servlet.http.HttpServletRequest request)` Obtain a reference to the current `DesktopBackingContext` in the request.
`PageBackingContext` | `getDisplayedPageBackingContext()` Return the last displayed page (not book).
`FooterBackingContext` | `getFooterBackingContextRecursive()` Return a reference to the Footer backing context if one exists.
`HeaderBackingContext` | `getHeaderBackingContextRecursive()` Return a reference to the Header backing context if one exists.
`LookAndFeelDefinitionId` | `getLookAndFeelDefinitionId()` Return the look and feel definition id.
`String` | `getLookAndFeelDefinitionLabel()` Return the look and feel definition label.
`PageBackingContext` | `getPageBackingContextRecursive(String definitionLabel)` Return a book or a page but traverse the entire tree, this will go inside books that are on pages too.
`PageBackingContext[]` | `getPageBackingContextsByMeta(MetaData[] metaData, int limit)` Return a set of pages and books (books extend pages) matching the supplied metadata search criteria.
`PortletBackingContext` | `getPortletBackingContextRecursive(String instanceLabel)` Return the portlet backing context matching the supplied instance label.
`PortletBackingContext[]` | `getPortletBackingContextsByMeta(MetaData[] metaData, int limit)` Return a set of portlets matching the supplied metadata search criteria.
`PortletBackingContext[]` | `getPortletsBackingContextRecursive(String definitionLabel)` Return portlet backing contexts matching the supplied definition label.
`String` | `getTitle()` Get the internationalized title for this desktop.
`boolean` | `isAsyncModeDisabled()` Is desktop asyncMode set to `disabled` for this request?
`boolean` | `isAsyncModeEnabled()` Is desktop asyncMode set to `enabled` for this request?
`boolean` | `isDiscEnabled()` Is the Desktop attribute discEnabled currently set to true? Disc is WLP's Dynamic Interface Scripting environment, a JavaScript framework for client-side development.
`boolean` | `isDvtEnabled()` Is the Desktop attribute dvtEnabled currently set to true? This flag enables or disables dynamic visitor tooling functionality.
`void` | `setAsyncMode(DesktopBackingContext.AsyncModeType asyncMode)` Set the async mode for this request.
`void` | `setTitle(String title)` Set a temporary value for the title.

Methods inherited from class com.bea.netuix.servlets.controls.BackingContext
`ensureCurrentLifecycleStageLegalForOperation, getChildrenBackingContexts, getParentBackingContext, getParsedProperties, getProperties, getProperty, getProperty, getSendRedirectPath, getTopParentBackingContext, isBackingPhase, isVisible, sendRedirect, setBackingPhase, setVisible`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### CLASS_NAME

    protected static final String CLASS_NAME

Method Detail

### getDesktopBackingContext

    public static DesktopBackingContext getDesktopBackingContext(javax.servlet.http.HttpServletRequest request)

  Obtain a reference to the current `DesktopBackingContext` in the request. Note: the DesktopBackingContext should only be obtained from a backing file. If you think you need this context from a JSP look at DesktopPresentationContext.

  Parameters
    `request` - http servlet request.
  Returns
    a refence to the DesktopBackingContext or null if none exist.

### getBookBackingContext

    public BookBackingContext getBookBackingContext()

  Retrieve the main book (top level) backing context.

  Returns
    a reference to the main book backing context otherwise null if none exist.

### getBookBackingContextRecursive

    public BookBackingContext getBookBackingContextRecursive(String definitionLabel)

  Return a book searching the entire tree recursively. If you are interested in both books AND pages use `getPageBackingContextRecursive()` as that method returns both. Note: this method may return null if called from the init() method of a backing context.

  Parameters
    `definitionLabel` - of the book
  Returns
    the Book of interest or null if not found.

### getBookBackingContextsByMeta

    public BookBackingContext[] getBookBackingContextsByMeta(MetaData[] metaData,
                                                             int limit)

  Return a set of books matching the supplied metadata search criteria. This method will search the entire tree looking for books with matching metadata and only stopping when the `limit` is reached. Meta data can be added to books by inserting <netuix:meta> tags into the body of the main book element. If you are interested in both books AND pages use `getPageBackingContextsByMeta()` as that method returns both.

  Parameters
    `metaData` - contains the search criteria
    `limit` - maximium number of items to return: 0 == no limit, 1 == first match , n == first n matches
  Returns
    a non null array of matching book backing contexts.

### getPageBackingContextsByMeta

    public PageBackingContext[] getPageBackingContextsByMeta(MetaData[] metaData,
                                                             int limit)

  Return a set of pages and books (books extend pages) matching the supplied metadata search criteria. This method will search the entire tree looking for pages and books with matching metadata and only stoping when the supplied `limit` is reached. Meta data can be added to pages by inserting <netuix:meta> tags into the body of the main page element.

  Parameters
    `metaData` - contains the search criteria
    `limit` - maximium number of items to return: 0 == no limit, 1 == first match , n = first n matches
  Returns
    a non null array of matching page backing contexts.

### getPortletBackingContextsByMeta

    public PortletBackingContext[] getPortletBackingContextsByMeta(MetaData[] metaData,
                                                                   int limit)

  Return a set of portlets matching the supplied metadata search criteria. This method will search the entire tree looking for portlets and books with matching metadata and only stoping when the supplied `limit` is reached. Meta data can be added to portlets by inserting <netuix:meta> tags into the body of the main portlet element.

  Parameters
    `metaData` - contains the search criteria
    `limit` - maximium number of items to return: 0 == no limit, 1 == first match , n = first n matches
  Returns
    a non null array of matching portlet backing contexts.

### getPageBackingContextRecursive

    public PageBackingContext getPageBackingContextRecursive(String definitionLabel)

  Return a book or a page but traverse the entire tree, this will go inside books that are on pages too. Note: this method may return null if called from the init() method of a backing context.

  Parameters
    `definitionLabel` -
  Returns
    pageBackingContext or (BookBackingContext if book) of the page or book with matching definition label.

### getPortletBackingContextRecursive

    public PortletBackingContext getPortletBackingContextRecursive(String instanceLabel)

  Return the portlet backing context matching the supplied instance label. Note: this method may return null if called from the init() method of a backing context.

  Parameters
    `instanceLabel` - unique instance label of the portlet
  Returns
    a reference to the portlet's BackingContext if it exist otherwise null.

### getPortletsBackingContextRecursive

    public PortletBackingContext[] getPortletsBackingContextRecursive(String definitionLabel)

  Return portlet backing contexts matching the supplied definition label. Since many portlets can share the same definition label, more then one portlet can be returned. If you are interested in just one portlet then try `getPortletBackingContextRecursive(String instanceLabel)` Note: this method may return null if called from the init() method of a backing context.

  Parameters
    `definitionLabel` - label of the portlet
  Returns
    a non null array of PortletBackingContext.

### getHeaderBackingContextRecursive

    public HeaderBackingContext getHeaderBackingContextRecursive()

  Return a reference to the Header backing context if one exists.

  Returns
    a reference to the Header if one exists in the shell otherwise null.

### getFooterBackingContextRecursive

    public FooterBackingContext getFooterBackingContextRecursive()

  Return a reference to the Footer backing context if one exists.

  Returns
    a reference to the Footer if one exists in the shell otherwise null.

### getDisplayedPageBackingContext

    public PageBackingContext getDisplayedPageBackingContext()

  Return the last displayed page (not book). This method listens to Page Change events and remembers the last page that was activated in the Desktop. If no page changes have occurred then the first default page found will be returned.

  Note: This method will only return the right results if called after the `handlePostbackData` method. Therefore, it is recommended that you call this methods from `preRender`.

  Returns
    last displayed `PageBackingContext`

### getTitle

    public String getTitle()

  Get the internationalized title for this desktop.

  Returns
    a non null title for this desktop.

### setTitle

    public void setTitle(String title)

  Set a temporary value for the title.

### getDefinitionLabel

    public String getDefinitionLabel()

  Get definition label as defined in the portal file.

### getLookAndFeelDefinitionId

    public LookAndFeelDefinitionId getLookAndFeelDefinitionId()

  Return the look and feel definition id. This method will only work for streamed portals.

  Returns
    look and feel definition id or null if portal file.

### getLookAndFeelDefinitionLabel

    public String getLookAndFeelDefinitionLabel()

  Return the look and feel definition label.

  Returns
    look and feel definition label as defined by the developer.

### getAsyncMode

    public DesktopBackingContext.AsyncModeType getAsyncMode()

  Return the current async mode setting on the desktop.

  Returns
    "enabled", "disabled", "compat_9_2";
  See Also
    `DesktopBackingContext.AsyncModeType`

### setAsyncMode

    public void setAsyncMode(DesktopBackingContext.AsyncModeType asyncMode)

  Set the async mode for this request. Depending on the original state the following will occur:

  Original State | New State | Effect
  enabled | disabled | The request will finish out and a redirect will be sent to the browser as a JSON response. The redirect will be a regular post back but with a special parameter informing the server not to perform javascript rewriting of the URLs. The next request will not be an AJAX request as the URLs have not been rewritten. subsequent requests will default back to asyncContent="enabled"
  enabled | compat_9_2 | The AJAX request will finish out and a redirect will be sent to the browser as a JSON response. The redirect will be a regular post back but with a special parameter informing the server to run in compatibility mode (compat_9_2). Under this mode all portlets with the attribute "asyncContent" set as ajax or iframe will perform a separate request. Subsequent requests will default back to asyncContent="enabled"
  disabled | enabled | The full request will finish out as normal, however all links will then be rewritten to perform AJAX request. All requests after that will be of type AJAX. The server will continue to act in AJAX mode until the mode is rest or a link is clicked which has not been rewritten
  disabled | compat_9_2 | The request will behave as in compat_9_2 mode just for that request. Under this mode all portlets with the attribute "asyncContent" set as ajax or iframe will perform a separate request. Subsequent requests will default back to asyncContent="disabled"
  compat_9_2 | enabled | Not Supported
  compat_9_2 | disabled | The request will behave as in disabled mode just for that request. Under this mode all portlets with the attribute "asyncContent" set as ajax or iframe will be ignored.

  NOTE: This method must be called during the init lifecycle.

  Parameters
    `asyncMode` - "disabled", "enabled, "compat_9_2"
  See Also
    `DesktopBackingContext.AsyncModeType`

### isAsyncModeEnabled

    public boolean isAsyncModeEnabled()

  Is desktop asyncMode set to `enabled` for this request?

  Returns
    true is asyncMode equals "enabled"

### isAsyncModeDisabled

    public boolean isAsyncModeDisabled()

  Is desktop asyncMode set to `disabled` for this request?

  Returns
    true is asyncMode equals "disabled"

### isDiscEnabled

    public boolean isDiscEnabled()

  Is the Desktop attribute discEnabled currently set to true? Disc is WLP's Dynamic Interface Scripting environment, a JavaScript framework for client-side development. Defaults to false if unset, but is enabled implicitly when either asyncMode or DVT is enabled.

  Returns
    true if Desktop attribute discEnabled is true.

### isDvtEnabled

    public boolean isDvtEnabled()

  Is the Desktop attribute dvtEnabled currently set to true? This flag enables or disables dynamic visitor tooling functionality. Defaults to false if unset.

  Returns
    true if Desktop attribute dvtEnabled is true.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 BEA Systems, Inc. All Rights Reserved