Package org.dspace.content
Class Community
- java.lang.Object
-
- org.dspace.content.DSpaceObject
-
- org.dspace.content.Community
-
- All Implemented Interfaces:
Serializable,DSpaceObjectLegacySupport,ReloadableEntity<UUID>
@Entity public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
Class representing a communityThe community's metadata (name, introductory text etc.) is loaded into' memory. Changes to this metadata are only reflected in the database after
updateis called.- Author:
- Robert Tansley
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CommunityServicecommunityService-
Fields inherited from class org.dspace.content.DSpaceObject
id, predefinedUUID
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCommunity()Protected constructor, create object using:CommunityService.create(Community, Context)orCommunityService.create(Community, Context, String)protectedCommunity(UUID uuid)Takes a pre-determined UUID to be passed to the object to allow for the restoration of previously defined UUID's.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountArchivedItems()return count of the community itemsbooleanequals(Object other)Returntrueifotheris the same Community as this object,falseotherwiseGroupgetAdministrators()Get the default group of administrators, if there is one.List<Collection>getCollections()Get the collections in this community.IntegergetLegacyId()BitstreamgetLogo()Get the logo for the community.StringgetName()List<Community>getParentCommunities()Return the parent community of this community, or null if the community is top-levelList<Community>getSubcommunities()Get the immediate sub-communities of this community.intgetType()return type found in ConstantsinthashCode()voidremoveParentCommunity(Community parentCommunity)voidremoveSubCommunity(Community subCommunity)-
Methods inherited from class org.dspace.content.DSpaceObject
addDetails, addHandle, addMetadata, clearDetails, clearModified, getDetails, getHandle, getHandles, getID, getMetadata, getPredefinedUUID, getResourcePolicies, isMetadataModified, isModified, removeMetadata, removeMetadata, setMetadata, setMetadataModified, setModified
-
-
-
-
Field Detail
-
communityService
protected transient CommunityService communityService
-
-
Constructor Detail
-
Community
protected Community()
Protected constructor, create object using:CommunityService.create(Community, Context)orCommunityService.create(Community, Context, String)
-
Community
protected Community(UUID uuid)
Takes a pre-determined UUID to be passed to the object to allow for the restoration of previously defined UUID's.- Parameters:
uuid- Takes a uuid to be passed to the Pre-Defined UUID Generator
-
-
Method Detail
-
removeSubCommunity
public void removeSubCommunity(Community subCommunity)
-
getLogo
public Bitstream getLogo()
Get the logo for the community.nullis return if the community does not have a logo.- Returns:
- the logo of the community, or
null
-
getAdministrators
public Group getAdministrators()
Get the default group of administrators, if there is one. Note that the authorization system may allow others to be administrators for the community.The default group of administrators for community 100 is the one called
community_100_admin.- Returns:
- group of administrators, or
nullif there is no default group.
-
getCollections
public List<Collection> getCollections()
Get the collections in this community. Throws an SQLException because creating a community object won't load in all collections.- Returns:
- array of Collection objects
-
getSubcommunities
public List<Community> getSubcommunities()
Get the immediate sub-communities of this community. Throws an SQLException because creating a community object won't load in all collections.- Returns:
- array of Community objects
-
getParentCommunities
public List<Community> getParentCommunities()
Return the parent community of this community, or null if the community is top-level- Returns:
- the immediate parent community, or null if top-level
-
removeParentCommunity
public void removeParentCommunity(Community parentCommunity)
-
equals
public boolean equals(Object other)
Returntrueifotheris the same Community as this object,falseotherwise
-
getType
public int getType()
return type found in Constants- Specified by:
getTypein classDSpaceObject- Returns:
- Community type
-
getName
public String getName()
- Specified by:
getNamein classDSpaceObject
-
getLegacyId
public Integer getLegacyId()
- Specified by:
getLegacyIdin interfaceDSpaceObjectLegacySupport- Returns:
- the old integer based legacy identifier
-
countArchivedItems
public int countArchivedItems()
return count of the community items- Returns:
- int
-
-