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 SummaryConstructors Constructor Description DefaultYellowpagesService()
 - 
Method SummaryAll 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)List<org.silverpeas.core.node.model.NodeDetail>addGroup(List<org.silverpeas.core.node.model.NodeDetail> tree, org.silverpeas.core.admin.user.model.Group group, int level)org.silverpeas.core.node.model.NodePKaddToTopic(org.silverpeas.core.node.model.NodeDetail father, org.silverpeas.core.node.model.NodeDetail subTopic)Add a subtopic to a topic - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePKStringcreateContact(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)org.silverpeas.core.node.model.NodePKupdateTopic(org.silverpeas.core.node.model.NodeDetail topic)Update a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
 
- 
- 
- 
Method Detail- 
goTopublic TopicDetail goTo(org.silverpeas.core.node.model.NodePK pk, String userId) Return a the detail of a topic- Specified by:
- goToin interface- YellowpagesService
- Parameters:
- pk- the id of the topic
- Returns:
- a TopicDetail
- See Also:
- TopicDetail
 
 - 
getTreepublic List<org.silverpeas.core.node.model.NodeDetail> getTree(String instanceId) - Specified by:
- getTreein interface- YellowpagesService
 
 - 
addGrouppublic List<org.silverpeas.core.node.model.NodeDetail> addGroup(List<org.silverpeas.core.node.model.NodeDetail> tree, org.silverpeas.core.admin.user.model.Group group, int level) 
 - 
addToTopicpublic org.silverpeas.core.node.model.NodePK addToTopic(org.silverpeas.core.node.model.NodeDetail father, org.silverpeas.core.node.model.NodeDetail subTopic)Add a subtopic to a topic - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK- Specified by:
- addToTopicin interface- YellowpagesService
- Parameters:
- father- the topic Id of the future father
- subTopic- the NodeDetail of the new sub topic
- Returns:
- If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
- See Also:
- NodeDetail,- NodePK
 
 - 
updateTopicpublic org.silverpeas.core.node.model.NodePK updateTopic(org.silverpeas.core.node.model.NodeDetail topic) Update a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK- Specified by:
- updateTopicin interface- YellowpagesService
- Parameters:
- topic- the NodeDetail of the updated sub topic
- Returns:
- If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
- See Also:
- NodeDetail,- NodePK
 
 - 
getSubTopicDetailpublic 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 interface- YellowpagesService
- Parameters:
- pk- the id of the researched topic
- Returns:
- the detail of the specified topic
- See Also:
- NodeDetail
 
 - 
deleteTopicpublic 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 interface- YellowpagesService
- Parameters:
- pkToDelete- the id of the topic to delete
 
 - 
getContactDetailpublic 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 interface- YellowpagesService
- Parameters:
- contactPK- the id of the contact
- Returns:
- a ContactDetail
- See Also:
- ContactDetail
 
 - 
getContactDetailsByLastNamepublic Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastName(org.silverpeas.core.contact.model.ContactPK pk, String query) - Specified by:
- getContactDetailsByLastNamein interface- YellowpagesService
 
 - 
getContactDetailsByLastNameOrFirstNamepublic Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastNameOrFirstName(org.silverpeas.core.contact.model.ContactPK pk, String query) - Specified by:
- getContactDetailsByLastNameOrFirstNamein interface- YellowpagesService
 
 - 
getContactDetailsByLastNameAndFirstNamepublic Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastNameAndFirstName(org.silverpeas.core.contact.model.ContactPK pk, String lastName, String firstName) - Specified by:
- getContactDetailsByLastNameAndFirstNamein interface- YellowpagesService
 
 - 
getAllContactDetailspublic Collection<org.silverpeas.core.contact.model.ContactFatherDetail> getAllContactDetails(org.silverpeas.core.node.model.NodePK nodePK) - Specified by:
- getAllContactDetailsin interface- YellowpagesService
 
 - 
getPathListpublic 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 interface- YellowpagesService
- Parameters:
- contactPK- the id of the contact
- Returns:
- a Collection of NodeDetail collection
- See Also:
- NodeDetail
 
 - 
createContactpublic 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 interface- YellowpagesService
- Parameters:
- contact- a contact
- Returns:
- the id of the new contact
- See Also:
- Contact
 
 - 
updateContactpublic void updateContact(org.silverpeas.core.contact.model.Contact contactDetail) Update a contact (only the header - parameters)- Specified by:
- updateContactin interface- YellowpagesService
- Parameters:
- contactDetail- a ContactDetail
- See Also:
- Contact
 
 - 
deleteContactpublic 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 interface- YellowpagesService
- Parameters:
- contactPK- the id of the contact to delete
- See Also:
- TopicDetail
 
 - 
emptyDZByUserIdpublic void emptyDZByUserId(String instanceId, String userId) - Specified by:
- emptyDZByUserIdin interface- YellowpagesService
 
 - 
addContactToTopicpublic 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 interface- YellowpagesService
- Parameters:
- contactPK- the id of the contact
- fatherId- the id of the topic
 
 - 
deleteContactFromTopicpublic void deleteContactFromTopic(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId)Delete a path between contact and topic- Specified by:
- deleteContactFromTopicin interface- YellowpagesService
- Parameters:
- contactPK- the id of the contact
- fatherId- the id of the topic
 
 - 
createInfoModelpublic void createInfoModel(org.silverpeas.core.contact.model.ContactPK contactPK, String modelId)Create model info attached to a contact- Specified by:
- createInfoModelin interface- YellowpagesService
- Parameters:
- contactPK- the id of the contact
- modelId- the id of the selected model
 
 - 
getCompleteContactInNodepublic 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 interface- YellowpagesService
- Parameters:
- contactPK- the id of a contact
- nodeId- the id of the node
- Returns:
- a CompleteContact
- See Also:
- CompleteContact
 
 - 
getCompleteContactpublic org.silverpeas.core.contact.model.CompleteContact getCompleteContact(org.silverpeas.core.contact.model.ContactPK contactPK) - Specified by:
- getCompleteContactin interface- YellowpagesService
 
 - 
getContactspublic Collection<UserContact> getContacts(Collection<String> contactIds, String instanceId) Return a collection of ContactDetail throught a collection of contact ids- Specified by:
- getContactsin interface- YellowpagesService
- Parameters:
- contactIds- a collection of contact ids
- Returns:
- a collection of ContactDetail
- See Also:
- ContactDetail
 
 - 
getContactFatherspublic Collection<org.silverpeas.core.node.model.NodePK> getContactFathers(org.silverpeas.core.contact.model.ContactPK contactPK) - Specified by:
- getContactFathersin interface- YellowpagesService
 
 - 
unreferenceOrphanContactspublic void unreferenceOrphanContacts(org.silverpeas.core.contact.model.ContactPK contactPK) 
 - 
getGroupspublic 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 interface- YellowpagesService
- Parameters:
- pk- the reference to a node.
- Returns:
- a list of GroupState.VALIDGroupinstance.
 
 - 
addGrouppublic void addGroup(String groupId, org.silverpeas.core.node.model.NodePK nodePK) - Specified by:
- addGroupin interface- YellowpagesService
 
 - 
removeGrouppublic void removeGroup(String groupId) - Specified by:
- removeGroupin interface- YellowpagesService
 
 - 
removeGrouppublic void removeGroup(String groupId, org.silverpeas.core.node.model.NodePK nodePK) - Specified by:
- removeGroupin interface- YellowpagesService
 
 - 
setModelUsedpublic void setModelUsed(String[] models, String instanceId) - Specified by:
- setModelUsedin interface- YellowpagesService
 
 - 
getModelUsedpublic Collection<String> getModelUsed(String instanceId) - Specified by:
- getModelUsedin interface- YellowpagesService
 
 - 
indexpublic void index(String instanceId) - Specified by:
- indexin interface- YellowpagesService
 
 
- 
 
-