Class ShareDocumentService

  • All Implemented Interfaces:
    IShareDocumentService, org.picocontainer.Startable

    public class ShareDocumentService
    extends Object
    implements IShareDocumentService, org.picocontainer.Startable
    Created by The eXo Platform SAS Author : eXoPlatform exo@exoplatform.com Nov 19, 2014
    • Constructor Detail

      • ShareDocumentService

        public ShareDocumentService​(org.exoplatform.services.jcr.RepositoryService repositoryService,
                                    org.exoplatform.services.cms.link.LinkManager linkManager,
                                    org.exoplatform.social.core.manager.IdentityManager identityManager,
                                    org.exoplatform.social.core.manager.ActivityManager activityManager,
                                    org.exoplatform.social.core.space.spi.SpaceService spaceService,
                                    org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService)
    • Method Detail

      • publishDocumentToSpace

        public String publishDocumentToSpace​(String space,
                                             javax.jcr.Node currentNode,
                                             String comment,
                                             String perm)
        Description copied from interface: IShareDocumentService
        Share a document to a space, permission of space's user also apply to this document.

        There is a symbolic link of origin document will create at Documents/Shared folder of destination space.

        Specified by:
        publishDocumentToSpace in interface IShareDocumentService
        Parameters:
        space - destination space will share file in
        currentNode - file will be shared
        comment - message attach with share activity
        perm - permission of destination space's member on origin node
        Returns:
        return false if have issue
      • publishDocumentToSpace

        public String publishDocumentToSpace​(String space,
                                             javax.jcr.Node currentNode,
                                             String comment,
                                             String perm,
                                             Boolean postActivity)
        Description copied from interface: IShareDocumentService
        Share a document to a space, permission of space's user also apply to this document.

        There is a symbolic link of origin document will create at Documents/Shared folder of destination space.

        Specified by:
        publishDocumentToSpace in interface IShareDocumentService
        Parameters:
        space - destination space will share file in
        currentNode - file will be shared
        comment - message attach with share activity
        perm - permission of destination space's member on origin node
        postActivity - define post activity after sharing to a space or not
        Returns:
        return false if have issue
      • publishDocumentToUser

        public void publishDocumentToUser​(String user,
                                          javax.jcr.Node currentNode,
                                          String comment,
                                          String perm)
        Description copied from interface: IShareDocumentService
        Share a document to a user

        There is a symbolic link of origin document will be created at Private/Documents/Shared folder of destination user.

        Specified by:
        publishDocumentToUser in interface IShareDocumentService
        Parameters:
        user - destination user to share file with
        currentNode - file will be shared
        comment - message attach with share activity
        perm - permission of destination space's member on origin node
      • unpublishDocumentToUser

        public void unpublishDocumentToUser​(String user,
                                            org.exoplatform.services.jcr.core.ExtendedNode node)
        Description copied from interface: IShareDocumentService
        Unshare a document to a user

        The symbolic link of origin document will be removed from Private/Documents/Shared folder of destination user.

        Specified by:
        unpublishDocumentToUser in interface IShareDocumentService
        Parameters:
        user - destination user to share file with
        node - file will be shared
      • unpublishDocumentToSpace

        public void unpublishDocumentToSpace​(String space,
                                             org.exoplatform.services.jcr.core.ExtendedNode node)
        Description copied from interface: IShareDocumentService
        Unshare a document to a space

        The symbolic link of origin document will be removed from Documents/Shared folder of destination space.

        Specified by:
        unpublishDocumentToSpace in interface IShareDocumentService
        Parameters:
        space - destination user to share file with
        node - file will be shared
      • shareDocumentActivityToSpace

        public void shareDocumentActivityToSpace​(org.exoplatform.social.core.activity.model.ExoSocialActivity sharedActivity)
                                          throws Exception
        Description copied from interface: IShareDocumentService
        Share documents of an activity to a space
        Specified by:
        shareDocumentActivityToSpace in interface IShareDocumentService
        Parameters:
        sharedActivity - shared activity
        Throws:
        Exception - when an error occurred while sharing document to space
      • start

        public void start()
        Specified by:
        start in interface org.picocontainer.Startable
      • stop

        public void stop()
        Specified by:
        stop in interface org.picocontainer.Startable