#8912: adding new metadata/registries api in the configs

This commit is contained in:
Bernaldo Mihasi 2023-07-21 17:04:41 +03:00
parent ee90ac37b6
commit 3fc307c831
4 changed files with 56 additions and 20 deletions

View File

@ -6,22 +6,40 @@
<registries>
<urls>
<!-- <urlConfig>-->
<!-- <key>cristin</key>-->
<!-- <label>Cristin</label>-->
<!-- <ordinal>1</ordinal>-->
<!-- <type>External</type>-->
<!-- <url>https://eestore.paas2.uninett.no/api/metadataschema/?search={like}&amp;page={page}&amp;size={pageSize}</url>-->
<!-- <firstPage>1</firstPage>-->
<!-- <contenttype>application/vnd.api+json; charset=utf-8</contenttype>-->
<!-- <data>-->
<!-- <path>$['data'][*]['attributes']</path>-->
<!-- <fields>-->
<!-- <id>'pid'</id>-->
<!-- <name>'name'</name>-->
<!-- <uri>'uri'</uri>-->
<!-- <description>'description'</description>-->
<!-- <source>'source'</source>-->
<!-- </fields>-->
<!-- </data>-->
<!-- <paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>-->
<!-- </urlConfig>-->
<urlConfig>
<key>cristin</key>
<label>Cristin</label>
<key>rda-metadata-schemes</key>
<label>RDA Metadata Schemes</label>
<ordinal>1</ordinal>
<type>External</type>
<url>https://eestore.paas2.uninett.no/api/metadataschema/?search={like}&amp;page={page}&amp;size={pageSize}</url>
<firstPage>1</firstPage>
<contenttype>application/vnd.api+json; charset=utf-8</contenttype>
<url>https://rdamsc.bath.ac.uk/api2/m?q={like}&amp;start=1&amp;pageSize=111</url>
<contenttype>application/json; charset=utf-8</contenttype>
<data>
<path>$['data'][*]['attributes']</path>
<path>$['data']['items'][*]</path>
<fields>
<id>'pid'</id>
<name>'name'</name>
<id>'mscid'</id>
<name>'title'</name>
<uri>'uri'</uri>
<description>'description'</description>
<source>'source'</source>
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>

View File

@ -6,22 +6,40 @@
<registries>
<urls>
<!-- <urlConfig>-->
<!-- <key>cristin</key>-->
<!-- <label>Cristin</label>-->
<!-- <ordinal>1</ordinal>-->
<!-- <type>External</type>-->
<!-- <url>https://eestore.paas2.uninett.no/api/metadataschema/?search={like}&amp;page={page}&amp;size={pageSize}</url>-->
<!-- <firstPage>1</firstPage>-->
<!-- <contenttype>application/vnd.api+json; charset=utf-8</contenttype>-->
<!-- <data>-->
<!-- <path>$['data'][*]['attributes']</path>-->
<!-- <fields>-->
<!-- <id>'pid'</id>-->
<!-- <name>'name'</name>-->
<!-- <uri>'uri'</uri>-->
<!-- <description>'description'</description>-->
<!-- <source>'source'</source>-->
<!-- </fields>-->
<!-- </data>-->
<!-- <paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>-->
<!-- </urlConfig>-->
<urlConfig>
<key>cristin</key>
<label>Cristin</label>
<key>rda-metadata-schemes</key>
<label>RDA Metadata Schemes</label>
<ordinal>1</ordinal>
<type>External</type>
<url>https://eestore.paas2.uninett.no/api/metadataschema/?search={like}&amp;page={page}&amp;size={pageSize}</url>
<firstPage>1</firstPage>
<contenttype>application/vnd.api+json; charset=utf-8</contenttype>
<url>https://rdamsc.bath.ac.uk/api2/m?q={like}&amp;start=1&amp;pageSize=111</url>
<contenttype>application/json; charset=utf-8</contenttype>
<data>
<path>$['data'][*]['attributes']</path>
<path>$['data']['items'][*]</path>
<fields>
<id>'pid'</id>
<name>'name'</name>
<id>'mscid'</id>
<name>'title'</name>
<uri>'uri'</uri>
<description>'description'</description>
<source>'source'</source>
</fields>
</data>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>

View File

@ -60,7 +60,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
initialItems: (type) => this.searchDatasetExternalRegistries('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
dataRepositoriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {

View File

@ -271,7 +271,7 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
initialItems: () => this.searchDatasetExternalRegistries(''),
displayFn: (item) => { try { return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name } catch { return '' } },
titleFn: (item) => { try { return typeof (item) == 'string' ? JSON.parse(item)['name'] : item.name } catch { return '' } },
subtitleFn: (item) => { try { return item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE') } catch { return '' } },
subtitleFn: (item) => { try { return item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE') } catch { return '' } },
valueAssign: (item) => { try { return typeof (item) == 'string' ? item : JSON.stringify(item) } catch { return '' } }
};
break;