|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.portal.portlets.AbstractPortlet org.apache.jetspeed.portal.controls.AbstractPortletControl
The PortletControl acts both as a decoration around a Portlet or PortletSet and also as the window manager for the enclosed Portlet(Set). As such it controls the operation that may be performed on this portlet and whether the portlet content should be displayed or not. PortletControl also delegates all Portlet and PortletSet methods to its inner object and can thus be transparently cascaded or substituted to a simple portlet wherever in a PSML object tree.
Nested Class Summary |
Nested classes inherited from class org.apache.jetspeed.portal.PortletSet |
PortletSet.Constraints |
Field Summary | |
static java.lang.String |
BACKGROUND_COLOR
|
static java.lang.String |
COLOR
|
static java.lang.String |
TITLE_COLOR
|
static java.lang.String |
WIDTH
|
Fields inherited from class org.apache.jetspeed.portal.portlets.AbstractPortlet |
content |
Fields inherited from interface org.apache.jetspeed.portal.Portlet |
PORTLET_MAXIMIZED, PORTLET_MINIMIZED, PORTLET_NORMAL |
Constructor Summary | |
AbstractPortletControl()
|
Method Summary | |
void |
addPortlet(Portlet portlet)
Adds a portlet to the inner portletSet |
void |
addPortlet(Portlet portlet,
int position)
Adds a portlet to the inner portletSet at the explicit position |
void |
addPortlet(Portlet portlet,
PortletSet.Constraints constraints)
Adds a portlet to the inner portletSet within the given constraints |
void |
addPortlet(Portlet portlet,
PortletSet.Constraints constraint,
int position)
Adds a portlet to the inner portletSet within the given constraints at the specific position |
boolean |
allowClose(org.apache.turbine.util.RunData rundata)
Implements the default close behavior: any authenticated user may remove a portlet from his page |
boolean |
allowCustomize(org.apache.turbine.util.RunData rundata)
Implements the default customize behavior: any authenticated user may customize a portlet |
boolean |
allowInfo(org.apache.turbine.util.RunData rundata)
Implements the default info behavior: any authenticated user may get information on a portlet |
boolean |
allowMaximize(org.apache.turbine.util.RunData rundata)
Implements the default maximize behavior: any authenticated user may maximize a portlet |
boolean |
allowMinimize(org.apache.turbine.util.RunData rundata)
Implements the default info behavior: any authenticated user may minimize a portlet |
boolean |
allowPrintFriendly(org.apache.turbine.util.RunData rundata)
Implements the default info behavior: any authenticated user may display portlet in print friendly format |
java.lang.String |
getBackgroundColor()
Deprecated. |
java.lang.String |
getColor()
Deprecated. |
PortletControlConfig |
getConfig()
|
org.apache.ecs.ConcreteElement |
getContent(org.apache.turbine.util.RunData rundata)
Returns the content of inner portlet |
PortletController |
getController()
Return the current controller for this set |
java.lang.String |
getDescription()
Returns a description of this portlet. |
java.lang.String |
getID()
Retrieve a unique portlet id |
java.lang.String |
getName()
Returns a name for this portlet. |
Portlet |
getPortlet()
Retrieves the portlet managed by this control |
Portlet |
getPortletAt(int pos)
Returns the Portlet at the given position if the control manages a PortletSet, else the inner portlet if the queried position is 0 |
Portlet |
getPortletByID(java.lang.String id)
Returns the Portlet with the given id |
Portlet |
getPortletByName(java.lang.String name)
Returns the Portlet with the given name |
PortletConfig |
getPortletConfig()
Get the config of this servlet. |
java.util.Enumeration |
getPortlets()
Returns the elements contained within the inner PortletSet or the inner portlet |
java.lang.String |
getTitle()
Allows a Portlet to define its title. |
java.lang.String |
getTitleColor()
Deprecated. |
java.lang.String |
getWidth()
Deprecated. |
void |
init()
Inits the inner portlet |
void |
init(Portlet portlet)
Initializes the control and associates it with a portlet |
boolean |
isClosed(org.apache.turbine.util.RunData rundata)
Returns true if this portlet is currently closed |
boolean |
isMinimized(org.apache.turbine.util.RunData rundata)
Returns true if this portlet is currently minimized |
void |
setBackgroundColor(java.lang.String backgroundColor)
Deprecated. |
void |
setClosed(boolean close,
org.apache.turbine.util.RunData rundata)
Toggles the portlet state between closed and normal |
void |
setColor(java.lang.String color)
Deprecated. |
void |
setConfig(PortletControlConfig conf)
Sets the PortletControl specific configuration |
void |
setController(PortletController controller)
Sets the controller for the inner PortletSet. |
void |
setDescription(java.lang.String description)
Set the description for the inner portlet |
void |
setID(java.lang.String id)
|
void |
setMinimized(boolean minimize,
org.apache.turbine.util.RunData rundata)
Change the portlet visibility state ( minimized <-> normal ) |
void |
setName(java.lang.String name)
Updates the managed portlet name |
void |
setPortlet(Portlet portlet)
Sets the portlet to be managed by this control |
void |
setPortletConfig(PortletConfig portletConfig)
Updates the managed portlet config object |
void |
setTitle(java.lang.String title)
Set the title for the inner portlet |
void |
setTitleColor(java.lang.String titleColor)
Deprecated. |
void |
setWidth(int width)
Deprecated. |
void |
setWidth(java.lang.String width)
Deprecated. |
int |
size()
Returns the number of portlets currently stored in this set |
boolean |
supportsType(MimeType mimeType)
Returns true portlet is able to output content for given mimetype |
Portlet[] |
toArray()
Returns the portlet set as an array. |
Methods inherited from class org.apache.jetspeed.portal.portlets.AbstractPortlet |
allowView, clearContent, getAllowEdit, getAllowMaximize, getAllowView, getAttribute, getContent, getContent, getCreationTime, getDescription, getExpirationMillis, getExpire, getHandle, getHandle, getImage, getImage, getInstance, getTitle, isCacheable, isShowTitleBar, providesCustomization, refresh, setAttribute, setCacheable, setCachedObject, setContent, setContent, setContent, setCreationTime, setExpirationMillis, setHandle, setImage, setTitle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jetspeed.portal.Portlet |
getAllowEdit, getAllowMaximize, getAllowView, getAttribute, getCreationTime, getDescription, getImage, getInstance, getTitle, isShowTitleBar, providesCustomization, setAttribute, setCreationTime, setImage, setTitle |
Field Detail |
public static final java.lang.String COLOR
public static final java.lang.String BACKGROUND_COLOR
public static final java.lang.String TITLE_COLOR
public static final java.lang.String WIDTH
Constructor Detail |
public AbstractPortletControl()
Method Detail |
public PortletControlConfig getConfig()
getConfig
in interface PortletControl
public void setConfig(PortletControlConfig conf)
setConfig
in interface PortletControl
conf
- the new PortletControl configurationpublic void setPortlet(Portlet portlet)
setPortlet
in interface PortletControl
portlet
- the new portlet to be managed by the controlpublic Portlet getPortlet()
getPortlet
in interface PortletControl
public void init(Portlet portlet)
init
in interface PortletControl
portlet
- the portlet to be managed by this controlpublic java.lang.String getColor()
getColor
in interface PortletControl
public void setColor(java.lang.String color)
setColor
in interface PortletControl
color
- the text color value in HTML format (#RRGGBB)public java.lang.String getBackgroundColor()
getBackgroundColor
in interface PortletControl
public void setBackgroundColor(java.lang.String backgroundColor)
setBackgroundColor
in interface PortletControl
backgroundColor
- the background color value in HTML format (#RRGGBB)public java.lang.String getTitleColor()
getTitleColor
in interface PortletControl
public void setTitleColor(java.lang.String titleColor)
setTitleColor
in interface PortletControl
titleColor
- the title color value in HTML format (#RRGGBB)public java.lang.String getWidth()
getWidth
in interface PortletControl
public void setWidth(int width)
setWidth
in interface PortletControl
width
- the width of portlet. Must be a positive, non nul integerpublic void setWidth(java.lang.String width)
setWidth
in interface PortletControl
width
- the width of portlet. Must be parseable as a positive, non
nul integer or a percentagepublic PortletConfig getPortletConfig()
Portlet
getPortletConfig
in interface Portlet
getPortletConfig
in class AbstractPortlet
public void setPortletConfig(PortletConfig portletConfig)
setPortletConfig
in interface Portlet
setPortletConfig
in class AbstractPortlet
portletConfig
- the new portet config objectpublic java.lang.String getName()
Portlet
getName
in interface Portlet
getName
in class AbstractPortlet
public void setName(java.lang.String name)
setName
in interface Portlet
setName
in class AbstractPortlet
name
- the new portet namepublic java.lang.String getTitle()
Portlet
Allows a Portlet to define its title. This can be used by a PortletControl for rendering its content.
In order to define a default title you should not override this but should call setTitle() within your init() method
This should return null if not specified.
getTitle
in interface Portlet
getTitle
in class AbstractPortlet
public void setTitle(java.lang.String title)
setTitle
in interface Portlet
setTitle
in class AbstractPortlet
title
- the new portlet titlepublic java.lang.String getDescription()
Portlet
Returns a description of this portlet. This should describe what the capabilities of the portlet and how it can help the user.
In order to define a default title you should not override (in the AbstractPortlet implementation) this but should call setDescription() within your init() method
This should return null if not specified.
getDescription
in interface Portlet
getDescription
in class AbstractPortlet
public void setDescription(java.lang.String description)
setDescription
in interface Portlet
setDescription
in class AbstractPortlet
description
- the new portlet descriptionpublic void init() throws PortletException
init
in interface Portlet
init
in class AbstractPortlet
PortletException
public org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData rundata)
getContent
in interface Portlet
getContent
in class AbstractPortlet
rundata
- the RunData for the requestpublic boolean supportsType(MimeType mimeType)
Portlet
supportsType
in interface Portlet
supportsType
in class AbstractPortlet
Portlet.supportsType(org.apache.jetspeed.util.MimeType)
public int size()
PortletSet
size
in interface PortletSet
public Portlet[] toArray()
PortletSet
toArray
in interface PortletSet
public Portlet getPortletAt(int pos)
getPortletAt
in interface PortletSet
pos
- the queried position. Must be strictly smaller than the
value of size()
public java.util.Enumeration getPortlets()
getPortlets
in interface PortletSet
public void addPortlet(Portlet portlet)
addPortlet
in interface PortletSet
portlet
- the portlet to addpublic void addPortlet(Portlet portlet, int position)
addPortlet
in interface PortletSet
portlet
- the portlet to addposition
- the position of the new portletpublic void addPortlet(Portlet portlet, PortletSet.Constraints constraints)
addPortlet
in interface PortletSet
portlet
- the portlet to addconstraints
- the portlet layout constraintspublic void addPortlet(Portlet portlet, PortletSet.Constraints constraint, int position)
addPortlet
in interface PortletSet
portlet
- the portlet to addconstraint
- the portlet layout constraintsposition
- the portlet required positionpublic PortletController getController()
PortletSet
getController
in interface PortletSet
public void setController(PortletController controller)
setController
in interface PortletSet
public boolean allowClose(org.apache.turbine.util.RunData rundata)
allowClose
in interface PortletState
allowClose
in class AbstractPortlet
rundata
- the RunData object for the current requestpublic boolean isClosed(org.apache.turbine.util.RunData rundata)
isClosed
in interface PortletState
isClosed
in class AbstractPortlet
rundata
- The RunData object for the current requestpublic void setClosed(boolean close, org.apache.turbine.util.RunData rundata)
setClosed
in interface PortletState
setClosed
in class AbstractPortlet
rundata
- The RunData object for the current requestpublic boolean allowInfo(org.apache.turbine.util.RunData rundata)
allowInfo
in interface PortletState
allowInfo
in class AbstractPortlet
rundata
- the RunData object for the current requestpublic boolean allowCustomize(org.apache.turbine.util.RunData rundata)
allowCustomize
in interface PortletState
allowCustomize
in class AbstractPortlet
rundata
- the RunData object for the current requestpublic boolean allowMaximize(org.apache.turbine.util.RunData rundata)
allowMaximize
in interface PortletState
allowMaximize
in class AbstractPortlet
rundata
- the RunData object for the current requestpublic boolean allowMinimize(org.apache.turbine.util.RunData rundata)
allowMinimize
in interface PortletState
allowMinimize
in class AbstractPortlet
rundata
- the RunData object for the current requestpublic boolean allowPrintFriendly(org.apache.turbine.util.RunData rundata)
allowPrintFriendly
in interface PortletState
allowPrintFriendly
in class AbstractPortlet
rundata
- the RunData object for the current requestpublic boolean isMinimized(org.apache.turbine.util.RunData rundata)
isMinimized
in interface PortletState
isMinimized
in class AbstractPortlet
rundata
- The RunData object for the current requestpublic void setMinimized(boolean minimize, org.apache.turbine.util.RunData rundata)
setMinimized
in interface PortletState
setMinimized
in class AbstractPortlet
minimize
- True if the portlet change to minimizedrundata
- A RunData objectpublic java.lang.String getID()
Portlet
getID
in interface Portlet
getID
in class AbstractPortlet
public void setID(java.lang.String id)
setID
in interface Portlet
setID
in class AbstractPortlet
public Portlet getPortletByID(java.lang.String id)
getPortletByID
in interface PortletSet
public Portlet getPortletByName(java.lang.String name)
getPortletByName
in interface PortletSet
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |