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 java.util.Set<java.lang.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 java.util.Set<java.lang.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(java.lang.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,
java.lang.String name)
Find the group by its name - assumes name is unique
|
java.lang.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
|
java.lang.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,
java.lang.String query)
Find the groups that match the search query across eperson_group_id or name
|
static Group[] |
search(Context context,
java.lang.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,
java.lang.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(java.lang.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()
java.sql.SQLExceptionpublic static Group create(Context context) throws java.sql.SQLException, AuthorizeException
context - DSpace context objectjava.sql.SQLExceptionAuthorizeExceptionpublic int getID()
getID in class DSpaceObjectpublic java.lang.String getName()
getName in class DSpaceObjectpublic void setName(java.lang.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 java.sql.SQLException
c - contextgroupid - group ID to checkjava.sql.SQLExceptionpublic static Group[] allMemberGroups(Context c, EPerson e) throws java.sql.SQLException
c - e - java.sql.SQLExceptionpublic static java.util.Set<java.lang.Integer> allMemberGroupIDs(Context c, EPerson e) throws java.sql.SQLException
c - e - java.sql.SQLExceptionpublic static EPerson[] allMembers(Context c, Group g) throws java.sql.SQLException
c - DSpace contextg - Group objectjava.sql.SQLExceptionpublic static java.util.Set<java.lang.Integer> allMemberIDs(Context c, Group g) throws java.sql.SQLException
c - DSpace contextg - Group objectjava.sql.SQLExceptionpublic static Group find(Context context, int id) throws java.sql.SQLException
context - id - java.sql.SQLExceptionpublic static Group findByName(Context context, java.lang.String name) throws java.sql.SQLException
context - name - java.sql.SQLExceptionpublic static Group[] findAll(Context context, int sortField) throws java.sql.SQLException
context - DSpace contextsortField - field to sort by -- Group.ID or Group.NAMEjava.sql.SQLExceptionpublic static Group[] search(Context context, java.lang.String query) throws java.sql.SQLException
context - DSpace contextquery - The search stringjava.sql.SQLExceptionpublic static Group[] search(Context context, java.lang.String query, int offset, int limit) throws java.sql.SQLException
context - DSpace contextquery - The search stringoffset - Inclusive offsetlimit - Maximum number of matches returnedjava.sql.SQLExceptionpublic static int searchResultCount(Context context, java.lang.String query) throws java.sql.SQLException
context - DSpace contextquery - The search stringjava.sql.SQLExceptionpublic void delete()
throws java.sql.SQLException
java.sql.SQLExceptionpublic EPerson[] getMembers()
public Group[] getMemberGroups()
public boolean isEmpty()
public void update()
throws java.sql.SQLException,
AuthorizeException
update in class DSpaceObjectjava.sql.SQLExceptionAuthorizeExceptionpublic boolean equals(java.lang.Object obj)
true if other is the same Group as
this object, false otherwiseequals in class java.lang.Objectobj - object to compare totrue if object passed in represents the same group
as this objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int getType()
DSpaceObjectgetType in class DSpaceObjectpublic java.lang.String getHandle()
DSpaceObjectnullgetHandle in class DSpaceObjectnull if it doesn't have
onepublic DSpaceObject getParentObject() throws java.sql.SQLException
DSpaceObjectgetParentObject in class DSpaceObjectjava.sql.SQLExceptionpublic void updateLastModified()
updateLastModified in class DSpaceObjectCopyright © 2013 DuraSpace. All Rights Reserved.