Package org.silverpeas.components.whitepages.control

## Class CardManager

- java.lang.Object
- - org.silverpeas.components.whitepages.control.CardManager

-     @Service
      public class CardManager
      extends Object

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `CardManager()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `create​(Card card, String creatorId, org.silverpeas.core.pdc.pdc.model.PdcClassification classification)` |
    `void` | `delete​(Collection<String> ids)` |
    `boolean` | `existCard​(String userId, String instanceId)` |
    `Card` | `getCard​(long id)` |
    `Collection<Card>` | `getCards​(String instanceId)` |
    `Collection<Card>` | `getCardsByIds​(List<String> ids)` |
    `List<WhitePagesCard>` | `getHomeUserCards​(String userId, Collection<String> instanceIds, String instanceId)` |
    `static CardManager` | `getInstance()` |
    `Card` | `getUserCard​(String userId, String instanceId)` | Get card for a user and instance.
    `List<WhitePagesCard>` | `getUserCards​(String userId, Collection<String> instanceIds)` |
    `Collection<Card>` | `getVisibleCards​(String instanceId)` |
    `void` | `indexCard​(Card card)` |
    `boolean` | `isPublicationClassifiedOnPDC​(Card card)` |
    `void` | `reverseHide​(Collection<String> ids)` |
    `void` | `setHideStatus​(Collection<String> ids, int status)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CardManager

          protected CardManager()

  - ### Method Detail

    - #### getInstance

          public static CardManager getInstance()

    - #### create

          public long create​(Card card,
                             String creatorId,
                             org.silverpeas.core.pdc.pdc.model.PdcClassification classification)
                      throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### delete

          public void delete​(Collection<String> ids)
                      throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### getCard

          public Card getCard​(long id)
                       throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### getCards

          public Collection<Card> getCards​(String instanceId)
                                    throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### getCardsByIds

          public Collection<Card> getCardsByIds​(List<String> ids)
                                         throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### getVisibleCards

          public Collection<Card> getVisibleCards​(String instanceId)
                                           throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### getUserCards

          public List<WhitePagesCard> getUserCards​(String userId,
                                                   Collection<String> instanceIds)
                                            throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### getHomeUserCards

          public List<WhitePagesCard> getHomeUserCards​(String userId,
                                                       Collection<String> instanceIds,
                                                       String instanceId)
                                                throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### setHideStatus

          public void setHideStatus​(Collection<String> ids,
                                    int status)
                             throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### reverseHide

          public void reverseHide​(Collection<String> ids)
                           throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### existCard

          public boolean existCard​(String userId,
                                   String instanceId)
                            throws WhitePagesException

      Throws:
        `WhitePagesException`

    - #### isPublicationClassifiedOnPDC

          public boolean isPublicationClassifiedOnPDC​(Card card)
                                               throws org.silverpeas.core.contribution.contentcontainer.content.ContentManagerException,
                                                      org.silverpeas.core.pdc.pdc.model.PdcException

      Throws:
        `org.silverpeas.core.contribution.contentcontainer.content.ContentManagerException`
        `org.silverpeas.core.pdc.pdc.model.PdcException`

    - #### getUserCard

          public Card getUserCard​(String userId,
                                  String instanceId)
                           throws WhitePagesException

      Get card for a user and instance.
      Parameters:
        `userId` - user id
        `instanceId` - instance id
      Returns:
        the card, null if not found
      Throws:
        `WhitePagesException` - if an error occurs

    - #### indexCard

          public void indexCard​(Card card)