DS-3782: Restore lines that should not be modified

This commit is contained in:
Tom Desair
2018-07-18 16:44:41 +02:00
parent 8ffbec58ca
commit de33709364
8 changed files with 29 additions and 30 deletions

View File

@@ -680,6 +680,7 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
moved.getAuthority(), moved.getConfidence()); moved.getAuthority(), moved.getConfidence());
} }
} }
@Override @Override
public void replaceMetadata(Context context, T dso, String schema, String element, String qualifier, String lang, public void replaceMetadata(Context context, T dso, String schema, String element, String qualifier, String lang,
String value, String authority, int confidence, int index) throws SQLException { String value, String authority, int confidence, int index) throws SQLException {

View File

@@ -254,7 +254,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator {
throws SQLException, IOException, AuthorizeException { throws SQLException, IOException, AuthorizeException {
String[] dmdTypes = configurationService.getArrayProperty("aip.disseminate.dmd"); String[] dmdTypes = configurationService.getArrayProperty("aip.disseminate.dmd");
if (ArrayUtils.isEmpty(dmdTypes)) { if (ArrayUtils.isEmpty(dmdTypes)) {
return new String[]{"MODS", "DIM"}; return new String[] {"MODS", "DIM"};
} else { } else {
return dmdTypes; return dmdTypes;
} }
@@ -280,7 +280,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator {
String[] techTypes = configurationService.getArrayProperty("aip.disseminate.techMD"); String[] techTypes = configurationService.getArrayProperty("aip.disseminate.techMD");
if (ArrayUtils.isEmpty(techTypes)) { if (ArrayUtils.isEmpty(techTypes)) {
if (dso.getType() == Constants.BITSTREAM) { if (dso.getType() == Constants.BITSTREAM) {
return new String[]{"PREMIS"}; return new String[] {"PREMIS"};
} else { } else {
return new String[0]; return new String[0];
} }
@@ -312,7 +312,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator {
throws SQLException, IOException, AuthorizeException { throws SQLException, IOException, AuthorizeException {
String[] sourceTypes = configurationService.getArrayProperty("aip.disseminate.sourceMD"); String[] sourceTypes = configurationService.getArrayProperty("aip.disseminate.sourceMD");
if (ArrayUtils.isEmpty(sourceTypes)) { if (ArrayUtils.isEmpty(sourceTypes)) {
return new String[]{"AIP-TECHMD"}; return new String[] {"AIP-TECHMD"};
} else { } else {
return sourceTypes; return sourceTypes;
} }

View File

@@ -97,13 +97,12 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
List<MetadataField> sortFields = Collections.EMPTY_LIST; List<MetadataField> sortFields = Collections.EMPTY_LIST;
if (metadataSortField != null) { if (metadataSortField != null) {ItemRestRepositoryIT
sortFields = Collections.singletonList(metadataSortField); sortFields = Collections.singletonList(metadataSortField);
} }
Query query = getSearchQuery(context, queryString, null, Collections.EMPTY_LIST, sortFields, sortField, Query query = getSearchQuery(context, queryString, null, Collections.EMPTY_LIST, sortFields,
pageSize, sortField, pageSize, offset);
offset);
return list(query); return list(query);
} }

View File

@@ -12,7 +12,6 @@ import java.util.Collection;
import org.apache.commons.collections4.map.MultiValueMap; import org.apache.commons.collections4.map.MultiValueMap;
/** /**
* Represents a query to a source. Subclasses may enforce stricter typing or more verbose setting of parameters. * Represents a query to a source. Subclasses may enforce stricter typing or more verbose setting of parameters.
* *

View File

@@ -17,12 +17,8 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import org.apache.commons.collections4.CollectionUtils;
import org.dspace.core.Constants;
import org.dspace.core.Context;
import mockit.NonStrictExpectations;
import java.io.FileInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.sql.SQLException; import java.sql.SQLException;
@@ -31,9 +27,13 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mockit.NonStrictExpectations;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.dspace.authorize.AuthorizeException; import org.dspace.authorize.AuthorizeException;
import org.dspace.authorize.ResourcePolicy; import org.dspace.authorize.ResourcePolicy;
import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;