com.bea.netuix.servlets.controls.window.backing
Class WindowBackingContext

java.lang.Object
  extended by com.bea.netuix.servlets.controls.ControlContext
      extended by com.bea.netuix.servlets.controls.BackingContext
          extended by com.bea.netuix.servlets.controls.window.backing.WindowBackingContext
All Implemented Interfaces
Serializable
Direct Known Subclasses:
PageBackingContext, PortletBackingContext

public abstract class WindowBackingContext
extends BackingContext

This is the backing context class for a Window. Use this class when in a backing file to get information about the owning window. If you want to access this context from a JSP, look at WindowPresentationContext instead.

You can obtain the backing context for the active window by calling BackingContext.getContextFromRequest

See Also
BackingContext, Serialized Form

Field Summary
static String CLASS_NAME
           
 
Method Summary
 Capability getCapability(Capability capability)
          Gets the capability for the Window, may be a state or a mode.
 boolean getCapabilityVisible(String name)
          Gets the visible property for a capability.
 String getDefinitionId()
          Return the definition id of this portlet, page or book.
 String getDefinitionLabel()
          Get the definition label for the portlet/page or book.
 String getDescription()
          Returns the description for the current window.
 String getInstanceId()
          Return the instance id of this portlet.
abstract  String getLabel()
          Return the label for the control.
 MetaData getMetaData(String name)
          Return the metadata elements for this control matching the supplied name
 MetaData[] getMetaDatas()
          Return the metadata elements for this control
 String getOrientation()
          Get the orientation of the navigation bar or titlebar of the current window.
 PageBackingContext getParentPageBackingContext()
          Return the window's parent page.
 BackingContext getParentWindowBackingContext()
          Get the BackingContext of the parent of the current window.
 String getPlacementId()
          Get the PlacementId for this window.
 WindowMode getPreviousWindowMode()
          Get the previous WindowMode.
 WindowState getPreviousWindowState()
          Get the previous WindowState.
 List getRenderedChildrenWindowBackingContexts()
          This method returns a deep List containing all the Window, Page, and Book backing contexts of these type of controls that are rendered.
 String getTitle()
          Get the title of the window.
 WindowMode getWindowMode()
          Return the current window mode.
 WindowState getWindowState()
          Return the current window state.
 boolean isCapable(Capability capability)
          Determine if this control has the given capability.
 boolean isPacked()
          Return true if the current window is packed.
 void setCapabilityVisible(String name, boolean isVisible)
          Sets the visible property for a capability.
 void setDescription(String description)
          Set window description.
 void setTitle(String title)
          Set the window's title.
 void setupModeChangeEvent(String modeValue)
          Tell the window to change its mode.
 void setupModeChangeEvent(WindowMode modeValue)
          Tell the window to change its mode.
 void setupPageChangeEvent(String pageLabel)
          Tell the window to change the page.
 void setupStateChangeEvent(String stateValue)
          Tell the window to change its state.
 void setupStateChangeEventFromParent(String stateValue)
          Deprecated as of version 9.0 this method is deprecated. Use setupStateChangeEvent instead.
 
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

public static final String CLASS_NAME
Method Detail

getLabel

public abstract String getLabel()
Return the label for the control. This will be the instance label for portlets and the definition label for pages and books.

Returns
the label from the book, page or portlet.

getTitle

public String getTitle()
Get the title of the window.


setCapabilityVisible

public void setCapabilityVisible(String name,
                                 boolean isVisible)
                          throws NullPointerException
Sets the visible property for a capability. This must be called in the pre-render method or earlier, and is reset upon every new request.

Parameters
name - the Capability name
isVisible - is it visible
Throws
NullPointerException

getCapabilityVisible

public boolean getCapabilityVisible(String name)
                             throws NullPointerException
Gets the visible property for a capability. name should be the Capability name.

Parameters
name - the Capability name
Returns
is it visible
Throws
NullPointerException

setTitle

public void setTitle(String title)

Set the window's title. Note: this method only sets the title for the current request. If you want to set the title permanently (and you are in streaming mode - not single file) then use the PortalCustomizationManager EJB.

Parameters
title -
See Also
IPortletInstanceManager.updatePortletInstance(com.bea.netuix.application.manager.CustomizationContext, com.bea.netuix.application.identifier.DesktopDefinitionId, com.bea.netuix.application.instance.PortletInstance)

getDescription

public String getDescription()
Returns the description for the current window.

Returns
description

setDescription

public void setDescription(String description)
Set window description. Note this method only sets the description for the current request. If you want to set the description permanently (and you are in streaming mode - not single file) then use the PortalCustomizationManager EJB.

Parameters
description -
See Also
IPortletInstanceManager.updatePortletInstance(com.bea.netuix.application.manager.CustomizationContext, com.bea.netuix.application.identifier.DesktopDefinitionId, com.bea.netuix.application.instance.PortletInstance)

getDefinitionLabel

public String getDefinitionLabel()
Get the definition label for the portlet/page or book.

Returns
a String containing the window's definition label.

getInstanceId

public String getInstanceId()
Return the instance id of this portlet. Note: the instance id is only populated when in streaming mode, not single file.

Returns
A string representation of the portlet's instance id (this is always a number)

getDefinitionId

public String getDefinitionId()
Return the definition id of this portlet, page or book. Note: the definition id is only populated in streaming mode (database, not single file). This can be useful with the persistence API.

Returns
A string representation of the windows defintion id (this is always a number)

getRenderedChildrenWindowBackingContexts

public List getRenderedChildrenWindowBackingContexts()
This method returns a deep List containing all the Window, Page, and Book backing contexts of these type of controls that are rendered.

Returns
List of BookBackingContext, WindowBackingContext, and PageBackingContext

setupModeChangeEvent

public void setupModeChangeEvent(String modeValue)
Tell the window to change its mode. Should only be called during handlePostback or during event handling.

Parameters
modeValue - the mode to change to

setupModeChangeEvent

public void setupModeChangeEvent(WindowMode modeValue)
Tell the window to change its mode. Should only be called during handlePostback or during event handling.

Parameters
modeValue - the mode to change to

setupStateChangeEventFromParent

@Deprecated
public void setupStateChangeEventFromParent(String stateValue)
Deprecated as of version 9.0 this method is deprecated. Use setupStateChangeEvent instead.

Tell the window to change its state from a parent control. Should only be called during handlePostback.

Parameters
stateValue - the state to change to

setupStateChangeEvent

public void setupStateChangeEvent(String stateValue)
Tell the window to change its state. This method should only be called during handlePostback or during event handling. Note that in many cases it is easier to use declarative state changes in the .portlet file event handler sections.

Parameters
stateValue - the state to change to, which should be one of the WindowCapabilities constants.

setupPageChangeEvent

public void setupPageChangeEvent(String pageLabel)
Tell the window to change the page. Should only be called during handlePostback or during event handling.

Parameters
pageLabel - the label of the page to change to

getWindowMode

public WindowMode getWindowMode()
Return the current window mode.

Returns
mode

getWindowState

public WindowState getWindowState()
Return the current window state.

Returns
window state

getOrientation

public String getOrientation()
Get the orientation of the navigation bar or titlebar of the current window. Value can be top(default), left, right.

Returns
titlebar or navigation bar orientation

getPlacementId

public String getPlacementId()
Get the PlacementId for this window.

Returns
PlacementId
See Also
PlacementId

isPacked

public boolean isPacked()
Return true if the current window is packed.

Returns
true if packed

getPreviousWindowState

public WindowState getPreviousWindowState()
Get the previous WindowState.

Returns
WindowState

getPreviousWindowMode

public WindowMode getPreviousWindowMode()
Get the previous WindowMode.

Returns
WindowMode

getParentWindowBackingContext

public BackingContext getParentWindowBackingContext()
Get the BackingContext of the parent of the current window.

Returns
parent window BackingContext

isCapable

public boolean isCapable(Capability capability)
Determine if this control has the given capability.

Parameters
capability - - window mode or state
See Also
WindowCapabilities

getCapability

public Capability getCapability(Capability capability)
                         throws NullPointerException

Gets the capability for the Window, may be a state or a mode. This method can be used to check if a Window (Book, Page or Portlet) supports a given Mode or State. If you are intersted in the current or active Window Mode or Window State you should use getWindowMode() and getWindowState repectively.

Note: this method should be called after the init() lifcycle, because the buttons have net yet registered with the parent window.

Parameters
capability - the Capability to check for.
Returns
The Capability if this Window has it and the user is entitled to use it, otherwise null. Note. this Capability may be cast to a WindowMode or WindowState to get additional information such as mode content uri.
Throws
NullPointerException
See Also
WindowCapabilities, Capability, WindowMode, WindowState

getParentPageBackingContext

public PageBackingContext getParentPageBackingContext()
Return the window's parent page.

Returns
reference the the parent Page or null if there is none.

getMetaDatas

public MetaData[] getMetaDatas()
Return the metadata elements for this control

Returns
a non null array of MetaData objects

getMetaData

public MetaData getMetaData(String name)
Return the metadata elements for this control matching the supplied name

Returns
a MetaData element if a match is found, otherwise null.


Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.