Remove deprecated getMetadata(Context, String) from CommunityService, CollectionService.

This commit is contained in:
Mark H. Wood
2020-09-09 10:14:27 -04:00
parent 8ee14c3abc
commit 7ab6aed276
20 changed files with 421 additions and 189 deletions

View File

@@ -51,7 +51,7 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
/**
* log4j category
*/
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(CommunityServiceImpl.class);
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(CommunityServiceImpl.class);
@Autowired(required = true)
protected CommunityDAO communityDAO;
@@ -174,13 +174,6 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
return communityDAO.findAllNoParent(context, sortField);
}
@Override
public String getMetadata(Community community, String field) {
String[] MDValue = getMDValueByLegacyField(field);
String value = getMetadataFirstValue(community, MDValue[0], MDValue[1], MDValue[2], Item.ANY);
return value == null ? "" : value;
}
@Override
public void setMetadata(Context context, Community community, String field, String value)
throws MissingResourceException, SQLException {
@@ -310,7 +303,7 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
@Override
public List<Community> getAllParents(Context context, Community community) throws SQLException {
List<Community> parentList = new ArrayList<Community>();
List<Community> parentList = new ArrayList<>();
Community parent = (Community) getParentObject(context, community);
while (parent != null) {
parentList.add(parent);
@@ -332,7 +325,7 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
@Override
public List<Collection> getAllCollections(Context context, Community community) throws SQLException {
List<Collection> collectionList = new ArrayList<Collection>();
List<Collection> collectionList = new ArrayList<>();
List<Community> subCommunities = community.getSubcommunities();
for (Community subCommunity : subCommunities) {
addCollectionList(subCommunity, collectionList);