Class DefaultYellowpagesService
java.lang.Object
org.silverpeas.components.yellowpages.service.DefaultYellowpagesService
- All Implemented Interfaces:
YellowpagesService
This is the Yellowpages Service layer to manage the yellow page application.
- Author:
- Nicolas Eysseric
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContactToTopic(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId) Add a contact to a topic and send email alerts to topic subscribersvoidvoidaddGroup(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.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 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 sends 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) getContacts(Collection<String> contactIds, String instanceId) Return a collection of ContactDetail through 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.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>Return a detail of a topicvoidvoidremoveGroup(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.
-
Constructor Details
-
DefaultYellowpagesService
public DefaultYellowpagesService()
-
-
Method Details
-
goTo
Return a detail of a topic- Specified by:
goToin interfaceYellowpagesService- Parameters:
pk- the id of the topic- Returns:
- a TopicDetail
- See Also:
-
getTree
- 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:
-
NodeDetailNodePK
-
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 as another sibling topic.- Specified by:
updateTopicin interfaceYellowpagesService- Parameters:
topic- the NodeDetail of the updated sub topic- See Also:
-
NodeDetailNodePK
-
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 these 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 sends to the basket- Specified by:
deleteContactin interfaceYellowpagesService- Parameters:
contactPK- the id of the contact to delete- See Also:
-
emptyDZByUserId
- 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
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
Return a collection of ContactDetail through 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
- Specified by:
addGroupin interfaceYellowpagesService
-
removeGroup
- Specified by:
removeGroupin interfaceYellowpagesService
-
removeGroup
- Specified by:
removeGroupin interfaceYellowpagesService
-
setModelUsed
- Specified by:
setModelUsedin interfaceYellowpagesService
-
getModelUsed
- Specified by:
getModelUsedin interfaceYellowpagesService
-
index
- Specified by:
indexin interfaceYellowpagesService
-