Class DefaultContactService
- java.lang.Object
-
- org.silverpeas.core.contact.service.DefaultContactService
-
- All Implemented Interfaces:
ComponentInstanceDeletion
,ContactService
@Service @Singleton public class DefaultContactService extends Object implements ContactService, ComponentInstanceDeletion
-
-
Constructor Summary
Constructors Constructor Description DefaultContactService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFather(ContactPK contactPK, NodePK fatherPK)
addFather() add a new father (designed by "fatherPK") to a contact ("pubPK") The contact will be visible from its new father node.ContactPK
createContact(Contact contact)
Create a new contact A new line will be added in contact table.void
createInfoModel(ContactPK contactPK, String modelId)
void
delete(String componentInstanceId)
Deletes the resources belonging to the specified component instance.void
deleteIndex(ContactPK contactPK)
Called on : - deleteContact()void
deleteOrphanContactsByCreatorId(ContactPK contactPK, String creatorId)
Collection<NodePK>
getAllFatherPK(ContactPK contactPK)
getAllFatherPKCompleteContact
getCompleteContact(ContactPK contactPK)
CompleteContact
getCompleteContact(ContactPK contactPK, String modelId)
Collection<ContactDetail>
getContacts(Collection<ContactPK> contactPKs)
ContactDetail
getDetail(ContactPK contactPK)
get details on the contact specified by the primary key given in contactPK parameterCollection<ContactDetail>
getDetailsByFatherPK(NodePK fatherPK)
getDetailsByFatherPK() return a ContactDetail collection of all contact visible from the node identified by "fatherPK" parameterCollection<ContactFatherDetail>
getDetailsByFatherPKs(Collection<NodePK> fatherPKs, ContactPK contactPK, NodePK nodePK)
Collection<ContactDetail>
getDetailsByLastName(ContactPK pk, String query)
Collection<ContactDetail>
getDetailsByLastNameAndFirstName(ContactPK pk, String lastName, String firstName)
Collection<ContactDetail>
getDetailsByLastNameOrFirstName(ContactPK pk, String query)
int
getNbPubByFatherPath(NodePK fatherPK, String fatherPath)
int
getNbPubInFatherPKs(Collection<NodePK> fatherPKs)
Collection<ContactDetail>
getOrphanContacts(ContactPK contactPK)
getOrphanContacts() return the Detail of contact which are not linked to a fatherCollection<ContactDetail>
getUnavailableContactsByPublisherId(ContactPK contactPK, String publisherId, String nodeId)
List<CompleteContact>
getVisibleContacts(String instanceId)
Gets all non transitive contacts from an component represented by the given identifier that are not in basket.void
index(ContactPK contactPK)
void
removeAllFather(ContactPK contactPK)
Remove all the fathers from a contact ("pubPK") The contact won't be visible.void
removeAllIssue(NodePK originPK, ContactPK contactPK)
removeAllIssue() remove all links between contacts and node N N is a descendant of the node designed by originPK.void
removeContact(ContactPK contactPK)
removeContact() remove the contact designed by contactPK parameter.void
removeFather(ContactPK contactPK, NodePK fatherPK)
removeFather() remove a father (designed by "fatherPK") from a contact ("pubPK") The contact won't be visible from its old father node.void
setDetail(Contact contact)
setDetail() update the contact content.
-
-
-
Method Detail
-
getDetail
public ContactDetail getDetail(ContactPK contactPK)
Description copied from interface:ContactService
get details on the contact specified by the primary key given in contactPK parameter- Specified by:
getDetail
in interfaceContactService
- Parameters:
contactPK
- the contact primary key- Returns:
- the contact detail
-
createContact
public ContactPK createContact(Contact contact)
Description copied from interface:ContactService
Create a new contact A new line will be added in contact table. The "id" in "detail" is not used (a new one will be computed). The "ed" is used to know the table name.- Specified by:
createContact
in interfaceContactService
- Parameters:
contact
- the contact detail- Returns:
- contact primary key
-
removeContact
public void removeContact(ContactPK contactPK)
Description copied from interface:ContactService
removeContact() remove the contact designed by contactPK parameter.- Specified by:
removeContact
in interfaceContactService
-
setDetail
public void setDetail(Contact contact)
Description copied from interface:ContactService
setDetail() update the contact content.- Specified by:
setDetail
in interfaceContactService
- Parameters:
contact
- the contact detail to update
-
addFather
public void addFather(ContactPK contactPK, NodePK fatherPK)
addFather() add a new father (designed by "fatherPK") to a contact ("pubPK") The contact will be visible from its new father node.- Specified by:
addFather
in interfaceContactService
- Parameters:
contactPK
- reference to a contactfatherPK
- reference to a category
-
removeFather
public void removeFather(ContactPK contactPK, NodePK fatherPK)
removeFather() remove a father (designed by "fatherPK") from a contact ("pubPK") The contact won't be visible from its old father node.- Specified by:
removeFather
in interfaceContactService
- Parameters:
contactPK
- reference to a contactfatherPK
- reference to a category
-
removeAllFather
public void removeAllFather(ContactPK contactPK)
Remove all the fathers from a contact ("pubPK") The contact won't be visible.- Specified by:
removeAllFather
in interfaceContactService
- Parameters:
contactPK
- the id of the contact.
-
removeAllIssue
public void removeAllIssue(NodePK originPK, ContactPK contactPK)
removeAllIssue() remove all links between contacts and node N N is a descendant of the node designed by originPK.- Specified by:
removeAllIssue
in interfaceContactService
- Parameters:
originPK
- reference to a categorycontactPK
- reference to a contact
-
getOrphanContacts
public Collection<ContactDetail> getOrphanContacts(ContactPK contactPK)
Description copied from interface:ContactService
getOrphanContacts() return the Detail of contact which are not linked to a father- Specified by:
getOrphanContacts
in interfaceContactService
- Parameters:
contactPK
- the contact primary key- Returns:
- list of contact which are not linked to a father
-
deleteOrphanContactsByCreatorId
public void deleteOrphanContactsByCreatorId(ContactPK contactPK, String creatorId)
- Specified by:
deleteOrphanContactsByCreatorId
in interfaceContactService
-
getUnavailableContactsByPublisherId
public Collection<ContactDetail> getUnavailableContactsByPublisherId(ContactPK contactPK, String publisherId, String nodeId)
- Specified by:
getUnavailableContactsByPublisherId
in interfaceContactService
-
getAllFatherPK
public Collection<NodePK> getAllFatherPK(ContactPK contactPK)
getAllFatherPK- Specified by:
getAllFatherPK
in interfaceContactService
- Returns:
-
getDetailsByFatherPK
public Collection<ContactDetail> getDetailsByFatherPK(NodePK fatherPK)
getDetailsByFatherPK() return a ContactDetail collection of all contact visible from the node identified by "fatherPK" parameter- Specified by:
getDetailsByFatherPK
in interfaceContactService
- Returns:
-
getDetailsByLastName
public Collection<ContactDetail> getDetailsByLastName(ContactPK pk, String query)
- Specified by:
getDetailsByLastName
in interfaceContactService
-
getDetailsByLastNameOrFirstName
public Collection<ContactDetail> getDetailsByLastNameOrFirstName(ContactPK pk, String query)
- Specified by:
getDetailsByLastNameOrFirstName
in interfaceContactService
-
getDetailsByLastNameAndFirstName
public Collection<ContactDetail> getDetailsByLastNameAndFirstName(ContactPK pk, String lastName, String firstName)
- Specified by:
getDetailsByLastNameAndFirstName
in interfaceContactService
-
createInfoModel
public void createInfoModel(ContactPK contactPK, String modelId)
- Specified by:
createInfoModel
in interfaceContactService
-
getCompleteContact
public CompleteContact getCompleteContact(ContactPK contactPK, String modelId)
- Specified by:
getCompleteContact
in interfaceContactService
-
getCompleteContact
public CompleteContact getCompleteContact(ContactPK contactPK)
- Specified by:
getCompleteContact
in interfaceContactService
-
getContacts
public Collection<ContactDetail> getContacts(Collection<ContactPK> contactPKs)
- Specified by:
getContacts
in interfaceContactService
-
getNbPubInFatherPKs
public int getNbPubInFatherPKs(Collection<NodePK> fatherPKs)
- Specified by:
getNbPubInFatherPKs
in interfaceContactService
-
getDetailsByFatherPKs
public Collection<ContactFatherDetail> getDetailsByFatherPKs(Collection<NodePK> fatherPKs, ContactPK contactPK, NodePK nodePK)
- Specified by:
getDetailsByFatherPKs
in interfaceContactService
-
getNbPubByFatherPath
public int getNbPubByFatherPath(NodePK fatherPK, String fatherPath)
- Specified by:
getNbPubByFatherPath
in interfaceContactService
-
getVisibleContacts
public List<CompleteContact> getVisibleContacts(String instanceId)
Description copied from interface:ContactService
Gets all non transitive contacts from an component represented by the given identifier that are not in basket. A transitive contact is a contact of user type linked directly by a group.- Specified by:
getVisibleContacts
in interfaceContactService
- Parameters:
instanceId
- the identifier of the component instance into which contact are retrieved.- Returns:
- the list of complete contact data. Empty list if none.
-
index
public void index(ContactPK contactPK)
- Specified by:
index
in interfaceContactService
-
deleteIndex
public void deleteIndex(ContactPK contactPK)
Called on : - deleteContact()- Specified by:
deleteIndex
in interfaceContactService
- Parameters:
contactPK
- reference to a contact
-
delete
public void delete(String componentInstanceId)
Deletes the resources belonging to the specified component instance. This method is invoked by Silverpeas when a component instance is being deleted.- Specified by:
delete
in interfaceComponentInstanceDeletion
- Parameters:
componentInstanceId
- the unique identifier of a component instance.
-
-