org.apache.jetspeed.layout
Interface PortletPlacementContext


public interface PortletPlacementContext

Handles portlet placement for client such as AJAX client side on a per request basis. The context is associated with a request context, thus it is only valid for the span of a request.

Version:
$Id: $
Author:
David Gurney, David Sean Taylor

Method Summary
 Coordinate add(ContentFragment fragment, Coordinate coordinate)
          Add a portlet to its managed page.
 ContentFragment getFragmentAtNewCoordinate(Coordinate coordinate)
          Retrieve a portlet fragment for the given coordinate.
 ContentFragment getFragmentAtOldCoordinate(Coordinate coordinate)
          Retrieve the old portlet fragment for the given coordinate (prior to placement).
 ContentFragment getFragmentById(java.lang.String fragmentId)
          Retrieve a fragment by fragment id.
 int getNumberColumns()
          retrieve the number of columns for the managed layout.
 int getNumberRows(int column)
          retrieve the number of rows for the managed layout at the given column.
 Coordinate moveAbsolute(ContentFragment fragment, Coordinate coordinate)
          Move a portlet fragment to a new absolute position as specified in the Coordinate parameter.
 Coordinate moveAbsolute(ContentFragment fragment, Coordinate coordinate, boolean addFragment)
          Move a portlet fragment to a new absolute position as specified in the Coordinate parameter.
 Coordinate moveDown(ContentFragment fragment)
          Move a portlet relative to its current position DOWN one row.
 Coordinate moveLeft(ContentFragment fragment)
          Move a portlet relative to its current position LEFT one column.
 Coordinate moveRight(ContentFragment fragment)
          Move a portlet relative to its current position RIGHT one column.
 Coordinate moveUp(ContentFragment fragment)
          Move a portlet relative to its current position UP one row.
 Coordinate remove(ContentFragment fragment)
          Remove the specified fragment.
 ContentPage syncPageFragments()
          Takes the internal portlet placement state and writes it back out to the root fragment for the managed page layout.
 ContentPage syncPageFragments(java.lang.String scope, java.lang.String scopeValue)
          Takes the internal portlet placement state and writes it back out to the root fragment for the managed page layout.
 

Method Detail

moveAbsolute

Coordinate moveAbsolute(ContentFragment fragment,
                        Coordinate coordinate)
                        throws PortletPlacementException
Move a portlet fragment to a new absolute position as specified in the Coordinate parameter.

Parameters:
fragment - The fragment to be moved.
coordinate - The specification of the new absolute coordinate
Returns:
new coordinate location of the portlet
Throws:
PortletPlacementException

moveAbsolute

Coordinate moveAbsolute(ContentFragment fragment,
                        Coordinate coordinate,
                        boolean addFragment)
                        throws PortletPlacementException
Move a portlet fragment to a new absolute position as specified in the Coordinate parameter.

Parameters:
fragment - The fragment to be moved.
coordinate - The specification of the new absolute coordinate
addFragment - When true, the fragment is being added (i.e. it is not being moved within the column)
Returns:
new coordinate location of the portlet
Throws:
PortletPlacementException

moveUp

Coordinate moveUp(ContentFragment fragment)
                  throws PortletPlacementException
Move a portlet relative to its current position UP one row.

Parameters:
fragment - The fragment to be moved.
Returns:
new coordinate location of the portlet
Throws:
PortletPlacementException

moveDown

Coordinate moveDown(ContentFragment fragment)
                    throws PortletPlacementException
Move a portlet relative to its current position DOWN one row.

Parameters:
fragment - The fragment to be moved.
Returns:
new coordinate location of the portlet
Throws:
PortletPlacementException

moveLeft

Coordinate moveLeft(ContentFragment fragment)
                    throws PortletPlacementException
Move a portlet relative to its current position LEFT one column.

Parameters:
fragment - The fragment to be moved.
Returns:
new coordinate location of the portlet
Throws:
PortletPlacementException

moveRight

Coordinate moveRight(ContentFragment fragment)
                     throws PortletPlacementException
Move a portlet relative to its current position RIGHT one column.

Parameters:
fragment - The fragment to be moved.
Returns:
new coordinate location of the portlet
Throws:
PortletPlacementException

add

Coordinate add(ContentFragment fragment,
               Coordinate coordinate)
               throws PortletPlacementException
Add a portlet to its managed page.

Parameters:
fragment - The Fragment to add
coordinate - The coordinate where to place the new portlet
Returns:
Throws:
PortletPlacementException

remove

Coordinate remove(ContentFragment fragment)
                  throws PortletPlacementException
Remove the specified fragment.

Parameters:
fragment -
Returns:
Throws:
PortletPlacementException

getNumberColumns

int getNumberColumns()
                     throws PortletPlacementException
retrieve the number of columns for the managed layout.

Returns:
the number of columns in the manged layout
Throws:
PortletPlacementException

getNumberRows

int getNumberRows(int column)
                  throws PortletPlacementException
retrieve the number of rows for the managed layout at the given column.

Parameters:
column - the column to retrieve the number of rows for
Returns:
the number of rows for the given column
Throws:
PortletPlacementException

getFragmentAtNewCoordinate

ContentFragment getFragmentAtNewCoordinate(Coordinate coordinate)
                                           throws PortletPlacementException
Retrieve a portlet fragment for the given coordinate.

Parameters:
coordinate - the coordinate associated to a fragment.
Returns:
the fragment associated to the given coordinate
Throws:
PortletPlacementException

getFragmentAtOldCoordinate

ContentFragment getFragmentAtOldCoordinate(Coordinate coordinate)
                                           throws PortletPlacementException
Retrieve the old portlet fragment for the given coordinate (prior to placement).

Parameters:
coordinate - the coordinate associated to a fragment.
Returns:
the fragment associated to the given coordinate
Throws:
PortletPlacementException

getFragmentById

ContentFragment getFragmentById(java.lang.String fragmentId)
                                throws PortletPlacementException
Retrieve a fragment by fragment id.

Parameters:
fragmentId - a string key for a fragment managed on this layout.
Returns:
The fragment associated with the given fragment id.
Throws:
PortletPlacementException

syncPageFragments

ContentPage syncPageFragments(java.lang.String scope,
                              java.lang.String scopeValue)
Takes the internal portlet placement state and writes it back out to the root fragment for the managed page layout.

Parameters:
scope - the name of the property scope to update
scopeValue - the scope discriminator value, (unless scope is GLOBAL or USER where the default user name is used if null)
Returns:
the managed page layout with updated fragment state.

syncPageFragments

ContentPage syncPageFragments()
Takes the internal portlet placement state and writes it back out to the root fragment for the managed page layout.

Returns:
the managed page layout with updated fragment state.


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.