fr.paris.lutece.plugins.links.business.portlet
Class LinksPortletHome

java.lang.Object
  extended by fr.paris.lutece.portal.business.portlet.PortletHome
      extended by fr.paris.lutece.plugins.links.business.portlet.LinksPortletHome
All Implemented Interfaces:
fr.paris.lutece.portal.business.portlet.PortletHomeInterface

public class LinksPortletHome
extends fr.paris.lutece.portal.business.portlet.PortletHome

This class provides instances management methods for LinkPortlet objects


Constructor Summary
LinksPortletHome()
          Constructor
 
Method Summary
static fr.paris.lutece.util.ReferenceList findUnselectedPortlets()
          Returns Links portlet list
 fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO getDAO()
          Returns the instance of the Link portlet DAO singleton
static fr.paris.lutece.portal.business.portlet.PortletHome getInstance()
          Returns the instance of LinksPortletHome
static int getLinkIdByOrder(int nPortletId, int nOrder)
          Return the Id of an link by is order in a portlet
static int getLinkOrder(int nPortletId, int nLinkId)
          Return the order of an link in a specified portlet
static java.util.Collection<Link> getLinksInPortletList(int nPortletId)
          Returns the list of links in a specified portlet
static fr.paris.lutece.util.ReferenceList getLinksList()
          Returns a list of all the links
static int getMaxOrder(int nPortletId)
          Return the max order of a portlet
static int getPortletIdByOrder(int nOrder)
          Returns the Id of a portlet from its order in the links page
static int getPortletMaxOrder()
          Returns the maximum order of the portlets in the links page
static int getPortletOrder(int nPortletId)
          Returns the order of a portlet in the links page
static java.util.Collection<fr.paris.lutece.portal.business.portlet.Portlet> getPortletsInLinksPage()
          Returns a Collection of all the portlets of the links page
 java.lang.String getPortletTypeId()
          Returns The type of the portlet
static void insertLink(int nPortletId, int nLinkId, int nOrder)
          Insert a specified link in a specified Links portlet with a specified order
static void insertPortlet(int nPortletId, int nOrder)
          Inserts a portlet in the links page
static void removeLink(int nPortletId, int nLinkId)
          Remove a link from a portlet
static void removeLinkFromPortlets(int nLinkId)
          Removes a link from all the portlets
static void removePortlet(int nPortletId)
          Removes a portlet from the links page
static boolean testDuplicate(int nPortletId, int nLinkId)
          Verify if an link is already in a portlet
static void updateLinkOrder(int nOrder, int nPortletId, int nLinkId)
          Update the order of a specified link in a specified portlet
static void updatePortletOrder(int nOrder, int nPortletId)
          Updates the order of a portlet in the links page
 
Methods inherited from class fr.paris.lutece.portal.business.portlet.PortletHome
create, findByPrimaryKey, findByType, getPortletListByStyle, getPortletsListbyName, getPortletType, getStylesList, hasAlias, invalidate, invalidate, remove, update, updateStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinksPortletHome

public LinksPortletHome()
Constructor

Method Detail

getPortletTypeId

public java.lang.String getPortletTypeId()
Returns The type of the portlet

Returns:
The type of the portlet (integer)

getInstance

public static fr.paris.lutece.portal.business.portlet.PortletHome getInstance()
Returns the instance of LinksPortletHome

Returns:
the LinksPortletHome instance

getDAO

public fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO getDAO()
Returns the instance of the Link portlet DAO singleton

Returns:
the instance of the DAO singleton

getLinksList

public static fr.paris.lutece.util.ReferenceList getLinksList()
Returns a list of all the links

Returns:
a list of links

getLinksInPortletList

public static java.util.Collection<Link> getLinksInPortletList(int nPortletId)
Returns the list of links in a specified portlet

Parameters:
nPortletId - The identifier of the portlet to check
Returns:
A collection of links objects

insertLink

public static void insertLink(int nPortletId,
                              int nLinkId,
                              int nOrder)
Insert a specified link in a specified Links portlet with a specified order

Parameters:
nPortletId - The identifier of the portlet to be inserted
nLinkId - The identifier of the link to insert
nOrder - The order of the inserted link

removeLink

public static void removeLink(int nPortletId,
                              int nLinkId)
Remove a link from a portlet

Parameters:
nPortletId - The identifier of the portlet from wich the link is removed
nLinkId - The identifier of the link to remove

removeLinkFromPortlets

public static void removeLinkFromPortlets(int nLinkId)
Removes a link from all the portlets

Parameters:
nLinkId - The identifier of the link

testDuplicate

public static boolean testDuplicate(int nPortletId,
                                    int nLinkId)
Verify if an link is already in a portlet

Parameters:
nPortletId - The identifier of the portlet to check
nLinkId - The identifier of the link to inscribe
Returns:
A boolean of the result

getLinkOrder

public static int getLinkOrder(int nPortletId,
                               int nLinkId)
Return the order of an link in a specified portlet

Parameters:
nPortletId - The identifier of the portlet to check
nLinkId - The identifier of the link
Returns:
The order of the link

getMaxOrder

public static int getMaxOrder(int nPortletId)
Return the max order of a portlet

Parameters:
nPortletId - The identifier of the portlet
Returns:
The max order

getPortletMaxOrder

public static int getPortletMaxOrder()
Returns the maximum order of the portlets in the links page

Returns:
the maximum order

updateLinkOrder

public static void updateLinkOrder(int nOrder,
                                   int nPortletId,
                                   int nLinkId)
Update the order of a specified link in a specified portlet

Parameters:
nOrder - The new order of the link
nPortletId - The identifier of the portlet to update
nLinkId - The identifier of the link who has a new order

getLinkIdByOrder

public static int getLinkIdByOrder(int nPortletId,
                                   int nOrder)
Return the Id of an link by is order in a portlet

Parameters:
nPortletId - The identifier of the portlet in wich the link is inscribed
nOrder - The order of the link
Returns:
The identifier of the link

findUnselectedPortlets

public static fr.paris.lutece.util.ReferenceList findUnselectedPortlets()
Returns Links portlet list

Returns:
the list of the links portlets in the database as a links portlets Collection object

getPortletsInLinksPage

public static java.util.Collection<fr.paris.lutece.portal.business.portlet.Portlet> getPortletsInLinksPage()
Returns a Collection of all the portlets of the links page

Returns:
collection

getPortletOrder

public static int getPortletOrder(int nPortletId)
Returns the order of a portlet in the links page

Parameters:
nPortletId - The identifier of the portlet
Returns:
order

removePortlet

public static void removePortlet(int nPortletId)
Removes a portlet from the links page

Parameters:
nPortletId - The identifier of the portlet

insertPortlet

public static void insertPortlet(int nPortletId,
                                 int nOrder)
Inserts a portlet in the links page

Parameters:
nPortletId - The identifier of the portlet
nOrder - The order of the portlet

getPortletIdByOrder

public static int getPortletIdByOrder(int nOrder)
Returns the Id of a portlet from its order in the links page

Parameters:
nOrder - The order of the portlet
Returns:
the portlet Id

updatePortletOrder

public static void updatePortletOrder(int nOrder,
                                      int nPortletId)
Updates the order of a portlet in the links page

Parameters:
nOrder - The order of the portlet
nPortletId - The identifier of the portlet


Copyright © 2009 Mairie de Paris. All Rights Reserved.