|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.layout.impl.PortletPlacementContextImpl
public class PortletPlacementContextImpl
Portal Placement Context The purpose of the object is to provide an API that can be used to move a portlet fragment on the page. This includes moving, adding, removing and getting information about portlets that are on the page and portlets that are available to be added to the page. This object represents the fragment contents of a single layout fragment (i.e. nested depth cannot be captured by this object). An important note about this object: This object is really only intended to be used to do a single operation such as "moveabs" or "add". After performing the operation, the hashmap data structures are not correct and should not be used for subsequent operations. The reason they are incorrect is that when a fragment is moved, the coordinate of fragments below it are now different. These could be updated, but it really doesn't serve a purpose since this is a short lived object.
Field Summary | |
---|---|
protected java.util.ArrayList[] |
columnsList
|
protected static java.lang.String |
eol
|
protected java.util.Map |
fragmentCoordinateMap
|
protected java.util.Map |
fragmentMap
|
protected Fragment |
layoutContainerFragment
|
protected int |
numberOfColumns
|
protected Page |
page
|
Constructor Summary | |
---|---|
PortletPlacementContextImpl(Page page,
PortletRegistry registry)
|
|
PortletPlacementContextImpl(Page page,
PortletRegistry registry,
Fragment container)
|
Method Summary | |
---|---|
Coordinate |
add(Fragment fragment,
Coordinate coordinate)
Add a portlet to its managed page. |
Fragment |
debugFragments(java.lang.String debug)
|
java.lang.String |
dumpFragments(java.lang.String debug)
|
static int |
getColumnCountAndSizes(Fragment layoutFragment,
PortletRegistry registry,
java.util.Map fragSizes)
|
static int |
getColumnCountAndSizes(Fragment layoutFragment,
PortletRegistry registry,
java.util.Map fragSizes,
boolean suppressErrorLogging)
|
Fragment |
getFragment(java.lang.String fragmentId)
|
protected Fragment |
getFragmentAtCoordinate(Coordinate coordinate,
boolean useOldCoordinateValues,
boolean suppressExceptions)
|
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(java.lang.String fragmentId)
Retrieve a fragment by fragment id. |
int |
getFragmentCol(Fragment fragment)
|
int |
getFragmentRow(Fragment fragment)
|
protected int |
getLatestColumn(Coordinate coordinate)
|
protected int |
getLatestRow(Coordinate coordinate)
|
int |
getNumberColumns()
retrieve the number of columns for the managed layout. |
int |
getNumberRows(int col)
retrieve the number of rows for the managed layout at the given column. |
protected void |
init(Fragment container)
|
Coordinate |
moveAbsolute(Fragment fragment,
Coordinate newCoordinate)
Move a portlet fragment to a new absolute position as specified in the Coordinate parameter. |
Coordinate |
moveAbsolute(Fragment fragment,
Coordinate newCoordinate,
boolean okToAddFragment)
Move a portlet fragment to a new absolute position as specified in the Coordinate parameter. |
protected Coordinate |
moveDirection(Fragment fragment,
int deltaCol,
int deltaRow)
|
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. |
protected void |
syncFragments(boolean updateFragmentObjects,
int onlyForColumnIndex)
|
Page |
syncPageFragments()
Takes the internal portlet placement state and stores back out to fragment state |
protected Fragment |
verifyFragmentAtExpectedCoordinate(int colIndex,
int rowIndex,
Fragment fragment,
java.lang.String sourceDesc)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String eol
protected java.util.ArrayList[] columnsList
protected java.util.Map fragmentCoordinateMap
protected java.util.Map fragmentMap
protected int numberOfColumns
protected Page page
protected Fragment layoutContainerFragment
Constructor Detail |
---|
public PortletPlacementContextImpl(Page page, PortletRegistry registry) throws PortletPlacementException
PortletPlacementException
public PortletPlacementContextImpl(Page page, PortletRegistry registry, Fragment container) throws PortletPlacementException
PortletPlacementException
Method Detail |
---|
protected void init(Fragment container) throws PortletPlacementException
PortletPlacementException
public java.lang.String dumpFragments(java.lang.String debug)
public Fragment debugFragments(java.lang.String debug)
public Page syncPageFragments()
syncPageFragments
in interface PortletPlacementContext
protected int getLatestColumn(Coordinate coordinate)
protected int getLatestRow(Coordinate coordinate)
protected void syncFragments(boolean updateFragmentObjects, int onlyForColumnIndex)
public int getFragmentRow(Fragment fragment)
public int getFragmentCol(Fragment fragment)
public Fragment getFragment(java.lang.String fragmentId) throws PortletPlacementException
PortletPlacementException
public Fragment getFragmentAtOldCoordinate(Coordinate coordinate) throws PortletPlacementException
PortletPlacementContext
getFragmentAtOldCoordinate
in interface PortletPlacementContext
coordinate
- the coordinate associated to a fragment.
PortletPlacementException
public Fragment getFragmentAtNewCoordinate(Coordinate coordinate) throws PortletPlacementException
PortletPlacementContext
getFragmentAtNewCoordinate
in interface PortletPlacementContext
coordinate
- the coordinate associated to a fragment.
PortletPlacementException
protected Fragment getFragmentAtCoordinate(Coordinate coordinate, boolean useOldCoordinateValues, boolean suppressExceptions) throws PortletPlacementException
PortletPlacementException
public Fragment getFragmentById(java.lang.String fragmentId) throws PortletPlacementException
PortletPlacementContext
getFragmentById
in interface PortletPlacementContext
fragmentId
- a string key for a fragment managed on this layout.
PortletPlacementException
public int getNumberColumns() throws PortletPlacementException
PortletPlacementContext
getNumberColumns
in interface PortletPlacementContext
PortletPlacementException
public int getNumberRows(int col) throws PortletPlacementException
PortletPlacementContext
getNumberRows
in interface PortletPlacementContext
col
- the column to retrieve the number of rows for
PortletPlacementException
public Coordinate add(Fragment fragment, Coordinate coordinate) throws PortletPlacementException
PortletPlacementContext
add
in interface PortletPlacementContext
fragment
- The Fragment to addcoordinate
- The coordinate where to place the new portlet
PortletPlacementException
public Coordinate moveAbsolute(Fragment fragment, Coordinate newCoordinate) throws PortletPlacementException
PortletPlacementContext
moveAbsolute
in interface PortletPlacementContext
fragment
- The fragment to be moved.newCoordinate
- The specification of the new absolute coordinate
PortletPlacementException
public Coordinate moveAbsolute(Fragment fragment, Coordinate newCoordinate, boolean okToAddFragment) throws PortletPlacementException
PortletPlacementContext
moveAbsolute
in interface PortletPlacementContext
fragment
- The fragment to be moved.newCoordinate
- The specification of the new absolute coordinateokToAddFragment
- When true, the fragment is being added (i.e. it is not being moved within the column)
PortletPlacementException
protected Coordinate moveDirection(Fragment fragment, int deltaCol, int deltaRow) throws PortletPlacementException
PortletPlacementException
public Coordinate moveDown(Fragment fragment) throws PortletPlacementException
PortletPlacementContext
moveDown
in interface PortletPlacementContext
fragment
- The fragment to be moved.
PortletPlacementException
public Coordinate moveUp(Fragment fragment) throws PortletPlacementException
PortletPlacementContext
moveUp
in interface PortletPlacementContext
fragment
- The fragment to be moved.
PortletPlacementException
public Coordinate moveLeft(Fragment fragment) throws PortletPlacementException
PortletPlacementContext
moveLeft
in interface PortletPlacementContext
fragment
- The fragment to be moved.
PortletPlacementException
public Coordinate moveRight(Fragment fragment) throws PortletPlacementException
PortletPlacementContext
moveRight
in interface PortletPlacementContext
fragment
- The fragment to be moved.
PortletPlacementException
public Coordinate remove(Fragment fragment) throws PortletPlacementException
PortletPlacementContext
remove
in interface PortletPlacementContext
PortletPlacementException
protected Fragment verifyFragmentAtExpectedCoordinate(int colIndex, int rowIndex, Fragment fragment, java.lang.String sourceDesc) throws PortletPlacementException
PortletPlacementException
public static int getColumnCountAndSizes(Fragment layoutFragment, PortletRegistry registry, java.util.Map fragSizes)
public static int getColumnCountAndSizes(Fragment layoutFragment, PortletRegistry registry, java.util.Map fragSizes, boolean suppressErrorLogging)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |