fr.paris.lutece.plugins.contact.business
Class ContactHome

java.lang.Object
  extended by fr.paris.lutece.plugins.contact.business.ContactHome

public final class ContactHome
extends java.lang.Object

This class provides instances management methods (create, find, ...) for Contact objects


Method Summary
static Contact create(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Creation of an instance of contact
static java.util.Collection<Contact> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns a collection of contacts objects
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
static int getContactIdByOrder(int nContactOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Search the order number of contacts for one list
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
static fr.paris.lutece.util.ReferenceList getContactsByListWithString(int nIdContactList, java.lang.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
static void remove(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the Contact whose identifier is specified in parameter
static Contact update(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update of the contact which is specified in parameter
static void updateContactOrder(int nNewOrder, int nId, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the number order of contact
static void updateHits(int nIdContactList, int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Increments hits in contact and contact_list_contact tables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Contact create(Contact contact,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Creation of an instance of contact

Parameters:
contact - The instance of the contact which contains the informations to store
plugin - The Plugin object
Returns:
The instance of contact which has been created with its primary key.

update

public static Contact update(Contact contact,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update of the contact which is specified in parameter

Parameters:
contact - The instance of the contact which contains the data to store
plugin - The Plugin object
Returns:
The instance of the contact which has been updated

remove

public static void remove(Contact contact,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the Contact whose identifier is specified in parameter

Parameters:
contact - The Contact object to remove
plugin - 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 contact
plugin - The Plugin object
Returns:
An instance of contact

findAll

public static java.util.Collection<Contact> 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

getContactsByListWithString

public static fr.paris.lutece.util.ReferenceList getContactsByListWithString(int nIdContactList,
                                                                             java.lang.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 contactList
strComboItem - The string to display at the top of combo
plugin - 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 contactList
nIdContact - id of the contact
plugin - 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 contactList
nContactOrder - the number of order of the contact
plugin - 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 contact
nIdContactList - the id of the contactList
plugin - 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 contactList
nNewOrder - the new number of order
nId - the Identifier of contact
plugin - The Plugin object


Copyright © 2009 Mairie de Paris. All Rights Reserved.