Class ContactListHome
java.lang.Object
fr.paris.lutece.plugins.contact.business.ContactListHome
This class provides instances management methods (create, find, ...) for Contact objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) assigns a contact to a list or a list to a contactstatic intcountContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts how many contacts are associated to the liststatic intcountListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) counts all lists for one contactstatic ContactListcreate(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Creation of an instance of Liststatic Collection<ContactList>findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a collection of contacts objectsstatic ContactListfindByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an instance of a contact whose identifier is specified in parameterstatic Collection<ContactList>findByRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a collection of contacts objectsstatic Collection<Contact>getAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) selects the list of assigned contacts for one liststatic Collection<ContactList>getAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) selects the list of Lists assigned to one contactstatic intgetContactListIdByOrder(int nContactListOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Search the order number of contactListsstatic intgetContactListOrderById(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) returns the order of a contact in a list using its Idstatic 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 liststatic intgetMaxOrderContact(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Search the max order number of contacts for one liststatic intgetMaxOrderContactList(fr.paris.lutece.portal.service.plugin.Plugin plugin) Search the max order number of contacts for one liststatic Collection<Contact>getNotAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) get all contacts that are not assigned to one specific liststatic Collection<ContactList>getNotAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) selects the list of Lists not assigned to one contactstatic booleanisAssigned(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) returns true if the count of couples is positivestatic booleanlistExists(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns true if the contactList existsstatic voidremove(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the Contact whose identifier is specified in parameterstatic voidunAssign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Unassigns a list and a contactstatic voidunassignContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) unassigns all contacts for one specific liststatic voidunassignListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) unassigns all lists for one specific contactstatic ContactListupdate(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update of the contactList which is specified in parameterstatic voidupdateContactListOrder(int nNewOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the number order of contact
-
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 storeplugin- 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 parametersplugin- 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 removeplugin- 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 contactplugin- The Plugin object- Returns:
- An instance of contact
-
findAll
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 keyplugin- 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 contactListplugin- 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 contactplugin- 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 contactListplugin- 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 contactListplugin- 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 contactnIdContactList- the id of contact Listplugin- 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 contactplugin- 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 contactplugin- 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 contactnIdContactList- the id of the contact listplugin- 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 contactnIdContactList- the id of contact Listplugin- 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 ContactListplugin- 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 listplugin- 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 contactplugin- 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 contactListplugin- 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 contactListnNewOrder- the new number of orderplugin- 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 contactListplugin- 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 contactplugin- 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 idsplugin- The Plugin object- Returns:
- the list which contains the data of all the contactlist objects
-