Package org.silverpeas.components.yellowpages.service

## Interface YellowpagesService

- All Known Implementing Classes:
    `DefaultYellowpagesService`

      public interface YellowpagesService

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addContactToTopic​(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId)` | Add a contact to a topic and send email alerts to topic subscribers
    `void` | `addGroup​(String groupId, org.silverpeas.core.node.model.NodePK nodePK)` |
    `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
    `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
    `void` | `createInfoModel​(org.silverpeas.core.contact.model.ContactPK contactPK, String modelId)` | Create model info attached to a contact
    `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
    `void` | `deleteContactFromTopic​(org.silverpeas.core.contact.model.ContactPK contactPK, String fatherId)` | Delete a path between contact and topic
    `void` | `deleteTopic​(org.silverpeas.core.node.model.NodePK pkToDelete)` | Delete a topic and all descendants.
    `void` | `emptyDZByUserId​(String instanceId, String userId)` |
    `static YellowpagesService` | `get()` |
    `Collection<org.silverpeas.core.contact.model.ContactFatherDetail>` | `getAllContactDetails​(org.silverpeas.core.node.model.NodePK nodePK)` |
    `org.silverpeas.core.contact.model.CompleteContact` | `getCompleteContact​(org.silverpeas.core.contact.model.ContactPK contactPK)` |
    `org.silverpeas.core.contact.model.CompleteContact` | `getCompleteContactInNode​(org.silverpeas.core.contact.model.ContactPK contactPK, String nodeId)` | Return all info of a contact and add a reading statistic
    `org.silverpeas.core.contact.model.ContactDetail` | `getContactDetail​(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 through a collection of contact ids
    `List<org.silverpeas.core.admin.user.model.Group>` | `getGroups​(org.silverpeas.core.node.model.NodePK pk)` | Gets `GroupState.VALID` `Group` hosted 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 collection
    `org.silverpeas.core.node.model.NodeDetail` | `getSubTopicDetail​(org.silverpeas.core.node.model.NodePK pk)` | Return a subtopic to currentTopic
    `List<org.silverpeas.core.node.model.NodeDetail>` | `getTree​(String instanceId)` |
    `TopicDetail` | `goTo​(org.silverpeas.core.node.model.NodePK pk, String userId)` | Return a the detail of a topic
    `void` | `index​(String instanceId)` |
    `void` | `removeGroup​(String groupId)` |
    `void` | `removeGroup​(String groupId, org.silverpeas.core.node.model.NodePK nodePK)` |
    `void` | `setModelUsed​(String[] models, String instanceId)` |
    `void` | `updateContact​(org.silverpeas.core.contact.model.Contact contact)` | Update a contact (only the header - parameters)
    `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

- - ### Method Detail

    - #### get

          static YellowpagesService get()

    - #### goTo

          TopicDetail goTo​(org.silverpeas.core.node.model.NodePK pk,
                           String userId)

      Return a the detail of a topic
      Parameters:
        `pk` - the id of the topic
      Returns:
        a TopicDetail
      Since:
        1.0
      See Also:
        `TopicDetail`

    - #### getTree

          List<org.silverpeas.core.node.model.NodeDetail> getTree​(String instanceId)

    - #### addToTopic

          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
      Parameters:
        `father` - the 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
      Since:
        1.0
      See Also:
        `NodeDetail`, `NodePK`

    - #### updateTopic

          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
      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
      Since:
        1.0
      See Also:
        `NodeDetail`, `NodePK`

    - #### getSubTopicDetail

          org.silverpeas.core.node.model.NodeDetail getSubTopicDetail​(org.silverpeas.core.node.model.NodePK pk)

      Return a subtopic to currentTopic
      Parameters:
        `pk` - the id of the researched topic
      Returns:
        the detail of the specified topic
      Since:
        1.0
      See Also:
        `NodeDetail`

    - #### deleteTopic

          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
      Parameters:
        `pkToDelete` - the id of the topic to delete
      Since:
        1.0

    - #### emptyDZByUserId

          void emptyDZByUserId​(String instanceId,
                               String userId)

    - #### getContactDetail

          org.silverpeas.core.contact.model.ContactDetail getContactDetail​(org.silverpeas.core.contact.model.ContactPK contactPK)

      Return the detail of a contact (only the Header)
      Parameters:
        `contactPK` - the id of the contact
      Returns:
        a ContactDetail
      Since:
        1.0
      See Also:
        `ContactDetail`

    - #### getPathList

          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
      Parameters:
        `contactPK` - the id of the contact
      Returns:
        a Collection of NodeDetail collection
      Since:
        1.0
      See Also:
        `NodeDetail`

    - #### createContact

          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
      Parameters:
        `contact` - a contact
      Returns:
        the id of the new contact
      Since:
        1.0
      See Also:
        `ContactDetail`

    - #### updateContact

          void updateContact​(org.silverpeas.core.contact.model.Contact contact)

      Update a contact (only the header - parameters)
      Parameters:
        `contact` - a contact
      Since:
        1.0
      See Also:
        `Contact`

    - #### deleteContact

          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
      Parameters:
        `contactPK` - the id of the contact to delete
      Since:
        1.0
      See Also:
        `TopicDetail`

    - #### addContactToTopic

          void addContactToTopic​(org.silverpeas.core.contact.model.ContactPK contactPK,
                                 String fatherId)

      Add a contact to a topic and send email alerts to topic subscribers
      Parameters:
        `contactPK` - the id of the contact
        `fatherId` - the id of the topic
      Since:
        1.0

    - #### deleteContactFromTopic

          void deleteContactFromTopic​(org.silverpeas.core.contact.model.ContactPK contactPK,
                                      String fatherId)

      Delete a path between contact and topic
      Parameters:
        `contactPK` - the id of the contact
        `fatherId` - the id of the topic
      Since:
        1.0

    - #### createInfoModel

          void createInfoModel​(org.silverpeas.core.contact.model.ContactPK contactPK,
                               String modelId)

      Create model info attached to a contact
      Parameters:
        `contactPK` - the id of the contact
        `modelId` - the id of the selected model
      Since:
        1.0

    - #### getCompleteContactInNode

          org.silverpeas.core.contact.model.CompleteContact getCompleteContactInNode​(org.silverpeas.core.contact.model.ContactPK contactPK,
                                                                                     String nodeId)

      Return all info of a contact and add a reading statistic
      Parameters:
        `contactPK` - the id of a contact
        `nodeId` - the id of the node
      Returns:
        a CompleteContact
      See Also:
        `CompleteContact`

    - #### getCompleteContact

          org.silverpeas.core.contact.model.CompleteContact getCompleteContact​(org.silverpeas.core.contact.model.ContactPK contactPK)

    - #### getContacts

          Collection<UserContact> getContacts​(Collection<String> contactIds,
                                              String instanceId)

      Return a collection of ContactDetail through a collection of contact ids
      Parameters:
        `contactIds` - a collection of contact ids
      Returns:
        a collection of ContactDetail
      Since:
        1.0
      See Also:
        `ContactDetail`

    - #### getContactDetailsByLastName

          Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastName​(org.silverpeas.core.contact.model.ContactPK pk,
                                                                                                  String query)

    - #### getContactDetailsByLastNameOrFirstName

          Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastNameOrFirstName​(org.silverpeas.core.contact.model.ContactPK pk,
                                                                                                             String query)

    - #### getContactDetailsByLastNameAndFirstName

          Collection<org.silverpeas.core.contact.model.ContactDetail> getContactDetailsByLastNameAndFirstName​(org.silverpeas.core.contact.model.ContactPK pk,
                                                                                                              String lastName,
                                                                                                              String firstName)

    - #### getContactFathers

          Collection<org.silverpeas.core.node.model.NodePK> getContactFathers​(org.silverpeas.core.contact.model.ContactPK contactPK)

    - #### getAllContactDetails

          Collection<org.silverpeas.core.contact.model.ContactFatherDetail> getAllContactDetails​(org.silverpeas.core.node.model.NodePK nodePK)

    - #### getGroups

          List<org.silverpeas.core.admin.user.model.Group> getGroups​(org.silverpeas.core.node.model.NodePK pk)

      Gets `GroupState.VALID` `Group` hosted by the given node.
      Parameters:
        `pk` - the reference to a node.
      Returns:
        a list of `GroupState.VALID` `Group` instance.

    - #### addGroup

          void addGroup​(String groupId,
                        org.silverpeas.core.node.model.NodePK nodePK)

    - #### removeGroup

          void removeGroup​(String groupId)

    - #### removeGroup

          void removeGroup​(String groupId,
                           org.silverpeas.core.node.model.NodePK nodePK)

    - #### setModelUsed

          void setModelUsed​(String[] models,
                            String instanceId)

    - #### getModelUsed

          Collection<String> getModelUsed​(String instanceId)

    - #### index

          void index​(String instanceId)