Skip to content
Snippets Groups Projects
Commit ff49af35 authored by gakin's avatar gakin
Browse files

SSDM-2399 : V3 AS API - rename criterion to criteria in both Java and JS -...

SSDM-2399 : V3 AS API - rename criterion to criteria in both Java and JS - Check-in changes to files in datastore_server project

SVN: 34695
parent e82a04d2
No related branches found
No related tags found
No related merge requests found
...@@ -38,13 +38,13 @@ import ch.ethz.sis.openbis.generic.dss.api.v3.dto.download.DataSetFileDownloadOp ...@@ -38,13 +38,13 @@ import ch.ethz.sis.openbis.generic.dss.api.v3.dto.download.DataSetFileDownloadOp
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.entity.datasetfile.DataSetFile; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.entity.datasetfile.DataSetFile;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.id.datasetfile.DataSetFilePermId; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.id.datasetfile.DataSetFilePermId;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.id.datasetfile.IDataSetFileId; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.id.datasetfile.IDataSetFileId;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.search.DataSetFileSearchCriterion; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.search.DataSetFileSearchCriteria;
import ch.ethz.sis.openbis.generic.shared.api.v3.IApplicationServerApi; import ch.ethz.sis.openbis.generic.shared.api.v3.IApplicationServerApi;
import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.dataset.DataSet; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.dataset.DataSet;
import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.dataset.DataSetFetchOptions; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.dataset.DataSetFetchOptions;
import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.dataset.DataSetPermId; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.dataset.DataSetPermId;
import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.DataSetSearchCriterion; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.DataSetSearchCriteria;
import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.ISearchCriterion; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.ISearchCriteria;
import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.SearchOperator; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.SearchOperator;
import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.SearchResult; import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.SearchResult;
import ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider; import ch.systemsx.cisd.common.filesystem.IFreeSpaceProvider;
...@@ -122,22 +122,22 @@ public class DataStoreServerApi extends AbstractDssServiceRpc<IDataStoreServerAp ...@@ -122,22 +122,22 @@ public class DataStoreServerApi extends AbstractDssServiceRpc<IDataStoreServerAp
@Transactional(readOnly = true) @Transactional(readOnly = true)
@RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER })
@Override @Override
public List<DataSetFile> searchFiles(String sessionToken, DataSetFileSearchCriterion searchCriterion) public List<DataSetFile> searchFiles(String sessionToken, DataSetFileSearchCriteria searchCriteria)
{ {
getOpenBISService().checkSession(sessionToken); getOpenBISService().checkSession(sessionToken);
List<DataSetFile> result = new ArrayList<>(); List<DataSetFile> result = new ArrayList<>();
Collection<ISearchCriterion> criteria = searchCriterion.getCriteria(); Collection<ISearchCriteria> criteria = searchCriteria.getCriteria();
Set<String> resultDataSets = null; Set<String> resultDataSets = null;
Map<String, DataSetPermId> permIds = new HashMap<>(); Map<String, DataSetPermId> permIds = new HashMap<>();
for (ISearchCriterion iSearchCriterion : criteria) for (ISearchCriteria iSearchCriterion : criteria)
{ {
if (iSearchCriterion instanceof DataSetSearchCriterion) if (iSearchCriterion instanceof DataSetSearchCriteria)
{ {
SearchResult<DataSet> searchResult = SearchResult<DataSet> searchResult =
as.searchDataSets(sessionToken, (DataSetSearchCriterion) iSearchCriterion, new DataSetFetchOptions()); as.searchDataSets(sessionToken, (DataSetSearchCriteria) iSearchCriterion, new DataSetFetchOptions());
List<DataSet> dataSets = searchResult.getObjects(); List<DataSet> dataSets = searchResult.getObjects();
HashSet<String> codes = new HashSet<String>(); HashSet<String> codes = new HashSet<String>();
...@@ -150,7 +150,7 @@ public class DataStoreServerApi extends AbstractDssServiceRpc<IDataStoreServerAp ...@@ -150,7 +150,7 @@ public class DataStoreServerApi extends AbstractDssServiceRpc<IDataStoreServerAp
if (resultDataSets == null) if (resultDataSets == null)
{ {
resultDataSets = codes; resultDataSets = codes;
} else if (searchCriterion.getOperator().equals(SearchOperator.OR)) // is an or } else if (searchCriteria.getOperator().equals(SearchOperator.OR)) // is an or
{ {
resultDataSets.addAll(codes); resultDataSets.addAll(codes);
} else } else
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.download.DataSetFileDownloadOptions; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.download.DataSetFileDownloadOptions;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.entity.datasetfile.DataSetFile; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.entity.datasetfile.DataSetFile;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.id.datasetfile.IDataSetFileId; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.id.datasetfile.IDataSetFileId;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.search.DataSetFileSearchCriterion; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.search.DataSetFileSearchCriteria;
import ch.systemsx.cisd.openbis.common.spring.IInvocationLoggerContext; import ch.systemsx.cisd.openbis.common.spring.IInvocationLoggerContext;
import ch.systemsx.cisd.openbis.generic.shared.AbstractServerLogger; import ch.systemsx.cisd.openbis.generic.shared.AbstractServerLogger;
...@@ -31,9 +31,9 @@ public class DataStoreServerApiLogger extends AbstractServerLogger implements ...@@ -31,9 +31,9 @@ public class DataStoreServerApiLogger extends AbstractServerLogger implements
} }
@Override @Override
public List<DataSetFile> searchFiles(String sessionToken, DataSetFileSearchCriterion searchCriterion) public List<DataSetFile> searchFiles(String sessionToken, DataSetFileSearchCriteria searchCriteria)
{ {
logAccess(sessionToken, "search-files", "SEARCH_CRITERION:\n%s\n", searchCriterion); logAccess(sessionToken, "search-files", "SEARCH_CRITERION:\n%s\n", searchCriteria);
return null; return null;
} }
......
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.entity.datasetfile.DataSetFile; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.entity.datasetfile.DataSetFile;
import ch.ethz.sis.openbis.generic.dss.api.v3.dto.search.DataSetFileSearchCriterion; import ch.ethz.sis.openbis.generic.dss.api.v3.dto.search.DataSetFileSearchCriteria;
public class SearchFileTest extends AbstractFileTest public class SearchFileTest extends AbstractFileTest
{ {
...@@ -16,7 +16,7 @@ public class SearchFileTest extends AbstractFileTest ...@@ -16,7 +16,7 @@ public class SearchFileTest extends AbstractFileTest
@Test @Test
public void allFilesOfGivenDatasetsAreReturned() throws Exception public void allFilesOfGivenDatasetsAreReturned() throws Exception
{ {
DataSetFileSearchCriterion sc = new DataSetFileSearchCriterion(); DataSetFileSearchCriteria sc = new DataSetFileSearchCriteria();
sc.withDataSet().withPermId().thatEquals(dataSetCode); sc.withDataSet().withPermId().thatEquals(dataSetCode);
List<DataSetFile> searchFiles = dss.searchFiles(sessionToken, sc); List<DataSetFile> searchFiles = dss.searchFiles(sessionToken, sc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment