Class ContactHome
java.lang.Object
fr.paris.lutece.plugins.contact.business.ContactHome
This class provides instances management methods (create, find, ...) for Contact objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic ContactCreation of an instance of contactstatic Collection<Contact>findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a collection of contacts objectsstatic ContactfindByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an instance of a contact whose identifier is specified in parameterstatic intgetContactIdByOrder(int nContactOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Search the order number of contacts for one liststatic intgetContactOrderById(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) returns the order of a contact in a list using its Idstatic fr.paris.lutece.util.ReferenceListgetContactsByListWithString(int nIdContactList, String strComboItem, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a reference list which contains all the contacts and the string "choose your contact", for the xpagegetContactsListByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the data of all the contact objects and returns them as a liststatic voidRemove the Contact whose identifier is specified in parameterstatic ContactUpdate of the contact which is specified in parameterstatic voidupdateContactOrder(int nNewOrder, int nId, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the number order of contactstatic voidupdateHits(int nIdContactList, int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) Increments hits in contact and contact_list_contact tables
-
Method Details
-
create
Creation of an instance of contact- Parameters:
contact- The instance of the contact which contains the informations to storeplugin- The Plugin object- Returns:
- The instance of contact which has been created with its primary key.
-
update
Update of the contact which is specified in parameter- Parameters:
contact- The instance of the contact which contains the data to storeplugin- The Plugin object- Returns:
- The instance of the contact which has been updated
-
remove
Remove the Contact whose identifier is specified in parameter- Parameters:
contact- The Contact object to removeplugin- The Plugin object
-
findByPrimaryKey
public static Contact 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
-
getContactsByListWithString
public static fr.paris.lutece.util.ReferenceList getContactsByListWithString(int nIdContactList, String strComboItem, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a reference list which contains all the contacts and the string "choose your contact", for the xpage- Parameters:
nIdContactList- The id of contactListstrComboItem- The string to display at the top of comboplugin- The Plugin object- Returns:
- a reference list
-
updateHits
public static void updateHits(int nIdContactList, int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) Increments hits in contact and contact_list_contact tables- Parameters:
nIdContactList- id of the contactListnIdContact- id of the contactplugin- the plugin Contact
-
getContactIdByOrder
public static int getContactIdByOrder(int nContactOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Search the order number of contacts for one list- Parameters:
nIdContactList- the id of the contactListnContactOrder- the number of order of the contactplugin- The Plugin object- Returns:
- int the id by a given order
-
getContactOrderById
public static int getContactOrderById(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) returns the order of a contact in a list using its Id- Parameters:
nIdContact- the id of the contactnIdContactList- the id of the contactListplugin- The Plugin object- Returns:
- int the id by a given order
-
updateContactOrder
public static void updateContactOrder(int nNewOrder, int nId, 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 ordernId- the Identifier of contactplugin- The Plugin object
-
getContactsListByIds
public static List<Contact> getContactsListByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the data of all the contact 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 contact objects
-