org.exoplatform.services.organization.rest
Class RESTOrganizationServiceAbstractImpl

java.lang.Object
  extended by org.exoplatform.services.organization.rest.RESTOrganizationServiceAbstractImpl
All Implemented Interfaces:
RESTOrganizationService
Direct Known Subclasses:
RESTOrganizationServiceJSONImpl, RESTOrganizationServiceXMLImpl

public abstract class RESTOrganizationServiceAbstractImpl
extends java.lang.Object
implements RESTOrganizationService

Created by The eXo Platform SAS .

Version:
$Id:$
Author:
Gennady Azarenkov

Field Summary
protected  org.exoplatform.services.organization.GroupHandler groupHandler
           
protected static org.apache.commons.logging.Log LOGGER
           
protected  org.exoplatform.services.organization.MembershipHandler membershipHandler
           
protected  org.exoplatform.services.organization.MembershipTypeHandler membershipTypeHandler
           
protected  org.exoplatform.services.organization.UserHandler userHandler
           
 
Constructor Summary
protected RESTOrganizationServiceAbstractImpl(org.exoplatform.services.organization.OrganizationService organizationService)
           
 
Method Summary
 org.exoplatform.services.rest.Response createGroup(java.lang.String baseURI, java.lang.String groupName, java.lang.String label, java.lang.String description, java.lang.String parentId)
           
 org.exoplatform.services.rest.Response createMembership(java.lang.String baseURI, java.lang.String username, java.lang.String groupId, java.lang.String type)
           
 org.exoplatform.services.rest.Response createUser(java.lang.String baseURI, java.lang.String username, java.lang.String password, java.lang.String firstname, java.lang.String lastname, java.lang.String email)
           
 org.exoplatform.services.rest.Response deleteGroup(java.lang.String groupId)
           
 org.exoplatform.services.rest.Response deleteMembership(java.lang.String membershipId)
           
 org.exoplatform.services.rest.Response deleteUser(java.lang.String username)
           
 org.exoplatform.services.rest.Response deleteUserFromGroup(java.lang.String baseURI, java.lang.String groupId, java.lang.String username)
           
 org.exoplatform.services.rest.Response findMembership(java.lang.String baseURI, java.lang.String membershipId)
          
 org.exoplatform.services.rest.Response findMemberships(java.lang.String baseURI, java.lang.String groupId, java.lang.String username, java.lang.String type)
          
 org.exoplatform.services.rest.Response findUsers(java.lang.String baseURI, java.lang.String username, java.lang.String firstname, java.lang.String lastname, java.lang.String email, java.lang.String fromLoginDate, java.lang.String toLoginDate)
          
 org.exoplatform.services.rest.Response findUsersRange(java.lang.String baseURI, java.lang.String username, java.lang.String firstname, java.lang.String lastname, java.lang.String email, java.lang.String fromLoginDate, java.lang.String toLoginDate, java.lang.Integer offset, java.lang.Integer amount)
          
 org.exoplatform.services.rest.Response getAllGroup(java.lang.String baseURI, java.lang.String filter)
          
 org.exoplatform.services.rest.Response getGroup(java.lang.String baseURI, java.lang.String groupId)
          
 org.exoplatform.services.rest.Response getGroups(java.lang.String baseURI, java.lang.String parentId)
          
 org.exoplatform.services.rest.Response getGroupsCount()
          
 org.exoplatform.services.rest.Response getGroupsOfUser(java.lang.String baseURI, java.lang.String username)
          
 org.exoplatform.services.rest.Response getGroupsRange(java.lang.String baseURI, java.lang.Integer offset, java.lang.Integer amount, java.lang.String parentId)
          
 org.exoplatform.services.rest.Response getMembershipTypes()
          
 org.exoplatform.services.rest.Response getUser(java.lang.String username)
          
 org.exoplatform.services.rest.Response getUsers(java.lang.String baseURI)
          
 org.exoplatform.services.rest.Response getUsersCount()
          
 org.exoplatform.services.rest.Response getUsersRange(java.lang.String baseURI, java.lang.Integer offset, java.lang.Integer amount)
          Returns XML document that content list of users in the system within the specified range.
 org.exoplatform.services.rest.Response updateGroup(java.lang.String baseURI, java.lang.String groupId, java.lang.String name, java.lang.String label, java.lang.String description)
          Update group data
 org.exoplatform.services.rest.Response updateUser(java.lang.String baseURI, java.lang.String username, java.lang.String password, java.lang.String firstname, java.lang.String lastname, java.lang.String email)
          Update user data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final org.apache.commons.logging.Log LOGGER

groupHandler

protected final org.exoplatform.services.organization.GroupHandler groupHandler

userHandler

protected final org.exoplatform.services.organization.UserHandler userHandler

membershipHandler

protected final org.exoplatform.services.organization.MembershipHandler membershipHandler

membershipTypeHandler

protected final org.exoplatform.services.organization.MembershipTypeHandler membershipTypeHandler
Constructor Detail

RESTOrganizationServiceAbstractImpl

protected RESTOrganizationServiceAbstractImpl(org.exoplatform.services.organization.OrganizationService organizationService)
Method Detail

createGroup

public org.exoplatform.services.rest.Response createGroup(java.lang.String baseURI,
                                                          java.lang.String groupName,
                                                          java.lang.String label,
                                                          java.lang.String description,
                                                          java.lang.String parentId)
Specified by:
createGroup in interface RESTOrganizationService
groupName - the group name
label - the label
description - the description
parentId - Id of the parent group
Returns:
Response object with HTTP status.

createMembership

public org.exoplatform.services.rest.Response createMembership(java.lang.String baseURI,
                                                               java.lang.String username,
                                                               java.lang.String groupId,
                                                               java.lang.String type)
Specified by:
createMembership in interface RESTOrganizationService
username - the user name
groupId - the group ID
type - the membership type
Returns:
Response object with HTTP status.

createUser

public org.exoplatform.services.rest.Response createUser(java.lang.String baseURI,
                                                         java.lang.String username,
                                                         java.lang.String password,
                                                         java.lang.String firstname,
                                                         java.lang.String lastname,
                                                         java.lang.String email)
Specified by:
createUser in interface RESTOrganizationService
username - the user name.
password - the user's password.
firstname - the first name.
lastname - the last name.
email - the email address.
Returns:
Response object with HTTP status.

deleteGroup

public org.exoplatform.services.rest.Response deleteGroup(java.lang.String groupId)
Specified by:
deleteGroup in interface RESTOrganizationService
Parameters:
groupId - the ID of the group to delete
Returns:
Response object with HTTP status.

deleteMembership

public org.exoplatform.services.rest.Response deleteMembership(java.lang.String membershipId)
Specified by:
deleteMembership in interface RESTOrganizationService
Parameters:
membershipId - the ID of the membership to delete
Returns:
Response object with HTTP status.

deleteUser

public org.exoplatform.services.rest.Response deleteUser(java.lang.String username)
Specified by:
deleteUser in interface RESTOrganizationService
Parameters:
username - the user name to remove.
Returns:
Response object with HTTP status.

deleteUserFromGroup

public org.exoplatform.services.rest.Response deleteUserFromGroup(java.lang.String baseURI,
                                                                  java.lang.String groupId,
                                                                  java.lang.String username)
Specified by:
deleteUserFromGroup in interface RESTOrganizationService
groupId - the ID of the group
username - the user's name
Returns:
Response object with HTTP status.

updateGroup

public org.exoplatform.services.rest.Response updateGroup(java.lang.String baseURI,
                                                          java.lang.String groupId,
                                                          java.lang.String name,
                                                          java.lang.String label,
                                                          java.lang.String description)
Description copied from interface: RESTOrganizationService
Update group data

Specified by:
updateGroup in interface RESTOrganizationService
groupId - the group id
name - the name of the group
label - the label of the group
description - of the group
Returns:
Response object with HTTP status. It points on result of operation. No useful content is returned.

updateUser

public org.exoplatform.services.rest.Response updateUser(java.lang.String baseURI,
                                                         java.lang.String username,
                                                         java.lang.String password,
                                                         java.lang.String firstname,
                                                         java.lang.String lastname,
                                                         java.lang.String email)
Description copied from interface: RESTOrganizationService
Update user data

Specified by:
updateUser in interface RESTOrganizationService
username - the username.
password - the password.
firstname - the first name.
lastname - the last name.
email - the email address.
Returns:
Response object with HTTP status. It points on result of operation. No useful content is returned.

findMembership

public org.exoplatform.services.rest.Response findMembership(java.lang.String baseURI,
                                                             java.lang.String membershipId)

Specified by:
findMembership in interface RESTOrganizationService
Returns:

findMemberships

public org.exoplatform.services.rest.Response findMemberships(java.lang.String baseURI,
                                                              java.lang.String groupId,
                                                              java.lang.String username,
                                                              java.lang.String type)

Specified by:
findMemberships in interface RESTOrganizationService
Returns:

findUsers

public org.exoplatform.services.rest.Response findUsers(java.lang.String baseURI,
                                                        java.lang.String username,
                                                        java.lang.String firstname,
                                                        java.lang.String lastname,
                                                        java.lang.String email,
                                                        java.lang.String fromLoginDate,
                                                        java.lang.String toLoginDate)

Specified by:
findUsers in interface RESTOrganizationService
username - the username.
firstname - the first name.
lastname - the last name.
email - the email address.
Returns:
Returns list of users in the system.

findUsersRange

public org.exoplatform.services.rest.Response findUsersRange(java.lang.String baseURI,
                                                             java.lang.String username,
                                                             java.lang.String firstname,
                                                             java.lang.String lastname,
                                                             java.lang.String email,
                                                             java.lang.String fromLoginDate,
                                                             java.lang.String toLoginDate,
                                                             java.lang.Integer offset,
                                                             java.lang.Integer amount)

Specified by:
findUsersRange in interface RESTOrganizationService
username - the username.
firstname - the first name.
lastname - the last name.
email - the email address.
Returns:
Returns list of users in the system within the specified range.

getAllGroup

public org.exoplatform.services.rest.Response getAllGroup(java.lang.String baseURI,
                                                          java.lang.String filter)

Specified by:
getAllGroup in interface RESTOrganizationService
Returns:
list of the groups except filters

getGroup

public org.exoplatform.services.rest.Response getGroup(java.lang.String baseURI,
                                                       java.lang.String groupId)

Specified by:
getGroup in interface RESTOrganizationService
Returns:

getGroups

public org.exoplatform.services.rest.Response getGroups(java.lang.String baseURI,
                                                        java.lang.String parentId)

Specified by:
getGroups in interface RESTOrganizationService
Returns:
list of the groups which are related to parent group

getGroupsCount

public org.exoplatform.services.rest.Response getGroupsCount()

Specified by:
getGroupsCount in interface RESTOrganizationService
Returns:
count of the groups

getGroupsOfUser

public org.exoplatform.services.rest.Response getGroupsOfUser(java.lang.String baseURI,
                                                              java.lang.String username)

Specified by:
getGroupsOfUser in interface RESTOrganizationService
username - the name of the user
Returns:
all groups where user participate

getGroupsRange

public org.exoplatform.services.rest.Response getGroupsRange(java.lang.String baseURI,
                                                             java.lang.Integer offset,
                                                             java.lang.Integer amount,
                                                             java.lang.String parentId)

Specified by:
getGroupsRange in interface RESTOrganizationService
offset - the start range
amount - - quantity of groups
parentId - the parent id
Returns:
list of the groups in special range

getMembershipTypes

public org.exoplatform.services.rest.Response getMembershipTypes()

Specified by:
getMembershipTypes in interface RESTOrganizationService
Returns:
list of membership types

getUser

public org.exoplatform.services.rest.Response getUser(java.lang.String username)

Specified by:
getUser in interface RESTOrganizationService
Parameters:
username - the user name
Returns:
document that content information about user based on it's name.

getUsers

public org.exoplatform.services.rest.Response getUsers(java.lang.String baseURI)

Specified by:
getUsers in interface RESTOrganizationService
Returns:
document that content list of all usernames in system.

getUsersCount

public org.exoplatform.services.rest.Response getUsersCount()

Specified by:
getUsersCount in interface RESTOrganizationService
Returns:
XML document that content information about number of user in system.

getUsersRange

public org.exoplatform.services.rest.Response getUsersRange(java.lang.String baseURI,
                                                            java.lang.Integer offset,
                                                            java.lang.Integer amount)
Returns XML document that content list of users in the system within the specified range.

Specified by:
getUsersRange in interface RESTOrganizationService
Returns:
Returns XML document that content list of users in the system within the specified range.


Copyright © 2011 eXo Platform SAS. All Rights Reserved.