Class PortletHome
java.lang.Object
fr.paris.lutece.portal.business.portlet.PortletHome
- All Implemented Interfaces:
PortletHomeInterface
- Direct Known Subclasses:
AliasPortletHome
This class provides instances management methods (create, find, ...) for Portlet objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new portlet in the databasestatic PortletfindByPrimaryKey(int nKey) Returns the Portlet whose primary key is specified in parameterfindByType(String strIdPortletType) Returns a collection of portlets according to the selected typestatic Collection<Portlet>getAliasList(int nPortletId) Returns the collection of the StyleSheet objects associated to the StylegetColumnPositions(int nPageId, int nColumn) The portlets of a column of a page, in their order, with only their identifier, name, page, column and order loadedstatic PortletGet the last modified portletgetPagePositions(int nPageId) The portlets of a page, by column and in their order, with only their identifier, type, name, page, column and order loadedstatic Collection<PortletImpl>getPortletListByStyle(int nStyleId) Returns the collection of the StyleSheet objects associated to the Stylestatic Collection<Portlet>getPortletsByRoleKey(String strRole) Gets a collection of portlets associated to a given rolestatic Collection<PortletImpl>getPortletsListbyName(String strPortletName) Returns the list of portlets for the search on publishingstatic PortletTypegetPortletType(String strPortletTypeId) Returns the instance of the PortletType whose identifier is specified in parameterstatic ReferenceListgetStylesList(String strIdPortletType) Returns all the styles corresponding to a portlet typeun type de portletgetUsedOrdersForColumns(int pageId, int columnId) Get list of used orders for a columnstatic StringgetXslFile(int nIdPortlet, int nIdMode) Returns the stylesheet content of the portlet according to the modestatic byte[]getXslSource(int nIdPortlet, int nIdMode) Returns the stylesheet binary content of the portlet according to the modestatic booleanhasAlias(int nIdPortlet) Indicates if the portlet has aliasstatic voidinvalidate(int nIdPortlet) Invalidate a portlet whose identifier is specified in paramaeterstatic voidinvalidate(Portlet portlet) Invalidate the portlet which is specified in parameter Invalidates the alias portlets connected to this portlet too.static voidnotifyListeners(PortletEvent event) Notifies listenersstatic voidplaceInColumn(Portlet portlet, int nColumn, int nOrder) Puts a portlet at a place of a column of its page.voidDeletes the portlet in the database.voidUpdates a portlet with the values of the specified portlet instance.static voidupdatePosition(Portlet portlet, int nColumn, int nOrder) Update the status of portletstatic voidupdateStatus(Portlet portlet, int nStatus) Update the status of portletMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.paris.lutece.portal.business.portlet.PortletHomeInterface
getDAO, getPortletTypeId
-
Constructor Details
-
PortletHome
public PortletHome()
-
-
Method Details
-
findByPrimaryKey
Returns the Portlet whose primary key is specified in parameter- Parameters:
nKey- the portlet identifier- Returns:
- The portlet object, or null if the portlet does not exist
-
findByType
Returns a collection of portlets according to the selected type- Parameters:
strIdPortletType- the portlet type- Returns:
- the portlets in form of Collection
-
getPortletsListbyName
Returns the list of portlets for the search on publishing- Parameters:
strPortletName- STh name of the portlet- Returns:
- the list in form of Collection
-
getXslFile
Returns the stylesheet content of the portlet according to the mode- Parameters:
nIdPortlet- the identifier of the portletnIdMode- the selected mode- Returns:
- the stylesheet content
-
getXslSource
public static byte[] getXslSource(int nIdPortlet, int nIdMode) Returns the stylesheet binary content of the portlet according to the mode- Parameters:
nIdPortlet- the identifier of the portletnIdMode- the selected mode- Returns:
- the stylesheet binary content
-
getStylesList
Returns all the styles corresponding to a portlet typeun type de portlet- Parameters:
strIdPortletType- the identifier of the portlet type- Returns:
- the list of styles in form of ReferenceList
-
getPortletsByRoleKey
Gets a collection of portlets associated to a given role- Parameters:
strRole- The role- Returns:
- The collection
-
create
Creates a new portlet in the database- Parameters:
portlet- An instance of the portlet to create- Returns:
- the Portlet instance created
-
remove
Deletes the portlet in the database. The column it leaves closes the gap: it keeps the orders 1 to n, which the preview sends back as places- Parameters:
portlet- the portlet to remove
-
update
Updates a portlet with the values of the specified portlet instance. When it moves to another page, that page is invalidated too, as the page it joins- Parameters:
portlet- portlet to update
-
invalidate
Invalidate the portlet which is specified in parameter Invalidates the alias portlets connected to this portlet too.- Parameters:
portlet- the portlet instance
-
invalidate
public static void invalidate(int nIdPortlet) Invalidate a portlet whose identifier is specified in paramaeter- Parameters:
nIdPortlet- the portlet identifier
-
hasAlias
public static boolean hasAlias(int nIdPortlet) Indicates if the portlet has alias- Parameters:
nIdPortlet- the portlet identifier- Returns:
- true if the portlet has alias, false if not.
-
updateStatus
Update the status of portlet- Parameters:
portlet- the portlet to removenStatus- The status to update
-
updatePosition
Update the status of portlet- Parameters:
portlet- the portlet to removenStatus- The status to update
-
placeInColumn
Puts a portlet at a place of a column of its page. The portlets of that column keep their order around it and take the orders 1 to n; the column it leaves, if it changes column, closes the gap. Only the portlets whose position changes are updated, and the page is invalidated once- Parameters:
portlet- the portlet, with its current column; its column and its order are set to the new onesnColumn- the columnnOrder- the place in the column, from 1; beyond the last portlet, the portlet goes last
-
getColumnPositions
The portlets of a column of a page, in their order, with only their identifier, name, page, column and order loaded- Parameters:
nPageId- the pagenColumn- the column- Returns:
- the portlets of the column
-
getPagePositions
The portlets of a page, by column and in their order, with only their identifier, type, name, page, column and order loaded- Parameters:
nPageId- the page- Returns:
- the portlets of the page
-
getPortletType
Returns the instance of the PortletType whose identifier is specified in parameter- Parameters:
strPortletTypeId- the identifier of the portlet type- Returns:
- the instance of the portlet type
-
getPortletListByStyle
Returns the collection of the StyleSheet objects associated to the Style- Parameters:
nStyleId- identifier of the style- Returns:
- A collection of styles
-
getAliasList
Returns the collection of the StyleSheet objects associated to the Style- Parameters:
nPortletId- identifier of the portlet- Returns:
- A collection of styles
-
getLastModifiedPortlet
Get the last modified portlet- Returns:
- the last modified portlet
-
notifyListeners
Notifies listeners- Parameters:
event- the event
-
getUsedOrdersForColumns
Get list of used orders for a column- Parameters:
pageId- the page idcolumnId- the column id- Returns:
- list of orders used for this column
-