站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.4 API 英文版文档

MarkupCommand - JBOSS Portal 2.4 API 英文版文档


org.jboss.portal.core.command
Class MarkupCommand

java.lang.Object
  extended byorg.jboss.portal.common.invocation.Invocation
      extended byorg.jboss.portal.core.command.ControllerCommand
          extended byorg.jboss.portal.core.command.PortalObjectCommand
              extended byorg.jboss.portal.core.command.MarkupCommand
Direct Known Subclasses:
RenderPageCommand, RenderRegionCommand, RenderWindowContextCommand

public abstract class MarkupCommand
extends PortalObjectCommand

Abstract base class for portal object commands that produce markup (of a page, region, window).

This command contains all the shared functionality amongst all commands that create page , or page fragment markup, like the RenderPageCommand and the RenderRegionCommand.


Field Summary
 
Fields inherited from class org.jboss.portal.core.command.ControllerCommand
context, log
 
Constructor Summary
MarkupCommand(java.lang.String pageRef)
          render the entire page
MarkupCommand(java.lang.String pageRef, MarkupContainer markupContainer)
          render a fragment on the page (a region or a window on the page)
 
Method Summary
 void create()
          initialize the command
 void enforceSecurity(PortalAuthorizationManager pam)
          Enforce the security on this command using the provided portal authorization manager.
 void execute()
          execute the command
 CommandInfo getInfo()
          Get the command info (runtime info about the command)
 PortalLayout getLayout()
          Get the layout that was determined for this request (based on portal and page properties)
static PortalLayout getLayout(LayoutService layoutService, Page page)
          Get the portal layout to use for the provided page.
 MarkupContainer getMarkupContainer()
          Get the fragment identifier of the page fragment that was requested
 Page getPage()
          Get the requeste page
 java.lang.String getPageRef()
          Get the identifier of the requeste page
 PortalObject getTarget()
          for security checks and navigational state, return the page of the requested MarkupContainer
abstract  MarkupResult renderFragments(ServerConfig cfg, NavigationalStateContext navCtx)
          call the component invocation(s) to create the markup fragment(s) for this request
protected  MarkupResult renderPortletWindow(ServerConfig cfg, Window window)
          Call the component container to render the markup fragment of a window
 
Methods inherited from class org.jboss.portal.core.command.ControllerCommand
destroy, dispatch, getContext, setContext
 
Methods inherited from class org.jboss.portal.common.invocation.Invocation
getAttribute, invoke, invokeNext, removeAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkupCommand

public MarkupCommand(java.lang.String pageRef)
render the entire page

Parameters:
pageRef - the page idenitifier of the page to render

MarkupCommand

public MarkupCommand(java.lang.String pageRef,
                     MarkupContainer markupContainer)
render a fragment on the page (a region or a window on the page)

Parameters:
pageRef - the page idenitifier of the page to render
markupContainer - the fragment to render (the region or the window); if the argument is null, the entire page will be rendered
Method Detail

renderFragments

public abstract MarkupResult renderFragments(ServerConfig cfg,
                                             NavigationalStateContext navCtx)
                                      throws CommandException
call the component invocation(s) to create the markup fragment(s) for this request

Parameters:
cfg - the server config to get config information (for error behaviour )
navCtx - the navigational state context to get to the window navigational state
Returns:
a markup result containing the fragments rendered by the portlets in this command
Throws:
InvocationException
CommandException

getTarget

public PortalObject getTarget()
for security checks and navigational state, return the page of the requested MarkupContainer

Specified by:
getTarget in class PortalObjectCommand
Returns:
the requested page (or the page of the requested region or window)

getInfo

public CommandInfo getInfo()
Get the command info (runtime info about the command)

Specified by:
getInfo in class ControllerCommand
Returns:
info about the command

getPageRef

public java.lang.String getPageRef()
Get the identifier of the requeste page

Returns:
the identifier of the requeste page

getPage

public Page getPage()
Get the requeste page

Returns:
the requested page

getLayout

public PortalLayout getLayout()
Get the layout that was determined for this request (based on portal and page properties)

Returns:
the layout to use for this request

getMarkupContainer

public MarkupContainer getMarkupContainer()
Get the fragment identifier of the page fragment that was requested

Returns:
the region or window to render as part of this request

create

public void create()
            throws CommandException
initialize the command

Overrides:
create in class ControllerCommand
Throws:
InvocationException
CommandException

enforceSecurity

public void enforceSecurity(PortalAuthorizationManager pam)
                     throws SecurityException,
                            PortalSecurityException
Description copied from class: PortalObjectCommand
Enforce the security on this command using the provided portal authorization manager.

Overrides:
enforceSecurity in class PortalObjectCommand
Parameters:
pam - the portal authorization manager
Throws:
SecurityException - if the access is not granted
PortalSecurityException

execute

public final void execute()
                   throws InvocationException
execute the command

Specified by:
execute in class ControllerCommand
Throws:
InvocationException

getLayout

public static PortalLayout getLayout(LayoutService layoutService,
                                     Page page)
Get the portal layout to use for the provided page.

The name of the layout to use can be defined as a property in the portal, or the individual page. The page property overwrites the portal property. If no property was set, a default layout with the name "nodesk" is assumed.

Parameters:
layoutService - the layout service that allows access to the layout
page - the page that hosts the markup container to render (the page, region, window,...)
Returns:
a PortalLayout for the defined layout name

renderPortletWindow

protected MarkupResult renderPortletWindow(ServerConfig cfg,
                                           Window window)
                                    throws CommandException
Call the component container to render the markup fragment of a window

Parameters:
cfg - the server config to get information about the error behaviour
window - the window to render
Returns:
a result containing markup, or other result information (redirect url, etc.)
Throws:
InvocationException
CommandException