mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
91680: Refactor: move entity type getters to itemService
This commit is contained in:

committed by
Ben Bosman

parent
a028b4130f
commit
3a5766a5d2
@@ -792,7 +792,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
+ item.getID() + " due to " + currentDepth + " depth");
|
||||
return;
|
||||
}
|
||||
String entityTypeStringFromMetadata = relationshipMetadataService.getEntityTypeStringFromMetadata(item);
|
||||
String entityTypeStringFromMetadata = itemService.getEntityTypeLabel(item);
|
||||
EntityType actualEntityType = entityTypeService.findByEntityType(context, entityTypeStringFromMetadata);
|
||||
// Get all types of relations for the current item
|
||||
List<RelationshipType> relationshipTypes = relationshipTypeService.findByEntityType(context, actualEntityType);
|
||||
@@ -865,8 +865,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
boolean copyToRightItem)
|
||||
throws SQLException, AuthorizeException {
|
||||
if (copyToLeftItem) {
|
||||
String entityTypeString = relationshipMetadataService
|
||||
.getEntityTypeStringFromMetadata(relationship.getLeftItem());
|
||||
String entityTypeString = itemService.getEntityTypeLabel(relationship.getLeftItem());
|
||||
List<RelationshipMetadataValue> relationshipMetadataValues =
|
||||
relationshipMetadataService.findRelationshipMetadataValueForItemRelationship(context,
|
||||
relationship.getLeftItem(), entityTypeString, relationship, true);
|
||||
@@ -892,8 +891,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
itemService.update(context, relationship.getLeftItem());
|
||||
}
|
||||
if (copyToRightItem) {
|
||||
String entityTypeString = relationshipMetadataService
|
||||
.getEntityTypeStringFromMetadata(relationship.getRightItem());
|
||||
String entityTypeString = itemService.getEntityTypeLabel(relationship.getRightItem());
|
||||
List<RelationshipMetadataValue> relationshipMetadataValues =
|
||||
relationshipMetadataService.findRelationshipMetadataValueForItemRelationship(context,
|
||||
relationship.getRightItem(), entityTypeString, relationship, true);
|
||||
|
Reference in New Issue
Block a user