Class ContactListHome

java.lang.Object
fr.paris.lutece.plugins.contact.business.ContactListHome

public final class ContactListHome extends Object
This class provides instances management methods (create, find, ...) for Contact objects
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    assigns a contact to a list or a list to a contact
    static int
    countContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Counts how many contacts are associated to the list
    static int
    countListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    counts all lists for one contact
    create(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Creation of an instance of List
    findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns a collection of contacts objects
    findByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns an instance of a contact whose identifier is specified in parameter
    findByRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns a collection of contacts objects
    getAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    selects the list of assigned contacts for one list
    getAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    selects the list of Lists assigned to one contact
    static int
    getContactListIdByOrder(int nContactListOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Search the order number of contactLists
    static int
    getContactListOrderById(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    returns the order of a contact in a list using its Id
    getContactListsByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the data of all the contactlist objects and returns them as a list
    static int
    getMaxOrderContact(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Search the max order number of contacts for one list
    static int
    getMaxOrderContactList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Search the max order number of contacts for one list
    getNotAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    get all contacts that are not assigned to one specific list
    getNotAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    selects the list of Lists not assigned to one contact
    static boolean
    isAssigned(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    returns true if the count of couples is positive
    static boolean
    listExists(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns true if the contactList exists
    static void
    remove(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove the Contact whose identifier is specified in parameter
    static void
    unAssign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Unassigns a list and a contact
    static void
    unassignContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    unassigns all contacts for one specific list
    static void
    unassignListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    unassigns all lists for one specific contact
    update(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update of the contactList which is specified in parameter
    static void
    updateContactListOrder(int nNewOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update the number order of contact

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static ContactList create(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Creation of an instance of List
      Parameters:
      contactList - The instance of the contact which contains the informations to store
      plugin - The Plugin object
      Returns:
      The instance of contactList which has been created with its primary key.
    • update

      public static ContactList update(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update of the contactList which is specified in parameter
      Parameters:
      contactList - the contactList object with updated parameters
      plugin - The Plugin object
      Returns:
      The instance of the contact which has been updated
    • remove

      public static void remove(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove the Contact whose identifier is specified in parameter
      Parameters:
      nIdContactList - the Id of the contact list to remove
      plugin - The Plugin object
    • findByPrimaryKey

      public static ContactList findByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns an instance of a contact whose identifier is specified in parameter
      Parameters:
      nKey - The Primary key of the contact
      plugin - The Plugin object
      Returns:
      An instance of contact
    • findAll

      public static Collection<ContactList> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns a collection of contacts objects
      Parameters:
      plugin - The Plugin object
      Returns:
      A collection of contacts
    • findByRoleKey

      public static Collection<ContactList> findByRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns a collection of contacts objects
      Parameters:
      strRoleKey - The role key
      plugin - The Plugin object
      Returns:
      A collection of ContactList
    • countContactsForList

      public static int countContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Counts how many contacts are associated to the list
      Parameters:
      nIdContactList - the id of the contactList
      plugin - The plugin contact
      Returns:
      the number of contacts
    • countListsForContact

      public static int countListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      counts all lists for one contact
      Parameters:
      nIdContact - the Id of the contact
      plugin - The plugin contact
      Returns:
      the number of lists
    • getAssignedContactsFor

      public static Collection<Contact> getAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      selects the list of assigned contacts for one list
      Parameters:
      nIdContactList - the id of contactList
      plugin - The plugin contact
      Returns:
      the collection of contacts assigned to the list
    • getNotAssignedContactsFor

      public static Collection<Contact> getNotAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      get all contacts that are not assigned to one specific list
      Parameters:
      nIdContactList - th id of the contactList
      plugin - The plugin contact
      Returns:
      the collection of not assigned contacts
    • isAssigned

      public static boolean isAssigned(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      returns true if the count of couples is positive
      Parameters:
      nIdContact - the id of the contact
      nIdContactList - the id of contact List
      plugin - The plugin contact
      Returns:
      true or false
    • getAssignedListsFor

      public static Collection<ContactList> getAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      selects the list of Lists assigned to one contact
      Parameters:
      nIdContact - the Id of the contact
      plugin - The plugin contact
      Returns:
      collection of assigned lists
    • getNotAssignedListsFor

      public static Collection<ContactList> getNotAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      selects the list of Lists not assigned to one contact
      Parameters:
      nIdContact - the id of the contact
      plugin - The plugin Contact
      Returns:
      collection of not assigned lists
    • assign

      public static void assign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      assigns a contact to a list or a list to a contact
      Parameters:
      nIdContact - the id of the contact
      nIdContactList - the id of the contact list
      plugin - The plugin Contact
    • unAssign

      public static void unAssign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Unassigns a list and a contact
      Parameters:
      nIdContact - the id of the contact
      nIdContactList - the id of contact List
      plugin - The plugin Contact
    • unassignContactsForList

      public static void unassignContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      unassigns all contacts for one specific list
      Parameters:
      nIdContactList - the id of concerned ContactList
      plugin - The plugin Contact
    • getMaxOrderContactList

      public static int getMaxOrderContactList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Search the max order number of contacts for one list
      Parameters:
      plugin - The Plugin object
      Returns:
      int the max order
    • getMaxOrderContact

      public static int getMaxOrderContact(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Search the max order number of contacts for one list
      Parameters:
      nIdContactList - the id contact list
      plugin - The Plugin object
      Returns:
      int the max order
    • getContactListIdByOrder

      public static int getContactListIdByOrder(int nContactListOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Search the order number of contactLists
      Parameters:
      nContactListOrder - the order of contact
      plugin - The Plugin object
      Returns:
      int the id by a given order
    • getContactListOrderById

      public static int getContactListOrderById(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      returns the order of a contact in a list using its Id
      Parameters:
      nIdContactList - the id of the contactList
      plugin - The Plugin object
      Returns:
      int the id by a given order
    • updateContactListOrder

      public static void updateContactListOrder(int nNewOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the number order of contact
      Parameters:
      nIdContactList - the id of the contactList
      nNewOrder - the new number of order
      plugin - The Plugin object
    • listExists

      public static boolean listExists(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns true if the contactList exists
      Parameters:
      nIdContactList - The if of contactList
      plugin - The Plugin object
      Returns:
      boolean the existance of the list
    • unassignListsForContact

      public static void unassignListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      unassigns all lists for one specific contact
      Parameters:
      nIdContact - The if of contact
      plugin - The Plugin object
    • getContactListsByIds

      public static List<ContactList> getContactListsByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of all the contactlist objects and returns them as a list
      Parameters:
      listIds - list of ids
      plugin - The Plugin object
      Returns:
      the list which contains the data of all the contactlist objects