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 exisiting 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, 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
context - DSpace context objectSQLExceptionAuthorizeExceptionCommunity create(Community parent, Context context, String handle) throws SQLException, AuthorizeException
context - DSpace context objecthandle - the pre-determined Handle to assign to the new communitySQLExceptionAuthorizeExceptionList<Community> findAll(Context context) throws SQLException
context - DSpace context objectSQLExceptionList<Community> findAll(Context context, Integer limit, Integer offset) throws SQLException
context - limit - offset - SQLExceptionList<Community> findAllTop(Context context) throws SQLException
context - DSpace context objectSQLException@Deprecated String getMetadata(Community community, String field)
getMetadata in interface DSpaceObjectService<Community>field - 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
field - the name of the metadata field to getvalue - value to set the field toIllegalArgumentException - if the requested metadata field doesn't existMissingResourceExceptionSQLExceptionBitstream 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(/code> 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.is - the stream to use as the new logonull if there is no
logo (null was passed in)AuthorizeExceptionIOExceptionSQLExceptionGroup createAdministrators(Context context, Community community) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionvoid removeAdministrators(Context context, Community community) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionList<Community> getAllParents(Context context, Community community) throws SQLException
SQLExceptionList<Collection> getAllCollections(Context context, Community community) throws SQLException
SQLExceptionvoid addCollection(Context context, Community community, Collection collection) throws SQLException, AuthorizeException
collection - collection to addSQLExceptionAuthorizeExceptionCommunity createSubcommunity(Context context, Community parentCommunity) throws SQLException, AuthorizeException
SQLExceptionAuthorizeExceptionCommunity createSubcommunity(Context context, Community parentCommunity, String handle) throws SQLException, AuthorizeException
handle - the pre-determined Handle to assign to the new communitySQLExceptionAuthorizeExceptionvoid addSubcommunity(Context context, Community parentCommunity, Community childCommunity) throws SQLException, AuthorizeException
parentCommunity - parent community to add our subcommunity tochildCommunity - subcommunity to addSQLExceptionAuthorizeExceptionvoid removeCollection(Context context, Community community, Collection c) throws SQLException, AuthorizeException, IOException
c - collection to removeSQLExceptionAuthorizeExceptionIOExceptionvoid removeSubcommunity(Context context, Community parentCommunity, Community childCommunity) throws SQLException, AuthorizeException, IOException
childCommunity - subcommunity to removeSQLExceptionAuthorizeExceptionIOExceptionboolean canEditBoolean(Context context, Community community) throws SQLException
SQLExceptionvoid 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.