Package org.dspace.content
Class EntityServiceImpl
java.lang.Object
org.dspace.content.EntityServiceImpl
- All Implemented Interfaces:
EntityService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EntityTypeServiceprotected ItemServiceprotected RelationshipServiceprotected RelationshipTypeService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindByItemId(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.findByItemId(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.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 variablesgetAllRelationshipTypes(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 variablesgetLeftRelations(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 alonggetLeftRelationshipTypes(Context context, Entity entity) Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the leftEntityTypegetLeftRelationshipTypes(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 leftEntityTypegetRelationsByTypeName(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 StringgetRelationsByTypeName(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 StringgetRelationshipTypesByTypeName(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 alonggetRelationshipTypesByTypeName(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 alonggetRightRelations(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 alonggetRightRelationshipTypes(Context context, Entity entity) Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the rightEntityTypegetRightRelationshipTypes(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 rightEntityTypeReturns the EntityType for the Item that is attached to the Entity that is passed along to this method.
-
Field Details
-
entityTypeService
-
relationshipService
-
relationshipTypeService
-
itemService
-
-
Constructor Details
-
EntityServiceImpl
public EntityServiceImpl()
-
-
Method Details
-
findByItemId
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
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
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
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
-