Class PortletDAO

  • All Implemented Interfaces:
    IPortletDAO

    public final class PortletDAO
    extends java.lang.Object
    implements IPortletDAO
    This class provides Data Access methods for Portlet objects
    • Constructor Summary

      Constructors 
      Constructor Description
      PortletDAO()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(int nPortletId)
      Delete a record from the table and its alias
      java.util.List<java.lang.Integer> getUsedOrdersForColumns​(int pageId, int columnId)
      Get list of used orders for a column
      boolean hasAlias​(int nPortletId)
      Indicates if the portlet has alias in the database or not.
      void insert​(Portlet portlet)
      Insert a new record in the table.
      Portlet load​(int nPortletId)
      Load the data of a portlet from the database
      Portlet loadLastModifiedPortlet()
      Load the last modified portlet
      java.util.Collection<Portlet> selectAliasesForPortlet​(int nPortletId)
      Returns the list of the alias portlets associated to the original portlet
      java.util.Collection<PortletImpl> selectPortletListByStyle​(int nStyleId)
      Returns the list of the portlets associated to the style
      java.util.Collection<Portlet> selectPortletsByRole​(java.lang.String strRole)
      Gets a collection of portlets associated to a given role
      java.util.List<Portlet> selectPortletsByType​(java.lang.String strPortletTypeId)
      Returns a list of portlets according to the selected type
      java.util.Collection<PortletImpl> selectPortletsListbyName​(java.lang.String strPortletName)
      Returns the list of portlets in a distinct name
      PortletType selectPortletType​(java.lang.String strPortletTypeId)
      Returns the instance of the PortletType whose identifier is specified in parameter
      void store​(Portlet portlet)
      Update the record in the table
      void updatePosition​(Portlet portlet, int nColumn, int nOrder)
      Update the portlet status : 0 for activated - 1 for suspended
      void updateStatus​(Portlet portlet, int nStatus)
      Update the portlet status : 0 for activated - 1 for suspended
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PortletDAO

        public PortletDAO()
    • Method Detail

      • insert

        public void insert​(Portlet portlet)
        Insert a new record in the table. NB : The portlet identifier will already been obtained by the portlet girl
        Specified by:
        insert in interface IPortletDAO
        Parameters:
        portlet - the portlet to insert in the database
      • delete

        public void delete​(int nPortletId)
        Delete a record from the table and its alias
        Specified by:
        delete in interface IPortletDAO
        Parameters:
        nPortletId - the identifier of the portlet to be deleted
      • load

        public Portlet load​(int nPortletId)
        Load the data of a portlet from the database
        Specified by:
        load in interface IPortletDAO
        Parameters:
        nPortletId - the portlet identifier
        Returns:
        the object Portlet initialized with the data of the database
      • store

        public void store​(Portlet portlet)
        Update the record in the table
        Specified by:
        store in interface IPortletDAO
        Parameters:
        portlet - the portlet reference
      • updateStatus

        public void updateStatus​(Portlet portlet,
                                 int nStatus)
        Update the portlet status : 0 for activated - 1 for suspended
        Specified by:
        updateStatus in interface IPortletDAO
        Parameters:
        portlet - the portlet to upadte in the database
        nStatus - the status to update
      • updatePosition

        public void updatePosition​(Portlet portlet,
                                   int nColumn,
                                   int nOrder)
        Update the portlet status : 0 for activated - 1 for suspended
        Specified by:
        updatePosition in interface IPortletDAO
        Parameters:
        portlet - the portlet to upadte in the database
        nColumn - the column to update
        nOrder - the order to update
      • selectPortletsListbyName

        public java.util.Collection<PortletImpl> selectPortletsListbyName​(java.lang.String strPortletName)
        Returns the list of portlets in a distinct name
        Specified by:
        selectPortletsListbyName in interface IPortletDAO
        Parameters:
        strPortletName - the name of portlet
        Returns:
        the list in form of Collection
      • selectAliasesForPortlet

        public java.util.Collection<Portlet> selectAliasesForPortlet​(int nPortletId)
        Returns the list of the alias portlets associated to the original portlet
        Specified by:
        selectAliasesForPortlet in interface IPortletDAO
        Parameters:
        nPortletId - the original portlet id
        Returns:
        the list of alais portlets.
      • selectPortletsByType

        public java.util.List<Portlet> selectPortletsByType​(java.lang.String strPortletTypeId)
        Returns a list of portlets according to the selected type
        Specified by:
        selectPortletsByType in interface IPortletDAO
        Parameters:
        strPortletTypeId - the portlet type
        Returns:
        the portlets in form of Collection
      • hasAlias

        public boolean hasAlias​(int nPortletId)
        Indicates if the portlet has alias in the database or not.
        Specified by:
        hasAlias in interface IPortletDAO
        Parameters:
        nPortletId - the identifier of the portlet
        Returns:
        true if the portlet has some alias, false if not.
      • selectPortletType

        public PortletType selectPortletType​(java.lang.String strPortletTypeId)
        Returns the instance of the PortletType whose identifier is specified in parameter
        Specified by:
        selectPortletType in interface IPortletDAO
        Parameters:
        strPortletTypeId - the identifier of the portlet type
        Returns:
        the instance of the portlet type
      • selectPortletListByStyle

        public java.util.Collection<PortletImpl> selectPortletListByStyle​(int nStyleId)
        Returns the list of the portlets associated to the style
        Specified by:
        selectPortletListByStyle in interface IPortletDAO
        Parameters:
        nStyleId - the identifier of the style
        Returns:
        the list of the portlets in form of a Collection of Portlets objects
      • selectPortletsByRole

        public java.util.Collection<Portlet> selectPortletsByRole​(java.lang.String strRole)
        Gets a collection of portlets associated to a given role
        Specified by:
        selectPortletsByRole in interface IPortletDAO
        Parameters:
        strRole - The role
        Returns:
        The collection
      • getUsedOrdersForColumns

        public java.util.List<java.lang.Integer> getUsedOrdersForColumns​(int pageId,
                                                                         int columnId)
        Get list of used orders for a column
        Specified by:
        getUsedOrdersForColumns in interface IPortletDAO
        Parameters:
        pageId - the page id
        columnId - the column id
        Returns:
        list of orders used for this column