Package org.silverpeas.core.cmis
Interface CmisContributionsProvider
-
public interface CmisContributionsProviderA provider of user contributions in order to be exposed through the Silverpeas implementation of the CMIS objects tree. Each application that has to expose some of its contributions must implements this interface by a CDI managed bean. The bean will be then discovered by the CMIS system in order to get some contributions managed by the application. For doing, the bean has to be annotated with the @Namedqualifier with as value the name of the application following by the suffixContributionsProvider. The way the contributions are handled in the application or the concrete type of the contribution is left to the implementation details of the bean implementing this interface.- Author:
- mmoquillon
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCmisContributionsProvider.Constants
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description I18nContributioncreateContribution(I18nContribution contribution, ResourceIdentifier app, String language)Creates the specified contribution into the specified application.I18nContributioncreateContributionInFolder(I18nContribution contribution, ContributionIdentifier folder, String language)Creates the specified contribution into the specified folder.List<I18nContribution>getAllowedContributionsInFolder(ContributionIdentifier folder, User user)Gets the contributions that are directly in the specified folder and that are accessible to the given user.List<I18nContribution>getAllowedRootContributions(ResourceIdentifier appId, User user)Gets the contributions that are rooted at the specified application and that are accessible to the given user.static CmisContributionsProvidergetByAppId(String appId)Gets a provider of user contributions managed by the specified application.I18nContributiongetContribution(ContributionIdentifier contributionId, User user)Gets the specified contribution accessible to the given user.
-
-
-
Method Detail
-
getByAppId
static CmisContributionsProvider getByAppId(String appId)
Gets a provider of user contributions managed by the specified application.- Parameters:
appId- the unique identifier of an application in Silverpeas.- Returns:
- a
CmisContributionsProviderinstance. - Throws:
org.silverpeas.kernel.SilverpeasRuntimeException- if no suchCmisContributionsProviderinstance can be found.
-
getAllowedRootContributions
List<I18nContribution> getAllowedRootContributions(ResourceIdentifier appId, User user)
Gets the contributions that are rooted at the specified application and that are accessible to the given user. For applications usingFolders to categorize the content, the root contributions are those that are contained directly in the root folder (in other words, the folder representation of the application).- Parameters:
appId- the unique identifier of a component instance. Should throwCmisObjectNotFoundExceptionexception if there is no such application.user- a user in Silverpeas.- Returns:
- a list with the localized contributions directly accessible at the root level of the application. If there is no contributions, then an empty list is returned.
-
getAllowedContributionsInFolder
List<I18nContribution> getAllowedContributionsInFolder(ContributionIdentifier folder, User user)
Gets the contributions that are directly in the specified folder and that are accessible to the given user. If the folder or the application doesn't exist, aCmisObjectNotFoundExceptionexception has to be thrown.- Parameters:
folder- a folder in the application.user- a user in Silverpeas.- Returns:
- a list with the localized contributions contained in the given folder. If the folder doesn't have any contributions, then an empty list is returned.
-
getContribution
I18nContribution getContribution(ContributionIdentifier contributionId, User user)
Gets the specified contribution accessible to the given user. If the contribution doesn't exist then aCmisObjectNotFoundExceptionmust be thrown. If the contribution cannot be accessed by the given user then aCmisPermissionDeniedExceptionmust be thrown.- Parameters:
contributionId- the unique identifier of the contribution to get.- Returns:
- the asked contribution.
-
createContribution
I18nContribution createContribution(I18nContribution contribution, ResourceIdentifier app, String language)
Creates the specified contribution into the specified application. If the application doesn't yet support the creation by CMIS of the specified contribution, then aCmisNotSupportedExceptionexception has to be thrown. If the specified application doesn't exist then aCmisObjectNotFoundExceptionexception has to be thrown.- Parameters:
contribution- the localized contribution to create.app- the unique identifier of the Silverpeas application in which the contribution has to be created and then managed.language- the language in which is authored the contribution.- Returns:
- the instance of the created contribution. It can be different of the one passed as argument.
-
createContributionInFolder
I18nContribution createContributionInFolder(I18nContribution contribution, ContributionIdentifier folder, String language)
Creates the specified contribution into the specified folder. If the application doesn't yet support the creation by CMIS of the specified contribution, then aCmisNotSupportedExceptionexception has to be thrown. If the specified folder or the application with the given folder doesn't exist, aCmisObjectNotFoundExceptionhas to be thrown.- Parameters:
contribution- the localized contribution to create.folder- the unique identifier of the folder in which the contribution has to be added once created.language- the language in which is authored the contribution.- Returns:
- the instance of the created contribution. It can be different of the one passed as argument.
-
-