mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
Merge branch 'main' into CST-4503-AddingNewRelationshipsInEditItem
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
package org.dspace.content;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -251,7 +251,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
}
|
||||
List<Relationship> rightRelationships = findByItemAndRelationshipType(context, itemToProcess, relationshipType,
|
||||
isLeft);
|
||||
if (maxCardinality != null && rightRelationships.size() >= maxCardinality) {
|
||||
if (rightRelationships.size() >= maxCardinality) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -267,6 +267,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
return StringUtils.equals(leftEntityType, entityTypeToProcess.getLabel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Relationship find(Context context, int id) throws SQLException {
|
||||
Relationship relationship = relationshipDAO.findByID(context, Relationship.class, id);
|
||||
return relationship;
|
||||
@@ -340,7 +341,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
@Override
|
||||
public void delete(Context context, Relationship relationship, boolean copyToLeftItem, boolean copyToRightItem)
|
||||
throws SQLException, AuthorizeException {
|
||||
log.info(org.dspace.core.LogManager.getHeader(context, "delete_relationship",
|
||||
log.info(org.dspace.core.LogHelper.getHeader(context, "delete_relationship",
|
||||
"relationship_id=" + relationship.getID() + "&" +
|
||||
"copyMetadataValuesToLeftItem=" + copyToLeftItem + "&" +
|
||||
"copyMetadataValuesToRightItem=" + copyToRightItem));
|
||||
@@ -357,7 +358,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
@Override
|
||||
public void forceDelete(Context context, Relationship relationship, boolean copyToLeftItem, boolean copyToRightItem)
|
||||
throws SQLException, AuthorizeException {
|
||||
log.info(org.dspace.core.LogManager.getHeader(context, "delete_relationship",
|
||||
log.info(org.dspace.core.LogHelper.getHeader(context, "delete_relationship",
|
||||
"relationship_id=" + relationship.getID() + "&" +
|
||||
"copyMetadataValuesToLeftItem=" + copyToLeftItem + "&" +
|
||||
"copyMetadataValuesToRightItem=" + copyToRightItem));
|
||||
@@ -408,7 +409,7 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
// Set a limit on the total depth of relationships to traverse during a relationship change
|
||||
int maxDepth = configurationService.getIntProperty("relationship.update.relateditems.maxdepth", 5);
|
||||
// This is the list containing all items which will have changes to their virtual metadata
|
||||
List<Item> itemsToUpdate = new LinkedList<>();
|
||||
List<Item> itemsToUpdate = new ArrayList<>();
|
||||
itemsToUpdate.add(relationship.getLeftItem());
|
||||
itemsToUpdate.add(relationship.getRightItem());
|
||||
|
||||
|
Reference in New Issue
Block a user