Fixed compile issues
This commit is contained in:
parent
d856255405
commit
7a3b4a18ca
|
@ -38,7 +38,7 @@ public class DataRepositoryManager {
|
||||||
|
|
||||||
public List<DataRepositoryModel> getDataRepositories(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
public List<DataRepositoryModel> getDataRepositories(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
||||||
List<Map<String, Object>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getRepositories(externalUrlCriteria, type);
|
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getRepositories(externalUrlCriteria, type);
|
||||||
|
|
||||||
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
|
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
|
||||||
if (!query.isEmpty()) criteria.setLike(query);
|
if (!query.isEmpty()) criteria.setLike(query);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class ExternalDatasetManager {
|
||||||
|
|
||||||
// Fetch external Datasets from external sources.
|
// Fetch external Datasets from external sources.
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
||||||
List<Map<String, Object>> remoteRepos = remoteFetcher.getDatasets(externalUrlCriteria, type);
|
List<Map<String, String>> remoteRepos = remoteFetcher.getDatasets(externalUrlCriteria, type);
|
||||||
|
|
||||||
// Parse items from external sources to listing models.
|
// Parse items from external sources to listing models.
|
||||||
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class FunderManager {
|
||||||
QueryableList<eu.eudat.data.entities.Funder> authItems = apiContext.getOperationsContext().getDatabaseRepository().getFunderDao().getAuthenticated(items, userInfo);
|
QueryableList<eu.eudat.data.entities.Funder> authItems = apiContext.getOperationsContext().getDatabaseRepository().getFunderDao().getAuthenticated(items, userInfo);
|
||||||
List<Funder> funders = authItems.select(item -> new eu.eudat.models.data.funder.Funder().fromDataModel(item));
|
List<Funder> funders = authItems.select(item -> new eu.eudat.models.data.funder.Funder().fromDataModel(item));
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(funderCriteria.getCriteria().getLike());
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(funderCriteria.getCriteria().getLike());
|
||||||
List<Map<String, Object>> remoteRepos = remoteFetcher.getFunders(externalUrlCriteria);
|
List<Map<String, String>> remoteRepos = remoteFetcher.getFunders(externalUrlCriteria);
|
||||||
FundersExternalSourcesModel fundersExternalSourcesModel = new FundersExternalSourcesModel().fromExternalItem(remoteRepos);
|
FundersExternalSourcesModel fundersExternalSourcesModel = new FundersExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
for (ExternalSourcesItemModel externalListingItem : fundersExternalSourcesModel) {
|
for (ExternalSourcesItemModel externalListingItem : fundersExternalSourcesModel) {
|
||||||
eu.eudat.models.data.funder.Funder funder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(FunderBuilder.class)
|
eu.eudat.models.data.funder.Funder funder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(FunderBuilder.class)
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class GrantManager {
|
||||||
QueryableList<eu.eudat.data.entities.Grant> authItems = apiContext.getOperationsContext().getDatabaseRepository().getGrantDao().getAuthenticated(items, userInfo);
|
QueryableList<eu.eudat.data.entities.Grant> authItems = apiContext.getOperationsContext().getDatabaseRepository().getGrantDao().getAuthenticated(items, userInfo);
|
||||||
List<eu.eudat.models.data.grant.Grant> grants = authItems.select(item -> new Grant().fromDataModel(item));
|
List<eu.eudat.models.data.grant.Grant> grants = authItems.select(item -> new Grant().fromDataModel(item));
|
||||||
|
|
||||||
List<Map<String, Object>> remoteRepos = remoteFetcher.getGrants(externalUrlCriteria);
|
List<Map<String, String>> remoteRepos = remoteFetcher.getGrants(externalUrlCriteria);
|
||||||
|
|
||||||
GrantsExternalSourcesModel grantsExternalSourcesModel = new GrantsExternalSourcesModel().fromExternalItem(remoteRepos);
|
GrantsExternalSourcesModel grantsExternalSourcesModel = new GrantsExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
for (ExternalSourcesItemModel externalListingItem : grantsExternalSourcesModel) {
|
for (ExternalSourcesItemModel externalListingItem : grantsExternalSourcesModel) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class LicenseManager {
|
||||||
|
|
||||||
public List<LicenseModel> getLicenses(String query, String type) throws HugeResultSet, NoURLFound {
|
public List<LicenseModel> getLicenses(String query, String type) throws HugeResultSet, NoURLFound {
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
||||||
List<Map<String, Object>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getlicenses(externalUrlCriteria, type);
|
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getlicenses(externalUrlCriteria, type);
|
||||||
|
|
||||||
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
|
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
|
||||||
if (!query.isEmpty()) criteria.setLike(query);
|
if (!query.isEmpty()) criteria.setLike(query);
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class OrganisationsManager {
|
||||||
|
|
||||||
public List<Organisation> getCriteriaWithExternal(String query, String type) throws HugeResultSet, NoURLFound {
|
public List<Organisation> getCriteriaWithExternal(String query, String type) throws HugeResultSet, NoURLFound {
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
||||||
List<Map<String, Object>> remoteRepos = apiContext.getOperationsContext().getRemoteFetcher().getOrganisations(externalUrlCriteria, type);
|
List<Map<String, String>> remoteRepos = apiContext.getOperationsContext().getRemoteFetcher().getOrganisations(externalUrlCriteria, type);
|
||||||
OrganisationsExternalSourcesModel organisationsExternalSourcesModel = new OrganisationsExternalSourcesModel().fromExternalItem(remoteRepos);
|
OrganisationsExternalSourcesModel organisationsExternalSourcesModel = new OrganisationsExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
List<Organisation> organisations = new LinkedList<>();
|
List<Organisation> organisations = new LinkedList<>();
|
||||||
for (ExternalSourcesItemModel externalListingItem : organisationsExternalSourcesModel) {
|
for (ExternalSourcesItemModel externalListingItem : organisationsExternalSourcesModel) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class ProjectManager {
|
||||||
QueryableList<eu.eudat.data.entities.Project> authItems = apiContext.getOperationsContext().getDatabaseRepository().getProjectDao().getAuthenticated(items, userInfo);
|
QueryableList<eu.eudat.data.entities.Project> authItems = apiContext.getOperationsContext().getDatabaseRepository().getProjectDao().getAuthenticated(items, userInfo);
|
||||||
List<Project> projects = authItems.select(item -> new Project().fromDataModel(item));
|
List<Project> projects = authItems.select(item -> new Project().fromDataModel(item));
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(projectCriteria.getCriteria().getLike());
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(projectCriteria.getCriteria().getLike());
|
||||||
List<Map<String, Object>> remoteRepos = remoteFetcher.getProjects(externalUrlCriteria);
|
List<Map<String, String>> remoteRepos = remoteFetcher.getProjects(externalUrlCriteria);
|
||||||
ProjectsExternalSourcesModel projectsExternalSourcesModel = new ProjectsExternalSourcesModel().fromExternalItem(remoteRepos);
|
ProjectsExternalSourcesModel projectsExternalSourcesModel = new ProjectsExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
for (ExternalSourcesItemModel externalListingItem : projectsExternalSourcesModel) {
|
for (ExternalSourcesItemModel externalListingItem : projectsExternalSourcesModel) {
|
||||||
eu.eudat.models.data.project.Project project = apiContext.getOperationsContext().getBuilderFactory().getBuilder(ProjectBuilder.class)
|
eu.eudat.models.data.project.Project project = apiContext.getOperationsContext().getBuilderFactory().getBuilder(ProjectBuilder.class)
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class RegistryManager {
|
||||||
|
|
||||||
public List<RegistryModel> getRegistries(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
public List<RegistryModel> getRegistries(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
||||||
List<Map<String, Object>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getRegistries(externalUrlCriteria, type);
|
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getRegistries(externalUrlCriteria, type);
|
||||||
|
|
||||||
RegistryCriteria criteria = new RegistryCriteria();
|
RegistryCriteria criteria = new RegistryCriteria();
|
||||||
if (!query.isEmpty()) criteria.setLike(query);
|
if (!query.isEmpty()) criteria.setLike(query);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class ResearcherManager {
|
||||||
item.setTag(keyToSourceMap.get(item.getKey()));
|
item.setTag(keyToSourceMap.get(item.getKey()));
|
||||||
}
|
}
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(researcherCriteriaRequest.getCriteria().getName());
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(researcherCriteriaRequest.getCriteria().getName());
|
||||||
List<Map<String, Object>> remoteRepos = remoteFetcher.getResearchers(externalUrlCriteria,null);
|
List<Map<String, String>> remoteRepos = remoteFetcher.getResearchers(externalUrlCriteria,null);
|
||||||
ResearchersExternalSourcesModel researchersExternalSourcesModel = new ResearchersExternalSourcesModel().fromExternalItem(remoteRepos);
|
ResearchersExternalSourcesModel researchersExternalSourcesModel = new ResearchersExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
for (ExternalSourcesItemModel externalListingItem : researchersExternalSourcesModel) {
|
for (ExternalSourcesItemModel externalListingItem : researchersExternalSourcesModel) {
|
||||||
eu.eudat.models.data.dmp.Researcher researcher = apiContext.getOperationsContext().getBuilderFactory().getBuilder(ResearcherBuilder.class)
|
eu.eudat.models.data.dmp.Researcher researcher = apiContext.getOperationsContext().getBuilderFactory().getBuilder(ResearcherBuilder.class)
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class ServiceManager {
|
||||||
|
|
||||||
public List<ServiceModel> getServices(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
public List<ServiceModel> getServices(String query, String type, Principal principal) throws HugeResultSet, NoURLFound {
|
||||||
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
ExternalUrlCriteria externalUrlCriteria = new ExternalUrlCriteria(query);
|
||||||
List<Map<String, Object>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getServices(externalUrlCriteria, type);
|
List<Map<String, String>> remoteRepos = this.apiContext.getOperationsContext().getRemoteFetcher().getServices(externalUrlCriteria, type);
|
||||||
|
|
||||||
ServiceCriteria criteria = new ServiceCriteria();
|
ServiceCriteria criteria = new ServiceCriteria();
|
||||||
if (!query.isEmpty()) criteria.setLike(query);
|
if (!query.isEmpty()) criteria.setLike(query);
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
||||||
|
|
||||||
public class ExternalDatasetSourcesModel extends ExternalListingItem<ExternalDatasetSourcesModel> {
|
public class ExternalDatasetSourcesModel extends ExternalListingItem<ExternalDatasetSourcesModel> {
|
||||||
@Override
|
@Override
|
||||||
public ExternalDatasetSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public ExternalDatasetSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setId((String)item.get("pid"));
|
model.setId((String)item.get("pid"));
|
||||||
model.setUri((String)item.get("uri"));
|
model.setUri((String)item.get("uri"));
|
||||||
|
|
|
@ -5,5 +5,5 @@ import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
public interface ExternalItem<T> {
|
public interface ExternalItem<T> {
|
||||||
T fromExternalItem(List<Map<String, Object>> values);
|
T fromExternalItem(List<Map<String, String>> values);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
||||||
public class FundersExternalSourcesModel extends ExternalListingItem<FundersExternalSourcesModel> {
|
public class FundersExternalSourcesModel extends ExternalListingItem<FundersExternalSourcesModel> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FundersExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public FundersExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setRemoteId((String)item.get("pid"));
|
model.setRemoteId((String)item.get("pid"));
|
||||||
model.setUri((String)item.get("uri"));
|
model.setUri((String)item.get("uri"));
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
||||||
|
|
||||||
public class GrantsExternalSourcesModel extends ExternalListingItem<GrantsExternalSourcesModel> {
|
public class GrantsExternalSourcesModel extends ExternalListingItem<GrantsExternalSourcesModel> {
|
||||||
@Override
|
@Override
|
||||||
public GrantsExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public GrantsExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setRemoteId((String)item.get("pid"));
|
model.setRemoteId((String)item.get("pid"));
|
||||||
model.setUri((String)item.get("uri"));
|
model.setUri((String)item.get("uri"));
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
||||||
|
|
||||||
public class LicensesExternalSourcesModel extends ExternalListingItem<LicensesExternalSourcesModel> {
|
public class LicensesExternalSourcesModel extends ExternalListingItem<LicensesExternalSourcesModel> {
|
||||||
@Override
|
@Override
|
||||||
public LicensesExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public LicensesExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setId((String)item.get("id"));
|
model.setId((String)item.get("id"));
|
||||||
model.setUri((String)item.get("uri"));
|
model.setUri((String)item.get("uri"));
|
||||||
|
|
|
@ -8,8 +8,8 @@ import java.util.Map;
|
||||||
@Component
|
@Component
|
||||||
public class OrganisationsExternalSourcesModel extends ExternalListingItem<OrganisationsExternalSourcesModel> {
|
public class OrganisationsExternalSourcesModel extends ExternalListingItem<OrganisationsExternalSourcesModel> {
|
||||||
@Override
|
@Override
|
||||||
public OrganisationsExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public OrganisationsExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setRemoteId((String)item.get("pid"));
|
model.setRemoteId((String)item.get("pid"));
|
||||||
model.setUri((String)item.get("uri"));
|
model.setUri((String)item.get("uri"));
|
||||||
|
|
|
@ -14,8 +14,8 @@ public class ProjectsExternalSourcesModel extends ExternalListingItem<ProjectsEx
|
||||||
private static final ObjectMapper mapper = new ObjectMapper();
|
private static final ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectsExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public ProjectsExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
try {
|
try {
|
||||||
JsonNode node = mapper.readTree(mapper.writeValueAsBytes(item));
|
JsonNode node = mapper.readTree(mapper.writeValueAsBytes(item));
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
||||||
|
|
||||||
public class RegistriesExternalSourcesModel extends ExternalListingItem<RegistriesExternalSourcesModel> {
|
public class RegistriesExternalSourcesModel extends ExternalListingItem<RegistriesExternalSourcesModel> {
|
||||||
@Override
|
@Override
|
||||||
public RegistriesExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public RegistriesExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setId((String)item.get("pid"));
|
model.setId((String)item.get("pid"));
|
||||||
model.setUri((String)item.get("uri"));
|
model.setUri((String)item.get("uri"));
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
||||||
|
|
||||||
public class ServiceExternalSourcesModel extends ExternalListingItem<ServiceExternalSourcesModel> {
|
public class ServiceExternalSourcesModel extends ExternalListingItem<ServiceExternalSourcesModel> {
|
||||||
@Override
|
@Override
|
||||||
public ServiceExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public ServiceExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setId((String)item.get("pid"));
|
model.setId((String)item.get("pid"));
|
||||||
model.setUri((String)item.get("label"));
|
model.setUri((String)item.get("label"));
|
||||||
|
|
|
@ -9,8 +9,8 @@ import java.util.Map;
|
||||||
public class TagExternalSourcesModel extends ExternalListingItem<TagExternalSourcesModel> {
|
public class TagExternalSourcesModel extends ExternalListingItem<TagExternalSourcesModel> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TagExternalSourcesModel fromExternalItem(List<Map<String, Object>> values) {
|
public TagExternalSourcesModel fromExternalItem(List<Map<String, String>> values) {
|
||||||
for (Map<String, Object> item : values) {
|
for (Map<String, String> item : values) {
|
||||||
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
|
||||||
model.setId((String)item.get("pid"));
|
model.setId((String)item.get("pid"));
|
||||||
model.setUri((String)item.get("label"));
|
model.setUri((String)item.get("label"));
|
||||||
|
|
Loading…
Reference in New Issue