Package org.dspace.content
Class EntityTypeServiceImpl
- java.lang.Object
-
- org.dspace.content.EntityTypeServiceImpl
-
- All Implemented Interfaces:
EntityTypeService,DSpaceCRUDService<EntityType>
public class EntityTypeServiceImpl extends Object implements EntityTypeService
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorizeServiceauthorizeServiceprotected EntityTypeDAOentityTypeDAOprotected GroupServicegroupServiceprotected SolrSearchCoresolrSearchCore
-
Constructor Summary
Constructors Constructor Description EntityTypeServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountEntityTypesByNames(Context context, List<String> names)EntityTypecreate(Context context)EntityTypecreate(Context context, String entityTypeString)This method creates an EntityType object in the database with the given entityTypeString as it's labelvoiddelete(Context context, EntityType entityType)EntityTypefind(Context context, int id)List<EntityType>findAll(Context context)Retrieves all the EntityType objects currently in the systemList<EntityType>findAll(Context context, Integer limit, Integer offset)Retrieves all the EntityType objects currently in the systemEntityTypefindByEntityType(Context context, String entityType)Retrieves the EntityType that has the entityType String parameter as labelList<EntityType>getEntityTypesByNames(Context context, List<String> names, Integer limit, Integer offset)List<String>getSubmitAuthorizedTypes(Context context)Retrieves all entity types related to the collections on which the current user can depositvoidinitDefaultEntityTypeNames(Context context)Initializes the EntityType names, and marks them "permanent".voidupdate(Context context, List<EntityType> entityTypes)Persist a collection of model objects.voidupdate(Context context, EntityType entityType)Persist a model object.
-
-
-
Field Detail
-
entityTypeDAO
@Autowired(required=true) protected EntityTypeDAO entityTypeDAO
-
authorizeService
@Autowired(required=true) protected AuthorizeService authorizeService
-
groupService
@Autowired protected GroupService groupService
-
solrSearchCore
@Autowired protected SolrSearchCore solrSearchCore
-
-
Method Detail
-
findByEntityType
public EntityType findByEntityType(Context context, String entityType) throws SQLException
Description copied from interface:EntityTypeServiceRetrieves the EntityType that has the entityType String parameter as label- Specified by:
findByEntityTypein interfaceEntityTypeService- Parameters:
context- The relevant DSpace contextentityType- The String label that has to match- Returns:
- The EntityType that has a String
- Throws:
SQLException- If something goes wrong
-
findAll
public List<EntityType> findAll(Context context) throws SQLException
Description copied from interface:EntityTypeServiceRetrieves all the EntityType objects currently in the system- Specified by:
findAllin interfaceEntityTypeService- Parameters:
context- The relevant DSpace context- Returns:
- A list of all EntityType objects
- Throws:
SQLException- If something goes wrong
-
findAll
public List<EntityType> findAll(Context context, Integer limit, Integer offset) throws SQLException
Description copied from interface:EntityTypeServiceRetrieves all the EntityType objects currently in the system- Specified by:
findAllin interfaceEntityTypeService- Parameters:
context- The relevant DSpace contextlimit- paging limitoffset- paging offset- Returns:
- A list of all EntityType objects
- Throws:
SQLException- If something goes wrong
-
create
public EntityType create(Context context) throws SQLException, AuthorizeException
- Specified by:
createin interfaceDSpaceCRUDService<EntityType>- Throws:
SQLExceptionAuthorizeException
-
create
public EntityType create(Context context, String entityTypeString) throws SQLException, AuthorizeException
Description copied from interface:EntityTypeServiceThis method creates an EntityType object in the database with the given entityTypeString as it's label- Specified by:
createin interfaceEntityTypeService- Parameters:
context- The relevant DSpace contextentityTypeString- The label for the newly created EntityType- Returns:
- The newly created EntityType
- Throws:
SQLException- If something goes wrongAuthorizeException- If something geos wrong with authorizations
-
find
public EntityType find(Context context, int id) throws SQLException
- Specified by:
findin interfaceDSpaceCRUDService<EntityType>- Throws:
SQLException
-
update
public void update(Context context, EntityType entityType) throws SQLException, AuthorizeException
Description copied from interface:DSpaceCRUDServicePersist a model object.- Specified by:
updatein interfaceDSpaceCRUDService<EntityType>entityType- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
update
public void update(Context context, List<EntityType> entityTypes) throws SQLException, AuthorizeException
Description copied from interface:DSpaceCRUDServicePersist a collection of model objects.- Specified by:
updatein interfaceDSpaceCRUDService<EntityType>entityTypes- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
delete
public void delete(Context context, EntityType entityType) throws SQLException, AuthorizeException
- Specified by:
deletein interfaceDSpaceCRUDService<EntityType>- Throws:
SQLExceptionAuthorizeException
-
getSubmitAuthorizedTypes
public List<String> getSubmitAuthorizedTypes(Context context) throws SQLException, org.apache.solr.client.solrj.SolrServerException, IOException
Description copied from interface:EntityTypeServiceRetrieves all entity types related to the collections on which the current user can deposit- Specified by:
getSubmitAuthorizedTypesin interfaceEntityTypeService- Parameters:
context- DSpace context object- Returns:
- Throws:
SQLException- If database errororg.apache.solr.client.solrj.SolrServerException- If there is a problem in communicating with SolrIOException- If IO error
-
getEntityTypesByNames
public List<EntityType> getEntityTypesByNames(Context context, List<String> names, Integer limit, Integer offset) throws SQLException
- Specified by:
getEntityTypesByNamesin interfaceEntityTypeService- Parameters:
context- DSpace context objectnames- List of Entity type names that you want to retrievelimit- paging limitoffset- the position of the first result to return- Returns:
- Throws:
SQLException- if database error
-
countEntityTypesByNames
public int countEntityTypesByNames(Context context, List<String> names) throws SQLException
- Specified by:
countEntityTypesByNamesin interfaceEntityTypeService- Parameters:
context- DSpace context objectnames- List of Entity type names that you want to retrieve- Returns:
- Throws:
SQLException- if database error
-
initDefaultEntityTypeNames
public void initDefaultEntityTypeNames(Context context) throws SQLException, AuthorizeException
Description copied from interface:EntityTypeServiceInitializes the EntityType names, and marks them "permanent".- Specified by:
initDefaultEntityTypeNamesin interfaceEntityTypeService- Parameters:
context- DSpace context object- Throws:
SQLException- Database exceptionAuthorizeException- Authorization error
-
-