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 voidaddFather(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.ContactPKcreateContact(Contact contact)Create a new contact A new line will be added in contact table.voidcreateInfoModel(ContactPK contactPK, String modelId)voiddelete(String componentInstanceId)Deletes the resources belonging to the specified component instance.voiddeleteIndex(ContactPK contactPK)Called on : - deleteContact()voiddeleteOrphanContactsByCreatorId(ContactPK contactPK, String creatorId)Collection<NodePK>getAllFatherPK(ContactPK contactPK)getAllFatherPKCompleteContactgetCompleteContact(ContactPK contactPK)CompleteContactgetCompleteContact(ContactPK contactPK, String modelId)Collection<ContactDetail>getContacts(Collection<ContactPK> contactPKs)ContactDetailgetDetail(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)intgetNbPubByFatherPath(NodePK fatherPK, String fatherPath)intgetNbPubInFatherPKs(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.voidindex(ContactPK contactPK)voidremoveAllFather(ContactPK contactPK)Remove all the fathers from a contact ("pubPK") The contact won't be visible.voidremoveAllIssue(NodePK originPK, ContactPK contactPK)removeAllIssue() remove all links between contacts and node N N is a descendant of the node designed by originPK.voidremoveContact(ContactPK contactPK)removeContact() remove the contact designed by contactPK parameter.voidremoveFather(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.voidsetDetail(Contact contact)setDetail() update the contact content.
-
-
-
Method Detail
-
getDetail
public ContactDetail getDetail(ContactPK contactPK)
Description copied from interface:ContactServiceget details on the contact specified by the primary key given in contactPK parameter- Specified by:
getDetailin interfaceContactService- Parameters:
contactPK- the contact primary key- Returns:
- the contact detail
-
createContact
public ContactPK createContact(Contact contact)
Description copied from interface:ContactServiceCreate 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:
createContactin interfaceContactService- Parameters:
contact- the contact detail- Returns:
- contact primary key
-
removeContact
public void removeContact(ContactPK contactPK)
Description copied from interface:ContactServiceremoveContact() remove the contact designed by contactPK parameter.- Specified by:
removeContactin interfaceContactService
-
setDetail
public void setDetail(Contact contact)
Description copied from interface:ContactServicesetDetail() update the contact content.- Specified by:
setDetailin 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:
addFatherin 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:
removeFatherin 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:
removeAllFatherin 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:
removeAllIssuein interfaceContactService- Parameters:
originPK- reference to a categorycontactPK- reference to a contact
-
getOrphanContacts
public Collection<ContactDetail> getOrphanContacts(ContactPK contactPK)
Description copied from interface:ContactServicegetOrphanContacts() return the Detail of contact which are not linked to a father- Specified by:
getOrphanContactsin 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:
deleteOrphanContactsByCreatorIdin interfaceContactService
-
getUnavailableContactsByPublisherId
public Collection<ContactDetail> getUnavailableContactsByPublisherId(ContactPK contactPK, String publisherId, String nodeId)
- Specified by:
getUnavailableContactsByPublisherIdin interfaceContactService
-
getAllFatherPK
public Collection<NodePK> getAllFatherPK(ContactPK contactPK)
getAllFatherPK- Specified by:
getAllFatherPKin 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:
getDetailsByFatherPKin interfaceContactService- Returns:
-
getDetailsByLastName
public Collection<ContactDetail> getDetailsByLastName(ContactPK pk, String query)
- Specified by:
getDetailsByLastNamein interfaceContactService
-
getDetailsByLastNameOrFirstName
public Collection<ContactDetail> getDetailsByLastNameOrFirstName(ContactPK pk, String query)
- Specified by:
getDetailsByLastNameOrFirstNamein interfaceContactService
-
getDetailsByLastNameAndFirstName
public Collection<ContactDetail> getDetailsByLastNameAndFirstName(ContactPK pk, String lastName, String firstName)
- Specified by:
getDetailsByLastNameAndFirstNamein interfaceContactService
-
createInfoModel
public void createInfoModel(ContactPK contactPK, String modelId)
- Specified by:
createInfoModelin interfaceContactService
-
getCompleteContact
public CompleteContact getCompleteContact(ContactPK contactPK, String modelId)
- Specified by:
getCompleteContactin interfaceContactService
-
getCompleteContact
public CompleteContact getCompleteContact(ContactPK contactPK)
- Specified by:
getCompleteContactin interfaceContactService
-
getContacts
public Collection<ContactDetail> getContacts(Collection<ContactPK> contactPKs)
- Specified by:
getContactsin interfaceContactService
-
getNbPubInFatherPKs
public int getNbPubInFatherPKs(Collection<NodePK> fatherPKs)
- Specified by:
getNbPubInFatherPKsin interfaceContactService
-
getDetailsByFatherPKs
public Collection<ContactFatherDetail> getDetailsByFatherPKs(Collection<NodePK> fatherPKs, ContactPK contactPK, NodePK nodePK)
- Specified by:
getDetailsByFatherPKsin interfaceContactService
-
getNbPubByFatherPath
public int getNbPubByFatherPath(NodePK fatherPK, String fatherPath)
- Specified by:
getNbPubByFatherPathin interfaceContactService
-
getVisibleContacts
public List<CompleteContact> getVisibleContacts(String instanceId)
Description copied from interface:ContactServiceGets 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:
getVisibleContactsin 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:
indexin interfaceContactService
-
deleteIndex
public void deleteIndex(ContactPK contactPK)
Called on : - deleteContact()- Specified by:
deleteIndexin 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:
deletein interfaceComponentInstanceDeletion- Parameters:
componentInstanceId- the unique identifier of a component instance.
-
-