From 7e78cfdff0d833f9a18722725283ad83e6387256 Mon Sep 17 00:00:00 2001 From: gkolokythas Date: Fri, 13 Sep 2019 16:45:02 +0300 Subject: [PATCH] Adds mock up files for external sources. --- .../eu/eudat/controllers/TagController.java | 12 +- .../RegistriesExternalSourcesModel.java | 1 + .../external/TagExternalSourcesModel.java | 1 + .../resources/DatasetsInternalMockUpData.json | 32 + .../web/src/main/resources/ExternalUrls.xml | 588 +++++++++++------- .../resources/FunderInternalMockUpData.json | 32 + .../resources/GrantInternalMockUpData.json | 32 + .../OrganisationInternalMockUpData.json | 32 + .../resources/ProjectInternalMockUpData.json | 32 + .../RegistriesInternalMockUpData.json | 32 + .../RepositoriesInternalMockUpData.json | 32 + .../ResearcherInternalMockUpData.json | 32 + .../resources/ServicesInternalMockUpData.json | 32 + .../resources/TagsInternalMockUpData.json | 32 + ...et-external-references-editor.component.ts | 4 +- 15 files changed, 709 insertions(+), 217 deletions(-) create mode 100644 dmp-backend/web/src/main/resources/DatasetsInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/FunderInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/GrantInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/OrganisationInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/ProjectInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/RegistriesInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/RepositoriesInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/ResearcherInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/ServicesInternalMockUpData.json create mode 100644 dmp-backend/web/src/main/resources/TagsInternalMockUpData.json diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java index e922bd8f0..02bcb3186 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java @@ -47,13 +47,13 @@ public class TagController extends BaseController { public @ResponseBody ResponseEntity> listExternalTagModel( @RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type) throws HugeResultSet, NoURLFound, IOException { - /* List> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getTags(query, type); - TagExternalSourcesModel researchersExternalSourcesModel = new TagExternalSourcesModel().fromExternalItem(remoteRepos);*/ + List> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getTags(query, type); + TagExternalSourcesModel researchersExternalSourcesModel = new TagExternalSourcesModel().fromExternalItem(remoteRepos); - ObjectMapper mapper = new ObjectMapper(); - String fileUrl = this.environment.getProperty("configuration.resources.path") + this.environment.getProperty("dataset.tags.mock"); - List> data = mapper.readValue(new File(fileUrl), new TypeReference>>(){}); - TagExternalSourcesModel researchersExternalSourcesModel = new TagExternalSourcesModel().fromExternalItem(data); +// ObjectMapper mapper = new ObjectMapper(); +// String fileUrl = this.environment.getProperty("configuration.resources.path") + this.environment.getProperty("dataset.tags.mock"); +// List> data = mapper.readValue(new File(fileUrl), new TypeReference>>(){}); +// TagExternalSourcesModel researchersExternalSourcesModel = new TagExternalSourcesModel().fromExternalItem(data); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().payload(researchersExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE)); } diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/RegistriesExternalSourcesModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/RegistriesExternalSourcesModel.java index 4ec6583e8..e828d707f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/external/RegistriesExternalSourcesModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/external/RegistriesExternalSourcesModel.java @@ -12,6 +12,7 @@ public class RegistriesExternalSourcesModel extends ExternalListingItem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/metadataschemarepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/metadataschemarepo/ + Internal + RegistriesInternalMockUpData.json $['data'][*]['attributes'] @@ -48,29 +65,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/tags/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/tags/ + Internal + TagsInternalMockUpData.json $['data'][*]['attributes'] @@ -91,28 +125,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - https://eestore.paas2.uninett.no/api/projectrepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/projectrepo/ + GrantInternalMockUpData.json + Internal $['data'][*]['attributes'] @@ -134,29 +185,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/projectrepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/projectrepo/ + Internal + ProjectInternalMockUpData.json $['data'][*]['attributes'] @@ -178,29 +246,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/projectrepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/projectrepo/ + Internal + FunderInternalMockUpData.json $['data'][*]['attributes'] @@ -222,29 +307,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/datarepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/datarepo/ + Internal + RepositoriesInternalMockUpData.json $['data'][*]['attributes'] @@ -265,29 +367,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/servicerepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/servicerepo/ + Internal + ServicesInternalMockUpData.json $['data'][*]['attributes'] @@ -307,29 +426,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/personrepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/personrepo/ + Internal + ResearcherInternalMockUpData.json $['data'][*]['attributes'] @@ -349,29 +485,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/organizationrepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/organizationrepo/ + Internal + OrganisationInternalMockUpData.json $['data'][*]['attributes'] @@ -391,29 +544,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - cristin - + internal + 1 - External - https://eestore.paas2.uninett.no/api/datasetrepo/ - - $['data'][*]['attributes'] - - 'pid' - 'name' - 'uri' - 'description' - - - $['meta']['pagination']['page','pages','count'] - - - openAire - - 1 - External - https://eestore.paas2.uninett.no/api/datasetrepo/ + Internal + DatasetsInternalMockUpData.json $['data'][*]['attributes'] diff --git a/dmp-backend/web/src/main/resources/FunderInternalMockUpData.json b/dmp-backend/web/src/main/resources/FunderInternalMockUpData.json new file mode 100644 index 000000000..b3447f8ee --- /dev/null +++ b/dmp-backend/web/src/main/resources/FunderInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "fundermockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Funder test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "fundermockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Funder test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "fundermockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Funder test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/GrantInternalMockUpData.json b/dmp-backend/web/src/main/resources/GrantInternalMockUpData.json new file mode 100644 index 000000000..d1ebbc1b6 --- /dev/null +++ b/dmp-backend/web/src/main/resources/GrantInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "grantmockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Grant test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "grantmockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Grant test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "grantmockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Grant test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/OrganisationInternalMockUpData.json b/dmp-backend/web/src/main/resources/OrganisationInternalMockUpData.json new file mode 100644 index 000000000..249a44c2b --- /dev/null +++ b/dmp-backend/web/src/main/resources/OrganisationInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "organisationmockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Organisation test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "organisationmockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Organisation test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "organisationmockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Organisation test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/ProjectInternalMockUpData.json b/dmp-backend/web/src/main/resources/ProjectInternalMockUpData.json new file mode 100644 index 000000000..fa2413294 --- /dev/null +++ b/dmp-backend/web/src/main/resources/ProjectInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "projectmockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Project test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "projectmockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Project test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "projectmockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Project test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/RegistriesInternalMockUpData.json b/dmp-backend/web/src/main/resources/RegistriesInternalMockUpData.json new file mode 100644 index 000000000..7827ff557 --- /dev/null +++ b/dmp-backend/web/src/main/resources/RegistriesInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "registriesmockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Registries test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "registriesmockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Registries test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "registriesmockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Registries test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/RepositoriesInternalMockUpData.json b/dmp-backend/web/src/main/resources/RepositoriesInternalMockUpData.json new file mode 100644 index 000000000..2f92a4d2a --- /dev/null +++ b/dmp-backend/web/src/main/resources/RepositoriesInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "repositoriesmockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Repositories test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "repositoriesmockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Repositories test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "repositoriesmockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Repositories test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/ResearcherInternalMockUpData.json b/dmp-backend/web/src/main/resources/ResearcherInternalMockUpData.json new file mode 100644 index 000000000..b9778119a --- /dev/null +++ b/dmp-backend/web/src/main/resources/ResearcherInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "researchermockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Researcher test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "researchermockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Researcher test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "researchermockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Researcher test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/ServicesInternalMockUpData.json b/dmp-backend/web/src/main/resources/ServicesInternalMockUpData.json new file mode 100644 index 000000000..ceeb5fec0 --- /dev/null +++ b/dmp-backend/web/src/main/resources/ServicesInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "servicesmockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Services test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "servicesmockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Services test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "servicesmockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Services test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/TagsInternalMockUpData.json b/dmp-backend/web/src/main/resources/TagsInternalMockUpData.json new file mode 100644 index 000000000..5d243d117 --- /dev/null +++ b/dmp-backend/web/src/main/resources/TagsInternalMockUpData.json @@ -0,0 +1,32 @@ +[ + { + "pid": "tagsmockup:internal/001", + "remote_id": "", + "remote_pid": "", + "name": "Tags test 1", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "tagsmockup:internal/002", + "remote_id": "", + "remote_pid": "", + "name": "Tags test 2", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + }, + { + "pid": "tagsmockup:internal/003", + "remote_id": "", + "remote_pid": "", + "name": "Tags test 3", + "uri": "", + "last_fetched": "", + "description": "", + "tag": "internal" + } +] \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts index 0778eec74..e5adbbbbf 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts @@ -101,7 +101,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl initialItems: (type) => this.searchDatasetTags('', type), displayFn: (item) => item ? item.name : null, titleFn: (item) => item ? item.name: null, - subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.name : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE') + subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE') }; } @@ -232,6 +232,6 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl requestItem.criteria = new TagCriteria(); requestItem.criteria.like = query; requestItem.criteria.type = type; - return this.externalSourcesService.searchDatasetService(requestItem); + return this.externalSourcesService.searchDatasetTags(requestItem); } }