Package org.dspace.content
Class EntityServiceImpl
- java.lang.Object
-
- org.dspace.content.EntityServiceImpl
-
- All Implemented Interfaces:
EntityService
public class EntityServiceImpl extends Object implements EntityService
-
-
Field Summary
Fields Modifier and Type Field Description protected EntityTypeServiceentityTypeServiceprotected ItemServiceitemServiceprotected RelationshipServicerelationshipServiceprotected RelationshipTypeServicerelationshipTypeService
-
Constructor Summary
Constructors Constructor Description EntityServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityfindByItemId(Context context, UUID itemId)This will construct an Entity object that will be returned with the Item that matches the ItemID that was passed along as well as a list of relationships for that Item.EntityfindByItemId(Context context, UUID itemId, Integer limit, Integer offset)This will construct an Entity object that will be returned with the Item that matches the ItemID that was passed along as well as a list of relationships for that Item.List<RelationshipType>getAllRelationshipTypes(Context context, Entity entity)Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in either the leftEntityType or the rightEntityType variablesList<RelationshipType>getAllRelationshipTypes(Context context, Entity entity, Integer limit, Integer offset)Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in either the leftEntityType or the rightEntityType variablesList<Relationship>getLeftRelations(Context context, Entity entity)Retrieves the list of relationships, which are attached to the Entity object that is passed along, where the left item object of each relationship is equal to the Item object of the Entity object that is passed alongList<RelationshipType>getLeftRelationshipTypes(Context context, Entity entity)Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the leftEntityTypeList<RelationshipType>getLeftRelationshipTypes(Context context, Entity entity, boolean isLeft, Integer limit, Integer offset)Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the leftEntityTypeList<Relationship>getRelationsByTypeName(Context context, String typeName)Retrieves the list of relationships for which their relationshiptype has a left or right label that is equal to the passed along label StringList<Relationship>getRelationsByTypeName(Context context, String typeName, Integer limit, Integer offset)Retrieves the list of relationships for which their relationshiptype has a left or right label that is equal to the passed along label StringList<RelationshipType>getRelationshipTypesByTypeName(Context context, String type)Retrieves a list of RelationshipType objects for which either their left or right label is equal to the label parameter that's being passed alongList<RelationshipType>getRelationshipTypesByTypeName(Context context, String typeName, Integer limit, Integer offset)Retrieves a list of RelationshipType objects for which either their left or right label is equal to the label parameter that's being passed alongList<Relationship>getRightRelations(Context context, Entity entity)Retrieves the list of relationships, which are attached to the Entity object that is passed along, where the right item object of each relationship is equal to the Item object of the Entity object that is passed alongList<RelationshipType>getRightRelationshipTypes(Context context, Entity entity)Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the rightEntityTypeList<RelationshipType>getRightRelationshipTypes(Context context, Entity entity, boolean isLeft, Integer limit, Integer offset)Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the rightEntityTypeEntityTypegetType(Context context, Entity entity)Returns the EntityType for the Item that is attached to the Entity that is passed along to this method.
-
-
-
Field Detail
-
entityTypeService
@Autowired(required=true) protected EntityTypeService entityTypeService
-
relationshipService
@Autowired(required=true) protected RelationshipService relationshipService
-
relationshipTypeService
@Autowired(required=true) protected RelationshipTypeService relationshipTypeService
-
itemService
@Autowired(required=true) protected ItemService itemService
-
-
Method Detail
-
findByItemId
public Entity findByItemId(Context context, UUID itemId) throws SQLException
Description copied from interface:EntityServiceThis will construct an Entity object that will be returned with the Item that matches the ItemID that was passed along as well as a list of relationships for that Item.- Specified by:
findByItemIdin interfaceEntityService- Parameters:
context- The relevant DSpace contextitemId- The ItemID for the Item that is to be used in the Entity object- Returns:
- The constructed Entity object with the Item and the list of relationships
- Throws:
SQLException- If something goes wrong
-
findByItemId
public Entity findByItemId(Context context, UUID itemId, Integer limit, Integer offset) throws SQLException
Description copied from interface:EntityServiceThis will construct an Entity object that will be returned with the Item that matches the ItemID that was passed along as well as a list of relationships for that Item.- Specified by:
findByItemIdin interfaceEntityService- Parameters:
context- The relevant DSpace contextitemId- The ItemID for the Item that is to be used in the Entity objectlimit- paging limitoffset- paging offset- Returns:
- The constructed Entity object with the Item and the list of relationships
- Throws:
SQLException- If something goes wrong
-
getType
public EntityType getType(Context context, Entity entity) throws SQLException
Description copied from interface:EntityServiceReturns the EntityType for the Item that is attached to the Entity that is passed along to this method. The EntityType String logic is in the Metadata for that Item and will be searched on in the EntityTypeService to retrieve the actual EntityType object- Specified by:
getTypein interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity object which contains the Item- Returns:
- The EntityType that belongs to this Item
- Throws:
SQLException- If something goes wrong
-
getLeftRelations
public List<Relationship> getLeftRelations(Context context, Entity entity)
Description copied from interface:EntityServiceRetrieves the list of relationships, which are attached to the Entity object that is passed along, where the left item object of each relationship is equal to the Item object of the Entity object that is passed along- Specified by:
getLeftRelationsin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity object to be returned- Returns:
- The list of relationships that have the Item in the Entity object as their left item
-
getRightRelations
public List<Relationship> getRightRelations(Context context, Entity entity)
Description copied from interface:EntityServiceRetrieves the list of relationships, which are attached to the Entity object that is passed along, where the right item object of each relationship is equal to the Item object of the Entity object that is passed along- Specified by:
getRightRelationsin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity object to be returned- Returns:
- The list of relationships that have the Item in the Entity object as their right item
-
getRelationsByTypeName
public List<Relationship> getRelationsByTypeName(Context context, String typeName) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships for which their relationshiptype has a left or right label that is equal to the passed along label String- Specified by:
getRelationsByTypeNamein interfaceEntityService- Parameters:
context- The relevant DSpace contexttypeName- The label that needs to be in the relationshiptype of the relationship- Returns:
- The list of relationships that have a relationshiptype with a left or right label that is equal to the label param
- Throws:
SQLException- If something goes wrong
-
getRelationsByTypeName
public List<Relationship> getRelationsByTypeName(Context context, String typeName, Integer limit, Integer offset) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships for which their relationshiptype has a left or right label that is equal to the passed along label String- Specified by:
getRelationsByTypeNamein interfaceEntityService- Parameters:
context- The relevant DSpace contexttypeName- The label that needs to be in the relationshiptype of the relationshiplimit- paging limitoffset- paging offset- Returns:
- The list of relationships that have a relationshiptype with a left or right label that is equal to the label param
- Throws:
SQLException- If something goes wrong
-
getAllRelationshipTypes
public List<RelationshipType> getAllRelationshipTypes(Context context, Entity entity) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in either the leftEntityType or the rightEntityType variables- Specified by:
getAllRelationshipTypesin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity for which the EntityType should be checked for relationships- Returns:
- The list of relationships that each contain a relationshiptype in which there is a right or left entity type that is equal to the entity type for the given entity
- Throws:
SQLException- If something goes wrong
-
getAllRelationshipTypes
public List<RelationshipType> getAllRelationshipTypes(Context context, Entity entity, Integer limit, Integer offset) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in either the leftEntityType or the rightEntityType variables- Specified by:
getAllRelationshipTypesin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity for which the EntityType should be checked for relationshipslimit- paging limitoffset- paging offset- Returns:
- The list of relationships that each contain a relationshiptype in which there is a right or left entity type that is equal to the entity type for the given entity
- Throws:
SQLException- If something goes wrong
-
getLeftRelationshipTypes
public List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the leftEntityType- Specified by:
getLeftRelationshipTypesin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity for which the EntityType should be checked for relationships- Returns:
- The list of relationships that each contain a relationshiptype in which there is a left entity type that is equal to the entity type for the given entity
- Throws:
SQLException- If something goes wrong
-
getLeftRelationshipTypes
public List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity, boolean isLeft, Integer limit, Integer offset) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the leftEntityType- Specified by:
getLeftRelationshipTypesin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity for which the EntityType should be checked for relationshipsisLeft- 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 relationships that each contain a relationshiptype in which there is a left entity type that is equal to the entity type for the given entity
- Throws:
SQLException- If something goes wrong
-
getRightRelationshipTypes
public List<RelationshipType> getRightRelationshipTypes(Context context, Entity entity) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the rightEntityType- Specified by:
getRightRelationshipTypesin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity for which the EntityType should be checked for relationships- Returns:
- The list of relationships that each contain a relationshiptype in which there is a right entity type that is equal to the entity type for the given entity
- Throws:
SQLException- If something goes wrong
-
getRightRelationshipTypes
public List<RelationshipType> getRightRelationshipTypes(Context context, Entity entity, boolean isLeft, Integer limit, Integer offset) throws SQLException
Description copied from interface:EntityServiceRetrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the rightEntityType- Specified by:
getRightRelationshipTypesin interfaceEntityService- Parameters:
context- The relevant DSpace contextentity- The Entity for which the EntityType should be checked for relationshipsisLeft- 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 relationships that each contain a relationshiptype in which there is a right entity type that is equal to the entity type for the given entity
- Throws:
SQLException- If something goes wrong
-
getRelationshipTypesByTypeName
public List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type) throws SQLException
Description copied from interface:EntityServiceRetrieves a list of RelationshipType objects for which either their left or right label is equal to the label parameter that's being passed along- Specified by:
getRelationshipTypesByTypeNamein interfaceEntityService- Parameters:
context- The relevant DSpace contexttype- The typeName for which the relationshiptype's labels must be checked- Returns:
- The list of relationshiptypes that each contain a left or right label that is equal to the given label parameter
- Throws:
SQLException- If something goes wrong
-
getRelationshipTypesByTypeName
public List<RelationshipType> getRelationshipTypesByTypeName(Context context, String typeName, Integer limit, Integer offset) throws SQLException
Description copied from interface:EntityServiceRetrieves a list of RelationshipType objects for which either their left or right label is equal to the label parameter that's being passed along- Specified by:
getRelationshipTypesByTypeNamein interfaceEntityService- Parameters:
context- The relevant DSpace contexttypeName- The label for which the relationshiptype's labels must be checkedlimit- paging limitoffset- paging offset- Returns:
- The list of relationshiptypes that each contain a left or right label that is equal to the given label parameter
- Throws:
SQLException- If something goes wrong
-
-