Interface CmisContributionsProvider


  • public interface CmisContributionsProvider
    A 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 @Named qualifier with as value the name of the application following by the suffix ContributionsProvider. 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
    • Method Detail

      • 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 using Folders 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 throw CmisObjectNotFoundException exception 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, a CmisObjectNotFoundException exception 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 a CmisObjectNotFoundException must be thrown. If the contribution cannot be accessed by the given user then a CmisPermissionDeniedException must 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 a CmisNotSupportedException exception has to be thrown. If the specified application doesn't exist then a CmisObjectNotFoundException exception 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 a CmisNotSupportedException exception has to be thrown. If the specified folder or the application with the given folder doesn't exist, a CmisObjectNotFoundException has 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.