org.apache.jetspeed.om.page
Interface Fragment

All Superinterfaces:
BaseElement, Cloneable, SecuredResource, Serializable
All Known Subinterfaces:
ContentFragment

public interface Fragment
extends BaseElement, Cloneable, Serializable

A Fragment is the basic element handled by the aggregation engine to compose the final portal page. It represents a reserved screen area whose layout is managed by a specified component.

The component that is responsible for the layout policy of the fragment is defined by two properties:

In addition to specifying the component responsible for the layout, the fragment also stores contextual information used for rendering:

Finally the fragment also holds layout and rendering properties that may be used by a parent fragment to layout all its inner fragments in an appropriate fashion. These properties are always defined for a specific named component.

Version:
$Id: Fragment.java 188614 2005-05-25 01:30:38Z ate $

Field Summary
static String LAYOUT
          A fragment of type LAYOUT is a specific JSR 168 compliant portlet that knows how to layout a Page and depends on the Jetspeed layout service.
static String PORTLET
          A fragment of type PORTLET is considered to be a compliant portlet in the sense of the JSR 168.
 
Fields inherited from interface org.apache.jetspeed.om.common.SecuredResource
EDIT_ACTION, VIEW_ACTION
 
Method Summary
 void addProperty(Property p)
          Adds a new property to this fragment
 void clearProperties(String layoutName)
          Clear all the properties for a specific layout, if layoutName is null, clear all properties.
 Object clone()
          Creates a clone of this object
 String getDecorator()
          Returns the name of the decorator bound to this fragment
 List getFragments()
          Returns all fragments used in this node.
 List getLayoutProperties()
          Returns all layout names for which properties have been defined.
 String getName()
          Returns the administrative name of this fragment.
 List getProperties(String layoutName)
          Returns a list of all properties defined for the layoutName specified.
 String getPropertyValue(String layout, String propName)
           getPropertyValue
 String getSkin()
          Returns the name of the skin associated to this fragment
 String getState()
          Returns the display state of this fragment.
 String getType()
          Returns the type of the class bound to this fragment
 boolean isReference()
          Test if this fragment is actually a reference to an external fragment.
 void removeProperty(Property p)
          Removes a new property from this fragment
 void setDecorator(String decoratorName)
          Defines the decorator for this fragment.
 void setName(String name)
          Binds an administrative name to this fragment
 void setPropertyValue(String layout, String propName, String value)
           setPropertyValue
 void setSkin(String skinName)
          Defines the skin for this fragment.
 void setState(String state)
          Sets the display state of this fragment.
 void setType(String type)
          Binds a type to this fragment
 
Methods inherited from interface org.apache.jetspeed.om.page.BaseElement
getId, getShortTitle, getTitle, setId, setShortTitle, setTitle
 
Methods inherited from interface org.apache.jetspeed.om.common.SecuredResource
checkAccess, checkConstraints, checkPermissions, getConstraintsEnabled, getPermissionsEnabled, getSecurityConstraints, setSecurityConstraints
 

Field Detail

PORTLET

public static final String PORTLET
A fragment of type PORTLET is considered to be a compliant portlet in the sense of the JSR 168.

See Also:
Constant Field Values

LAYOUT

public static final String LAYOUT
A fragment of type LAYOUT is a specific JSR 168 compliant portlet that knows how to layout a Page and depends on the Jetspeed layout service.

See Also:
Constant Field Values
Method Detail

getName

public String getName()
Returns the administrative name of this fragment. This name should map to a component name in the component repository defined by the type attribute. If the name is not mapped to any component, the fragment is discarded from the rendering process, as well as any inner fragment.

Returns:
the administrative name

setName

public void setName(String name)
Binds an administrative name to this fragment

Parameters:
name - the administrative name

getType

public String getType()
Returns the type of the class bound to this fragment


setType

public void setType(String type)
Binds a type to this fragment

Parameters:
type - the type

getSkin

public String getSkin()
Returns the name of the skin associated to this fragment


setSkin

public void setSkin(String skinName)
Defines the skin for this fragment. This skin should be known by the portal.

Parameters:
skinName - the name of the new skin applied to this fragment

getDecorator

public String getDecorator()
Returns the name of the decorator bound to this fragment


setDecorator

public void setDecorator(String decoratorName)
Defines the decorator for this fragment. This decorator should be known by the portal.

Parameters:
decoratorName - the name of the decorator applied to this fragment

getState

public String getState()
Returns the display state of this fragment. This state may have the following values: "Normal","Minimized","Maximized","Hidden".


setState

public void setState(String state)
Sets the display state of this fragment. Valid states are: "Normal","Minimzed","Maximized","Hidden"


getFragments

public List getFragments()
Returns all fragments used in this node. This may be a page fragment or even directly a portlet fragment

Returns:
a collection containing Fragment objects

getLayoutProperties

public List getLayoutProperties()
Returns all layout names for which properties have been defined.

Returns:
a list of layout names Strings

getProperties

public List getProperties(String layoutName)
Returns a list of all properties defined for the layoutName specified. You can update the properties but not add or remove them

Returns:
an immutable List of Property objects

getPropertyValue

public String getPropertyValue(String layout,
                               String propName)

getPropertyValue

Parameters:
layout -
propName -
Returns:

setPropertyValue

public void setPropertyValue(String layout,
                             String propName,
                             String value)

setPropertyValue

Parameters:
layout -
propName -
value -

addProperty

public void addProperty(Property p)
Adds a new property to this fragment

Parameters:
p - the new Property to add

removeProperty

public void removeProperty(Property p)
Removes a new property from this fragment

Parameters:
p - the Property to remove

clearProperties

public void clearProperties(String layoutName)
Clear all the properties for a specific layout, if layoutName is null, clear all properties.

Parameters:
layoutName - the layout for which to remove the properties

isReference

public boolean isReference()
Test if this fragment is actually a reference to an external fragment.

Returns:
true is this element is a reference

clone

public Object clone()
             throws CloneNotSupportedException
Creates a clone of this object

Throws:
CloneNotSupportedException


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.