Interface SilverpeasContentManager

    • Method Detail

      • getSilverContentByReference

        List<SilverContentInterface> getSilverContentByReference​(List<ResourceReference> resourceReferences,
                                                                 String currentUserId)
        Find all the SilverContents with the given silverpeas content identifiers.
        Parameters:
        resourceReferences - list of silverpeas content identifier as integer
        currentUserId - the identifier of the user accessing the content.
        Returns:
        the content as SilverpeasComponentInstance
      • getSilverContentId

        <T extends Contribution> int getSilverContentId​(T contribution)
        Gets the silverpeas content identifier about a contribution.
        Type Parameters:
        T - a contribution implementation.
        Parameters:
        contribution - a contribution.
        Returns:
        a silverpeas content identifier as integer.
      • getOrCreateSilverContentId

        <T extends Contribution> int getOrCreateSilverContentId​(T contribution)
        Gets the silverpeas content identifier about a contribution.
        If no content identifier exists, then it is created.
        Type Parameters:
        T - a contribution implementation.
        Parameters:
        contribution - a contribution.
        Returns:
        a silverpeas content identifier as integer.
      • getOrCreateSilverContentId

        int getOrCreateSilverContentId​(String resourceId,
                                       String componentInstanceId)

        Gets the silverpeas content identifier for given resource (represented by an id) in the given component instance (represented by an id).

        In a first time, the Contribution from the given identifiers is retrieved.
        An error is thrown if it does not exists.
        Then the getting or creating of the linked silverpeas content id is performed.
        For performances, and if it knows his context, the caller can performed ContentManagementEngine.getSilverContentId(String, String) before calling this method.

        If no silverpeas content identifier exists, then it is created.

        Parameters:
        resourceId - a resource identifier.
        componentInstanceId - a component instance identifier.
        Returns:
        a silverpeas content identifier as integer.
        Throws:
        IllegalArgumentException - if no Contribution can be retrieved from the given identifier.
      • createSilverContent

        <T extends Contribution> int createSilverContent​(T contribution,
                                                         String userId)
        Creates a silverpeas content from a contribution identifier and the instance of the component instance the resource belong to.
        Type Parameters:
        T - a contribution implementation.
        Parameters:
        contribution - a contribution.
        userId - the identifier of the user responsible of the creation.
        Returns:
        the identifier of the silverpeas content of the contribution as integer.
      • deleteSilverContent

        void deleteSilverContent​(String resourceId,
                                 String componentInstanceId)
        Deletes a silverpeas content from a resource identifier and the instance of the component instance the resource belong to.
        Parameters:
        resourceId - the identifier of a resource.
        componentInstanceId - the identifier of the component instance the resource belong to.