public interface CommunityService extends DSpaceObjectService<Community>, DSpaceObjectLegacySupportService<Community>
| Modifier and Type | Method and Description |
|---|---|
void |
addCollection(Context context,
Community community,
Collection collection)
Add an exisiting collection to the community
|
void |
addSubcommunity(Context context,
Community parentCommunity,
Community childCommunity)
Add an existing community as a subcommunity to the community
|
void |
canEdit(Context context,
Community community) |
boolean |
canEditBoolean(Context context,
Community community)
return TRUE if context's user can edit community, false otherwise
|
int |
countTotal(Context context) |
Community |
create(Community parent,
Context context)
Create a new top-level community, with a new ID.
|
Community |
create(Community parent,
Context context,
String handle)
Create a new top-level community, with a new ID.
|
Group |
createAdministrators(Context context,
Community community)
Create a default administrators group if one does not already exist.
|
Community |
createSubcommunity(Context context,
Community parentCommunity)
Create a new sub-community within this community.
|
Community |
createSubcommunity(Context context,
Community parentCommunity,
String handle)
Create a new sub-community within this community.
|
List<Community> |
findAll(Context context)
Get a list of all communities in the system.
|
List<Community> |
findAll(Context context,
Integer limit,
Integer offset)
Get all communities in the system.
|
List<Community> |
findAllTop(Context context)
Get a list of all top-level communities in the system.
|
List<Community> |
findAuthorized(Context context,
List<Integer> actions) |
List<Community> |
findAuthorizedGroupMapped(Context context,
List<Integer> actions) |
Community |
findByAdminGroup(Context context,
Group group) |
List<Collection> |
getAllCollections(Context context,
Community community)
Return an array of collections of this community and its subcommunities
|
List<Community> |
getAllParents(Context context,
Community community)
Return an array of parent communities of this community, in ascending
order.
|
String |
getMetadata(Community community,
String field)
Deprecated.
|
void |
removeAdministrators(Context context,
Community community)
Remove the administrators group, if no group has already been created
then return without error.
|
void |
removeCollection(Context context,
Community community,
Collection c)
Remove a collection.
|
void |
removeSubcommunity(Context context,
Community parentCommunity,
Community childCommunity)
Remove a subcommunity.
|
Bitstream |
setLogo(Context context,
Community community,
InputStream is)
Give the community a logo.
|
void |
setMetadata(Context context,
Community community,
String field,
String value)
Deprecated.
|
addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, delete, find, getAdminObject, getIdentifiers, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getName, getParentObject, getSupportsTypeConstant, getTypeText, removeMetadataValues, setMetadataSingleValue, update, updateLastModifiedfindByIdOrLegacyId, findByLegacyId, getSupportsTypeConstantCommunity create(Community parent, Context context) throws SQLException, AuthorizeException
parent - parent communitycontext - DSpace context objectSQLException - if database errorAuthorizeException - if authorization errorCommunity create(Community parent, Context context, String handle) throws SQLException, AuthorizeException
parent - parent communitycontext - DSpace context objecthandle - the pre-determined Handle to assign to the new communitySQLException - if database errorAuthorizeException - if authorization errorList<Community> findAll(Context context) throws SQLException
context - DSpace context objectSQLException - if database errorList<Community> findAll(Context context, Integer limit, Integer offset) throws SQLException
context - contextlimit - limitoffset - offsetSQLException - if database errorList<Community> findAllTop(Context context) throws SQLException
context - DSpace context objectSQLException - if database error@Deprecated String getMetadata(Community community, String field)
getMetadata in interface DSpaceObjectService<Community>community - communityfield - the name of the metadata field to getIllegalArgumentException - if the requested metadata field doesn't exist@Deprecated void setMetadata(Context context, Community community, String field, String value) throws MissingResourceException, SQLException
context - contextcommunity - communityfield - the name of the metadata field to getvalue - value to set the field toIllegalArgumentException - if the requested metadata field doesn't existMissingResourceExceptionSQLException - if database errorBitstream setLogo(Context context, Community community, InputStream is) throws AuthorizeException, IOException, SQLException
null removes any
existing logo. You will need to set the format of the new logo bitstream
before it will work, for example to "JPEG". Note that
update will need to be called for the change to take
effect. Setting a logo and not calling update later may
result in a previous logo lying around as an "orphaned" bitstream.context - contextcommunity - communityis - the stream to use as the new logonull if there is no
logo (null was passed in)IOException - if IO errorSQLException - if database errorAuthorizeException - if authorization errorGroup createAdministrators(Context context, Community community) throws SQLException, AuthorizeException
context - contextcommunity - communitySQLException - if database errorAuthorizeException - if authorization errorvoid removeAdministrators(Context context, Community community) throws SQLException, AuthorizeException
context - contextcommunity - communitySQLException - if database errorAuthorizeException - if authorization errorList<Community> getAllParents(Context context, Community community) throws SQLException
context - contextcommunity - communitySQLException - if database errorList<Collection> getAllCollections(Context context, Community community) throws SQLException
context - contextcommunity - communitySQLException - if database errorvoid addCollection(Context context, Community community, Collection collection) throws SQLException, AuthorizeException
context - contextcommunity - communitycollection - collection to addSQLException - if database errorAuthorizeException - if authorization errorCommunity createSubcommunity(Context context, Community parentCommunity) throws SQLException, AuthorizeException
context - contextparentCommunity - parent communitySQLException - if database errorAuthorizeException - if authorization errorCommunity createSubcommunity(Context context, Community parentCommunity, String handle) throws SQLException, AuthorizeException
context - contexthandle - the pre-determined Handle to assign to the new communityparentCommunity - parent communitySQLException - if database errorAuthorizeException - if authorization errorvoid addSubcommunity(Context context, Community parentCommunity, Community childCommunity) throws SQLException, AuthorizeException
context - contextparentCommunity - parent community to add our subcommunity tochildCommunity - subcommunity to addSQLException - if database errorAuthorizeException - if authorization errorvoid removeCollection(Context context, Community community, Collection c) throws SQLException, AuthorizeException, IOException
context - contextc - collection to removecommunity - communitySQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorvoid removeSubcommunity(Context context, Community parentCommunity, Community childCommunity) throws SQLException, AuthorizeException, IOException
context - contextchildCommunity - subcommunity to removeparentCommunity - parent communitySQLException - if database errorAuthorizeException - if authorization errorIOException - if IO errorboolean canEditBoolean(Context context, Community community) throws SQLException
context - contextcommunity - communitySQLException - if database errorvoid canEdit(Context context, Community community) throws AuthorizeException, SQLException
AuthorizeExceptionSQLExceptionCommunity findByAdminGroup(Context context, Group group) throws SQLException
SQLExceptionList<Community> findAuthorized(Context context, List<Integer> actions) throws SQLException
SQLExceptionList<Community> findAuthorizedGroupMapped(Context context, List<Integer> actions) throws SQLException
SQLExceptionint countTotal(Context context) throws SQLException
SQLExceptionCopyright © 2016 DuraSpace. All rights reserved.