Class CommunityWebManager
java.lang.Object
org.silverpeas.components.community.CommunityWebManager
WEB manager which allows to centralize code to be used by REST Web Services and Web Component
Controller.
- Author:
- silveryocha
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.silverpeas.core.admin.PaginationPage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendMembershipOf(CommunityOfUsers community, org.silverpeas.core.admin.user.model.User member) Makes the given user leaving the given community.static CommunityWebManagerget()Gets the singleton instance of the provider.org.silverpeas.core.util.SilverpeasList<CommunityMembership>getHistory(CommunityOfUsers community, org.silverpeas.core.admin.PaginationPage page) Gets history of the given community.org.silverpeas.core.util.SilverpeasList<CommunityMembership>getMembers(CommunityOfUsers community, org.silverpeas.core.admin.PaginationPage page) Gets members of the given community.org.silverpeas.core.util.SilverpeasList<CommunityMembership>getMembersToValidate(CommunityOfUsers community, org.silverpeas.core.admin.PaginationPage page) Gets members pending validation of the given community.Set<org.silverpeas.core.admin.user.model.SilverpeasRole>getUserRoleOn(CommunityOfUsers community) Gets the roles the current requester has on the given community.booleanisMemberOf(CommunityOfUsers community) Indicates if the current requester is a member.booleanisMembershipPendingFor(CommunityOfUsers community) Indicates if the current requester has membership pending validation.voidjoin(CommunityOfUsers community) Makes the current user joining the given community.voidleave(CommunityOfUsers community, int reason, String message, boolean contactInFuture) Makes the current user leaving the given community.voidsetDisplayCharterOnSpaceHomepage(CommunityOfUsers community, boolean value) Saves into instance parameter of the given community the value of parameter 'displayCharterOnSpaceHomepage'.voidvalidateRequestOf(org.silverpeas.core.admin.user.model.User requester, CommunityOfUsers community, boolean accept, String message) Validates the membership request of user given in parameters on specified community.
-
Field Details
-
NO_PAGINATION
public static final org.silverpeas.core.admin.PaginationPage NO_PAGINATION
-
-
Constructor Details
-
CommunityWebManager
protected CommunityWebManager()
-
-
Method Details
-
get
Gets the singleton instance of the provider. -
join
Makes the current user joining the given community.- Parameters:
community-CommunityOfUsersinstance representing the community.
-
validateRequestOf
public void validateRequestOf(org.silverpeas.core.admin.user.model.User requester, CommunityOfUsers community, boolean accept, String message) Validates the membership request of user given in parameters on specified community.- Parameters:
requester- the user behind the request to join the community.community- the community the user accesses.accept- true to accept the request, false to refuse.message- message linked to the acceptation or refuse.
-
endMembershipOf
public void endMembershipOf(CommunityOfUsers community, org.silverpeas.core.admin.user.model.User member) Makes the given user leaving the given community.- Parameters:
community-CommunityOfUsersinstance representing the community.member- the member to manage.
-
leave
Makes the current user leaving the given community.- Parameters:
community-CommunityOfUsersinstance representing the community.reason- the index of the reason of the leaving.message- a message to explain more precisely the member leaving.contactInFuture- boolean, true to indicate that the member accepts to be contacted in the future about its leaving.
-
setDisplayCharterOnSpaceHomepage
Saves into instance parameter of the given community the value of parameter 'displayCharterOnSpaceHomepage'.- Parameters:
community-CommunityOfUsersinstance representing the community.value- true to display the charter, false otherwise.
-
getMembersToValidate
public org.silverpeas.core.util.SilverpeasList<CommunityMembership> getMembersToValidate(@Nonnull CommunityOfUsers community, @Nullable org.silverpeas.core.admin.PaginationPage page) Gets members pending validation of the given community.- Parameters:
community-CommunityOfUsersinstance representing the community.page- the pending members to get are paginated. Indicates the page to return. If null, all the pending members are got.- Returns:
- list of
CommunityMembershipinstance, representing each one a pending member.
-
getMembers
public org.silverpeas.core.util.SilverpeasList<CommunityMembership> getMembers(@Nonnull CommunityOfUsers community, @Nullable org.silverpeas.core.admin.PaginationPage page) Gets members of the given community.- Parameters:
community-CommunityOfUsersinstance representing the community.page- the members to get are paginated. Indicates the page to return. If null, all the members are got.- Returns:
- list of
CommunityMembershipinstance, representing each one a committed member.
-
getHistory
public org.silverpeas.core.util.SilverpeasList<CommunityMembership> getHistory(@Nonnull CommunityOfUsers community, @Nullable org.silverpeas.core.admin.PaginationPage page) Gets history of the given community.- Parameters:
community-CommunityOfUsersinstance representing the community.page- the members to get are paginated. Indicates the page to return. If null, all the members are got.- Returns:
- list of
CommunityMembershipinstance, representing each one a membership whatever its status.
-
isMemberOf
Indicates if the current requester is a member.A member MUST be directly specified into ADMIN, PUBLISHER, WRITER or READER role of direct parent space.
- Parameters:
community-CommunityOfUsersinstance.- Returns:
- true if member, false otherwise.
-
isMembershipPendingFor
Indicates if the current requester has membership pending validation.A member MUST be directly specified into ADMIN, PUBLISHER, WRITER or READER role of direct parent space.
- Parameters:
community-CommunityOfUsersinstance.- Returns:
- true if member, false otherwise.
-
getUserRoleOn
public Set<org.silverpeas.core.admin.user.model.SilverpeasRole> getUserRoleOn(CommunityOfUsers community) Gets the roles the current requester has on the given community.- Parameters:
community-CommunityOfUsersinstance.- Returns:
- a set of
SilverpeasRole.
-