Class DefaultYellowpagesService
- java.lang.Object
-
- org.silverpeas.components.yellowpages.service.DefaultYellowpagesService
-
- All Implemented Interfaces:
YellowpagesService
@Service public class DefaultYellowpagesService extends Object implements YellowpagesService
This is the Yellowpages Service layer to manage the yellow page application.- Author:
- Nicolas Eysseric
-
-
Constructor Summary
Constructors Constructor Description DefaultYellowpagesService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContactToTopic(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId)Add a contact to a topic and send email alerts to topic subscribersvoidaddGroup(String groupId, org.silverpeas.core.node.model.NodePK nodePK)voidaddGroup(List<org.silverpeas.core.node.model.NodeDetail> tree, org.silverpeas.core.admin.user.model.Group group, int level)voidaddToTopic(org.silverpeas.core.node.model.NodeDetail father, org.silverpeas.core.node.model.NodeDetail subTopic)Add a subtopic to a topic.StringcreateContact(org.silverpeas.core.contact.model.Contact contact, org.silverpeas.core.node.model.NodePK nodePK)Create a new Contact (only the header - parameters) to the current TopicvoidcreateInfoModel(org.silverpeas.core.contact.model.ContactPK contactPK, String modelId)Create model info attached to a contactvoiddeleteContact(org.silverpeas.core.contact.model.ContactPK contactPK, org.silverpeas.core.node.model.NodePK nodePK)Delete a contact If this contact is in the basket or in the DZ, it's deleted from the database Else it only send to the basketvoiddeleteContactFromTopic(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId)Delete a path between contact and topicvoiddeleteTopic(org.silverpeas.core.node.model.NodePK pkToDelete)Delete a topic and all descendants.voidemptyDZByUserId(String instanceId, String userId)Collection<org.silverpeas.core.contact.model.ContactFatherDetail>getAllContactDetails(org.silverpeas.core.node.model.NodePK nodePK)org.silverpeas.core.contact.model.CompleteContactgetCompleteContact(org.silverpeas.core.contact.model.ContactPK contactPK)org.silverpeas.core.contact.model.CompleteContactgetCompleteContactInNode(org.silverpeas.core.contact.model.ContactPK contactPK, String nodeId)Return all info of a contactorg.silverpeas.core.contact.model.ContactDetailgetContactDetail(org.silverpeas.core.contact.model.ContactPK contactPK)Return the detail of a contact (only the Header)Collection<org.silverpeas.core.contact.model.ContactDetail>getContactDetailsByLastName(org.silverpeas.core.contact.model.ContactPK pk, String query)Collection<org.silverpeas.core.contact.model.ContactDetail>getContactDetailsByLastNameAndFirstName(org.silverpeas.core.contact.model.ContactPK pk, String lastName, String firstName)Collection<org.silverpeas.core.contact.model.ContactDetail>getContactDetailsByLastNameOrFirstName(org.silverpeas.core.contact.model.ContactPK pk, String query)Collection<org.silverpeas.core.node.model.NodePK>getContactFathers(org.silverpeas.core.contact.model.ContactPK contactPK)Collection<UserContact>getContacts(Collection<String> contactIds, String instanceId)Return a collection of ContactDetail throught a collection of contact idsList<org.silverpeas.core.admin.user.model.Group>getGroups(org.silverpeas.core.node.model.NodePK pk)GetsGroupState.VALIDGrouphosted by the given node.Collection<String>getModelUsed(String instanceId)List<Collection<org.silverpeas.core.node.model.NodeDetail>>getPathList(org.silverpeas.core.contact.model.ContactPK contactPK)Return list of all path to this contact - it's a Collection of NodeDetail collectionorg.silverpeas.core.node.model.NodeDetailgetSubTopicDetail(org.silverpeas.core.node.model.NodePK pk)Return a subtopic to currentTopicList<org.silverpeas.core.node.model.NodeDetail>getTree(String instanceId)TopicDetailgoTo(org.silverpeas.core.node.model.NodePK pk, String userId)Return a the detail of a topicvoidindex(String instanceId)voidremoveGroup(String groupId)voidremoveGroup(String groupId, org.silverpeas.core.node.model.NodePK nodePK)voidsetModelUsed(String[] models, String instanceId)voidunreferenceOrphanContacts(org.silverpeas.core.contact.model.ContactPK contactPK)voidupdateContact(org.silverpeas.core.contact.model.Contact contactDetail)Update a contact (only the header - parameters)voidupdateTopic(org.silverpeas.core.node.model.NodeDetail topic)Update a subtopic to currentTopic.
-
-
-
Method Detail
-
goTo
public TopicDetail goTo(org.silverpeas.core.node.model.NodePK pk, String userId)
Return a the detail of a topic- Specified by:
goToin interfaceYellowpagesService- Parameters:
pk- the id of the topic- Returns:
- a TopicDetail
- See Also:
TopicDetail
-
getTree
public List<org.silverpeas.core.node.model.NodeDetail> getTree(String instanceId)
- Specified by:
getTreein interfaceYellowpagesService
-
addGroup
public void addGroup(List<org.silverpeas.core.node.model.NodeDetail> tree, org.silverpeas.core.admin.user.model.Group group, int level)
-
addToTopic
public void addToTopic(org.silverpeas.core.node.model.NodeDetail father, org.silverpeas.core.node.model.NodeDetail subTopic)Description copied from interface:YellowpagesServiceAdd a subtopic to a topic. Does nothing if a subtopic with the same name exists in the father topic.- Specified by:
addToTopicin interfaceYellowpagesService- Parameters:
father- the fathersubTopic- the NodeDetail of the new sub topic- See Also:
NodeDetail,NodePK
-
updateTopic
public void updateTopic(org.silverpeas.core.node.model.NodeDetail topic)
Description copied from interface:YellowpagesServiceUpdate a subtopic to currentTopic. Does nothing if the topic to update is at the same level than another sibling topic.- Specified by:
updateTopicin interfaceYellowpagesService- Parameters:
topic- the NodeDetail of the updated sub topic- See Also:
NodeDetail,NodePK
-
getSubTopicDetail
public org.silverpeas.core.node.model.NodeDetail getSubTopicDetail(org.silverpeas.core.node.model.NodePK pk)
Description copied from interface:YellowpagesServiceReturn a subtopic to currentTopic- Specified by:
getSubTopicDetailin interfaceYellowpagesService- Parameters:
pk- the id of the researched topic- Returns:
- the detail of the specified topic
- See Also:
NodeDetail
-
deleteTopic
public void deleteTopic(org.silverpeas.core.node.model.NodePK pkToDelete)
Delete a topic and all descendants. Delete all links between descendants and contacts. This contacts will be visible in the Declassified zone. Delete All subscriptions and favorites on this topics and all descendants- Specified by:
deleteTopicin interfaceYellowpagesService- Parameters:
pkToDelete- the id of the topic to delete
-
getContactDetail
public org.silverpeas.core.contact.model.ContactDetail getContactDetail(org.silverpeas.core.contact.model.ContactPK contactPK)
Return the detail of a contact (only the Header)- Specified by:
getContactDetailin interfaceYellowpagesService- Parameters:
contactPK- the id of the contact- Returns:
- a ContactDetail
- See Also:
ContactDetail
-
getContactDetailsByLastName
public Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastName(org.silverpeas.core.contact.model.ContactPK pk, String query)
- Specified by:
getContactDetailsByLastNamein interfaceYellowpagesService
-
getContactDetailsByLastNameOrFirstName
public Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastNameOrFirstName(org.silverpeas.core.contact.model.ContactPK pk, String query)
- Specified by:
getContactDetailsByLastNameOrFirstNamein interfaceYellowpagesService
-
getContactDetailsByLastNameAndFirstName
public Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastNameAndFirstName(org.silverpeas.core.contact.model.ContactPK pk, String lastName, String firstName)
- Specified by:
getContactDetailsByLastNameAndFirstNamein interfaceYellowpagesService
-
getAllContactDetails
public Collection<org.silverpeas.core.contact.model.ContactFatherDetail> getAllContactDetails(org.silverpeas.core.node.model.NodePK nodePK)
- Specified by:
getAllContactDetailsin interfaceYellowpagesService
-
getPathList
public List<Collection<org.silverpeas.core.node.model.NodeDetail>> getPathList(org.silverpeas.core.contact.model.ContactPK contactPK)
Return list of all path to this contact - it's a Collection of NodeDetail collection- Specified by:
getPathListin interfaceYellowpagesService- Parameters:
contactPK- the id of the contact- Returns:
- a Collection of NodeDetail collection
- See Also:
NodeDetail
-
createContact
public String createContact(org.silverpeas.core.contact.model.Contact contact, org.silverpeas.core.node.model.NodePK nodePK)
Create a new Contact (only the header - parameters) to the current Topic- Specified by:
createContactin interfaceYellowpagesService- Parameters:
contact- a contact- Returns:
- the id of the new contact
- See Also:
Contact
-
updateContact
public void updateContact(org.silverpeas.core.contact.model.Contact contactDetail)
Update a contact (only the header - parameters)- Specified by:
updateContactin interfaceYellowpagesService- Parameters:
contactDetail- a ContactDetail- See Also:
Contact
-
deleteContact
public void deleteContact(org.silverpeas.core.contact.model.ContactPK contactPK, org.silverpeas.core.node.model.NodePK nodePK)Delete a contact If this contact is in the basket or in the DZ, it's deleted from the database Else it only send to the basket- Specified by:
deleteContactin interfaceYellowpagesService- Parameters:
contactPK- the id of the contact to delete- See Also:
TopicDetail
-
emptyDZByUserId
public void emptyDZByUserId(String instanceId, String userId)
- Specified by:
emptyDZByUserIdin interfaceYellowpagesService
-
addContactToTopic
public void addContactToTopic(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId)Add a contact to a topic and send email alerts to topic subscribers- Specified by:
addContactToTopicin interfaceYellowpagesService- Parameters:
contactPK- the id of the contactfatherId- the id of the topic
-
deleteContactFromTopic
public void deleteContactFromTopic(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId)Delete a path between contact and topic- Specified by:
deleteContactFromTopicin interfaceYellowpagesService- Parameters:
contactPK- the id of the contactfatherId- the id of the topic
-
createInfoModel
public void createInfoModel(org.silverpeas.core.contact.model.ContactPK contactPK, String modelId)Create model info attached to a contact- Specified by:
createInfoModelin interfaceYellowpagesService- Parameters:
contactPK- the id of the contactmodelId- the id of the selected model
-
getCompleteContactInNode
public org.silverpeas.core.contact.model.CompleteContact getCompleteContactInNode(org.silverpeas.core.contact.model.ContactPK contactPK, String nodeId)Return all info of a contact- Specified by:
getCompleteContactInNodein interfaceYellowpagesService- Parameters:
contactPK- the id of a contactnodeId- the id of the node- Returns:
- a CompleteContact
- See Also:
CompleteContact
-
getCompleteContact
public org.silverpeas.core.contact.model.CompleteContact getCompleteContact(org.silverpeas.core.contact.model.ContactPK contactPK)
- Specified by:
getCompleteContactin interfaceYellowpagesService
-
getContacts
public Collection<UserContact> getContacts(Collection<String> contactIds, String instanceId)
Return a collection of ContactDetail throught a collection of contact ids- Specified by:
getContactsin interfaceYellowpagesService- Parameters:
contactIds- a collection of contact ids- Returns:
- a collection of ContactDetail
- See Also:
ContactDetail
-
getContactFathers
public Collection<org.silverpeas.core.node.model.NodePK> getContactFathers(org.silverpeas.core.contact.model.ContactPK contactPK)
- Specified by:
getContactFathersin interfaceYellowpagesService
-
unreferenceOrphanContacts
public void unreferenceOrphanContacts(org.silverpeas.core.contact.model.ContactPK contactPK)
-
getGroups
public List<org.silverpeas.core.admin.user.model.Group> getGroups(org.silverpeas.core.node.model.NodePK pk)
Description copied from interface:YellowpagesServiceGetsGroupState.VALIDGrouphosted by the given node.- Specified by:
getGroupsin interfaceYellowpagesService- Parameters:
pk- the reference to a node.- Returns:
- a list of
GroupState.VALIDGroupinstance.
-
addGroup
public void addGroup(String groupId, org.silverpeas.core.node.model.NodePK nodePK)
- Specified by:
addGroupin interfaceYellowpagesService
-
removeGroup
public void removeGroup(String groupId)
- Specified by:
removeGroupin interfaceYellowpagesService
-
removeGroup
public void removeGroup(String groupId, org.silverpeas.core.node.model.NodePK nodePK)
- Specified by:
removeGroupin interfaceYellowpagesService
-
setModelUsed
public void setModelUsed(String[] models, String instanceId)
- Specified by:
setModelUsedin interfaceYellowpagesService
-
getModelUsed
public Collection<String> getModelUsed(String instanceId)
- Specified by:
getModelUsedin interfaceYellowpagesService
-
index
public void index(String instanceId)
- Specified by:
indexin interfaceYellowpagesService
-
-