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

java.lang.Object
  extended by fr.paris.lutece.plugins.links.business.portlet.LinksPortletDAO
All Implemented Interfaces:
ILinksPortletDAO, fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO

public final class LinksPortletDAO
extends java.lang.Object
implements ILinksPortletDAO

This class provides Data Access methods for LinksPortlet objects


Constructor Summary
LinksPortletDAO()
           
 
Method Summary
 void delete(int nPortletId)
          Delete a record from the table
 void deleteLink(int nPortletId, int nLinkId)
          Remove a specified link from a specified portlet
 fr.paris.lutece.util.ReferenceList findUnselectedPortlets()
          Finds the portlets which have not been selected in the links page
 void insert(fr.paris.lutece.portal.business.portlet.Portlet portlet)
          Insert a new record in the table.
 void insertLink(int nPortletId, int nLinkId, int nOrder)
          Insert a new record in the table.
 void insertPortlet(int nPortletId, int nOrder)
          Insert a new portlet in the links page
 fr.paris.lutece.portal.business.portlet.Portlet load(int nPortletId)
          Gets the data from database
 void removeLinkFromPortlets(int nLinkId)
          Removes a link from all the portlets
 void removePortlet(int nPortletId)
          Remove a portlet from the links page
 int selectLinkIdByOrder(int nPortletId, int nOrder)
          Returns the id of an link wich has a specified order in a specified portlet
 int selectLinkOrder(int nPortletId, int nLinkId)
          Return the order of a specified link in a specified portlet
 java.util.Collection<Link> selectLinksInPortletList(int nPortletId)
          Return a list of links wich belong to a specified portlet
 fr.paris.lutece.util.ReferenceList selectLinksList()
          Returns a list of all the links
 int selectMaxOrder(int nPortletId)
          Calculate a new primary key to add a new link
 int selectPortletIdByOrder(int nOrder)
          Selects a portlet Id from the links page by its order
 int selectPortletMaxOrder()
          Returns the maximum order of the portlets in the links page
 int selectPortletOrder(int nPortletId)
          Selects the order of a portlet in the links page
 java.util.Collection<fr.paris.lutece.portal.business.portlet.Portlet> selectPortletsInLinksPage()
          Selects the list of the portlets in the links page
 void store(fr.paris.lutece.portal.business.portlet.Portlet portlet)
          Update the record in the table
 void storeLinkOrder(int nOrder, int nPortletId, int nLinkId)
          Update the order of a specified link in a specified portlet
 void storePortletOrder(int nOrder, int nPortletId)
          Stores the order of a portlet in the links page
 boolean testDuplicate(int nPortletId, int nLinkId)
          Check if a specified links is not already registered in a specified portlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinksPortletDAO

public LinksPortletDAO()
Method Detail

insert

public void insert(fr.paris.lutece.portal.business.portlet.Portlet portlet)
Insert a new record in the table.

Specified by:
insert in interface ILinksPortletDAO
Specified by:
insert in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
portlet - The identifier of the portlet

insertLink

public void insertLink(int nPortletId,
                       int nLinkId,
                       int nOrder)
Insert a new record in the table.

Specified by:
insertLink in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
nLinkId - The identifier of the link
nOrder - The order of the portlet to insert

deleteLink

public void deleteLink(int nPortletId,
                       int nLinkId)
Remove a specified link from a specified portlet

Specified by:
deleteLink in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
nLinkId - The identifier of the link

delete

public void delete(int nPortletId)
Delete a record from the table

Specified by:
delete in interface ILinksPortletDAO
Specified by:
delete in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
nPortletId - The identifier of the portlet

load

public fr.paris.lutece.portal.business.portlet.Portlet load(int nPortletId)
Gets the data from database

Specified by:
load in interface ILinksPortletDAO
Specified by:
load in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
nPortletId - The identifier of the portlet
Returns:
portlet The instance of the object portlet

store

public void store(fr.paris.lutece.portal.business.portlet.Portlet portlet)
Update the record in the table

Specified by:
store in interface ILinksPortletDAO
Specified by:
store in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
portlet - The instance of the object portlet

selectLinksList

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

Specified by:
selectLinksList in interface ILinksPortletDAO
Returns:
A list of links in form of a ReferenceList object

testDuplicate

public boolean testDuplicate(int nPortletId,
                             int nLinkId)
Check if a specified links is not already registered in a specified portlet

Specified by:
testDuplicate in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
nLinkId - The identifier of the link
Returns:
The result(boolean)

selectLinksInPortletList

public java.util.Collection<Link> selectLinksInPortletList(int nPortletId)
Return a list of links wich belong to a specified portlet

Specified by:
selectLinksInPortletList in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
Returns:
A collection of links objects

selectLinkOrder

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

Specified by:
selectLinkOrder in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
nLinkId - The identifier of the link
Returns:
The link's order

selectMaxOrder

public int selectMaxOrder(int nPortletId)
Calculate a new primary key to add a new link

Specified by:
selectMaxOrder in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
Returns:
The new key.

selectPortletMaxOrder

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

Specified by:
selectPortletMaxOrder in interface ILinksPortletDAO
Returns:
the max order

storeLinkOrder

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

Specified by:
storeLinkOrder in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
nLinkId - The identifier of the link
nOrder - The new order

selectLinkIdByOrder

public int selectLinkIdByOrder(int nPortletId,
                               int nOrder)
Returns the id of an link wich has a specified order in a specified portlet

Specified by:
selectLinkIdByOrder in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
nOrder - The link's order
Returns:
The identifier of the link

findUnselectedPortlets

public fr.paris.lutece.util.ReferenceList findUnselectedPortlets()
Finds the portlets which have not been selected in the links page

Specified by:
findUnselectedPortlets in interface ILinksPortletDAO
Returns:
the list of the unselected portlets

selectPortletsInLinksPage

public java.util.Collection<fr.paris.lutece.portal.business.portlet.Portlet> selectPortletsInLinksPage()
Selects the list of the portlets in the links page

Specified by:
selectPortletsInLinksPage in interface ILinksPortletDAO
Returns:
a collection of the unselected portlets

selectPortletOrder

public int selectPortletOrder(int nPortletId)
Selects the order of a portlet in the links page

Specified by:
selectPortletOrder in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
Returns:
the order

removePortlet

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

Specified by:
removePortlet in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet

removeLinkFromPortlets

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

Specified by:
removeLinkFromPortlets in interface ILinksPortletDAO
Parameters:
nLinkId - The identifier of the link

insertPortlet

public void insertPortlet(int nPortletId,
                          int nOrder)
Insert a new portlet in the links page

Specified by:
insertPortlet in interface ILinksPortletDAO
Parameters:
nPortletId - The identifier of the portlet
nOrder - The order of the portlet

selectPortletIdByOrder

public int selectPortletIdByOrder(int nOrder)
Selects a portlet Id from the links page by its order

Specified by:
selectPortletIdByOrder in interface ILinksPortletDAO
Parameters:
nOrder - The order of the portlet
Returns:
the portlet Id

storePortletOrder

public void storePortletOrder(int nOrder,
                              int nPortletId)
Stores the order of a portlet in the links page

Specified by:
storePortletOrder in interface ILinksPortletDAO
Parameters:
nOrder - The order of the portlet
nPortletId - The identifier of the portlet


Copyright © 2007 Mairie de Paris. All Rights Reserved.