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(Fragment fragment, Coordinate coordinate)
          Add a portlet to its managed page.
 Fragment getFragmentAtNewCoordinate(Coordinate coordinate)
          Retrieve a portlet fragment for the given coordinate.
 Fragment getFragmentAtOldCoordinate(Coordinate coordinate)
          Retrieve the old portlet fragment for the given coordinate (prior to placement).
 Fragment getFragmentById(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(Fragment fragment, Coordinate coordinate)
          Move a portlet fragment to a new absolute position as specified in the Coordinate parameter.
 Coordinate moveAbsolute(Fragment fragment, Coordinate coordinate, boolean addFragment)
          Move a portlet fragment to a new absolute position as specified in the Coordinate parameter.
 Coordinate moveDown(Fragment fragment)
          Move a portlet relative to its current position DOWN one row.
 Coordinate moveLeft(Fragment fragment)
          Move a portlet relative to its current position LEFT one column.
 Coordinate moveRight(Fragment fragment)
          Move a portlet relative to its current position RIGHT one column.
 Coordinate moveUp(Fragment fragment)
          Move a portlet relative to its current position UP one row.
 Coordinate remove(Fragment fragment)
          Remove the specified fragment.
 Page syncPageFragments()
          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(Fragment 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(Fragment 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(Fragment 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(Fragment 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(Fragment 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(Fragment 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(Fragment 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(Fragment 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

Fragment 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

Fragment 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

Fragment getFragmentById(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

Page 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-2007 Apache Software Foundation. All Rights Reserved.