mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
add JavaDoc
This commit is contained in:
@@ -55,6 +55,7 @@ import org.junit.Test;
|
||||
public class CSVMetadataImportReferenceIT extends AbstractIntegrationTestWithDatabase {
|
||||
|
||||
//Common collection to utilize for test
|
||||
private Collection col;
|
||||
private Collection col1;
|
||||
private Collection col2;
|
||||
|
||||
@@ -76,6 +77,10 @@ public class CSVMetadataImportReferenceIT extends AbstractIntegrationTestWithDat
|
||||
.withName("Parent Community")
|
||||
.build();
|
||||
|
||||
col = CollectionBuilder.createCollection(context, parentCommunity)
|
||||
.withName("Collection")
|
||||
.build();
|
||||
|
||||
col1 = CollectionBuilder.createCollection(context, parentCommunity)
|
||||
.withEntityType("Person")
|
||||
.withName("Collection 1")
|
||||
@@ -83,7 +88,7 @@ public class CSVMetadataImportReferenceIT extends AbstractIntegrationTestWithDat
|
||||
|
||||
col2 = CollectionBuilder.createCollection(context, parentCommunity)
|
||||
.withEntityType("Publication")
|
||||
.withName("Collection 1")
|
||||
.withName("Collection 2")
|
||||
.build();
|
||||
|
||||
context.turnOffAuthorisationSystem();
|
||||
@@ -149,6 +154,18 @@ public class CSVMetadataImportReferenceIT extends AbstractIntegrationTestWithDat
|
||||
cleanupImportItems(items);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSingleMdRefIntoCollectionWithoutEntityTypeTest() throws Exception {
|
||||
String[] csv = {"id,dspace.entity.type,relation.isAuthorOfPublication,collection,dc.identifier.other",
|
||||
"+,Person,," + col.getHandle() + ",0",
|
||||
"+,Publication,dc.identifier.other:0," + col.getHandle() + ",1"};
|
||||
Item[] items = runImport(csv);
|
||||
assertRelationship(items[1], items[0], 1, "left", 0);
|
||||
|
||||
// remove created items
|
||||
cleanupImportItems(items);
|
||||
}
|
||||
|
||||
/**
|
||||
* return an array of items given a representation of a CSV as a string array
|
||||
*
|
||||
|
@@ -222,6 +222,16 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository<Collect
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Collections for which the current user has 'submit' privileges.
|
||||
*
|
||||
* @param query The query used in the lookup
|
||||
* @param entityTypeLabel The EntityType label object that will be used to limit the returned collection
|
||||
* to those related to given entity type
|
||||
* @param pageable The pagination information
|
||||
* @return
|
||||
* @throws SearchServiceException If search error
|
||||
*/
|
||||
@SearchRestMethod(name = "findSubmitAuthorizedByEntityType")
|
||||
public Page<CollectionRest> findSubmitAuthorizedByEntityType(
|
||||
@Parameter(value = "query") String query,
|
||||
@@ -244,6 +254,16 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository<Collect
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Collections for which the current user has 'submit' privileges limited by parent community.
|
||||
*
|
||||
* @param query The query used in the lookup
|
||||
* @param communityUuid UUID of the parent community
|
||||
* @param entityTypeLabel The EntityType label object that will be used to limit the returned collection
|
||||
* to those related to given entity type
|
||||
* @param pageable The pagination information
|
||||
* @return
|
||||
*/
|
||||
@SearchRestMethod(name = "findSubmitAuthorizedByCommunityAndEntityType")
|
||||
public Page<CollectionRest> findSubmitAuthorizedByCommunityAndEntityType(
|
||||
@Parameter(value = "query") String query,
|
||||
|
@@ -63,6 +63,12 @@ public class EntityTypeRestRepository extends DSpaceRestRepository<EntityTypeRes
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all entity types related to the collections on which the current user can deposit.
|
||||
*
|
||||
* @param pageable The pagination information
|
||||
* @return
|
||||
*/
|
||||
@SearchRestMethod(name = "findAllByAuthorizedCollection")
|
||||
public Page<EntityTypeRest> findAllByAuthorizedCollection(Pageable pageable) {
|
||||
try {
|
||||
@@ -84,6 +90,13 @@ public class EntityTypeRestRepository extends DSpaceRestRepository<EntityTypeRes
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all entity types related to the collections
|
||||
* on which the current user can deposit and supported by External provider
|
||||
*
|
||||
* @param pageable The pagination information
|
||||
* @return
|
||||
*/
|
||||
@SearchRestMethod(name = "findAllByAuthorizedExternalSource")
|
||||
public Page<EntityTypeRest> findAllByAuthorizedExternalSource(Pageable pageable) {
|
||||
try {
|
||||
|
@@ -99,6 +99,14 @@ public class ExternalSourceRestRepository extends DSpaceRestRepository<ExternalS
|
||||
return converter.toRestPage(externalSources, pageable, utils.obtainProjection());
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all ExternalDataProviders that supports the provided EntityType.
|
||||
*
|
||||
* @param context The relevant DSpace context
|
||||
* @param pageable The pagination information
|
||||
* @param entityType Entity type label
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("permitAll()")
|
||||
@SearchRestMethod(name = "findByEntityType")
|
||||
public Page<ExternalSourceRest> findByEntityType(Context context, Pageable pageable,
|
||||
|
@@ -24,7 +24,6 @@ import org.dspace.builder.EntityTypeBuilder;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.EntityType;
|
||||
import org.dspace.content.service.EntityTypeService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.external.provider.AbstractExternalDataProvider;
|
||||
import org.dspace.external.service.ExternalDataService;
|
||||
import org.hamcrest.Matchers;
|
||||
|
@@ -75,7 +75,7 @@
|
||||
<property name="supportedEntityTypes">
|
||||
<list>
|
||||
<value>Publication</value>
|
||||
<value>unset</value>
|
||||
<value>none</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
@@ -87,7 +87,7 @@
|
||||
<property name="supportedEntityTypes">
|
||||
<list>
|
||||
<value>Publication</value>
|
||||
<value>unset</value>
|
||||
<value>none</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
Reference in New Issue
Block a user