Class ShareDocumentService
- java.lang.Object
-
- org.exoplatform.wcm.ext.component.document.service.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
-
-
Field Summary
Fields Modifier and Type Field Description static StringDOCPATHstatic StringIDstatic StringMIX_PRIVILEGEABLEstatic StringNODEPATH_NAMEstatic StringREPOSITORYstatic StringREPOSITORY_NAMEstatic StringWORKSPACEstatic StringWORKSPACE_NAME
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringpublishDocumentToSpace(String space, javax.jcr.Node currentNode, String comment, String perm)Share a document to a space, permission of space's user also apply to this document.StringpublishDocumentToSpace(String space, javax.jcr.Node currentNode, String comment, String perm, Boolean postActivity)Share a document to a space, permission of space's user also apply to this document.voidpublishDocumentToUser(String user, javax.jcr.Node currentNode, String comment, String perm)Share a document to a uservoidshareDocumentActivityToSpace(org.exoplatform.social.core.activity.model.ExoSocialActivity sharedActivity)Share documents of an activity to a spacevoidstart()voidstop()voidunpublishDocumentToSpace(String space, org.exoplatform.services.jcr.core.ExtendedNode node)Unshare a document to a spacevoidunpublishDocumentToUser(String user, org.exoplatform.services.jcr.core.ExtendedNode node)Unshare a document to a user
-
-
-
Field Detail
-
MIX_PRIVILEGEABLE
public static final String MIX_PRIVILEGEABLE
- See Also:
- Constant Field Values
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
REPOSITORY
public static final String REPOSITORY
- See Also:
- Constant Field Values
-
WORKSPACE
public static final String WORKSPACE
- See Also:
- Constant Field Values
-
DOCPATH
public static final String DOCPATH
- See Also:
- Constant Field Values
-
NODEPATH_NAME
public static final String NODEPATH_NAME
- See Also:
- Constant Field Values
-
REPOSITORY_NAME
public static final String REPOSITORY_NAME
- See Also:
- Constant Field Values
-
WORKSPACE_NAME
public static final String WORKSPACE_NAME
- See Also:
- Constant Field Values
-
-
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:IShareDocumentServiceShare 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:
publishDocumentToSpacein interfaceIShareDocumentService- Parameters:
space- destination space will share file incurrentNode- file will be sharedcomment- message attach with share activityperm- 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:IShareDocumentServiceShare 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:
publishDocumentToSpacein interfaceIShareDocumentService- Parameters:
space- destination space will share file incurrentNode- file will be sharedcomment- message attach with share activityperm- permission of destination space's member on origin nodepostActivity- 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:IShareDocumentServiceShare a document to a userThere is a symbolic link of origin document will be created at Private/Documents/Shared folder of destination user.
- Specified by:
publishDocumentToUserin interfaceIShareDocumentService- Parameters:
user- destination user to share file withcurrentNode- file will be sharedcomment- message attach with share activityperm- 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:IShareDocumentServiceUnshare a document to a userThe symbolic link of origin document will be removed from Private/Documents/Shared folder of destination user.
- Specified by:
unpublishDocumentToUserin interfaceIShareDocumentService- Parameters:
user- destination user to share file withnode- file will be shared
-
unpublishDocumentToSpace
public void unpublishDocumentToSpace(String space, org.exoplatform.services.jcr.core.ExtendedNode node)
Description copied from interface:IShareDocumentServiceUnshare a document to a spaceThe symbolic link of origin document will be removed from Documents/Shared folder of destination space.
- Specified by:
unpublishDocumentToSpacein interfaceIShareDocumentService- Parameters:
space- destination user to share file withnode- file will be shared
-
shareDocumentActivityToSpace
public void shareDocumentActivityToSpace(org.exoplatform.social.core.activity.model.ExoSocialActivity sharedActivity) throws ExceptionDescription copied from interface:IShareDocumentServiceShare documents of an activity to a space- Specified by:
shareDocumentActivityToSpacein interfaceIShareDocumentService- Parameters:
sharedActivity- shared activity- Throws:
Exception- when an error occurred while sharing document to space
-
start
public void start()
- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()
- Specified by:
stopin interfaceorg.picocontainer.Startable
-
-