public class Group extends DSpaceObject
| Modifier and Type | Method and Description |
|---|---|
void |
addMember(EPerson e)
add an eperson member
|
void |
addMember(Group g)
add group to this group
|
static Set<Integer> |
allMemberGroupIDs(Context c,
EPerson e)
get Set of Integers all of the group memberships for an eperson
|
static Group[] |
allMemberGroups(Context c,
EPerson e)
Get all of the groups that an eperson is a member of.
|
static Set<Integer> |
allMemberIDs(Context c,
Group g)
Get Set of all Integers all of the epeople
members for a group
|
static EPerson[] |
allMembers(Context c,
Group g)
Get all of the epeople who are a member of the
specified group, or a member of a sub-group of the
specified group, etc.
|
static Group |
create(Context context)
Create a new group
|
void |
delete()
Delete a group
|
boolean |
equals(Object obj)
Return
true if other is the same Group as
this object, false otherwise |
static Group |
find(Context context,
int id)
find the group by its ID
|
static Group[] |
findAll(Context context,
int sortField)
Finds all groups in the site
|
static Group |
findByName(Context context,
String name)
Find the group by its name - assumes name is unique
|
String |
getHandle()
Get the Handle of the object.
|
int |
getID()
get the ID of the group object
|
Group[] |
getMemberGroups()
Return Group members of a Group.
|
EPerson[] |
getMembers()
Return EPerson members of a Group
|
String |
getName()
get name of group
|
DSpaceObject |
getParentObject()
Return the dspace object that "own" the current object in the hierarchy.
|
int |
getType()
Get the type of this object, found in Constants
|
int |
hashCode() |
boolean |
isEmpty()
Return true if group has no direct or indirect members
|
static boolean |
isMember(Context c,
int groupid)
fast check to see if an eperson is a member called with eperson id, does
database lookup without instantiating all of the epeople objects and is
thus a static method
|
boolean |
isMember(EPerson e)
check to see if an eperson is a direct member.
|
boolean |
isMember(Group g)
Check to see if g is a direct group member.
|
void |
loadData()
Populate Group with eperson and group objects
|
void |
removeMember(EPerson e)
remove an eperson from a group
|
void |
removeMember(Group g)
remove group from this group
|
static Group[] |
search(Context context,
String query)
Find the groups that match the search query across eperson_group_id or name
|
static Group[] |
search(Context context,
String query,
int offset,
int limit)
Find the groups that match the search query across eperson_group_id or name
|
static int |
searchResultCount(Context context,
String query)
Returns the total number of groups returned by a specific query, without the overhead
of creating the Group objects to store the results.
|
void |
setName(String name)
set name of group
|
void |
update()
Update the group - writing out group object and EPerson list if necessary
|
void |
updateLastModified() |
addDetails, clearDetails, find, getAdminObject, getDetails, getTypeTextpublic static final int ID
public static final int NAME
public void loadData()
SQLExceptionpublic static Group create(Context context) throws SQLException, AuthorizeException
context - DSpace context objectSQLExceptionAuthorizeExceptionpublic int getID()
getID in class DSpaceObjectpublic String getName()
getName in class DSpaceObjectpublic void setName(String name)
name - new group namepublic void addMember(EPerson e)
e - epersonpublic void addMember(Group g)
g - public void removeMember(EPerson e)
e - epersonpublic void removeMember(Group g)
g - public boolean isMember(EPerson e)
falsee - eperson to check membershippublic boolean isMember(Group g)
falseg - group to checkpublic static boolean isMember(Context c, int groupid) throws SQLException
c - contextgroupid - group ID to checkSQLExceptionpublic static Group[] allMemberGroups(Context c, EPerson e) throws SQLException
c - e - SQLExceptionpublic static Set<Integer> allMemberGroupIDs(Context c, EPerson e) throws SQLException
c - e - SQLExceptionpublic static EPerson[] allMembers(Context c, Group g) throws SQLException
c - DSpace contextg - Group objectSQLExceptionpublic static Set<Integer> allMemberIDs(Context c, Group g) throws SQLException
c - DSpace contextg - Group objectSQLExceptionpublic static Group find(Context context, int id) throws SQLException
context - id - SQLExceptionpublic static Group findByName(Context context, String name) throws SQLException
context - name - SQLExceptionpublic static Group[] findAll(Context context, int sortField) throws SQLException
context - DSpace contextsortField - field to sort by -- Group.ID or Group.NAMESQLExceptionpublic static Group[] search(Context context, String query) throws SQLException
context - DSpace contextquery - The search stringSQLExceptionpublic static Group[] search(Context context, String query, int offset, int limit) throws SQLException
context - DSpace contextquery - The search stringoffset - Inclusive offsetlimit - Maximum number of matches returnedSQLExceptionpublic static int searchResultCount(Context context, String query) throws SQLException
context - DSpace contextquery - The search stringSQLExceptionpublic void delete()
throws SQLException
SQLExceptionpublic EPerson[] getMembers()
public Group[] getMemberGroups()
public boolean isEmpty()
public void update()
throws SQLException,
AuthorizeException
update in class DSpaceObjectSQLExceptionAuthorizeExceptionpublic boolean equals(Object obj)
true if other is the same Group as
this object, false otherwisepublic int getType()
DSpaceObjectgetType in class DSpaceObjectpublic String getHandle()
DSpaceObjectnullgetHandle in class DSpaceObjectnull if it doesn't have
onepublic DSpaceObject getParentObject() throws SQLException
DSpaceObjectgetParentObject in class DSpaceObjectSQLExceptionpublic void updateLastModified()
updateLastModified in class DSpaceObjectCopyright © 2015 DuraSpace. All Rights Reserved.