Interface SilverpeasContentManager
-
- All Known Implementing Classes:
AbstractSilverpeasContentManager
public interface SilverpeasContentManager
A manager of a given type of content in Silverpeas. Every containers ofSilverpeasContent
objects have to implement this interface.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Contribution>
intcreateSilverContent(T contribution, String userId)
Creates a silverpeas content from a contribution identifier and the instance of the component instance the resource belong to.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.static Optional<SilverpeasContentManager>
getByInstanceId(String componentInstanceId)
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).<T extends Contribution>
intgetOrCreateSilverContentId(T contribution)
Gets the silverpeas content identifier about a contribution.
If no content identifier exists, then it is created.List<SilverContentInterface>
getSilverContentByReference(List<ResourceReference> resourceReferences, String currentUserId)
Find all the SilverContents with the given silverpeas content identifiers.<T extends Contribution>
intgetSilverContentId(T contribution)
Gets the silverpeas content identifier about a contribution.
-
-
-
Method Detail
-
getByInstanceId
static Optional<SilverpeasContentManager> getByInstanceId(String componentInstanceId)
-
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 integercurrentUserId
- 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 performedContentManagementEngine.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 noContribution
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.
-
-