# com.bea.netuix.servlets.controls.application
DesktopPresentationContext Class

public class DesktopPresentationContext
extends `PresentationContext`

This class represents a portal desktop component. All presentation-related attributes of a desktop component are available from instances of this class. Such instances are typically used during portal rendering via look and feel skeleton files (e.g. desktop.jsp).

Related Topics

``DesktopPresentationContext.getDesktopPresentationContext(HttpServletRequest)``

Hierarchy
  `Object`
  `ControlContext`
  `PresentationContext`
  `DesktopPresentationContext`

All Implemented Interfaces
  `Serializable`

## Field Summary

`protected static final `String`` | `CLASS_NAME` String

Fields from com.bea.netuix.servlets.controls`.`ControlContext``
`debug`

## Constructor Summary

## Method Summary

`public `BookPresentationContext`` | `getBookPresentationContext`() Retrieve the main book (top level) presentation context.
`public `BookPresentationContext`` | `getBookPresentationContextRecursive`(`String` definitionLabel) Returns a book's presentation context, searching the entire tree recursively.
`public `String`` | `getDefinitionLabel`() Returns the definitionLabel of this desktop.
`public static `DesktopPresentationContext`` | `getDesktopPresentationContext`(`HttpServletRequest` request) This is a convenience method for returning a reference to the one and only `DesktopPresentationContext`.
`public `LookAndFeelDefinitionId`` | `getLookAndFeelDefinitionId`() Return the look and feel definition id.
`public `String`` | `getLookAndFeelDefinitionLabel`() Return the look and feel definition label.
`public `PagePresentationContext`` | `getPagePresentationContextRecursive`(`String` definitionLabel) Return a book or a page but traverse the entire tree; this will go inside books that are on pages too.
`public `PortletPresentationContext`` | `getPortletPresentationContextRecursive`(`String` instanceLabel) Return the portlet presentation context matching the supplied instance label.
`public `PortletPresentationContext`[]` | `getPortletsPresentationContextRecursive`(`String` definitionLabel) Return all portlet presentation contexts matching the supplied definition label.
`public `ShellPresentationContext`` | `getShellPresentationContext`() Return a reference to the shell presentation context.
`public `String`` | `getTitle`() Returns the title of this desktop instance.

Methods from `com.bea.netuix.servlets.controls.`PresentationContext``
``getChildren`, `getChildren`, `getFirstChild`, `getParsedProperties`, `getPresentationClass`, `getPresentationId`, `getPresentationStyle`, `getProperties`, `getProperty`, `getProperty`, `getPropertyAsBoolean`, `getPropertyAsInt`, `getResolvedLocale`, `getTagName`, `isVisible`, `setVisible``

Methods from `com.bea.netuix.servlets.controls.`ControlContext``
`getContextFromRequest, getControl, getRequestKey, getUniqueId, removeContextFromRequest, setContextInRequest`

Methods 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

## Constructor Detail

## Method Detail

### getBookPresentationContext() Method

    public BookPresentationContext getBookPresentationContext()

Retrieve the main book (top level) presentation context. This is a convenience method for returning the solitary, primary book for the portal. This is especially useful since the primary book is not an immediate child of the desktop or shell.

#### Returns

A reference to the main book presentation context or null if it does not exist

### getBookPresentationContextRecursive(String) Method

    public BookPresentationContext getBookPresentationContextRecursive(String definitionLabel)

Returns a book's presentation context, searching the entire tree recursively. If you are interested in both books AND pages use `getPagePresentationContextRecursive()` as that method returns both.

#### Parameters

definitionLabel
  The definition label of the book of interest

#### Returns

The book of interest or null if it is not found

### getDefinitionLabel() Method

    public String getDefinitionLabel()

Returns the definitionLabel of this desktop. This value should not be null.

#### Returns

The non-null definitionLabel for the desktop

### getDesktopPresentationContext(HttpServletRequest) Method

    public static DesktopPresentationContext getDesktopPresentationContext(HttpServletRequest request)

This is a convenience method for returning a reference to the one and only `DesktopPresentationContext`. Note this method will only work if called from within a portal (typically, from the desktop.jsp skeleton). This method may return null if called when no appropriate context exists, but such a context should safely exist when being fetched from the associated skeleton JSP during normal portal rendering.

#### Parameters

request
  The current HTTPServletRequest instance

#### Returns

A reference to the current DesktopPresentationContext, if any

### getLookAndFeelDefinitionId() Method

    public LookAndFeelDefinitionId getLookAndFeelDefinitionId()

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

#### Returns

look and feel definition id or null if portal file.

### getLookAndFeelDefinitionLabel() Method

    public String getLookAndFeelDefinitionLabel()

Return the look and feel definition label.

#### Returns

look and feel definition label as defined by the developer.

### getPagePresentationContextRecursive(String) Method

    public PagePresentationContext getPagePresentationContextRecursive(String definitionLabel)

Return a book or a page but traverse the entire tree; this will go inside books that are on pages too.

#### Parameters

definitionLabel
  The definition label of the page or book of interest

#### Returns

A PagePresentationContext (or BookPresentationContext if a book) of the page or book with a matching definition label

### getPortletPresentationContextRecursive(String) Method

    public PortletPresentationContext getPortletPresentationContextRecursive(String instanceLabel)

Return the portlet presentation context matching the supplied instance label.

#### Parameters

instanceLabel
  The unique instance label of the desired portlet

#### Returns

A reference to the portlet's PresentationContext if it exists; null otherwise

### getPortletsPresentationContextRecursive(String) Method

    public PortletPresentationContext[] getPortletsPresentationContextRecursive(String definitionLabel)

Return all portlet presentation contexts matching the supplied definition label. Since many portlets can share the same definition label, more than one portlet can be returned. If you are interested in just one portlet then try `getPortletPresentationContextRecursive(String instanceLabel)`.

#### Parameters

definitionLabel
  The label of the desired portlet

#### Returns

A non-null array of PortletPresentationContexts

### getShellPresentationContext() Method

    public ShellPresentationContext getShellPresentationContext()

Return a reference to the shell presentation context. This is a convenience method for returning the presentation context for the solitary, required child shell. This is equivalent to calling `getFirstChild("application:shell")`.

#### Returns

The child ShellPresentationContext instance or null if it does not exist

Related Topics

``#getChildren(String)``

### getTitle() Method

    public String getTitle()

Returns the title of this desktop instance. This value may be localized if localized values exist.

#### Returns

The desktop's localized title