org.apache.jetspeed.om.page
Interface ContentFragment


public interface ContentFragment

ContentFragment is a read-only version of the Fragment object for use in rendering. Fragment objects are persistent, single-instance metadata objects that should not be used to hold per-request content. ContentFragment solves this by providing a parallel interface that can be used for rendering requested content associated with the current user-request.

Author:
weaver@apache.org

Field Summary
static java.lang.String COLUMN_PROPERTY_NAME
          column standard layout property name
static java.lang.String DECORATOR_PROPERTY_NAME
          decorator standard layout property name
static java.lang.String GLOBAL_PROPERTY_SCOPE
          global standard property scope
static boolean GROUP_AND_ROLE_PROPERTY_SCOPES_ENABLED
          group and role standard property scopes enabled flag
static java.lang.String GROUP_PROPERTY_SCOPE
          group standard property scope
static java.lang.String HEIGHT_PROPERTY_NAME
          height standard layout property name
static java.lang.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 java.lang.String MODE_PROPERTY_NAME
          mode standard layout property name
static java.lang.String PAGE
          A fragment of type PAGE is a place holder for a page fragment.
static java.lang.String PORTLET
          A fragment of type PORTLET is considered to be a compliant portlet in the sense of the JSR 168.
static java.lang.String REFERENCE
          A fragment of type REFERENCE is a place holder for a fragment reference.
static java.lang.String ROLE_PROPERTY_SCOPE
          role standard property scope
static java.lang.String ROW_PROPERTY_NAME
          row standard layout property name
static java.lang.String SIZES_PROPERTY_NAME
          sizes standard layout property name
static java.lang.String SKIN_PROPERTY_NAME
          skin standard layout property name
static java.lang.String STATE_PROPERTY_NAME
          state standard layout property name
static java.lang.String USER_PROPERTY_SCOPE
          user standard property scope
static java.lang.String WIDTH_PROPERTY_NAME
          width standard layout property name
static java.lang.String X_PROPERTY_NAME
          x coordinate standard layout property name
static java.lang.String Y_PROPERTY_NAME
          y coordinate standard layout property name
static java.lang.String Z_PROPERTY_NAME
          z coordinate standard layout property name
 
Method Summary
 ContentFragment addPortlet(java.lang.String type, java.lang.String name)
          Add portlet to fragment returning associated content fragment.
 ContentFragment addPortlet(java.lang.String type, java.lang.String name, int row, int column)
          Add portlet to fragment with specified row and column returning associated content fragment.
 void checkAccess(java.lang.String actions)
          Check security access to fragment.
 Decoration getDecoration()
          Retrieves the actual org.apache.jetspeed.decoration.decorator object for this content fragment.
 java.lang.String getDecorator()
          Returns the name of the decorator bound to this fragment Property value is returned for the most specific scope found, (i.e.
 float getFloatProperty(java.lang.String propName)
          Get named property value as float.
 float getFloatProperty(java.lang.String propName, java.lang.String scope, java.lang.String scopeValue)
          Get named property value as float.
 java.lang.String getFragmentId()
          Returns the unique fragment id of this element.
 java.util.List getFragments()
          Provides a list of of child ContentFragment objects.
 java.lang.String getId()
          Returns the unique fully qualified id of this element.
 int getIntProperty(java.lang.String propName)
          Get named property value as integer.
 int getIntProperty(java.lang.String propName, java.lang.String scope, java.lang.String scopeValue)
          Get named property value as integer.
 int getLayoutColumn()
          Get layout column property.
 float getLayoutHeight()
          Get layout height property.
 int getLayoutRow()
          Get layout row property.
 java.lang.String getLayoutSizes()
          Get layout sizes property, (i.e.
 float getLayoutWidth()
          Get layout width property.
 float getLayoutX()
          Get layout x coordinate property.
 float getLayoutY()
          Get layout y coordinate property.
 float getLayoutZ()
          Get layout z coordinate property.
 java.lang.String getMode()
          Returns the display mode of this fragment.
 java.lang.String getName()
          Returns the administrative name of this fragment.
 java.lang.String getOverriddenContent()
           
 PageLayoutComponent getPageLayoutComponent()
          Returns the PageLayoutComponent that generated this ContentPage
 PortletContent getPortletContent()
          Retrieve the content for this fragment
 java.util.List getPreferences()
          Get read-only collection of fragment preference objects used to initialize user preferences
 java.util.List getProperties()
          Get read-only list of fragment property objects that initially returns the set of properties for all scopes.
 java.util.Map getPropertiesMap()
          Get named property value map.
 java.lang.String getProperty(java.lang.String propName)
          Get named property value.
 java.lang.String getProperty(java.lang.String propName, java.lang.String scope, java.lang.String scopeValue)
          Get named property value.
 java.lang.String getRefId()
          Returns the id of the referenced fragment element.
 java.lang.String getRenderedContent()
           getRenderedContent
 SecurityConstraints getSecurityConstraints()
          Get security constraints.
 java.lang.String getShortTitle()
          Returns the short title in the default Locale
 java.lang.String getSkin()
          Returns the name of the skin associated to this fragment Property value is returned for the most specific scope found, (i.e.
 java.lang.String getState()
          Returns the display state of this fragment.
 java.lang.String getTitle()
          Returns the title in the default Locale
 java.lang.String getType()
          Returns the type of the class bound to this fragment
 boolean isInstantlyRendered()
          Checks if the content is instantly rendered from JPT.
 boolean isLocked()
          Return is locked flag indicating whether this fragment was originally merged from a page template or fragment definition or is transient.
 boolean isTemplate()
          Return template flag indicating whether this fragment was originally merged from a page template
 SecurityConstraint newSecurityConstraint()
          Create new security constraint.
 SecurityConstraints newSecurityConstraints()
          Create new security constraints.
 void overrideRenderedContent(java.lang.String contnent)
           overrideRenderedContent
 void setDecoration(Decoration decoration)
           
 void setPortletContent(PortletContent portletContent)
           setPortletContent
 void updateDecorator(java.lang.String decoratorName)
          Update fragment portlet decorator.
 void updateDecorator(java.lang.String decoratorName, java.lang.String scope, java.lang.String scopeValue)
          Update fragment portlet decorator.
 void updateName(java.lang.String name)
          Update fragment name.
 void updatePosition(float x, float y, float z, float width, float height)
          Update fragment layout position.
 void updatePosition(float x, float y, float z, float width, float height, java.lang.String scope, java.lang.String scopeValue)
          Update fragment layout position.
 void updatePreferences(java.util.Map preferences)
          Update preferences with new preferences set, accepting Map of strings, string arrays, FragmentPreference or PortletPreference.
 void updateProperty(java.lang.String propName, java.lang.String propValue)
          Update fragment property.
 void updateProperty(java.lang.String propName, java.lang.String propValue, java.lang.String scope, java.lang.String scopeValue)
          Update fragment property.
 void updateRefId(java.lang.String refId)
          Update fragment reference reference id.
 void updateRowColumn(int row, int column)
          Update fragment row and column layout positions.
 void updateRowColumn(int row, int column, java.lang.String scope, java.lang.String scopeValue)
          Update fragment row and column layout positions.
 void updateSecurityConstraints(SecurityConstraints constraints)
          Update fragment security constraints.
 void updateStateMode(java.lang.String portletState, java.lang.String portletMode)
          Update fragment portlet state and/or mode.
 void updateStateMode(java.lang.String portletState, java.lang.String portletMode, java.lang.String scope, java.lang.String scopeValue)
          Update fragment portlet state and/or mode.
 

Field Detail

SKIN_PROPERTY_NAME

static final java.lang.String SKIN_PROPERTY_NAME
skin standard layout property name

See Also:
Constant Field Values

DECORATOR_PROPERTY_NAME

static final java.lang.String DECORATOR_PROPERTY_NAME
decorator standard layout property name

See Also:
Constant Field Values

STATE_PROPERTY_NAME

static final java.lang.String STATE_PROPERTY_NAME
state standard layout property name

See Also:
Constant Field Values

MODE_PROPERTY_NAME

static final java.lang.String MODE_PROPERTY_NAME
mode standard layout property name

See Also:
Constant Field Values

ROW_PROPERTY_NAME

static final java.lang.String ROW_PROPERTY_NAME
row standard layout property name

See Also:
Constant Field Values

COLUMN_PROPERTY_NAME

static final java.lang.String COLUMN_PROPERTY_NAME
column standard layout property name

See Also:
Constant Field Values

SIZES_PROPERTY_NAME

static final java.lang.String SIZES_PROPERTY_NAME
sizes standard layout property name

See Also:
Constant Field Values

X_PROPERTY_NAME

static final java.lang.String X_PROPERTY_NAME
x coordinate standard layout property name

See Also:
Constant Field Values

Y_PROPERTY_NAME

static final java.lang.String Y_PROPERTY_NAME
y coordinate standard layout property name

See Also:
Constant Field Values

Z_PROPERTY_NAME

static final java.lang.String Z_PROPERTY_NAME
z coordinate standard layout property name

See Also:
Constant Field Values

WIDTH_PROPERTY_NAME

static final java.lang.String WIDTH_PROPERTY_NAME
width standard layout property name

See Also:
Constant Field Values

HEIGHT_PROPERTY_NAME

static final java.lang.String HEIGHT_PROPERTY_NAME
height standard layout property name

See Also:
Constant Field Values

USER_PROPERTY_SCOPE

static final java.lang.String USER_PROPERTY_SCOPE
user standard property scope

See Also:
Constant Field Values

GROUP_PROPERTY_SCOPE

static final java.lang.String GROUP_PROPERTY_SCOPE
group standard property scope

See Also:
Constant Field Values

ROLE_PROPERTY_SCOPE

static final java.lang.String ROLE_PROPERTY_SCOPE
role standard property scope

See Also:
Constant Field Values

GLOBAL_PROPERTY_SCOPE

static final java.lang.String GLOBAL_PROPERTY_SCOPE
global standard property scope


GROUP_AND_ROLE_PROPERTY_SCOPES_ENABLED

static final boolean GROUP_AND_ROLE_PROPERTY_SCOPES_ENABLED
group and role standard property scopes enabled flag

See Also:
Constant Field Values

PORTLET

static final java.lang.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

static final java.lang.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

PAGE

static final java.lang.String PAGE
A fragment of type PAGE is a place holder for a page fragment.

See Also:
Constant Field Values

REFERENCE

static final java.lang.String REFERENCE
A fragment of type REFERENCE is a place holder for a fragment reference.

See Also:
Constant Field Values
Method Detail

getSecurityConstraints

SecurityConstraints getSecurityConstraints()
Get security constraints.

Returns:
security constraints for resource

newSecurityConstraints

SecurityConstraints newSecurityConstraints()
Create new security constraints.

Returns:
a newly created SecurityConstraints object

newSecurityConstraint

SecurityConstraint newSecurityConstraint()
Create new security constraint.

Returns:
a newly created SecurityConstraint object

checkAccess

void checkAccess(java.lang.String actions)
                 throws java.lang.SecurityException
Check security access to fragment.

Parameters:
actions - list to be checked against in CSV string form
Throws:
java.lang.SecurityException

getId

java.lang.String getId()
Returns the unique fully qualified id of this element. This id is guaranteed to be unique within the portal and is suitable to be used as a key.

Returns:
the unique fully qualified id of this element.

getTitle

java.lang.String getTitle()
Returns the title in the default Locale

Returns:
the page title

getShortTitle

java.lang.String getShortTitle()
Returns the short title in the default Locale

Returns:
the page short title

getSkin

java.lang.String getSkin()
Returns the name of the skin associated to this fragment Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).


getDecorator

java.lang.String getDecorator()
Returns the name of the decorator bound to this fragment Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).


getState

java.lang.String getState()
Returns the display state of this fragment. The state may have the following values: "Normal","Minimized","Maximized","Hidden" Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).


getMode

java.lang.String getMode()
Returns the display mode of this fragment. The mode may have the following values: "View","Edit","Help","Config","Print","Custom" Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).


getProperty

java.lang.String getProperty(java.lang.String propName)
Get named property value. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Parameters:
propName - property name
Returns:
value

getProperty

java.lang.String getProperty(java.lang.String propName,
                             java.lang.String scope,
                             java.lang.String scopeValue)
Get named property value.

Parameters:
propName - property name
scope - the name of the property scope to retrieve
scopeValue - the scope discriminator value, (unless scope is GLOBAL or USER where the default user name is used if null)
Returns:
value

getIntProperty

int getIntProperty(java.lang.String propName)
Get named property value as integer. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Parameters:
propName - property name
Returns:
int value

getIntProperty

int getIntProperty(java.lang.String propName,
                   java.lang.String scope,
                   java.lang.String scopeValue)
Get named property value as integer.

Parameters:
propName - property name
scope - the name of the property scope to retrieve
scopeValue - the scope discriminator value, (unless scope is GLOBAL or USER where the default user name is used if null)
Returns:
int value

getFloatProperty

float getFloatProperty(java.lang.String propName)
Get named property value as float. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Parameters:
propName - property name
Returns:
float value

getFloatProperty

float getFloatProperty(java.lang.String propName,
                       java.lang.String scope,
                       java.lang.String scopeValue)
Get named property value as float.

Parameters:
propName - property name
scope - the name of the property scope to retrieve
scopeValue - the scope discriminator value, (unless scope is GLOBAL or USER where the default user name is used if null)
Returns:
float value

getProperties

java.util.List getProperties()
Get read-only list of fragment property objects that initially returns the set of properties for all scopes.

Returns:
list of FragmentProperty instances

getPropertiesMap

java.util.Map getPropertiesMap()
Get named property value map. Property values are returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
map of fragment property values

getLayoutRow

int getLayoutRow()
Get layout row property. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
row layout property

getLayoutColumn

int getLayoutColumn()
Get layout column property. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
column layout property

getLayoutSizes

java.lang.String getLayoutSizes()
Get layout sizes property, (i.e. "25%,75%"). Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
sizes layout property

getLayoutX

float getLayoutX()
Get layout x coordinate property. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
the x coordinate value

getLayoutY

float getLayoutY()
Get layout y coordinate property. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
the y coordinate value

getLayoutZ

float getLayoutZ()
Get layout z coordinate property. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
the z coordinate value

getLayoutWidth

float getLayoutWidth()
Get layout width property. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
the width value

getLayoutHeight

float getLayoutHeight()
Get layout height property. Property value is returned for the most specific scope found, (i.e. user, group, role, or global scopes).

Returns:
the height value

getPreferences

java.util.List getPreferences()
Get read-only collection of fragment preference objects used to initialize user preferences

Returns:
list of FragmentPreference objects

getName

java.lang.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

getType

java.lang.String getType()
Returns the type of the class bound to this fragment


getFragments

java.util.List getFragments()
Provides a list of of child ContentFragment objects.

Returns:
ContentFragment list

getRefId

java.lang.String getRefId()
Returns the id of the referenced fragment element.

Returns:
the referenced fragment id.

getFragmentId

java.lang.String getFragmentId()
Returns the unique fragment id of this element. This id is guaranteed to be unique per fragment within the portal and is suitable to be used as a key. Note that multiple content fragments can have the same fragment id since a single fragment may be rendered multiple times within a page.

Returns:
the unique fragment id of this element.

getRenderedContent

java.lang.String getRenderedContent()
                                    throws java.lang.IllegalStateException

getRenderedContent

Returns the raw,undecorated content of this fragment. If overridenContent has been set and portlet content has not, overridden content should be returned.

Returns:
The raw,undecorated content of this fragment.
Throws:
java.lang.IllegalStateException - if the content has not yet been set.

overrideRenderedContent

void overrideRenderedContent(java.lang.String contnent)

overrideRenderedContent

Can be used to store errors that may have occurred during the rendering process.

Parameters:
contnent -

getOverriddenContent

java.lang.String getOverriddenContent()
Returns:
the overridden content set by overrideRenderedContent

setPortletContent

void setPortletContent(PortletContent portletContent)

setPortletContent

Parameters:
portletContent -

getPortletContent

PortletContent getPortletContent()
Retrieve the content for this fragment

Returns:
PortletContent

getDecoration

Decoration getDecoration()
Retrieves the actual org.apache.jetspeed.decoration.decorator object for this content fragment. TODO: Re-evaluate the naming as this is somewhat confusing due to the existence of Fragment.getDecorator()

Returns:

setDecoration

void setDecoration(Decoration decoration)
Parameters:
decoration -

isInstantlyRendered

boolean isInstantlyRendered()
Checks if the content is instantly rendered from JPT.


getPageLayoutComponent

PageLayoutComponent getPageLayoutComponent()
Returns the PageLayoutComponent that generated this ContentPage

Returns:
PageLayoutComponent instance.

isTemplate

boolean isTemplate()
Return template flag indicating whether this fragment was originally merged from a page template

Returns:
template flag

isLocked

boolean isLocked()
Return is locked flag indicating whether this fragment was originally merged from a page template or fragment definition or is transient.

Returns:
locked flag

addPortlet

ContentFragment addPortlet(java.lang.String type,
                           java.lang.String name,
                           int row,
                           int column)
Add portlet to fragment with specified row and column returning associated content fragment. The default, (Global), scope row and column values are set.

Parameters:
type - portlet type
name - portlet name
row - fragment row position
column - fragment column position
Returns:
new content fragment added to fragment

addPortlet

ContentFragment addPortlet(java.lang.String type,
                           java.lang.String name)
Add portlet to fragment returning associated content fragment.

Parameters:
type - portlet type
name - portlet name
Returns:
new content fragment added to fragment

updateDecorator

void updateDecorator(java.lang.String decoratorName)
Update fragment portlet decorator. The default, (Global), scope value is updated.

Parameters:
decoratorName - portlet decorator name

updateDecorator

void updateDecorator(java.lang.String decoratorName,
                     java.lang.String scope,
                     java.lang.String scopeValue)
Update fragment portlet decorator.

Parameters:
decoratorName - portlet decorator name
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)

updateName

void updateName(java.lang.String name)
Update fragment name.

Parameters:
name - fragment name

updatePosition

void updatePosition(float x,
                    float y,
                    float z,
                    float width,
                    float height)
Update fragment layout position. The default, (Global), scope values are updated.

Parameters:
x - fragment X coordinate or -1
y - fragment Y coordinate or -1
z - fragment Z level or -1
width - fragment portlet width or -1
height - fragment portlet height or -1

updatePosition

void updatePosition(float x,
                    float y,
                    float z,
                    float width,
                    float height,
                    java.lang.String scope,
                    java.lang.String scopeValue)
Update fragment layout position.

Parameters:
x - fragment X coordinate or -1
y - fragment Y coordinate or -1
z - fragment Z level or -1
width - fragment portlet width or -1
height - fragment portlet height or -1
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)

updatePreferences

void updatePreferences(java.util.Map preferences)
Update preferences with new preferences set, accepting Map of strings, string arrays, FragmentPreference or PortletPreference. Existing preferences are removed and replaced with the specified preferences.

Parameters:
preferences - map of new preferences set.

updateProperty

void updateProperty(java.lang.String propName,
                    java.lang.String propValue)
Update fragment property. The default, (Global), scope value is updated.

Parameters:
propName - fragment property name
propValue - fragment property value

updateProperty

void updateProperty(java.lang.String propName,
                    java.lang.String propValue,
                    java.lang.String scope,
                    java.lang.String scopeValue)
Update fragment property.

Parameters:
propName - fragment property name
propValue - fragment property value
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)

updateRefId

void updateRefId(java.lang.String refId)
Update fragment reference reference id.

Parameters:
refId - referenced fragment definition id

updateRowColumn

void updateRowColumn(int row,
                     int column)
Update fragment row and column layout positions. The default, (Global), scope values are updated.

Parameters:
row - fragment row position
column - fragment column position

updateRowColumn

void updateRowColumn(int row,
                     int column,
                     java.lang.String scope,
                     java.lang.String scopeValue)
Update fragment row and column layout positions.

Parameters:
row - fragment row position
column - fragment column position
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)

updateSecurityConstraints

void updateSecurityConstraints(SecurityConstraints constraints)
Update fragment security constraints.

Parameters:
constraints - security constraints for resource

updateStateMode

void updateStateMode(java.lang.String portletState,
                     java.lang.String portletMode)
Update fragment portlet state and/or mode. The default, (Global), scope values are updated.

Parameters:
portletState - fragment portlet state or null
portletMode - fragment portlet mode or null

updateStateMode

void updateStateMode(java.lang.String portletState,
                     java.lang.String portletMode,
                     java.lang.String scope,
                     java.lang.String scopeValue)
Update fragment portlet state and/or mode.

Parameters:
portletState - fragment portlet state or null
portletMode - fragment portlet mode or null
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)


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