Class Portlet
- java.lang.Object
-
- fr.paris.lutece.portal.business.portlet.Portlet
-
- All Implemented Interfaces:
XmlContent
- Direct Known Subclasses:
AliasPortlet,PortletHtmlContent,PortletImpl
public abstract class Portlet extends Object implements XmlContent
This class represents business objects Portlet. It is the base class of all portlets. It is abstract and the implementation of the interface XmlContent is compulsory.
-
-
Field Summary
Fields Modifier and Type Field Description static intFLAG_DISPLAY_ON_LARGE_DEVICEstatic intFLAG_DISPLAY_ON_NORMAL_DEVICEstatic intFLAG_DISPLAY_ON_SMALL_DEVICEstatic intFLAG_DISPLAY_ON_XLARGE_DEVICEstatic intSTATUS_PUBLISHEDstatic intSTATUS_UNPUBLISHED-
Fields inherited from interface fr.paris.lutece.portal.business.XmlContent
TAG_CHILD_PAGES_LIST, TAG_CURRENT_PAGE_ID, TAG_DISPLAY_ON_LARGE_DEVICE, TAG_DISPLAY_ON_NORMAL_DEVICE, TAG_DISPLAY_ON_SMALL_DEVICE, TAG_DISPLAY_ON_XLARGE_DEVICE, TAG_DISPLAY_PORTLET_TITLE, TAG_MENU, TAG_MENU_INDEX, TAG_MENU_LIST, TAG_MODE, TAG_PAGE, TAG_PAGE_DESCRIPTION, TAG_PAGE_ID, TAG_PAGE_IMAGE, TAG_PAGE_LEVEL, TAG_PAGE_NAME, TAG_PARENT_PAGE_ID, TAG_PLUGIN_NAME, TAG_PORTLET, TAG_PORTLET_ID, TAG_PORTLET_NAME, TAG_SUBLEVEL_INDEX, TAG_SUBLEVEL_MENU, TAG_SUBLEVEL_MENU_LIST
-
-
Constructor Summary
Constructors Constructor Description Portlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanBeCachedForAnonymousUsers()Check if the content of the portlet can be put in cache if the current user is not authenticated.booleancanBeCachedForConnectedUsers()Check if the content of the portlet can be put in cache if the current user is authenticated.voidcopy(Portlet portlet)This method copies the fields of the portlet specified in this portlet.intgetAcceptAlias()Indicates if this portlet can be modified after its creation or not.intgetColumn()Return the number of the column of this portlet in the pageTimestampgetDateUpdate()Returns the date of update of this portletintgetDeviceDisplayFlags()Gets device display flagsintgetDisplayPortletTitle()Indicates if this portlet can be modified have a title or not.StringgetHomeClassName()Returns the name of the java class which manages this type of portlet.StringgetHtmlContent(javax.servlet.http.HttpServletRequest request)Get the HTML content of the portlet.intgetId()Returns the identifier of this portlet.StringgetName()Returns the name of this portletintgetOrder()Returns the order of this portlet in the page which contains it.intgetPageId()Returns the page identifier associated to this portletStringgetPluginName()Get the plugin NameStringgetPortletTypeId()Returns the identifier of the portlet type of this portlet which caracterizes the portlet.StringgetPortletTypeName()Returns the portlet type name of this portletStringgetRole()Gets the portlet's roleintgetStatus()Returns the identifier of this portlet.intgetStyleId()Returns the style identifier of this portletStringgetUrlCreation()Returns the url of the program which manages the creation of a portletStringgetUrlUpdate()Returns the url of the program which manages the update of a portletStringgetXslFile(int nMode)Recovers the stylesheet of the portlet according to the modeMap<String,String>getXslParams()Recovers the parameters to use with the stylesheet at the time of the transformation.
By default, portlets do not return any parameterbyte[]getXslSource(int nMode)Recovers the stylesheet of the portlet according to the modebooleanhasDeviceDisplayFlag(int nFlag)Check if a flag is settedbooleanisContentGeneratedByXmlAndXsl()Check if the content of this portlet is generated by xml and xsl, or if it manage its own content generationabstract voidremove()Remove the portlet.voidsetAcceptAlias(int nAcceptAlias)Sets the flag which indicates that this portlet can be updated or not.voidsetColumn(int nColumn)Sets the number of the column of this portlet in its page with the specified int.voidsetDateUpdate(Timestamp dateUpdate)Sets the date of update of this portlet with the specified date.voidsetDeviceDisplayFlags(int nFlags)Set device display flagsvoidsetDisplayPortletTitle(int nDisplayPortletTitle)Sets the flag which indicates that this portlet can be have a title or not.voidsetHomeClassName(String strHomeClassName)Sets the name of the java class which manages this type of portlet with the specified string.voidsetId(int nId)Sets the identifier of the portlet to the specified int.voidsetName(String strName)Sets the name of this portlet to the specified string.voidsetOrder(int nType)Sets the order of this portlet in its page with the specified int.voidsetPageId(int nPageId)Sets the identifier of the portlet style with the specified int.voidsetPluginName(String strPluginName)Sets the flag which indicates that this portlet can be updated or not.voidsetPortletTypeId(String strPortletTypeId)Sets the identifier of the portlet type to the specified int.voidsetPortletTypeName(String strPortletTypeName)Sets the name of this portlet type with the specified string.voidsetRole(String strRole)Sets the portlet's rolevoidsetStatus(int nStatus)Sets the identifier of the portlet to the specified int.voidsetStyleId(int nStyleId)Sets the identifier of the portlet style with the specified int.voidsetUrlCreation(String strUrlCreation)Sets the url of the program which creates this portletvoidsetUrlUpdate(String strUrlUpdate)Sets the url of the program which updates this portlet-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.paris.lutece.portal.business.XmlContent
getXml, getXmlDocument
-
-
-
-
Field Detail
-
STATUS_PUBLISHED
public static final int STATUS_PUBLISHED
- See Also:
- Constant Field Values
-
STATUS_UNPUBLISHED
public static final int STATUS_UNPUBLISHED
- See Also:
- Constant Field Values
-
FLAG_DISPLAY_ON_SMALL_DEVICE
public static final int FLAG_DISPLAY_ON_SMALL_DEVICE
- See Also:
- Constant Field Values
-
FLAG_DISPLAY_ON_NORMAL_DEVICE
public static final int FLAG_DISPLAY_ON_NORMAL_DEVICE
- See Also:
- Constant Field Values
-
FLAG_DISPLAY_ON_LARGE_DEVICE
public static final int FLAG_DISPLAY_ON_LARGE_DEVICE
- See Also:
- Constant Field Values
-
FLAG_DISPLAY_ON_XLARGE_DEVICE
public static final int FLAG_DISPLAY_ON_XLARGE_DEVICE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public int getId()
Returns the identifier of this portlet.- Returns:
- the portlet identifier
-
setId
public void setId(int nId)
Sets the identifier of the portlet to the specified int.- Parameters:
nId- the new identifier
-
getStyleId
public int getStyleId()
Returns the style identifier of this portlet- Returns:
- the style identifier
-
setStyleId
public void setStyleId(int nStyleId)
Sets the identifier of the portlet style with the specified int.- Parameters:
nStyleId- the new style identifier
-
getPageId
public int getPageId()
Returns the page identifier associated to this portlet- Returns:
- the page identifier
-
setPageId
public void setPageId(int nPageId)
Sets the identifier of the portlet style with the specified int.- Parameters:
nPageId- The identifier of the page
-
getStatus
public int getStatus()
Returns the identifier of this portlet.- Returns:
- the portlet identifier
-
setStatus
public void setStatus(int nStatus)
Sets the identifier of the portlet to the specified int.- Parameters:
nStatus- the new status
-
getName
public String getName()
Returns the name of this portlet- Returns:
- the portlet name
-
setName
public void setName(String strName)
Sets the name of this portlet to the specified string.- Parameters:
strName- the new name
-
getPortletTypeId
public String getPortletTypeId()
Returns the identifier of the portlet type of this portlet which caracterizes the portlet.- Returns:
- the portlet type identifier
-
setPortletTypeId
public void setPortletTypeId(String strPortletTypeId)
Sets the identifier of the portlet type to the specified int.- Parameters:
strPortletTypeId- the portlet type identifier
-
getPortletTypeName
public String getPortletTypeName()
Returns the portlet type name of this portlet- Returns:
- the portlet type name
-
setPortletTypeName
public void setPortletTypeName(String strPortletTypeName)
Sets the name of this portlet type with the specified string.- Parameters:
strPortletTypeName- the new portlet type name
-
getUrlCreation
public String getUrlCreation()
Returns the url of the program which manages the creation of a portlet- Returns:
- the url of the creation
-
setUrlCreation
public void setUrlCreation(String strUrlCreation)
Sets the url of the program which creates this portlet- Parameters:
strUrlCreation- The url of creation
-
getUrlUpdate
public String getUrlUpdate()
Returns the url of the program which manages the update of a portlet- Returns:
- the url of the program as a String
-
setUrlUpdate
public void setUrlUpdate(String strUrlUpdate)
Sets the url of the program which updates this portlet- Parameters:
strUrlUpdate- The url of update
-
getDateUpdate
public Timestamp getDateUpdate()
Returns the date of update of this portlet- Returns:
- the update date
-
setDateUpdate
public void setDateUpdate(Timestamp dateUpdate)
Sets the date of update of this portlet with the specified date.- Parameters:
dateUpdate- the new date
-
getColumn
public int getColumn()
Return the number of the column of this portlet in the page- Returns:
- the number of the column
-
setColumn
public void setColumn(int nColumn)
Sets the number of the column of this portlet in its page with the specified int.- Parameters:
nColumn- the new number of column
-
getOrder
public int getOrder()
Returns the order of this portlet in the page which contains it.- Returns:
- the order
-
setOrder
public void setOrder(int nType)
Sets the order of this portlet in its page with the specified int.- Parameters:
nType- the new order
-
getDeviceDisplayFlags
public int getDeviceDisplayFlags()
Gets device display flags- Returns:
- Flags
-
hasDeviceDisplayFlag
public boolean hasDeviceDisplayFlag(int nFlag)
Check if a flag is setted- Parameters:
nFlag- The flag to check- Returns:
- true if the flag is set, otherwise false
-
setDeviceDisplayFlags
public void setDeviceDisplayFlags(int nFlags)
Set device display flags- Parameters:
nFlags- Flags
-
getHomeClassName
public String getHomeClassName()
Returns the name of the java class which manages this type of portlet.- Returns:
- the java class name
-
setHomeClassName
public void setHomeClassName(String strHomeClassName)
Sets the name of the java class which manages this type of portlet with the specified string.- Parameters:
strHomeClassName- The Home Class name
-
getAcceptAlias
public int getAcceptAlias()
Indicates if this portlet can be modified after its creation or not.- Returns:
- 1 if the portlet can be updated, 0 if not
-
setDisplayPortletTitle
public void setDisplayPortletTitle(int nDisplayPortletTitle)
Sets the flag which indicates that this portlet can be have a title or not.- Parameters:
nDisplayPortletTitle- The flag
-
getDisplayPortletTitle
public int getDisplayPortletTitle()
Indicates if this portlet can be modified have a title or not.- Returns:
- 1 if the portlet can be have a title, 0 if not
-
setAcceptAlias
public void setAcceptAlias(int nAcceptAlias)
Sets the flag which indicates that this portlet can be updated or not.- Parameters:
nAcceptAlias- The flag
-
getPluginName
public String getPluginName()
Get the plugin Name- Returns:
- The pluginName
-
setPluginName
public void setPluginName(String strPluginName)
Sets the flag which indicates that this portlet can be updated or not.- Parameters:
strPluginName- The flag
-
getRole
public String getRole()
Gets the portlet's role- Returns:
- page's role as a String
- Since:
- v2.5
-
setRole
public void setRole(String strRole)
Sets the portlet's role- Parameters:
strRole- The role- Since:
- v2.5
-
copy
public void copy(Portlet portlet)
This method copies the fields of the portlet specified in this portlet.- Parameters:
portlet- the portlet to copy
-
getXslFile
public String getXslFile(int nMode)
Recovers the stylesheet of the portlet according to the mode- Parameters:
nMode- the selected mode.- Returns:
- the name of the stylesheet file
-
getXslSource
public byte[] getXslSource(int nMode)
Recovers the stylesheet of the portlet according to the mode- Parameters:
nMode- the selected mode.- Returns:
- the content of the stylesheet file
-
getXslParams
public Map<String,String> getXslParams()
Recovers the parameters to use with the stylesheet at the time of the transformation.
By default, portlets do not return any parameter- Returns:
- a collection of the type Dictionary (Use the Hashtable implementation)
-
remove
public abstract void remove()
Remove the portlet. This method MUST be overloaded on the level of the implementation of each portlet
-
isContentGeneratedByXmlAndXsl
public boolean isContentGeneratedByXmlAndXsl()
Check if the content of this portlet is generated by xml and xsl, or if it manage its own content generation- Returns:
- True if the content must be generated from XML and XSL, false if it must be generated by the
getHtmlContent(HttpServletRequest request)method
-
getHtmlContent
public String getHtmlContent(javax.servlet.http.HttpServletRequest request)
Get the HTML content of the portlet. If the content must be generated from XML and XSL, then this method should return null. This method should only be overrided if the methodisContentGeneratedByXmlAndXsl()returns true- Parameters:
request- The request- Returns:
- The HTML content of the portlet, or null if the content is generated from XML and XSL
-
canBeCachedForAnonymousUsers
public boolean canBeCachedForAnonymousUsers()
Check if the content of the portlet can be put in cache if the current user is not authenticated. If a cache is disabled for a portlet, then every page that contains a portlet of this type will NOT use the page cache, and portlet contents of this portlet type will not be saved into portlet cache.
WARNING : Overrides this method with extreme care : disabling page cache can cause severe performance issues !- Returns:
- True if the content of the portlet can be put in cache if the user is not authenticated, false otherwise.
The default value is true. - See Also:
for cache for authenticated users
-
canBeCachedForConnectedUsers
public boolean canBeCachedForConnectedUsers()
Check if the content of the portlet can be put in cache if the current user is authenticated. If a cache is disabled for a portlet, then every page that contains a portlet of this type will NOT use the page cache, and portlet contents of this portlet type will not be saved into portlet cache.
WARNING : Overrides this method with extreme care : disabling page cache can cause severe performance issues !- Returns:
- True if the content of the portlet can be put in cache if the user is authenticated, false otherwise.
The default value is true. - See Also:
for cache for anonymous users
-
-