Package org.dspace.content
Class RelationshipTypeServiceImpl
- java.lang.Object
-
- org.dspace.content.RelationshipTypeServiceImpl
-
- All Implemented Interfaces:
RelationshipTypeService,DSpaceCRUDService<RelationshipType>
public class RelationshipTypeServiceImpl extends Object implements RelationshipTypeService
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorizeServiceauthorizeServiceprotected RelationshipTypeDAOrelationshipTypeDAO
-
Constructor Summary
Constructors Constructor Description RelationshipTypeServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelationshipTypecreate(Context context)RelationshipTypecreate(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger)This method will support the creation of a RelationshipType object with the given parametersRelationshipTypecreate(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger, Boolean copyToLeft, Boolean copyToRight)This method will support the creation of a RelationshipType object with the given parametersRelationshipTypecreate(Context context, RelationshipType relationshipType)This method creates the given RelationshipType object in the database and returns itvoiddelete(Context context, RelationshipType relationshipType)RelationshipTypefind(Context context, int id)List<RelationshipType>findAll(Context context)Retrieves all RelationshipType objects currently in the systemList<RelationshipType>findAll(Context context, Integer limit, Integer offset)Retrieves all RelationshipType objects currently in the systemList<RelationshipType>findByEntityType(Context context, EntityType entityType)Returns a list of RelationshipType objects for which the given EntityType is equal to either the leftType or the rightTypeList<RelationshipType>findByEntityType(Context context, EntityType entityType, boolean isLeft)This method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightTypeList<RelationshipType>findByEntityType(Context context, EntityType entityType, boolean isLeft, Integer limit, Integer offset)This method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightTypeList<RelationshipType>findByEntityType(Context context, EntityType entityType, Integer limit, Integer offset)List<RelationshipType>findByLeftwardOrRightwardTypeName(Context context, String typeName)Retrieves all RelationshipType objects that have a left or right type that is equal to the given StringList<RelationshipType>findByLeftwardOrRightwardTypeName(Context context, String typeName, Integer limit, Integer offset)Retrieves all RelationshipType objects that have a left or right label that is equal to the given StringRelationshipTypefindbyTypesAndTypeName(Context context, EntityType leftType, EntityType rightType, String leftwardType, String rightwardType)Retrieves a RelationshipType for which the given parameters all match the one in the returned RelationshipTypevoidupdate(Context context, List<RelationshipType> relationshipTypes)voidupdate(Context context, RelationshipType relationshipType)
-
-
-
Field Detail
-
relationshipTypeDAO
@Autowired(required=true) protected RelationshipTypeDAO relationshipTypeDAO
-
authorizeService
@Autowired(required=true) protected AuthorizeService authorizeService
-
-
Method Detail
-
create
public RelationshipType create(Context context) throws SQLException, AuthorizeException
- Specified by:
createin interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLExceptionAuthorizeException
-
create
public RelationshipType create(Context context, RelationshipType relationshipType) throws SQLException, AuthorizeException
Description copied from interface:RelationshipTypeServiceThis method creates the given RelationshipType object in the database and returns it- Specified by:
createin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextrelationshipType- The RelationshipType to be created in the database- Returns:
- The newly created RelationshipType
- Throws:
SQLException- If something goes wrongAuthorizeException- If something goes wrong with authorizations
-
findbyTypesAndTypeName
public RelationshipType findbyTypesAndTypeName(Context context, EntityType leftType, EntityType rightType, String leftwardType, String rightwardType) throws SQLException
Description copied from interface:RelationshipTypeServiceRetrieves a RelationshipType for which the given parameters all match the one in the returned RelationshipType- Specified by:
findbyTypesAndTypeNamein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextleftType- The rightType EntityType that needs to match for the returned RelationshipTyperightType- The rightType EntityType that needs to match for the returned RelationshipTypeleftwardType- The leftwardType String that needs to match for the returned RelationshipTyperightwardType- The rightwardType String that needs to match for the returned RelationshipType- Returns:
- Throws:
SQLException- If something goes wrong
-
findAll
public List<RelationshipType> findAll(Context context) throws SQLException
Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects currently in the system- Specified by:
findAllin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace context- Returns:
- The list of all RelationshipType objects currently in the system
- Throws:
SQLException- If something goes wrong
-
findAll
public List<RelationshipType> findAll(Context context, Integer limit, Integer offset) throws SQLException
Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects currently in the system- Specified by:
findAllin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextlimit- paging limitoffset- paging offset- Returns:
- The list of all RelationshipType objects currently in the system
- Throws:
SQLException- If something goes wrong
-
findByLeftwardOrRightwardTypeName
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String typeName) throws SQLException
Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects that have a left or right type that is equal to the given String- Specified by:
findByLeftwardOrRightwardTypeNamein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contexttypeName- The label that has to match- Returns:
- The list of all RelationshipType objects that have a left or right label that is equal to the given label param
- Throws:
SQLException- If something goes wrong
-
findByLeftwardOrRightwardTypeName
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String typeName, Integer limit, Integer offset) throws SQLException
Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects that have a left or right label that is equal to the given String- Specified by:
findByLeftwardOrRightwardTypeNamein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contexttypeName- The typeName that has to matchlimit- paging limitoffset- paging offset- Returns:
- The list of all RelationshipType objects that have a left or right label that is equal to the given label param
- Throws:
SQLException- If something goes wrong
-
findByEntityType
public List<RelationshipType> findByEntityType(Context context, EntityType entityType) throws SQLException
Description copied from interface:RelationshipTypeServiceReturns a list of RelationshipType objects for which the given EntityType is equal to either the leftType or the rightType- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextentityType- The EntityType object used to check the leftType and rightType properties- Returns:
- A list of RelationshipType objects for which the leftType or rightType property are equal to the given EntityType object
- Throws:
SQLException- If something goes wrong
-
findByEntityType
public List<RelationshipType> findByEntityType(Context context, EntityType entityType, Integer limit, Integer offset) throws SQLException
- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Throws:
SQLException
-
findByEntityType
public List<RelationshipType> findByEntityType(Context context, EntityType entityType, boolean isLeft) throws SQLException
Description copied from interface:RelationshipTypeServiceThis method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightType- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextentityType- The EntityType object that will be used to check onisLeft- Boolean value used to filter by left_type or right_type. If true left_type results only else right_type results.- Returns:
- The list of RelationshipType objects that have the given EntityType object as either a leftType or rightType
- Throws:
SQLException- If something goes wrong
-
findByEntityType
public List<RelationshipType> findByEntityType(Context context, EntityType entityType, boolean isLeft, Integer limit, Integer offset) throws SQLException
Description copied from interface:RelationshipTypeServiceThis method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightType- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextentityType- The EntityType object that will be used to check onisLeft- Boolean value used to filter by left_type or right_type. If true left_type results only else right_type results.limit- paging limitoffset- paging offset- Returns:
- The list of RelationshipType objects that have the given EntityType object as either a leftType or rightType
- Throws:
SQLException- If something goes wrong
-
create
public RelationshipType create(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger) throws SQLException, AuthorizeException
Description copied from interface:RelationshipTypeServiceThis method will support the creation of a RelationshipType object with the given parameters- Specified by:
createin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextleftEntityType- The leftEntityType EntityType object for this relationshipTyperightEntityType- The rightEntityType EntityType object for this relationshipTypeleftwardType- The leftwardType String object for this relationshipTyperightwardType- The rightwardType String object for this relationshipTypeleftCardinalityMinInteger- The leftCardinalityMinInteger Integer object for this relationshipTypeleftCardinalityMaxInteger- The leftCardinalityMaxInteger Integer object for this relationshipTyperightCardinalityMinInteger- The rightCardinalityMinInteger Integer object for this relationshipTyperightCardinalityMaxInteger- The rightCardinalityMaxInteger Integer object for this relationshipType- Returns:
- The created RelationshipType object for these properties
- Throws:
SQLException- If something goes wrongAuthorizeException- If something goes wrong
-
create
public RelationshipType create(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger, Boolean copyToLeft, Boolean copyToRight) throws SQLException, AuthorizeException
Description copied from interface:RelationshipTypeServiceThis method will support the creation of a RelationshipType object with the given parameters- Specified by:
createin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextleftEntityType- The leftEntityType EntityType object for this relationshipTyperightEntityType- The rightEntityType EntityType object for this relationshipTypeleftwardType- The leftwardType String object for this relationshipTyperightwardType- The rightwardType String object for this relationshipTypeleftCardinalityMinInteger- The leftCardinalityMinInteger Integer object for this relationshipTypeleftCardinalityMaxInteger- The leftCardinalityMaxInteger Integer object for this relationshipTyperightCardinalityMinInteger- The rightCardinalityMinInteger Integer object for this relationshipTyperightCardinalityMaxInteger- The rightCardinalityMaxInteger Integer object for this relationshipType- Returns:
- The created RelationshipType object for these properties
- Throws:
SQLException- If something goes wrongAuthorizeException- If something goes wrong
-
find
public RelationshipType find(Context context, int id) throws SQLException
- Specified by:
findin interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLException
-
update
public void update(Context context, RelationshipType relationshipType) throws SQLException, AuthorizeException
- Specified by:
updatein interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLExceptionAuthorizeException
-
update
public void update(Context context, List<RelationshipType> relationshipTypes) throws SQLException, AuthorizeException
- Specified by:
updatein interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLExceptionAuthorizeException
-
delete
public void delete(Context context, RelationshipType relationshipType) throws SQLException, AuthorizeException
- Specified by:
deletein interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLExceptionAuthorizeException
-
-