public class SocialWorkspaceServiceImpl extends DefaultComponent implements SocialWorkspaceService
SocialWorkspaceService
service.Modifier and Type | Field and Description |
---|---|
static String |
CONFIGURATION_EP |
static String |
NEWS_ITEMS_ROOT_ACL_NAME |
static String |
PUBLIC_SOCIAL_WORKSPACE_ACL_NAME |
static String |
SOCIAL_WORKSPACE_ACL_NAME |
static String |
SOCIAL_WORKSPACE_CONTAINER_EP |
Constructor and Description |
---|
SocialWorkspaceServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
acceptSubscriptionRequest(SocialWorkspace socialWorkspace,
SubscriptionRequest subscriptionRequest)
Accepts the
subscriptionRequest for socialWorkspace . |
boolean |
addSocialWorkspaceAdministrator(SocialWorkspace socialWorkspace,
Principal principal)
Adds a user to the
socialWorkspace administrators group. |
boolean |
addSocialWorkspaceMember(SocialWorkspace socialWorkspace,
Principal principal)
Adds a user to the
socialWorkspace members group. |
List<String> |
addSocialWorkspaceMembers(SocialWorkspace socialWorkspace,
List<String> emails)
Add several users to the
socialWorkspace members group. |
List<String> |
addSocialWorkspaceMembers(SocialWorkspace socialWorkspace,
String groupName)
Add all group's users to the
socialWorkspace members groups |
List<SocialWorkspace> |
getDetachedPublicSocialWorkspaces(CoreSession session)
Return all public Social Workspaces.
|
SocialWorkspace |
getDetachedSocialWorkspace(CoreSession session,
DocumentRef docRef)
Returns the
SocialWorkspace container of the given document ref if it is in a Social Workspace even if
the user does not have right on it, null otherwise. |
SocialWorkspace |
getDetachedSocialWorkspace(DocumentModel doc)
Returns the
SocialWorkspace container of the given document if it is in a Social Workspace even if the
user does not have right on it, null otherwise. |
SocialWorkspace |
getSocialWorkspace(DocumentModel doc)
Returns the
SocialWorkspace container of the given document if it is part of a Social Workspace,
null otherwise. |
DocumentModel |
getSocialWorkspaceContainer(CoreSession session)
Returns Social Workspace Container and create it if needed.
|
SocialWorkspaceContainerDescriptor |
getSocialWorkspaceContainerDescriptor()
Returns the configured SocialWorkspaceContainerDescriptor that contains the path, title and description of the
container.
|
String |
getSubscriptionRequestStatus(SocialWorkspace socialWorkspace,
Principal principal)
Returns status of subscription request for the given
principal Values returned are: pending, accepted,
rejected or null if there is no subscription request |
int |
getValidationDays()
Gets the number of days before a social workspace expires without validation.
|
void |
handleSocialWorkspaceCreation(SocialWorkspace socialWorkspace,
Principal principal)
Handles a Social Workspace creation:
create related groups
put specific ACLs
|
void |
handleSocialWorkspaceDeletion(SocialWorkspace socialWorkspace)
Handles a Social Workspace deletion:
remove related groups
|
void |
handleSubscriptionRequest(SocialWorkspace socialWorkspace,
Principal principal)
Handles a Subscription Request on
socialWorkspace for the given principal . |
boolean |
isSubscriptionRequestPending(SocialWorkspace socialWorkspace,
Principal principal)
Returns
true if there is a pending Subscription Request for the given principal , false
otherwise. |
void |
makeSocialWorkspacePrivate(SocialWorkspace socialWorkspace)
Makes the given
socialWorkspace private. |
void |
makeSocialWorkspacePublic(SocialWorkspace socialWorkspace)
Makes the given
socialWorkspace public. |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
rejectSubscriptionRequest(SocialWorkspace socialWorkspace,
SubscriptionRequest subscriptionRequest)
Rejects the
subscriptionRequest for socialWorkspace . |
void |
removeSocialWorkspaceAdministrator(SocialWorkspace socialWorkspace,
Principal principal)
Removes a user from the @{code socialWorkspace} administrators group.
|
void |
removeSocialWorkspaceMember(SocialWorkspace socialWorkspace,
Principal principal)
Removes a user from the @{code socialWorkspace} members group.
|
List<String> |
searchAdministrators(SocialWorkspace socialWorkspace,
String pattern)
Returns all matching administrators from a Social Workspace, or an empty list.
|
List<SocialWorkspace> |
searchDetachedPublicSocialWorkspaces(CoreSession session,
String pattern)
Return matching public social workspace according the given pattern.
|
List<String> |
searchMembers(SocialWorkspace socialWorkspace,
String pattern)
Returns all matching members from a Social Workspace, or an empty list.
|
List<String> |
searchUsers(SocialWorkspace socialWorkspace,
RelationshipKind kind,
String pattern)
Returns all matching users from a Social Workspace, or an empty list.
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterContribution, unregisterExtension
public static final String CONFIGURATION_EP
public static final String SOCIAL_WORKSPACE_CONTAINER_EP
public static final String SOCIAL_WORKSPACE_ACL_NAME
public static final String NEWS_ITEMS_ROOT_ACL_NAME
public static final String PUBLIC_SOCIAL_WORKSPACE_ACL_NAME
public List<SocialWorkspace> getDetachedPublicSocialWorkspaces(CoreSession session)
SocialWorkspaceService
getDetachedPublicSocialWorkspaces
in interface SocialWorkspaceService
public List<SocialWorkspace> searchDetachedPublicSocialWorkspaces(CoreSession session, String pattern)
SocialWorkspaceService
searchDetachedPublicSocialWorkspaces
in interface SocialWorkspaceService
public SocialWorkspace getDetachedSocialWorkspace(DocumentModel doc)
SocialWorkspaceService
SocialWorkspace
container of the given document if it is in a Social Workspace even if the
user does not have right on it, null
otherwise.
The underlying DocumentModel
is detached.
getDetachedSocialWorkspace
in interface SocialWorkspaceService
public SocialWorkspace getDetachedSocialWorkspace(CoreSession session, DocumentRef docRef)
SocialWorkspaceService
SocialWorkspace
container of the given document ref if it is in a Social Workspace even if
the user does not have right on it, null
otherwise.
The underlying DocumentModel
is detached.
getDetachedSocialWorkspace
in interface SocialWorkspaceService
public SocialWorkspace getSocialWorkspace(DocumentModel doc)
SocialWorkspaceService
SocialWorkspace
container of the given document if it is part of a Social Workspace,
null
otherwise.getSocialWorkspace
in interface SocialWorkspaceService
public int getValidationDays()
SocialWorkspaceService
getValidationDays
in interface SocialWorkspaceService
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public SocialWorkspaceContainerDescriptor getSocialWorkspaceContainerDescriptor()
SocialWorkspaceService
getSocialWorkspaceContainerDescriptor
in interface SocialWorkspaceService
public DocumentModel getSocialWorkspaceContainer(CoreSession session)
SocialWorkspaceService
getSocialWorkspaceContainer
in interface SocialWorkspaceService
public void handleSocialWorkspaceCreation(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
handleSocialWorkspaceCreation
in interface SocialWorkspaceService
principal
- the Principal initializing the Social Workspacepublic void handleSocialWorkspaceDeletion(SocialWorkspace socialWorkspace)
SocialWorkspaceService
handleSocialWorkspaceDeletion
in interface SocialWorkspaceService
public boolean addSocialWorkspaceAdministrator(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
socialWorkspace
administrators group.addSocialWorkspaceAdministrator
in interface SocialWorkspaceService
true
if the user was successfully added to the administrators group, false
otherwise.public boolean addSocialWorkspaceMember(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
socialWorkspace
members group.addSocialWorkspaceMember
in interface SocialWorkspaceService
true
if the user was successfully added to the members group, false
otherwise.public List<String> addSocialWorkspaceMembers(SocialWorkspace socialWorkspace, String groupName) throws ClientException
SocialWorkspaceService
socialWorkspace
members groupsaddSocialWorkspaceMembers
in interface SocialWorkspaceService
groupName
- of an existing group.List<String>
containing imported users, or an empty one.ClientException
- when groupName doesn't existpublic List<String> addSocialWorkspaceMembers(SocialWorkspace socialWorkspace, List<String> emails) throws ClientException
SocialWorkspaceService
socialWorkspace
members group.addSocialWorkspaceMembers
in interface SocialWorkspaceService
List<String>
contains the email of user added, or an empty one.ClientException
public void removeSocialWorkspaceAdministrator(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
removeSocialWorkspaceAdministrator
in interface SocialWorkspaceService
public void removeSocialWorkspaceMember(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
removeSocialWorkspaceMember
in interface SocialWorkspaceService
public void makeSocialWorkspacePublic(SocialWorkspace socialWorkspace)
SocialWorkspaceService
socialWorkspace
public.
Puts the correct rights so that non-members can view public documents and public dashboard.
makeSocialWorkspacePublic
in interface SocialWorkspaceService
public void makeSocialWorkspacePrivate(SocialWorkspace socialWorkspace)
SocialWorkspaceService
socialWorkspace
private.
Restricts rights for non-members users.
makeSocialWorkspacePrivate
in interface SocialWorkspaceService
public void handleSubscriptionRequest(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
socialWorkspace
for the given principal
.handleSubscriptionRequest
in interface SocialWorkspaceService
public boolean isSubscriptionRequestPending(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
true
if there is a pending Subscription Request for the given principal
, false
otherwise.isSubscriptionRequestPending
in interface SocialWorkspaceService
public String getSubscriptionRequestStatus(SocialWorkspace socialWorkspace, Principal principal)
SocialWorkspaceService
principal
Values returned are: pending, accepted,
rejected or null if there is no subscription requestgetSubscriptionRequestStatus
in interface SocialWorkspaceService
public void acceptSubscriptionRequest(SocialWorkspace socialWorkspace, SubscriptionRequest subscriptionRequest)
SocialWorkspaceService
subscriptionRequest
for socialWorkspace
.acceptSubscriptionRequest
in interface SocialWorkspaceService
public void rejectSubscriptionRequest(SocialWorkspace socialWorkspace, SubscriptionRequest subscriptionRequest)
SocialWorkspaceService
subscriptionRequest
for socialWorkspace
.rejectSubscriptionRequest
in interface SocialWorkspaceService
public List<String> searchUsers(SocialWorkspace socialWorkspace, RelationshipKind kind, String pattern)
SocialWorkspaceService
searchUsers
in interface SocialWorkspaceService
kind
- can be null or empty to search through all users.pattern
- can be blank.public List<String> searchMembers(SocialWorkspace socialWorkspace, String pattern)
SocialWorkspaceService
searchMembers
in interface SocialWorkspaceService
pattern
- can be blank.public List<String> searchAdministrators(SocialWorkspace socialWorkspace, String pattern)
SocialWorkspaceService
searchAdministrators
in interface SocialWorkspaceService
pattern
- can be blank.Copyright © 2015 Nuxeo SA. All rights reserved.