Class CmisObjectFactory


  • @Provider
    public class CmisObjectFactory
    extends Object
    A factory of objects in the CMIS model by using as source object a Silverpeas resource. It is responsible to map a Silverpeas resource (spaces, applications, nodes, contributions, ...) to a CMIS object.
    Author:
    mmoquillon
    • Constructor Detail

      • CmisObjectFactory

        public CmisObjectFactory()
    • Method Detail

      • createRootSpace

        public Space createRootSpace​(String language)
        Creates the root space in the CMIS model. It is the root of the CMIS organizational tree of CMIS objects. It corresponds in Silverpeas to the container of all root workspaces.
        Returns:
        the root space.
      • createSpace

        public Space createSpace​(SpaceInstLight space,
                                 String language)
        Creates a CMIS representation of the specified Silverpeas workspace.
        Parameters:
        space - a Silverpeas space.
        language - the language to use in the localization of the CMIS object to construct.
        Returns:
        a CMIS space as a CMIS folder.
      • createApplication

        public Application createApplication​(ComponentInstLight component,
                                             String language)
        Creates a CMIS representation of the specified Silverpeas application.
        Parameters:
        component - a component instance in Silverpeas.
        language - the language to use in the localization of the CMIS object to construct.
        Returns:
        a CMIS application as a CMIS folder.
      • createContributionFolder

        public ContributionFolder createContributionFolder​(NodeDetail node,
                                                           String language)
        Creates a CMIS representation of the specified node descriptor in a given Silverpeas application. A node is a technical object used in Silverpeas to categorize or organize in a generic way any user contributions. Because a node can also contain others nodes, the nodes can be linked to each of them within a tree of nodes (hence the name node).
        Parameters:
        node - a descriptor about a node.
        language - the language to use in the localization of the CMIS object to construct.
        Returns:
        a CMIS contribution folder as a CMIS folder.
      • createPublication

        public Publication createPublication​(PublicationDetail pub,
                                             ContributionIdentifier folder,
                                             String language)
        Creates a CMIS representation of the specified publication in a given folder of a Silverpeas application. A publication in our CMIS implementation is always contained into a folder. If the application in Silverpeas doesn't organize them in folders, then the folder here should be a virtual one (a root folder).
        Parameters:
        pub - detail about the publication.
        folder - the folder in which is contained this publication.
        language - the language to use in the localization of the CMIS object to construct.
        Returns:
        a CMIS publication as a CMIS folder.
      • createDocument

        public DocumentFile createDocument​(SimpleDocument document,
                                           ContributionIdentifier parentId)
        Creates a CMIS representation of the specified localized document attached to the specified contribution.
        Parameters:
        document - a SimpleDocument instance.
        parentId - the unique identifier of a contribution.
        Returns:
        a CMIS document attached to a contribution.