com.ibm.portal.content
Interface LayoutModel<E extends java.lang.Object & LayoutNode>

All Superinterfaces:
ActiveFlag, BookmarkableFlag, Identifiable, Invalidatable, InvalidatableTreeModel<E>, LocatorProvider<E>, SearchableTreeModel<E>, ShareableFlag, ThemeProvider, TimeStamped, TreeModel<E>, WireModelProvider
All Known Subinterfaces:
LayoutModelController<T,M>

public interface LayoutModel<E extends java.lang.Object & LayoutNode>
extends InvalidatableTreeModel<E>, SearchableTreeModel<E>, ActiveFlag, ShareableFlag, BookmarkableFlag, ThemeProvider, TimeStamped, Identifiable, WireModelProvider

This interface provides a tree model for the layout of a page. The nodes of the tree are objects implementing the LayoutNode interface. This model describes the layout of a page (row and column containers, LayoutContainer) and the content (controls representing portlets, LayoutControl).

Here is an example of how page layout information and page content is represented. The following figure depicts a page with three portlets. The surrounding vertical and horizontal containers define the layout while the controls hold the portlets that provide the actual content presented to the user:

On the right-hand side of the figure the resulting topology is shown that can be queried from the layout model belonging to this page. If this model would be rendered, this would be the result of the page information (navigation information, surrounding page output is left out of this figure):

The layout model is searchable; this means it provides a Locator. This allows to search elements of the model by ObjectID and unique name. This model may implement other locators as well, for example the ControlLocator.

The active flag meaning is identical to that of the corresponding ContentPage.

Page layers

The layout of a page may be composed not only of information originating from the page itself, but also from other existing pages. In this case, the layout is called "layered", since it is built from a list of layouts. The methods getAllowedPortlets(), getAllPortletsAllowedFlag(), getDeletableFlag(Object) and getModifiableFlag(Object) apply to the last layer of the layout model used (there is always at least one layer). Then there are the methods getAllAllowedPortlets(), isAllPortletsAllowed(), isDeletable(Object) and isModifiable(Object), which apply to all layers combined, i.e. these methods need to be used to get an absolute statement on whether all portlets can be placed into this layout and - if not - what the list of allowed portlets is, whether a node is deleteable and whether a node is modifiable in this layout model.

Since:
5.1.0.1
See Also:
LayoutNode

Method Summary
 ListModel<ObjectID> getAllAllowedPortlets()
          Returns a list of object IDs of portlet definitions that are allowed for this layout model.
 ListModel<ObjectID> getAllowedPortlets()
          Returns a list of object IDs of portlet definitions that are allowed for this layout model.
 boolean getAllPortletsAllowedFlag()
          Indicates whether all portlets are allowed for this layout model which may be part of a (explicit) derivation hierarchy.
 boolean getDeletableFlag(E aNode)
          Returns the deletable flag set for this node.
 boolean getModifiableFlag(E aNode)
          Returns the modifiable flag set for this node.
 ObjectID getObjectID()
          Returns the object ID of the ContentPage which was used to retrieve this layout model.
 Theme getTheme()
          Deprecated. use this method on the corresponding ContentPage
 boolean hasContainerChild(E aNode)
          Checks whether the given node has a container as a child.
 boolean hasControlChild(E aNode)
          Checks whether the given node has a control as a child.
 boolean isActive()
          Deprecated. use this method on the corresponding ContentPage
 boolean isAllPortletsAllowed()
          Indicates whether all portlets are allowed for this layout model.
 boolean isBookmarkable()
          Deprecated. use this method on the corresponding ContentPage, if implemented (optional)
 boolean isDeletable(E aNode)
          Indicates whether this node can be deleted or not.
 boolean isModifiable(E aNode)
          Indicates whether this node can be modified or not.
 boolean isShareable()
          Deprecated. use this method on the corresponding ContentPage, if implemented (optional)
 
Methods inherited from interface com.ibm.portal.Invalidatable
invalidate, invalidate
 
Methods inherited from interface com.ibm.portal.TreeModel
getChildren, getParent, getRoot, hasChildren
 
Methods inherited from interface com.ibm.portal.LocatorProvider
getLocator
 
Methods inherited from interface com.ibm.portal.TimeStamped
getCreated, getLastModified
 
Methods inherited from interface com.ibm.portal.wire.WireModelProvider
getWireModel
 

Method Detail

isDeletable

boolean isDeletable(E aNode)
Indicates whether this node can be deleted or not. The decision for this is not based on permission access control but on flags set for this node and possibly the node in the super layer (in case of derivation).

Parameters:
aNode - the node to check
Returns:
true if the node can be deleted, false otherwise

getDeletableFlag

boolean getDeletableFlag(E aNode)
Returns the deletable flag set for this node. This flag may differ from the result of invoking isDeletable.

Parameters:
aNode - the node whose deletable flag is to be returned

isModifiable

boolean isModifiable(E aNode)
Indicates whether this node can be modified or not. The decision for this is not based on permission access control but on flags set for this node and possibly the node in the super layer (in case of derivation).

Parameters:
aNode - the node to check
Returns:
true if the node can be modified, false otherwise

getModifiableFlag

boolean getModifiableFlag(E aNode)
Returns the modifiable flag set for this node. This flag may differ from the result of invoking isModifiable.

Parameters:
aNode - the node whose modifiable flag is to be returned

isAllPortletsAllowed

boolean isAllPortletsAllowed()
Indicates whether all portlets are allowed for this layout model. If this layout model has content from parents (i.e. it is explicitly derived), then the flag will take into account the flags of the parent. If any parent has the flag set to false, then this method will return false as well.

Returns:
true if all portlets are allowed, false otherwise. in that case getAllAllowedPortlets can be used to retrieve the actual list of permitted portlets.
See Also:
getAllPortletsAllowedFlag()

getAllPortletsAllowedFlag

boolean getAllPortletsAllowedFlag()
Indicates whether all portlets are allowed for this layout model which may be part of a (explicit) derivation hierarchy. The flag is only valid for this layer (i.e. no flag information from potential parents is used).

Returns:
true if all portlets are allowed, false otherwise. in that case getAllowedPortlets can be used to retrieve the actual list of permitted portlets.
See Also:
isAllPortletsAllowed()

getAllowedPortlets

ListModel<ObjectID> getAllowedPortlets()
                                       throws DataException
Returns a list of object IDs of portlet definitions that are allowed for this layout model. This list is valid for this model only and does not take into account information from potential derivation parents.

Returns:
a list model containing object IDs of allowed portlets for this layout model, never null.
Throws:
DataException - if an error occured while accessing the database
See Also:
getAllAllowedPortlets()

getAllAllowedPortlets

ListModel<ObjectID> getAllAllowedPortlets()
                                          throws DataException
Returns a list of object IDs of portlet definitions that are allowed for this layout model. If this model has parents in the derivation hierarchy, object IDs of portlets of all parents will also appear in this list.

Returns:
a list containing object IDs of allowed portlets for this layout model, never null.
Throws:
DataException - if an error occured while accessing the database
See Also:
getAllowedPortlets()

hasContainerChild

boolean hasContainerChild(E aNode)
Checks whether the given node has a container as a child.

Parameters:
aNode - the node to check
Returns:
true if any of the children of the given node is a LayoutContainer, false otherwise

hasControlChild

boolean hasControlChild(E aNode)
Checks whether the given node has a control as a child.

Parameters:
aNode - the node to check
Returns:
true if any of the children of the given node is a LayoutControl, false otherwise

getObjectID

ObjectID getObjectID()
Returns the object ID of the ContentPage which was used to retrieve this layout model.

Specified by:
getObjectID in interface Identifiable
Returns:
the object ID of the ContentPage which provides this layout model

isActive

boolean isActive()
                 throws ModelException
Deprecated. use this method on the corresponding ContentPage

Description copied from interface: ActiveFlag
Returns whether this resource is active or not.

Specified by:
isActive in interface ActiveFlag
Returns:
true if the resource is active, false otherwise
Throws:
ModelException - in case the flag cannot be retrieved.

isShareable

boolean isShareable()
Deprecated. use this method on the corresponding ContentPage, if implemented (optional)

Description copied from interface: ShareableFlag
Returns whether this page can be shared or not.

Specified by:
isShareable in interface ShareableFlag
Returns:
true if the page is shareable, false otherwise

isBookmarkable

boolean isBookmarkable()
Deprecated. use this method on the corresponding ContentPage, if implemented (optional)

Description copied from interface: BookmarkableFlag
Checks whether this resource can be bookmarked or not.

Specified by:
isBookmarkable in interface BookmarkableFlag
Returns:
true if the page is "bookmarkable", false otherwise

getTheme

Theme getTheme()
Deprecated. use this method on the corresponding ContentPage

Description copied from interface: ThemeProvider
Returns the theme associated with this element.

Specified by:
getTheme in interface ThemeProvider
Returns:
always null