andreas.mantas 2022-08-05 08:45:51 +00:00
parent 2b212979dd
commit b9d7fb8732
37 changed files with 780 additions and 713 deletions

View File

@ -67,7 +67,7 @@ export class AppComponent implements OnInit {
() => {
// console.log(this.reposOfUser);
this.reposOfUser.forEach(repo => {
if (!repo.consentTermsOfUse || !repo.fullTextDownload) {
if (repo.consentTermsOfUse === null || repo.fullTextDownload === null) {
this.addTerm(repo.officialname, repo.id, repo.consentTermsOfUse);
this.isModalShown = true;
}

View File

@ -131,7 +131,7 @@ export const timezoneDesc = {
export const datasourceTypeDesc = {
desc: 'The type of your repository',
label: 'Repository Type',
label: 'Data source type',
mandatory: true,
recommended: false
};

View File

@ -1,159 +1,129 @@
// Generated using typescript-generator version 1.29.366 on 2018-02-05 16:06:12.
export class BrowseData {
data: { [index: string]: FieldData };
fields: string[];
data: { [index: string]: FieldData };
fields: string[];
}
export class DataCollectionAccessProtocol {
value: string;
username: string;
password: string;
value: string;
username: string;
password: string;
}
export class DataCollectionInterface {
protocol: DataCollectionAccessProtocol;
baseUrl: string;
format: string;
filter: string;
protocol: DataCollectionAccessProtocol;
baseUrl: string;
format: string;
filter: string;
}
export class DataCollectionType {
dataCollectionInterface: DataCollectionInterface;
id: string;
label: string;
group: string;
dataCollectionInterface: DataCollectionInterface;
id: string;
label: string;
group: string;
}
export class Document {
map: { [index: string]: string[] };
fieldNames: string[];
map: { [index: string]: string[] };
fieldNames: string[];
}
export class FieldData {
fieldRowList: FieldRow[];
count: number[];
values: string[];
fieldRowList: FieldRow[];
count: number[];
values: string[];
}
export class FieldRow {
value: string;
count: number;
value: string;
count: number;
}
export class FormattedSearchResult {
formattedResult: string;
resultsNumber: number;
formattedResult: string;
resultsNumber: number;
}
export class Hint {
alternateTerm: string;
autoFollowHint: boolean;
alternateTerm: string;
autoFollowHint: boolean;
}
export class DriverResource implements Serializable {
resourceId: string;
resourceUri: string;
resourceKind: string;
resourceType: string;
dateOfCreation: Date;
resourceId: string;
resourceUri: string;
resourceKind: string;
resourceType: string;
dateOfCreation: Date;
}
export class MDFormatDataStructure extends DriverResource {
resourceName: string;
layouts: { [index: string]: LayoutField[] };
resourceName: string;
layouts: { [index: string]: LayoutField[] };
}
export class PiwikInfo implements IsSerializable {
repositoryId: string;
openaireId: string;
repositoryName: string;
country: string;
siteId: string;
authenticationToken: string;
creationDate: Date;
requestorName: string;
requestorEmail: string;
validated: boolean;
validationDate: Date;
comment: string;
repositoryId: string;
openaireId: string;
repositoryName: string;
country: string;
siteId: string;
authenticationToken: string;
creationDate: Date;
requestorName: string;
requestorEmail: string;
validated: boolean;
validationDate: Date;
comment: string;
}
export class Repository extends DriverResource implements IsSerializable {
export class DatasourceDetails {
id: string;
officialName: string;
englishName: string;
websiteUrl: string;
logoUrl: string;
contactEmail: string;
countryName: string;
countryCode: string;
organization: string;
openaireId: string;
officialname: string;
englishname: string;
websiteurl: string;
logourl: string;
contactemail: string;
latitude: number;
longitude: number;
timezone: number;
namespacePrefix: string;
odNumberOfItems: string;
odNumberOfItemsDate: string;
odPolicies: string;
odLanguages: string;
odContentTypes: string;
collectedFrom: string;
inferred: boolean;
deletedByInference: boolean;
trust: number;
inferenceProvenance: string;
dateOfValidation: Date;
datasourceClass: string;
provenanceActionClass: string;
dateOfCollection: Date;
typology: string;
namespaceprefix: string;
languages: string;
dateofvalidation: Date;
eoscDatasourceType: string;
dateofcollection: Date;
platform: string;
activationId: string;
mergehomonyms: boolean;
description: string;
releaseStartDate: Date;
releaseEndDate: Date;
missionStatementUrl: string;
dataProvider: boolean;
serviceProvider: boolean;
databaseAccessType: string;
dataUploadType: string;
databaseAccessRestriction: string;
dataUploadRestriction: string;
versioning: boolean;
citationGuidelineUrl: string;
qualityManagementKind: string;
pidSystems: string;
certificates: string;
aggregator: string;
issn: string;
eissn: string;
lissn: string;
interfaces: RepositoryInterface[];
consentTermsOfUse: boolean;
fullTextDownload: boolean;
registeredby: string;
subjects: string;
aggregator: string;
collectedfrom: string;
managed: boolean;
registrationdate: Date;
consentTermsOfUseDate: Date;
lastConsentTermsOfUseDate: Date;
availableDiskSpace: string;
securityParameters: string;
protocol: string;
registeredBy: string;
datasourceType: string;
datasourceAggregatorId: string;
datasourceOriginalIdValue: string;
datasourceOriginalIdProvenance: string;
datasourceAggregated: boolean;
datasourceComplianceDegreeValue: string;
datasourceComplianceDegreeEncoding: string;
numberOfObjects: number;
maxSizeOfDatastructure: number;
maxNumberOfDataStructures: number;
registered: boolean;
extraFields: { [index: string]: string };
consentTermsOfUse: boolean;
fullTextDownload: boolean;
organizations: OrganizationDetails[] = new Array<OrganizationDetails>();
identities: IdentitiesDetails[];
status: string;
typology: string;
}
export class Repository extends DatasourceDetails implements IsSerializable {
timezone: number;
interfaces: RepositoryInterface[];
piwikInfo: PiwikInfo;
environments: string[];
registrationDate: Date;
verified: boolean;
namespacePrefix: string;
dateOfValidation: Date;
dateOfCollection: Date;
dataCollectionTypes: DataCollectionType[];
}
@ -162,16 +132,18 @@ export class RepositorySnippet {
officialname: string;
englishname: string;
websiteurl: string;
typology: string;
registeredby: string;
organizations: Organization[];
registrationdate: Date;
piwikInfo: PiwikInfo;
eoscDatasourceType: string;
logoUrl: string;
description: string;
consentTermsOfUse: boolean;
fullTextDownload: boolean;
consentTermsOfUseDate: Date;
lastConsentTermsOfUseDate: Date;
fullTextDownload: boolean;
organizations: OrganizationDetails[];
typology: string;
piwikInfo: PiwikInfo;
}
export class TermsOfUse {
@ -182,231 +154,260 @@ export class TermsOfUse {
consentTermsOfUseDate: Date;
}
export class Organization {
country: string;
legalname: string;
websiteurl: string;
legalshortname: string;
logourl: string;
}
export class RepositoryAccessProtocol {
value: string;
username: string;
password: string;
filter: string;
value: string;
username: string;
password: string;
filter: string;
}
export class RepositoryBlackboard {
lastrequest: string;
lastresponse: string;
messages: RepositoryBlackboardMessage[];
lastrequest: string;
lastresponse: string;
messages: RepositoryBlackboardMessage[];
}
export class RepositoryBlackboardMessage {
id: string;
action: Action;
actionStatus: ActionStatus;
parameters: string[];
id: string;
action: Action;
actionStatus: ActionStatus;
parameters: string[];
}
export class RepositoryComparator implements Comparator<Repository> {
}
export class RepositoryInterface implements Serializable, IsSerializable {
desiredCompatibilityLevel: string;
complianceName: string;
upgradeToV3: string;
deleteApi: boolean;
accessSet: string;
accessFormat: string;
metadataIdentifierPath: string;
lastCollectionDate: string;
nextScheduledExecution: string;
status: string;
collectedFrom: string;
// export class RepositoryInterface implements Serializable, IsSerializable {
// desiredCompatibilityLevel: string;
// complianceName: string;
// upgradeToV3: string;
// deleteApi: boolean;
// accessSet: string;
// accessFormat: string;
// metadataIdentifierPath: string;
// lastCollectionDate: string;
// nextScheduledExecution: string;
// status: string;
// collectedFrom: string;
// id: string;
// typology: string;
// compatibility: string;
// contentdescription: string;
// protocol: string;
// baseurl: string;
// active: boolean;
// removable: boolean;
// apiParams: { [index: string]: string };
// extraFields: { [index: string]: string };
// comments: string;
// }
export class ApiDetails {
id: string;
typology: string;
compliance: string;
contentDescription: string;
accessProtocol: string;
baseUrl: string;
active: boolean;
protocol: string;
datasource: string;
contentdescription: string;
eoscDatasourceType: string;
compatibility: string;
compatibilityOverride: string;
lastCollectionTotal: number;
lastCollectionDate: Date;
lastAggregationTotal: number;
lastAggregationDate: Date;
lastDownloadTotal: number;
lastDownloadDate: Date;
baseurl: string;
removable: boolean;
accessParams: { [index: string]: string };
extraFields: { [index: string]: string };
apiParams: ApiParamDetails[] = new Array<ApiParamDetails>();
metadataIdentifierPath: string;
typology: string;
comments: string;
}
export class RepositoryInterface extends ApiDetails {
}
export class ApiParamDetails {
param: string;
value: string;
constructor(param, value) {
this.param = param;
this.value = value;
}
}
export class SearchCriteriaImpl implements SearchCriteria {
startsWith: string;
endsWith: string;
contains: string;
startsWith: string;
endsWith: string;
contains: string;
}
export class RepositorySearchCriteria extends SearchCriteriaImpl implements SearchCriteria {
haveDocuments: boolean;
protocolType: string;
adminInfo: string;
officialName: string;
registeredBy: string;
country: string;
verified: boolean;
haveDocuments: boolean;
protocolType: string;
adminInfo: string;
officialName: string;
registeredBy: string;
country: string;
verified: boolean;
}
export class SearchResult {
query: string;
locale: string;
total: number;
page: number;
size: number;
fields: string[];
searchResults: string[];
browseResults: string[];
query: string;
locale: string;
total: number;
page: number;
size: number;
fields: string[];
searchResults: string[];
browseResults: string[];
}
export class SimilarDocument {
id: string;
score: number;
id: string;
score: number;
}
export class StoreInfo {
serviceUrl: string;
storeId: string;
serviceUrl: string;
storeId: string;
}
export class StoreObjectInfo {
storeInfo: StoreInfo;
objectId: string;
storeInfo: StoreInfo;
objectId: string;
}
export class SuggestiveResult {
epr: EPR;
alternativeTerm: string;
autofollow: boolean;
epr: EPR;
alternativeTerm: string;
autofollow: boolean;
}
export class CustomProperties implements IsSerializable {
properties: { [index: string]: string };
properties: { [index: string]: string };
}
export class JobForValidation implements IsSerializable {
officialName: string;
baseUrl: string;
userEmail: string;
validationSet: string;
datasourceId: string;
interfaceId: string;
desiredCompatibilityLevel: string;
activationId: string;
repoType: string;
interfaceIdOld: string;
groupByXpath: string;
metadataPrefix: string;
records: number;
registration: boolean;
updateExisting: boolean;
cris: boolean;
crisReferentialChecks: boolean;
selectedCrisEntities: string[];
selectedContentRules: number[];
selectedUsageRules: number[];
adminEmails: string[];
officialName: string;
baseUrl: string;
userEmail: string;
validationSet: string;
datasourceId: string;
interfaceId: string;
desiredCompatibilityLevel: string;
activationId: string;
repoType: string;
interfaceIdOld: string;
groupByXpath: string;
metadataPrefix: string;
records: number;
registration: boolean;
updateExisting: boolean;
cris: boolean;
crisReferentialChecks: boolean;
selectedCrisEntities: string[];
selectedContentRules: number[];
selectedUsageRules: number[];
adminEmails: string[];
}
export class JobResultEntry implements IsSerializable {
name: string;
description: string;
successes: string;
weight: number;
errors: string[];
ruleId: number;
hasErrors: boolean;
mandatory: boolean;
type: string;
name: string;
description: string;
successes: string;
weight: number;
errors: string[];
ruleId: number;
hasErrors: boolean;
mandatory: boolean;
type: string;
}
export class Rule implements IsSerializable {
id: number;
name: string;
description: string;
type: string;
mandatory: boolean;
weight: number;
provider_information: string;
job_type: string;
entity_type: string;
for_cris: boolean;
configuration: CustomProperties;
id: number;
name: string;
description: string;
type: string;
mandatory: boolean;
weight: number;
provider_information: string;
job_type: string;
entity_type: string;
for_cris: boolean;
configuration: CustomProperties;
}
export class RuleSet implements Serializable, IsSerializable {
id: number;
name: string;
description: string;
guidelinesAcronym: string;
shortName: string;
visibility: string[];
contentRules: Rule[];
usageRules: Rule[];
contentRulesIds: number[];
usageRulesIds: number[];
id: number;
name: string;
description: string;
guidelinesAcronym: string;
shortName: string;
visibility: string[];
contentRules: Rule[];
usageRules: Rule[];
contentRulesIds: number[];
usageRulesIds: number[];
}
export class StoredJob extends JobForValidation implements IsSerializable {
contentJobStatus: string;
usageJobStatus: string;
started: string;
ended: string;
duration: string;
error: string;
validationType: string;
jobType: string;
guidelinesShortName: string;
validationStatus: string;
recordsTested: number;
id: number;
contentJobScore: number;
usageJobScore: number;
rules: number[];
resultEntries: JobResultEntry[];
filteredScores: { [index: string]: number };
contentJobStatus: string;
usageJobStatus: string;
started: string;
ended: string;
duration: string;
error: string;
validationType: string;
jobType: string;
guidelinesShortName: string;
validationStatus: string;
recordsTested: number;
id: number;
contentJobScore: number;
usageJobScore: number;
rules: number[];
resultEntries: JobResultEntry[];
filteredScores: { [index: string]: number };
}
export class AdvQueryObject implements IsSerializable {
datasource: string;
topic: string;
titles: string[];
subjects: string[];
authors: string[];
dates: Range[];
trust: Range;
page: number;
datasource: string;
topic: string;
titles: string[];
subjects: string[];
authors: string[];
dates: Range[];
trust: Range;
page: number;
}
export class BrowseEntry implements Comparable<BrowseEntry>, IsSerializable {
value: string;
size: number;
value: string;
size: number;
}
export class ConditionParams implements IsSerializable {
value: string;
otherValue: string;
value: string;
otherValue: string;
}
export class OaBrokerRelatedDataset implements IsSerializable {
openaireId: string;
originalId: string;
title: string;
collectedFrom: string;
pids: OaBrokerTypedValue[];
instances: OaBrokerInstance[];
openaireId: string;
originalId: string;
title: string;
collectedFrom: string;
pids: OaBrokerTypedValue[];
instances: OaBrokerInstance[];
}
export class DatasourcesBroker implements IsSerializable {
datasourcesOfUser: Tuple<BrowseEntry, string>[];
sharedDatasources: Tuple<BrowseEntry, string>[];
datasourcesOfOthers: Tuple<BrowseEntry, string>[];
datasourcesOfUser: Tuple<BrowseEntry, string>[];
sharedDatasources: Tuple<BrowseEntry, string>[];
datasourcesOfOthers: Tuple<BrowseEntry, string>[];
}
export class OaBrokerRelatedDatasource implements IsSerializable {
@ -417,47 +418,47 @@ export class OaBrokerRelatedDatasource implements IsSerializable {
}
export class EventsPage implements IsSerializable {
datasource: string;
topic: string;
currPage: number;
totalPages: number;
total: number;
values: OaBrokerEventPayload[];
datasource: string;
topic: string;
currPage: number;
totalPages: number;
total: number;
values: OaBrokerEventPayload[];
}
export class OaBrokerExternalReference implements IsSerializable {
url: string;
sitename: string;
type: string;
refidentifier: string;
url: string;
sitename: string;
type: string;
refidentifier: string;
}
export class OaBrokerInstance implements IsSerializable {
url: string;
license: string;
hostedby: string;
instancetype: string;
url: string;
license: string;
hostedby: string;
instancetype: string;
}
export class OaBrokerJournal implements IsSerializable {
name: string;
issn: string;
eissn: string;
lissn: string;
name: string;
issn: string;
eissn: string;
lissn: string;
}
export class MapConditions implements IsSerializable {
field: string;
fieldType: MapValueType;
operator: ConditionOperator;
listParams: ConditionParams[];
field: string;
fieldType: MapValueType;
operator: ConditionOperator;
listParams: ConditionParams[];
}
export class OaBrokerEventPayload implements IsSerializable {
result: OaBrokerMainEntity; // old publication: Publication; ??
highlight: OaBrokerMainEntity;
provenance: OaBrokerProvenance;
trust: number;
result: OaBrokerMainEntity; // old publication: Publication; ??
highlight: OaBrokerMainEntity;
provenance: OaBrokerProvenance;
trust: number;
}
export class OaBrokerAuthor implements IsSerializable {
@ -466,32 +467,32 @@ export class OaBrokerAuthor implements IsSerializable {
}
export class OpenaireSubscription implements IsSerializable {
subscriber: string;
frequency: NotificationFrequency;
mode: NotificationMode;
query: AdvQueryObject;
subscriber: string;
frequency: NotificationFrequency;
mode: NotificationMode;
query: AdvQueryObject;
}
export class OaBrokerTypedValue implements IsSerializable {
value: string;
type: string;
value: string;
type: string;
}
export class OaBrokerProject implements IsSerializable {
openaireId: string;
code: string;
acronym: string;
title: string;
funder: string;
fundingProgram: string;
jurisdiction: string;
openaireId: string;
code: string;
acronym: string;
title: string;
funder: string;
fundingProgram: string;
jurisdiction: string;
}
export class OaBrokerProvenance implements IsSerializable {
repositoryName: string;
repositoryType: string;
url: string;
id: string;
repositoryName: string;
repositoryType: string;
url: string;
id: string;
}
export class OaBrokerRelatedPublication implements IsSerializable {
@ -505,41 +506,41 @@ export class OaBrokerRelatedPublication implements IsSerializable {
}
export class OaBrokerMainEntity implements IsSerializable {
openaireId: string;
originalId: string;
typology: string;
titles: string[];
abstracts: string[];
language: string;
subjects: OaBrokerTypedValue[];
creators: OaBrokerAuthor[];
publicationdate: string;
publisher: string;
embargoenddate: string;
contributor: string[];
journal: OaBrokerJournal;
pids: OaBrokerTypedValue[];
instances: OaBrokerInstance[];
externalReferences: OaBrokerExternalReference[];
publications: OaBrokerRelatedPublication[];
projects: OaBrokerProject[];
datasets: OaBrokerRelatedDataset[];
softwares: OaBrokerRelatedSoftware[];
datasources: OaBrokerRelatedDatasource[];
openaireId: string;
originalId: string;
typology: string;
titles: string[];
abstracts: string[];
language: string;
subjects: OaBrokerTypedValue[];
creators: OaBrokerAuthor[];
publicationdate: string;
publisher: string;
embargoenddate: string;
contributor: string[];
journal: OaBrokerJournal;
pids: OaBrokerTypedValue[];
instances: OaBrokerInstance[];
externalReferences: OaBrokerExternalReference[];
publications: OaBrokerRelatedPublication[];
projects: OaBrokerProject[];
datasets: OaBrokerRelatedDataset[];
softwares: OaBrokerRelatedSoftware[];
datasources: OaBrokerRelatedDatasource[];
}
export class Range implements IsSerializable {
min: string;
max: string;
min: string;
max: string;
}
export class SimpleSubscriptionDesc implements IsSerializable {
id: string;
datasource: string;
topic: string;
count: number;
creationDate: Date;
lastNotificationDate: Date;
id: string;
datasource: string;
topic: string;
count: number;
creationDate: Date;
lastNotificationDate: Date;
}
export class OaBrokerRelatedSoftware implements IsSerializable {
@ -551,25 +552,25 @@ export class OaBrokerRelatedSoftware implements IsSerializable {
}
export class Subscription implements IsSerializable {
subscriptionId: string;
subscriber: string;
topic: string;
frequency: NotificationFrequency;
mode: NotificationMode;
creationDate: Date;
lastNotificationDate: Date;
conditions: string;
conditionsAsList: MapConditions[];
subscriptionId: string;
subscriber: string;
topic: string;
frequency: NotificationFrequency;
mode: NotificationMode;
creationDate: Date;
lastNotificationDate: Date;
conditions: string;
conditionsAsList: MapConditions[];
}
export class LayoutField {
name: string;
xpath: string;
type: string;
indexable: boolean;
result: boolean;
stat: boolean;
tokenizable: boolean;
name: string;
xpath: string;
type: string;
indexable: boolean;
result: boolean;
stat: boolean;
tokenizable: boolean;
}
export interface IsSerializable {
@ -582,16 +583,16 @@ export interface SearchCriteria {
}
export class EPR {
epr: string;
address: string;
serviceName: string;
endpointName: string;
parameterNames: string[];
epr: string;
address: string;
serviceName: string;
endpointName: string;
parameterNames: string[];
}
export class Tuple<K, V> implements IsSerializable {
first: K;
second: V;
first: K;
second: V;
}
export interface Comparator<T> {
@ -600,18 +601,27 @@ export interface Comparator<T> {
export interface Comparable<T> {
}
export type ConditionOperator = "EXACT" | "MATCH_ANY" | "MATCH_ALL" | "RANGE";
export type ConditionOperator = 'EXACT' | 'MATCH_ANY' | 'MATCH_ALL' | 'RANGE';
export type MapValueType = "STRING" | "INTEGER" | "FLOAT" | "DATE" | "BOOLEAN" | "LIST_STRING" | "LIST_INTEGER" | "LIST_FLOAT" | "LIST_DATE" | "LIST_BOOLEAN";
export type MapValueType =
'STRING'
| 'INTEGER'
| 'FLOAT'
| 'DATE'
| 'BOOLEAN'
| 'LIST_STRING'
| 'LIST_INTEGER'
| 'LIST_FLOAT'
| 'LIST_DATE'
| 'LIST_BOOLEAN';
export type NotificationFrequency = "never" | "realtime" | "daily" | "weekly" | "monthly";
export type NotificationFrequency = 'never' | 'realtime' | 'daily' | 'weekly' | 'monthly';
export type NotificationMode = "MOCK" | "EMAIL";
export type NotificationMode = 'MOCK' | 'EMAIL';
export type Action = "CREATE" | "DELETE" | "UPDATE" | "MANAGE" | "RELEASE" | "CANCEL";
export type ActionStatus = "DONE" | "ONGOING" | "FAILED" | "WAITING" | "ASSIGNED";
export type Action = 'CREATE' | 'DELETE' | 'UPDATE' | 'MANAGE' | 'RELEASE' | 'CANCEL';
export type ActionStatus = 'DONE' | 'ONGOING' | 'FAILED' | 'WAITING' | 'ASSIGNED';
export class Country {
@ -681,7 +691,7 @@ export class Aggregations implements IsSerializable {
lastTransformation: AggregationDetails[];
}
export class UserInfo implements IsSerializable {
export class UserInfo implements IsSerializable {
sub: string;
role: string[];
name: string;
@ -732,3 +742,16 @@ export class User {
lastName: string;
email: string;
}
export class OrganizationDetails {
legalshortname: string;
legalname: string;
websiteurl: string;
logourl: string;
country: string;
}
export class IdentitiesDetails {
pid: string;
issuertype: string;
}

View File

@ -121,7 +121,7 @@
<!-- REPOSITORY CARD -->
<div *ngFor="let res of repositorySnippet" class="md-card repositoryCard">
<div class="md-card-content large-padding">
<div class="uk-text-meta">{{res.typology.split('::')[0]}} {{res.typology.split('::')[1]}} {{res.typology.split('::')[2]}}</div>
<div class="uk-text-meta">{{res.eoscDatasourceType.split('::')[0]}} {{res.eoscDatasourceType.split('::')[1]}} {{res.eoscDatasourceType.split('::')[2]}}</div>
<div class="repositoryCardHeader uk-margin-bottom uk-margin-small-top"><a [routerLink]="['/repositoryAdmin/' + res.id]">{{res.officialname}}</a></div>
<div class="uk-margin-small-bottom"><span class="uk-badge uk-badge-primary uk-badge-notification uk-margin-small-right">ID</span>{{res.id}}</div>
<div class="uk-margin-small-bottom"><span class="uk-badge uk-badge-primary uk-badge-notification uk-margin-small-right">RM</span>{{res.registeredby}}</div>

View File

@ -30,7 +30,7 @@ export class CompatibilityMonitorFullHistoryRepoComponent implements OnInit {
if(this.sharedService.getRepository()) {
this.repo = this.sharedService.getRepository();
this.repoName = this.repo.officialName;
this.repoName = this.repo.officialname;
this.getAllAggregationHistory();
}
@ -38,7 +38,7 @@ export class CompatibilityMonitorFullHistoryRepoComponent implements OnInit {
r => {
this.repo = r;
if (this.repo) {
this.repoName = this.repo.officialName;
this.repoName = this.repo.officialname;
this.getAllAggregationHistory();
}
}

View File

@ -29,7 +29,7 @@ export class CompatibilityMonitorRepoComponent implements OnInit {
if(this.sharedService.getRepository()) {
this.repo = this.sharedService.getRepository();
this.repoName = this.repo.officialName;
this.repoName = this.repo.officialname;
this.getLatestAggregationHistory();
}
@ -37,7 +37,7 @@ export class CompatibilityMonitorRepoComponent implements OnInit {
r => {
this.repo = r;
if (this.repo) {
this.repoName = this.repo.officialName;
this.repoName = this.repo.officialname;
this.getLatestAggregationHistory();
}
}

View File

@ -373,7 +373,7 @@
<div *ngIf="!brokerSummary || !brokerSummary.userSubs">No notifications were found</div>
<div *ngIf="brokerSummary && brokerSummary.userSubs">
<ul class="md-list md-list-addon gmap_list">
<li *ngFor="let sub of brokerSummary.userSubs[repository.officialName]">
<li *ngFor="let sub of brokerSummary.userSubs[repository.officialname]">
<div class="md-list-addon-element">
<span>{{ sub.count | number }}</span>
<!--<img class="md-user-image md-list-addon-avatar" src="assets/img/avatars/avatar_01_tn.png" alt="">-->

View File

@ -283,7 +283,7 @@ export class DashboardComponent implements OnInit {
}
getCorrectName() {
const temp = this.repository.officialName.split('|');
const temp = this.repository.officialname.split('|');
let correctName = temp[0];
let repoName = temp[0];
for (let i = 1; i < temp.length; i++) {

View File

@ -74,7 +74,7 @@ export class ContentEventsOfRepoEventslistComponent implements OnInit {
if(this.sharedService.getRepository()) {
this.repoName = this.sharedService.getRepository().officialName;
this.repoName = this.sharedService.getRepository().officialname;
this.initQuery();
this.initForm();
this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
@ -84,7 +84,7 @@ export class ContentEventsOfRepoEventslistComponent implements OnInit {
this.sharedService.repository$.subscribe(
r => {
if (r) {
this.repoName = r.officialName;
this.repoName = r.officialname;
this.initQuery();
this.initForm();
this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */

View File

@ -34,7 +34,7 @@ export class ContentEventsOfRepositoryComponent implements OnInit {
ngOnInit() {
if(this.sharedService.getRepository()) {
this.repoName = this.sharedService.getRepository().officialName;
this.repoName = this.sharedService.getRepository().officialname;
this.getCorrectName();
this.getTopics();
}
@ -42,7 +42,7 @@ export class ContentEventsOfRepositoryComponent implements OnInit {
this.sharedService.repository$.subscribe(
r => {
if (r) {
this.repoName = r.officialName;
this.repoName = r.officialname;
this.getCorrectName();
this.getTopics();
}

View File

@ -1,6 +1,6 @@
<div id="page_content_inner">
<!--<h2 class="heading_b uk-margin-bottom">Metrics for repository....</h2>-->
<h2 *ngIf="repo" class="heading_b uk-margin-bottom">Metrics for {{repo.officialName}}</h2>
<h2 *ngIf="repo" class="heading_b uk-margin-bottom">Metrics for {{repo.officialname}}</h2>
<!-- TOP HELP CONTENT -->
<help-content #topHelperContent [position]="'top'"

View File

@ -3,9 +3,11 @@ import { ActivatedRoute, Router } from '@angular/router';
import { ConfirmationDialogComponent } from '../../../shared/reusablecomponents/confirmation-dialog.component';
import { PiwikService } from '../../../services/piwik.service';
import { RepositoryService } from '../../../services/repository.service';
import { PiwikInfo, Repository } from '../../../domain/typeScriptClasses';
import { enabledMetricsError, enabledMetricsSuccess, enablingMetrics,
loadingRepoError, loadingRepoMessage } from '../../../domain/shared-messages';
import {Country, PiwikInfo, Repository} from '../../../domain/typeScriptClasses';
import {
enabledMetricsError, enabledMetricsSuccess, enablingMetrics,
loadingRepoError, loadingRepoMessage, noServiceMessage
} from '../../../domain/shared-messages';
import { AuthenticationService } from '../../../services/authentication.service';
import { SharedService } from "../../../services/shared.service";
@ -25,6 +27,8 @@ export class MetricsEnableComponent implements OnInit {
repo: Repository;
oaId: string;
countries: Country[] = [];
modalTitle = 'Confirmation';
modalButton = 'Yes, enable it';
isModalShown: boolean;
@ -60,11 +64,13 @@ export class MetricsEnableComponent implements OnInit {
// this.getRepo();
this.isModalShown = false;
let body = document.getElementsByTagName('body')[0];
body.classList.remove("top_bar_active"); //remove the class
body.classList.remove("page_heading_active");
body.classList.remove("landing");
body.classList.add("dashboard");
const body = document.getElementsByTagName('body')[0];
body.classList.remove('top_bar_active'); // remove the class
body.classList.remove('page_heading_active');
body.classList.remove('landing');
body.classList.add('dashboard');
this.getCountries();
}
// getRepo(): void {
@ -109,8 +115,8 @@ export class MetricsEnableComponent implements OnInit {
const piwik: PiwikInfo = {
repositoryId: this.repo.id,
openaireId: this.oaId,
repositoryName: this.repo.officialName,
country: this.repo.countryName,
repositoryName: this.repo.officialname,
country: this.getCountryName(this.repo.organizations[0].country),
siteId: '',
authenticationToken: this.authenticationToken,
creationDate: null,
@ -121,13 +127,13 @@ export class MetricsEnableComponent implements OnInit {
comment: ''
};
this.piwikService.enableMetricsForRepository(this.repo.officialName, this.repo.websiteUrl, piwik).subscribe(
this.piwikService.enableMetricsForRepository(this.repo.officialname, this.repo.websiteurl, piwik).subscribe(
response => {
console.log(`enableMetrics answered: ${response}`);
this.successMessage = enabledMetricsSuccess;
this.loadingMessage = '';
//save piwik and update shareRepo
// save piwik and update shareRepo
this.repo.piwikInfo = piwik;
this.sharedService.setRepository(this.repo);
},
@ -143,4 +149,33 @@ export class MetricsEnableComponent implements OnInit {
);
}
}
getCountries() {
this.repoService.getCountries()
.subscribe(
countries => this.countries = countries.sort(function (a, b) {
if (a.name < b.name) {
return -1;
} else if (a.name > b.name) {
return 1;
} else {
return 0;
}
}),
error => {
this.loadingMessage = '';
this.errorMessage = noServiceMessage;
console.log(error);
}
);
}
getCountryName(countryCode): string {
for (const country of Object.values(this.countries)) {
if (country.code === countryCode) {
return country.name;
}
}
}
}

View File

@ -37,7 +37,7 @@ export class MetricsShowComponent implements OnInit {
ngOnInit() {
if(this.sharedService.getRepository()) {
if (this.sharedService.getRepository()) {
this.repoId = this.sharedService.getRepository().id;
this.piwik = this.sharedService.getRepository().piwikInfo;
this.getMetrics();
@ -51,11 +51,11 @@ export class MetricsShowComponent implements OnInit {
}
);
let body = document.getElementsByTagName('body')[0];
body.classList.remove("top_bar_active"); //remove the class
body.classList.remove("page_heading_active");
body.classList.remove("landing");
body.classList.add("dashboard");
const body = document.getElementsByTagName('body')[0];
body.classList.remove('top_bar_active'); // remove the class
body.classList.remove('page_heading_active');
body.classList.remove('landing');
body.classList.add('dashboard');
}
getMetrics() {
@ -90,7 +90,7 @@ export class MetricsShowComponent implements OnInit {
getViewsUrl () {
let encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly views","type":"line","query":{"name":"usagestats.views.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly views"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
const encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly views","type":"line","query":{"name":"usagestats.views.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly views"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
this.viewsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`${this.repoMetrics.diagramsBaseURL}chart?json=${encodedURL}`);
// this.viewsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(
@ -112,7 +112,7 @@ export class MetricsShowComponent implements OnInit {
getDownloadsUrl () {
let encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly downloads","type":"line","query":{"name":"usagestats.downloads.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly downloads"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
const encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly downloads","type":"line","query":{"name":"usagestats.downloads.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly downloads"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
this.downloadsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`${this.repoMetrics.diagramsBaseURL}chart?json=${encodedURL}`);
// this.downloadsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(

View File

@ -68,7 +68,7 @@ export class MetricsUsagestatsReportComponent implements OnInit {
if (this.repo.issn && this.repo.issn !== 'null') {
this.shownRepoId = this.repo.issn.slice(0, 4) + '-' + this.repo.issn.toString().slice(4);
}
this.title = `${this.chosen_report} report for ${this.repo.officialName}`;
this.title = `${this.chosen_report} report for ${this.repo.officialname}`;
}
getParams() {

View File

@ -89,7 +89,7 @@
</div>
</div>
</div>
<div *ngIf="repo.datasourceType === 'journal'" class="uk-width-1-3@m">
<div *ngIf="repo.eoscDatasourceType === 'journal'" class="uk-width-1-3@m">
<div class="uk-margin uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="" data-id="" style="">
<a [routerLink]="['JR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="uk-card-media-top">

View File

@ -27,13 +27,13 @@ export class MetricsUsagestatsComponent implements OnInit {
if(this.sharedService.getRepository()) {
this.repo = this.sharedService.getRepository();
this.title = this.title + ' for ' + this.repo.officialName;
this.title = this.title + ' for ' + this.repo.officialname;
}
this.sharedService.repository$.subscribe(
r => {
this.repo = r;
this.title = this.title + ' for ' + this.repo.officialName;
this.title = this.title + ' for ' + this.repo.officialname;
}
);

View File

@ -15,9 +15,9 @@
<div class="uk-margin-medium-left uk-margin-medium-right">
<div class="uk-padding-small">
<h3 *ngIf="repository" class="heading_b">
<img *ngIf="!repository.logoUrl" src="../../../assets/imgs/yourLogoHere.jpg" style="margin-right: 15px; margin-top:-8px" width="60">
<img *ngIf="repository.logoUrl" src="{{ repository.logoUrl }}" style="margin-right: 15px; margin-top:-8px" width="60">
{{ repository.officialName }}
<img *ngIf="!repository.logourl" src="../../../assets/imgs/yourLogoHere.jpg" style="margin-right: 15px; margin-top:-8px" width="60">
<img *ngIf="repository.logourl" src="{{ repository.logourl }}" style="margin-right: 15px; margin-top:-8px" width="60">
{{ repository.officialname }}
</h3>
</div>

View File

@ -61,7 +61,7 @@ export class SourcesUpdateRepoComponent implements OnInit {
} else if (this.repo.id.includes('aggregator')) {
this.mode = 'aggregator';
}
this.logoURL = this.repo.logoUrl;
this.logoURL = this.repo.logourl;
this.getRepoInterfaces();
}
@ -69,7 +69,7 @@ export class SourcesUpdateRepoComponent implements OnInit {
r => {
this.repo = r;
if (this.repo) {
this.logoURL = this.repo.logoUrl;
this.logoURL = this.repo.logourl;
this.getRepoInterfaces();
}
}
@ -145,9 +145,9 @@ export class SourcesUpdateRepoComponent implements OnInit {
false, i,
{
id: this.repo.id,
datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass,
registeredBy: this.repo.registeredBy
datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredby
},
this.repoInterfaces[i]
]);
@ -157,9 +157,9 @@ export class SourcesUpdateRepoComponent implements OnInit {
false, 0,
{
id: this.repo.id,
datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass,
registeredBy: this.repo.registeredBy
datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredby
}
]);
}
@ -168,8 +168,8 @@ export class SourcesUpdateRepoComponent implements OnInit {
addInterfaceToList(intrf?: RepositoryInterface) {
const curIndex = this.dataForInterfaceComp.length;
const curRepoInfo = {
id: this.repo.id, datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy
id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby
};
if (intrf) {
this.dataForInterfaceComp.push([false, curIndex, curRepoInfo, intrf]);
@ -204,7 +204,7 @@ export class SourcesUpdateRepoComponent implements OnInit {
}
updatedLogoUrl(event: any) {
this.repo.logoUrl = this.logoURL;
this.repo.logourl = this.logoURL;
this.datasourceUpdateForm.updateGroup.get('logoUrl').setValue(this.logoURL);
this.datasourceUpdateForm.updateRepo();

View File

@ -22,45 +22,21 @@
<div class="uk-row-first">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
<a [routerLink]="['literature']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<a [routerLink]="['repository']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="md-card-content large-padding uk-margin-medium-top uk-margin-bottom">
<div class="">
<img class="el-image" src="../../../assets/imgs/datasourcetypes/Literature%20repository.svg" alt="" width="51">
</div>
<h3>Literature repository</h3>
<!--<a [routerLink]="['literature']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>-->
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary" (click)="goTo('literature')" style="cursor: pointer">
<p class="uk-margin-remove">Make sure your repository is already registered in OpenDOAR, the
authoritative directory of institutional and thematic OA repositories, and is compatible with the
OpenAIRE Guidelines for Literature Repositories.</p>
<a href="http://v2.sherpa.ac.uk/opendoar/" target="_blank">
List provided by<br>
OpenDOAR<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i>
</a>
</div>
</div>
</div>
</div>
<div class="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
<a [routerLink]="['data']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="md-card-content large-padding uk-margin-medium-top uk-margin-bottom">
<div class="">
<img class="el-image" src="../../../assets/imgs/datasourcetypes/Data%20repository.svg" alt="" width="51">
</div>
<h3>Data repository</h3>
<!--<a [routerLink]="['data']" [queryParams]="{ step: 'selectDatasource' }" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>-->
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary" (click)="goTo('data')" style="cursor: pointer">
<p class="uk-margin-remove">Make sure your data repository is registered in Re3Data, the global registry
of research data repositories from different academic disciplines, and is compatible with the OpenAIRE Guidelines for Data Archives.</p>
<a href="http://www.re3data.org" target="_blank">
List provided by
<br>
Re3data<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i>
</a>
<h3>Repository</h3>
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary" (click)="goTo('repository')" style="cursor: pointer">
<p class="uk-margin-remove">Make sure your repository is already registered in one of the following global registries -
<a href="https://v2.sherpa.ac.uk/opendoar/">OpenDOAR<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a> (for Literature Repositories),
<a href="http://www.re3data.org/">Re3data<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a> or
<a href="https://fairsharing.org/search?fairsharingRegistry=Database">FAIRsharing<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a>
(for Data Repositories) - and is compatible with the
<a href="https://guidelines.openaire.eu/en/latest/">OpenAIRE Guidelines<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a>.
<br>For any questions please contact the <a href="mailto:helpdesk@openaire.eu" target="_blank">OpenAIRE helpdesk.<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a>
</p>
</div>
</div>
</div>
@ -85,10 +61,6 @@
</div>
</div>
</div>
<div class="uk-margin uk-grid uk-grid-match uk-grid-medium repositoryTypeSelection uk-child-width-1-3@l uk-child-widht-1-3@m" uk-grid="">
<div class="uk-row-first">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
@ -108,6 +80,10 @@
</div>
</div>
</div>
<div class="uk-margin uk-grid uk-grid-match uk-grid-medium repositoryTypeSelection uk-child-width-1-3@l uk-child-widht-1-3@m" uk-grid="">
<div class="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
@ -154,23 +130,6 @@
</div>
</div>
<div class="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
<a class="el-link uk-position-cover uk-margin-remove-adjacent uk-disabled"></a>
<div class="md-card-content large-padding uk-margin-medium-top uk-margin-bottom">
<div class="">
<img class="el-image" src="../../../assets/imgs/datasourcetypes/Cris.svg" alt="" width="50">
</div>
<h3>CRIS systems</h3>
<div class="uk-transition-slide-bottom uk-position-bottom uk-overlay uk-overlay-primary">
<p class="uk-margin-remove">Stay tuned.</p>
</div>
</div>
<div class="whiteFilm"></div>
</div>
</div>
<div class="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium
datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">

View File

@ -20,7 +20,7 @@ export class SourcesRegisterComponent implements OnInit {
// fixme still when I click the link inside the text in overlay, this event happens as well (I go to the first step of the wizard)
goTo(datasourceType: string) {
if (datasourceType === 'literature') {
if (datasourceType === 'repository') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
} else if (datasourceType === 'data') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);

View File

@ -5,17 +5,39 @@
{{ alertMessage }}
</div>
<div class="uk-alert uk-alert-info">
Please make sure your {{mode === 'cris' ? 'Research Information System': 'repository'}} is registered in
<a target="_blank" href="{{ sourceUrl }}">
<i class="fas fa-external-link-alt" style="margin-right:3px;"></i>{{ sourceTitle }}
</a>
<a *ngIf="mode === 'cris'" target="_blank" href="https://eurocris.org/dris/dris-form">
<br><i class="fas fa-external-link-alt" style="margin-right:3px;"></i>euroCRIS DRIS
</a>
. <br>
<span *ngIf="latestUpdate && (latestUpdate !== 'null')">
<b>Last Updated: </b>{{ latestUpdate }}
</span>
<ng-container *ngIf="mode === 'repository'">
Please make sure your repository is registered in <a href="https://v2.sherpa.ac.uk/opendoar/" target="_blank">OpenDOAR</a>,
<a href="http://www.re3data.org/" target="_blank">Re3data</a> or <a href="https://fairsharing.org/search?fairsharingRegistry=Database" target="_blank">FAIRsharing</a>.
<span *ngIf="opendoarlatestUpdate && (opendoarlatestUpdate !== 'null')">
<br><b>Last Updated (OpenDOAR): </b>{{ opendoarlatestUpdate }}
</span>
<span *ngIf="re3datalatestUpdate && (re3datalatestUpdate !== 'null')">
<br><b>Last Updated (Re3data): </b>{{ re3datalatestUpdate }}
</span>
<span *ngIf="fairsharinglatestUpdate && (fairsharinglatestUpdate !== 'null')">
<br><b>Last Updated (FAIRsharing): </b>{{ fairsharinglatestUpdate }}
</span>
</ng-container>
<ng-container *ngIf="mode === 'cris'">
Please make sure your Research Information System is registered in <a href="https://eurocris.org" target="_blank">euroCRIS</a>.
<a href="https://eurocris.org/dris/dris-form" target="_blank"><br><i class="fas fa-external-link-alt" style="margin-right:3px;"></i>euroCRIS DRIS</a>
<span *ngIf="latestUpdate && (latestUpdate !== 'null')">
<br><b>Last Updated: </b>{{ latestUpdate }}
</span>
</ng-container>
<!-- <span *ngIf="latestUpdate && (latestUpdate !== 'null')">-->
<!-- <ng-container *ngIf="mode==='repository'">-->
<!-- <b>Last Updated (OpenDOAR): </b>{{ latestUpdate }}-->
<!-- <b>Last Updated (Re3data): </b>{{ latestUpdate }}-->
<!-- <b>Last Updated (FAIRsharing): </b>{{ latestUpdate }}-->
<!-- </ng-container>-->
<!-- <ng-container *ngIf="mode==='cris'">-->
<!-- -->
<!-- </ng-container>-->
<!-- </span>-->
</div>
<div class="uk-margin-medium-top">
<div class="md-input-wrapper md-input-filled">

View File

@ -28,6 +28,9 @@ export class RegisterDatasourceSelectExistingComponent implements OnInit {
sourceUrl: string;
sourceTitle: string;
latestUpdate: string;
opendoarlatestUpdate: string;
re3datalatestUpdate: string;
fairsharinglatestUpdate: string;
@Input() mode: string;
@ -44,7 +47,7 @@ export class RegisterDatasourceSelectExistingComponent implements OnInit {
this.hasSelectedCountry = false;
}
setUpSourceInfo() {
setUpSourceInfo() { // deprecated?
if (this.mode === 'opendoar') {
this.sourceUrl = 'http://v2.sherpa.ac.uk/opendoar/';
this.sourceTitle = 'OpenDOAR';
@ -126,8 +129,15 @@ export class RegisterDatasourceSelectExistingComponent implements OnInit {
}
getLatestUpdate() {
return this.repoService.getListLatestUpdate(this.mode).subscribe (
responseDate => this.latestUpdate = responseDate['lastCollectionDate'],
return this.repoService.getListLatestUpdate(this.mode).subscribe(
responseDate => {
if (this.mode === 'cris') { this.latestUpdate = responseDate['lastCollectionDate']; }
if (this.mode === 'repository') {
this.opendoarlatestUpdate = responseDate['opendoar'];
this.re3datalatestUpdate = responseDate['re3data'];
this.fairsharinglatestUpdate = responseDate['fairsharing'];
}
},
error => console.log(error)
);
}

View File

@ -164,12 +164,9 @@ export class RegisterExistingDatasourceComponent implements OnInit {
}
addInterfaceToList(intrf?: RepositoryInterface) {
console.log('clicked add interface to list');
const curIndex = this.dataForInterfaceComp.length;
const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy };
const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby };
if (intrf) {
this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]);
} else {
@ -185,7 +182,7 @@ export class RegisterExistingDatasourceComponent implements OnInit {
}
tempArray.splice(i, 1);
this.dataForInterfaceComp = tempArray;
console.log(JSON.stringify(this.dataForInterfaceComp));
// console.log(JSON.stringify(this.dataForInterfaceComp));
}
getInterfaces() {
@ -224,9 +221,9 @@ export class RegisterExistingDatasourceComponent implements OnInit {
this.dataForInterfaceComp.push([
true, i,
{ id: this.repo.id,
datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass,
registeredBy: this.repo.registeredBy
datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredby
},
this.repoInterfaces[i]
]);
@ -235,9 +232,9 @@ export class RegisterExistingDatasourceComponent implements OnInit {
this.dataForInterfaceComp.push([
true, 0,
{ id: this.repo.id,
datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass,
registeredBy: this.repo.registeredBy
datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredby
}
]);
}
@ -299,7 +296,7 @@ export class RegisterExistingDatasourceComponent implements OnInit {
return 0;
}
});
console.log(`the number of interfaces is ${this.repoInterfaces.length}`);
// console.log(`the number of interfaces is ${this.repoInterfaces.length}`);
},
error => {
console.log(error);
@ -316,7 +313,7 @@ export class RegisterExistingDatasourceComponent implements OnInit {
);
}
//recheck if needed
// recheck if needed
getTerms(repo: Repository) {
this.repo = repo;
}
@ -331,9 +328,9 @@ export class RegisterExistingDatasourceComponent implements OnInit {
this.loadingMessage = 'Saving changes';
this.errorMessage = '';
console.log('reg this.repo', this.repo);
this.repoService.addRepository( this.repo.datasourceType, this.repo).subscribe(
this.repoService.addRepository( this.repo.eoscDatasourceType, this.repo).subscribe( //this.repo.collectedfrom
response => {
console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
this.repo = response;
},
error => {
@ -356,15 +353,15 @@ export class RegisterExistingDatasourceComponent implements OnInit {
if (intrf.id) {
let req;
if (this.interfacesToDelete.some(id => id === intrf.id)) {
req = this.repoService.deleteInterface(intrf.id, this.repo.registeredBy);
req = this.repoService.deleteInterface(intrf.id, this.repo.registeredby);
} else {
// console.log('comments', intrf.comments);
req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
req = this.repoService.updateInterface(this.repo.id, this.repo.registeredby, intrf.comments, intrf);
}
return req;
} else {
// console.log('comments', intrf.comments);
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
return this.repoService.addInterface(this.repo.eoscDatasourceType, this.repo.id, this.repo.registeredby, intrf.comments, intrf);
}
})
).subscribe(

View File

@ -137,8 +137,8 @@ export class RegisterNewDatasourceComponent implements OnInit {
addInterfaceToList(intrf?: RepositoryInterface) {
const curIndex = this.dataForInterfaceComp.length;
const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy };
const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby };
if (intrf) {
this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]);
} else {
@ -180,9 +180,9 @@ export class RegisterNewDatasourceComponent implements OnInit {
this.dataForInterfaceComp.push([
true, i,
{ id: this.repo.id,
datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass,
registeredBy: this.repo.registeredBy
datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredby
},
this.repoInterfaces[i]
]);
@ -191,9 +191,9 @@ export class RegisterNewDatasourceComponent implements OnInit {
this.dataForInterfaceComp.push([
true, 0,
{ id: this.repo.id,
datasourceType: this.repo.datasourceType,
datasourceClass: this.repo.datasourceClass,
registeredBy: this.repo.registeredBy
datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredby
}
]);
}
@ -223,9 +223,9 @@ export class RegisterNewDatasourceComponent implements OnInit {
this.loadingMessage = 'Saving changes';
this.errorMessage = '';
console.log('add this.repo', this.repo);
this.repoService.addRepository(this.repo.datasourceType, this.repo).subscribe(
this.repoService.addRepository(this.repo.eoscDatasourceType, this.repo).subscribe(
response => {
console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
this.repo = response;
},
error => {
@ -246,10 +246,10 @@ export class RegisterNewDatasourceComponent implements OnInit {
concatMap(intrf => {
if (intrf.id) {
// console.log('comments', intrf.comments);
return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
return this.repoService.updateInterface(this.repo.id, this.repo.registeredby, intrf.comments, intrf);
} else {
// console.log('comments', intrf.comments);
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
return this.repoService.addInterface(this.repo.eoscDatasourceType, this.repo.id, this.repo.registeredby, intrf.comments, intrf);
}
})
).subscribe(

View File

@ -1,21 +0,0 @@
/*
* created by myrto on 12/12/2017
*/
import { Component, OnInit } from '@angular/core';
import { RegisterExistingDatasourceComponent } from './register-existing-datasource.component';
@Component ({
selector: 'app-sr-data',
templateUrl: './register-existing-datasource.component.html'
})
export class SrDataComponent extends RegisterExistingDatasourceComponent implements OnInit {
ngOnInit() {
this.datasourceType = 'data';
this.currentMode = 're3data';
super.ngOnInit();
}
}

View File

@ -1,19 +1,19 @@
/*
* updated by myrto on 19/12/2018
* created by andreas on 4/7/2022
*/
import { Component, OnInit } from '@angular/core';
import { RegisterExistingDatasourceComponent } from './register-existing-datasource.component';
@Component ({
selector: 'app-sr-literature',
selector: 'app-sr-repository',
templateUrl: './register-existing-datasource.component.html'
})
export class SrLiteratureComponent extends RegisterExistingDatasourceComponent implements OnInit {
export class SrRepositoryComponent extends RegisterExistingDatasourceComponent implements OnInit {
ngOnInit() {
this.datasourceType = 'literature';
this.currentMode = 'opendoar';
this.datasourceType = 'repository';
this.currentMode = 'repository';
super.ngOnInit();
}

View File

@ -4,11 +4,9 @@ import { SourcesComponent } from './sources.component';
import { SourcesRegisterComponent } from './sources-register.component';
import { CommonModule } from '@angular/common';
import { TabsModule } from 'ngx-bootstrap';
import { SrLiteratureComponent } from './sources-register/sr-literature.component';
import { ReusableComponentsModule } from '../../shared/reusablecomponents/reusable-components.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RepoFilter } from './sourcesPipes';
import { SrDataComponent } from './sources-register/sr-data.component';
import { RegisterDatasourceSelectExistingComponent } from './sources-register/register-datasource-select-existing.component';
import { SrJournalComponent } from './sources-register/sr-journal.component';
import { SrAggregatorComponent } from './sources-register/sr-aggregator.component';
@ -16,6 +14,7 @@ import { RegisterNewDatasourceComponent } from './sources-register/register-new-
import { RegisterExistingDatasourceComponent } from './sources-register/register-existing-datasource.component';
import { DatasourceUpdateTermsFormComponent } from '../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component';
import {SrCrisComponent} from './sources-register/sr-cris.component';
import {SrRepositoryComponent} from './sources-register/sr-repository.component';
@NgModule ({
imports: [
@ -34,8 +33,7 @@ import {SrCrisComponent} from './sources-register/sr-cris.component';
SourcesRegisterComponent,
RegisterNewDatasourceComponent,
RegisterExistingDatasourceComponent,
SrLiteratureComponent,
SrDataComponent,
SrRepositoryComponent,
SrJournalComponent,
SrAggregatorComponent,
SrCrisComponent,

View File

@ -1,11 +1,10 @@
import { RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { SourcesRegisterComponent } from './sources-register.component';
import { SrLiteratureComponent } from './sources-register/sr-literature.component';
import { SrDataComponent } from './sources-register/sr-data.component';
import { SrJournalComponent } from './sources-register/sr-journal.component';
import { SrAggregatorComponent } from './sources-register/sr-aggregator.component';
import {SrCrisComponent} from './sources-register/sr-cris.component';
import {SrRepositoryComponent} from './sources-register/sr-repository.component';
const sourcesRoutes: Routes = [
{
@ -20,12 +19,8 @@ const sourcesRoutes: Routes = [
component: SourcesRegisterComponent
},
{
path: 'literature',
component: SrLiteratureComponent
},
{
path: 'data',
component: SrDataComponent
path: 'repository',
component: SrRepositoryComponent
},
{
path: 'journal',

View File

@ -47,6 +47,7 @@ export class RepositoryService {
updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> {
let url;
console.log(comment);
if (comment == null || comment === '') {
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}`;
} else {
@ -161,7 +162,7 @@ export class RepositoryService {
return this.httpClient.get<Map<string, string>>(url, headerOptions);
}
getDatasourceClasses(mode: string): Observable<Map<string, string>> {
getDatasourceClasses(mode: string): Observable<Object> {
const url = `${this.apiUrl}getDatasourceClasses/${mode}`;
console.log(`knocking on: ${url}`);
return this.httpClient.get<Map<string, string>>(url, headerOptions);

View File

@ -57,7 +57,7 @@
<form-inline [description]="issnDesc" [valid]="group.get('issn').valid">
<span *ngIf="group.get('issn').invalid && group.get('issn').touched && group.get('issn').dirty"
class="help-block inline uk-text-danger"
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X"</span>
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
<input formControlName="issn" class="md-input" type="text"
(focus)="group.get('issn').markAsUntouched()" (blur)="group.get('issn').updateValueAndValidity()">
</form-inline>
@ -71,7 +71,7 @@
<form-inline [description]="eissnDesc" [valid]="group.get('eissn').valid">
<span *ngIf="group.get('eissn').invalid && group.get('eissn').touched && group.get('eissn').dirty"
class="help-block inline uk-text-danger"
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X"</span>
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
<input formControlName="eissn" class="md-input" type="text"
(focus)="group.get('eissn').markAsUntouched()" (blur)="group.get('eissn').updateValueAndValidity()">
</form-inline>
@ -85,7 +85,7 @@
<form-inline [description]="lissnDesc" [valid]="group.get('lissn').valid">
<span *ngIf="group.get('lissn').invalid && group.get('lissn').touched && group.get('lissn').dirty"
class="help-block inline uk-text-danger"
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X"</span>
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
<input formControlName="lissn" class="md-input" type="text"
(focus)="group.get('lissn').markAsUntouched()" (blur)="group.get('lissn').updateValueAndValidity()">
</form-inline>
@ -111,7 +111,7 @@
<form-inline [description]="countryDesc" [valid]="group.get('country')">
<select formControlName="country" class="md-input">
<option value="">-- none selected --</option>
<option *ngFor="let country of countries" value="{{country.code}}" title="{{country.name}}">{{ country.name }}</option>
<option *ngFor="let country of countries" value="{{country.code}}">{{ country.name }}</option>
</select>
</form-inline>
</div>
@ -277,7 +277,7 @@
<form-inline [description]="datasourceTypeDesc" [valid]="group.get('datasourceType').valid">
<select formControlName="datasourceType" class="md-input">
<option value="">-- none selected --</option>
<option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses[key] }}</option>
<option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses.get(key) }}</option>
</select>
</form-inline>
</div>

View File

@ -41,6 +41,7 @@ export class DatasourceCreateFormComponent implements OnInit {
countries: Country[] = [];
datasourceClasses: Map<string, string> = new Map<string, string>();
classCodes: string[] = [];
// classCodes: string[] = [];
@Input() mode: string;
@ -57,9 +58,9 @@ export class DatasourceCreateFormComponent implements OnInit {
softwarePlatform : ['', Validators.required],
platformName : '',
officialName : ['', Validators.required],
issn : ['', [Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')] ],
eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
issn : ['', [Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')] ],
eissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
lissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
repoDescription : ['', Validators.required],
country : ['', Validators.required],
longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ],
@ -110,7 +111,7 @@ export class DatasourceCreateFormComponent implements OnInit {
this.group = this.fb.group(this.groupDefinition);
if (this.mode === 'journal') {
this.group.get('issn').clearValidators();
this.group.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]);
this.group.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]);
}
this.getTypologies();
this.getTimezones();
@ -124,29 +125,29 @@ export class DatasourceCreateFormComponent implements OnInit {
setupForm() {
if (this.selectedRepo) {
console.log(`my datasource type is: ${this.selectedRepo.datasourceType}`);
console.log(`my datasource type is: ${this?.selectedRepo?.eoscDatasourceType}`);
this.group.setValue({
softwarePlatform: this.selectedRepo.typology,
softwarePlatform: this.selectedRepo.platform,
platformName: '',
officialName: this.selectedRepo.officialName,
officialName: this.selectedRepo.officialname,
issn: '',
eissn: '',
lissn: '',
repoDescription: this.selectedRepo.description,
country: this.selectedRepo.countryCode,
country: this.selectedRepo.organizations[0].country, // countryCode
longtitude: this.selectedRepo.longitude,
latitude: this.selectedRepo.latitude,
websiteUrl: this.selectedRepo.websiteUrl,
institutionName: this.selectedRepo.organization,
englishName: this.selectedRepo.englishName,
logoUrl: this.selectedRepo.logoUrl,
websiteUrl: this.selectedRepo.websiteurl,
institutionName: this.selectedRepo.organizations[0].legalname,
englishName: this.selectedRepo.englishname,
logoUrl: this.selectedRepo.logourl,
timezone: this.selectedRepo.timezone,
datasourceType: this.selectedRepo.datasourceClass,
adminEmail: this.selectedRepo.contactEmail
datasourceType: this.selectedRepo.eoscDatasourceType, // TODO: still needed?
adminEmail: this.selectedRepo.contactemail
});
if (this.selectedRepo.datasourceType === 'journal') {
if (this.selectedRepo.eoscDatasourceType === 'Journal archive') {
let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4);
this.group.get('issn').setValue(ssnToShow);
@ -185,15 +186,17 @@ export class DatasourceCreateFormComponent implements OnInit {
getDatasourceClasses() {
this.repoService.getDatasourceClasses(this.mode).subscribe(
classes => this.datasourceClasses = classes,
classes => {
for (const [key, value] of Object.entries(classes)) {
this.datasourceClasses.set(key, value);
}
},
error => {
this.errorMessage = noServiceMessage;
console.log(error);
},
() => {
for (const key of Object.keys(this.datasourceClasses)) {
this.classCodes.push(key);
}
this.classCodes = Array.from(this.datasourceClasses.keys());
}
);
}
@ -227,25 +230,32 @@ export class DatasourceCreateFormComponent implements OnInit {
}
createNewRepository(): Repository {
const newRepo: Repository = new Repository();
newRepo.officialName = this.group.get('officialName').value.toString();
newRepo.englishName = this.group.get('englishName').value.toString();
newRepo.websiteUrl = this.group.get('websiteUrl').value;
newRepo.logoUrl = this.group.get('logoUrl').value;
newRepo.contactEmail = this.group.get('adminEmail').value;
newRepo.countryName = this.countries.filter(x => x.code === this.group.get('country').value)[0].name;
newRepo.countryCode = this.group.get('country').value;
newRepo.organization = this.group.get('institutionName').value.toString();
const newRepo = new Repository();
newRepo.officialname = this.group.get('officialName').value.toString();
newRepo.englishname = this.group.get('englishName').value.toString();
newRepo.websiteurl = this.group.get('websiteUrl').value;
newRepo.logourl = this.group.get('logoUrl').value;
newRepo.contactemail = this.group.get('adminEmail').value;
newRepo.organizations.push({
legalshortname: null,
legalname: this.group.get('institutionName').value.toString(),
websiteurl: null,
logourl: null,
country: this.group.get('country').value
});
newRepo.latitude = this.group.get('latitude').value;
newRepo.longitude = this.group.get('longtitude').value;
newRepo.timezone = this.group.get('timezone').value;
newRepo.datasourceClass = this.group.get('datasourceType').value;
if (this.group.get('softwarePlatform').value ) {
newRepo.typology = this.group.get('softwarePlatform').value;
if (this.group.get('softwarePlatform').value !== '') {
console.log('1//', this.group.get('softwarePlatform').value);
newRepo.platform = this.group.get('softwarePlatform').value;
} else if (this.group.get('platformName').value) {
newRepo.typology = this.group.get('platformName').value;
newRepo.platform = this.group.get('platformName').value;
console.log('2//', this.group.get('platformName').value);
}
// newRepo.typology = this.group.get('softwarePlatform').value;
newRepo.typology = this.group.get('datasourceType').value;
// newRepo.eoscDatasourceType = this.datasourceClasses.get(this.group.get('datasourceType').value);
// console.warn(newRepo.eoscDatasourceType);
newRepo.description = this.group.get('repoDescription').value.toString();
newRepo.issn = '';
newRepo.eissn = '';
@ -267,14 +277,17 @@ export class DatasourceCreateFormComponent implements OnInit {
}
}
newRepo.registeredBy = this.authService.getUserEmail();
newRepo.registeredby = this.authService.getUserEmail();
/* THE BELOW FIELDS ARE NOT SET IN GWT CODE*/
newRepo.datasourceType = this.mode;
newRepo.dateOfCreation = new Date(Date.now()); // NOT NEEDED ??
newRepo.registered = true;
newRepo.registrationDate = new Date(Date.now()); // NOT NEEDED ??
newRepo.eoscDatasourceType = this.mode; // TODO: delete this?
console.warn(newRepo.eoscDatasourceType);
newRepo.managed = true;
const now = new Date(Date.now());
newRepo.consentTermsOfUseDate = now;
newRepo.lastConsentTermsOfUseDate = now;
newRepo.registrationdate = now;
return newRepo;
}

View File

@ -29,22 +29,22 @@
<div *ngIf="errorMessage" class="uk-alert" [ngClass]="{'uk-alert-warning': errorMessage == invalidCustomBaseUrl,
'uk-alert-danger': errorMessage != invalidCustomBaseUrl}" style="clear: both">{{ errorMessage }}</div>
<div class="md-input-wrapper uk-margin-medium-top {{ (repoInterfaceForm.get('baseUrl') != null) ? 'md-input-filled' : '' }}">
<label class="" for="baseUrl" title="{{ baseUrlDesc.desc }}">Base OAI-PMH URL (*)</label>
<div class="md-input-wrapper uk-margin-medium-top {{ (repoInterfaceForm.get('baseurl') != null) ? 'md-input-filled' : '' }}">
<label class="" for="baseurl" title="{{ baseUrlDesc.desc }}">Base OAI-PMH URL (*)</label>
<span *ngIf="showIdentifiedBaseUrl" class="help-block inline" style="margin-top: 8px; margin-bottom: 0px; padding-left: 10px; display: block;">
Identified
</span>
<input id="baseUrl" type="text" class="md-input" formControlName="baseUrl" (blur)="getInterfaceInfo()">
<input id="baseurl" type="text" class="md-input" formControlName="baseurl" (blur)="getInterfaceInfo()">
<span class="md-input-bar"></span>
</div>
<!--<div class="form-group has-success">-->
<!--<label class="control-label" for="baseUrl" title="{{ baseUrlDesc.desc }}">Base OAI-PMH URL (*)</label>-->
<!--<label class="control-label" for="baseurl" title="{{ baseUrlDesc.desc }}">Base OAI-PMH URL (*)</label>-->
<!--<span *ngIf="identifiedBaseUrl" class="help-block inline" style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">-->
<!--Identified-->
<!--</span>-->
<!--<input id="baseUrl" type="text" class="form-control" formControlName="baseUrl" (blur)="getInterfaceInfo()">-->
<!--<input id="baseurl" type="text" class="form-control" formControlName="baseurl" (blur)="getInterfaceInfo()">-->
<!--</div>-->

View File

@ -1,7 +1,7 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { baseUrlDesc, compatibilityLevelDesc, customValSetDesc, Description, existingValSetDesc, commentDesc } from '../../../domain/oa-description';
import { InterfaceInformation, RepositoryInterface } from '../../../domain/typeScriptClasses';
import {ApiParamDetails, InterfaceInformation, RepositoryInterface} from '../../../domain/typeScriptClasses';
import { ValidatorService } from '../../../services/validator.service';
import { RepositoryService } from '../../../services/repository.service';
import { formErrorWasntSaved, formInfoLoading, formSubmitting, formSuccessAddedInterface, formSuccessUpdatedInterface, invalidCustomBaseUrl,
@ -37,7 +37,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
repoInterfaceForm: FormGroup;
readonly repoInterfaceFormDef = {
baseUrl: ['', Validators.required],
baseurl: ['', Validators.required],
selectValidationSet: [''],
customValidationSet: [''],
compatibilityLevel: [''],
@ -71,8 +71,8 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
this.chooseValSet(true);
if (this.data[3]) {
this.currentInterface = this.data[3];
this.repoInterfaceForm.get('baseUrl').setValue(this.currentInterface.baseUrl);
this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.desiredCompatibilityLevel);
this.repoInterfaceForm.get('baseurl').setValue(this.currentInterface.baseurl);
this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.compatibilityOverride);
}
this.getInterfaceInfo();
this.getCompatibilityClasses();
@ -84,10 +84,10 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
this.successMessage = '';
this.errorMessage = '';
const baseUrl = this.repoInterfaceForm.get('baseUrl').value;
if (baseUrl) {
const baseurl = this.repoInterfaceForm.get('baseurl').value;
if (baseurl) {
this.loadingMessage = formInfoLoading;
this.valService.getInterfaceInformation(baseUrl).subscribe(
this.valService.getInterfaceInformation(baseurl).subscribe(
info => {
this.interfaceInfo = info;
if (this.interfaceInfo.identified) {
@ -95,12 +95,12 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
this.showIdentifiedBaseUrl = true;
} else {
this.errorMessage = invalidCustomBaseUrl;
this.identifiedBaseUrl = true; // pass interface without baseUrl identification
this.identifiedBaseUrl = true; // pass interface without baseurl identification
this.showIdentifiedBaseUrl = false;
}
if (this.interfaceInfo.sets) {
this.valsetList = this.interfaceInfo.sets;
console.log(this.valsetList);
// console.log(this.valsetList);
}
},
error => {
@ -110,11 +110,11 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
this.errorMessage = noServiceMessage;
},
() => {
if ( this.currentInterface && this.currentInterface.accessParams && this.currentInterface.accessParams['set'] ) {
if ( this.valsetList.some( x => x === this.currentInterface.accessParams['set']) ) {
this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.accessParams['set']);
if ( this.currentInterface && this.currentInterface.apiParams && this.currentInterface.apiParams.find(entry => entry.param === 'set')) {
if ( this.valsetList.some( x => x === this.currentInterface.apiParams['set']) ) {
this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.apiParams.find(entry => entry.param === 'set').value);
} else {
this.repoInterfaceForm.get('customValidationSet').setValue(this.currentInterface.accessParams['set']);
this.repoInterfaceForm.get('customValidationSet').setValue(this.currentInterface.apiParams.find(entry => entry.param === 'set').value);
}
}
this.loadingMessage = '';
@ -148,12 +148,12 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
getExistingCompatibilityLevel() {
if (this.currentInterface) {
if (this.currentInterface.desiredCompatibilityLevel &&
this.classCodes.some( x => x === this.currentInterface.desiredCompatibilityLevel ) ) {
this.existingCompLevel = this.compClasses[this.currentInterface.desiredCompatibilityLevel];
if (this.currentInterface.compatibilityOverride &&
this.classCodes.some( x => x === this.currentInterface.compatibilityOverride ) ) {
this.existingCompLevel = this.compClasses[this.currentInterface.compatibilityOverride];
} else {
this.repoInterfaceForm.get('compatibilityLevel').setValue('');
this.existingCompLevel = this.currentInterface.desiredCompatibilityLevel;
this.existingCompLevel = this.currentInterface.compatibilityOverride;
}
}
}
@ -199,7 +199,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
this.errorMessage = '';
this.successMessage = '';
if (this.formIsValid()) {
const baseUrl = this.repoInterfaceForm.get('baseUrl').value;
const baseurl = this.repoInterfaceForm.get('baseurl').value;
let valset = '';
if (this.existingValSet) {
valset = this.repoInterfaceForm.get('selectValidationSet').value;
@ -220,9 +220,9 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
}
if (this.currentInterface) {
this.updateCurrent(baseUrl, valset, compLvl, comment);
this.updateCurrent(baseurl, valset, compLvl, comment);
} else {
this.addCurrent(baseUrl, valset, compLvl, comment);
this.addCurrent(baseurl, valset, compLvl, comment);
}
} else {
this.interfaceToExport = null;
@ -231,37 +231,43 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
}
getCurrentValues() {
console.log('getcurrentvalues');
let intrf = this.currentInterface;
if (intrf == null) {
intrf = new RepositoryInterface();
}
intrf.baseUrl = this.repoInterfaceForm.get('baseUrl').value;
if (this.existingValSet) {
intrf.accessSet = this.repoInterfaceForm.get('selectValidationSet').value;
intrf.accessParams = {'set': this.repoInterfaceForm.get('selectValidationSet').value};
} else {
intrf.accessSet = this.repoInterfaceForm.get('customValidationSet').value;
intrf.accessParams = {'set': this.repoInterfaceForm.get('customValidationSet').value};
}
intrf.baseurl = this.repoInterfaceForm.get('baseurl').value;
this.updateValidationSet(intrf, this.repoInterfaceForm.get(this.existingValSet ? 'selectValidationSet' : 'customValidationSet').value);
console.log(intrf);
if (this.repoInterfaceForm.get('compatibilityLevel').value) {
intrf.desiredCompatibilityLevel = this.repoInterfaceForm.get('compatibilityLevel').value;
intrf.compliance = this.repoInterfaceForm.get('compatibilityLevel').value;
intrf.compatibilityOverride = this.repoInterfaceForm.get('compatibilityLevel').value;
intrf.compatibility = this.repoInterfaceForm.get('compatibilityLevel').value;
} else {
intrf.desiredCompatibilityLevel = this.existingCompLevel;
intrf.compliance = this.existingCompLevel;
intrf.compatibilityOverride = this.existingCompLevel;
intrf.compatibility = this.existingCompLevel;
}
intrf.typology = this.currentRepo.datasourceClass;
return intrf;
}
addCurrent (baseUrl: string, valset: string, compLvl: string, comment: string) {
updateValidationSet(intrf: RepositoryInterface, value: string) {
let validationSet = intrf.apiParams.find(element => element.param === 'set');
if (!validationSet) {
validationSet = new ApiParamDetails('set', value);
intrf.apiParams.push(validationSet);
} else {
validationSet.value = this.repoInterfaceForm.get(this.existingValSet ? 'selectValidationSet' : 'customValidationSet').value;
}
}
addCurrent (baseurl: string, valset: string, compLvl: string, comment: string) {
console.log('add current');
const currentInterface = new RepositoryInterface();
currentInterface.baseUrl = baseUrl;
currentInterface.accessSet = valset;
currentInterface.accessParams = {'set': valset};
currentInterface.desiredCompatibilityLevel = compLvl;
currentInterface.compliance = compLvl;
this.updateValidationSet(currentInterface, valset);
currentInterface.baseurl = baseurl;
currentInterface.compatibilityOverride = compLvl;
currentInterface.compatibility = compLvl;
currentInterface.typology = this.currentRepo.datasourceClass;
currentInterface.comments = comment;
@ -304,13 +310,12 @@ export class DatasourceNewInterfaceFormComponent implements OnInit {
}
updateCurrent (baseUrl: string, valset: string, compLvl: string, comment: string) {
this.currentInterface.baseUrl = baseUrl;
this.currentInterface.accessSet = valset;
this.currentInterface.accessParams['set'] = valset;
this.currentInterface.desiredCompatibilityLevel = compLvl;
this.currentInterface.compliance = compLvl;
updateCurrent (baseurl: string, valset: string, compLvl: string, comment: string) {
console.log('update current');
this.updateValidationSet(this.currentInterface, valset);
this.currentInterface.baseurl = baseurl;
this.currentInterface.compatibilityOverride = compLvl;
this.currentInterface.compatibility = compLvl;
this.currentInterface.typology = this.currentRepo.datasourceClass;
this.currentInterface.comments = comment;

View File

@ -12,15 +12,20 @@
Basic information
</h4>
</div>
<div *ngIf="selectedRepo.datasourceType === 'opendoar'" class="uk-alert uk-alert-info">
<div *ngIf="selectedRepo.collectedfrom.split('openaire____::')[1] === 'opendoar'" class="uk-alert uk-alert-info">
The following fields are completed by OpenDOAR.<br>
If you want to edit them, you can do it by using this
<a target="_blank" href="{{ 'http://v2.sherpa.ac.uk/id/repository/' + repoId }}">OpenDOAR link</a>
<a target="_blank" href="{{ 'http://v2.sherpa.ac.uk/id/repository/' + repoId }}">OpenDOAR link</a>.
</div>
<div *ngIf="selectedRepo.datasourceType === 're3data'" class="uk-alert uk-alert-info">
<div *ngIf="selectedRepo.collectedfrom.split('openaire____::')[1] === 're3data'" class="uk-alert uk-alert-info">
The following fields are completed by Re3data.<br>
If you want to edit them, you can do it by using this
<a target="_blank" href="{{ 'http://service.re3data.org/repository/' + repoId }}">Re3data link</a>
<a target="_blank" href="{{ 'http://service.re3data.org/repository/' + repoId }}">Re3data link</a>.
</div>
<div *ngIf="selectedRepo.collectedfrom.split('openaire____::')[1] === 'fairsharing'" class="uk-alert uk-alert-info">
The following fields are completed by FAIRsharing.<br>
If you want to edit them, you can do it by using this
<a target="_blank" href="{{ 'https://fairsharing.org/search?q=' + selectedRepo.officialname }}">FAIRsharing link</a>.
</div>
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0">
@ -59,14 +64,14 @@
</div>
</div>
<div *ngIf="selectedRepo.datasourceType == 'journal'">
<div *ngIf="selectedRepo.eoscDatasourceType == 'Journal archive'">
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0">
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first">
<div class="md-input-wrapper {{ (updateGroup.get('issn') != null) ? 'md-input-filled' : '' }}">
<div class="md-input-wrapper {{ (updateGroup.get('issn') != null) ? 'md-input-filled' : '1234-5678' }}">
<form-inline [description]="issnDesc" [valid]="updateGroup.get('issn').valid">
<span *ngIf="updateGroup.get('issn').invalid && updateGroup.get('issn').touched && updateGroup.get('issn').dirty"
class="help-block inline uk-text-danger"
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X"</span>
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
<input formControlName="issn" class="md-input" type="text"
(focus)="updateGroup.get('issn').markAsUntouched()" (blur)="updateGroup.get('issn').updateValueAndValidity()">
</form-inline>
@ -80,7 +85,7 @@
<form-inline [description]="eissnDesc" [valid]="updateGroup.get('eissn').valid">
<span *ngIf="updateGroup.get('eissn').invalid && updateGroup.get('eissn').touched && updateGroup.get('eissn').dirty"
class="help-block inline uk-text-danger"
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X"</span>
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
<input formControlName="eissn" class="md-input" type="text"
(focus)="updateGroup.get('eissn').markAsUntouched()" (blur)="updateGroup.get('eissn').updateValueAndValidity()">
</form-inline>
@ -94,7 +99,7 @@
<form-inline [description]="lissnDesc" [valid]="updateGroup.get('lissn').valid">
<span *ngIf="updateGroup.get('lissn').invalid && updateGroup.get('lissn').touched && updateGroup.get('lissn').dirty"
class="help-block inline uk-text-danger"
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X"</span>
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
<input formControlName="lissn" class="md-input" type="text"
(focus)="updateGroup.get('lissn').markAsUntouched()" (blur)="updateGroup.get('lissn').updateValueAndValidity()">
</form-inline>
@ -120,7 +125,7 @@
<form-inline [description]="countryDesc" [valid]="updateGroup.get('country')">
<select formControlName="country" class="md-input">
<option value="">-- none selected --</option>
<option *ngFor="let country of countries" value="{{country.code}}" title="{{country.name}}">{{ country.name }}</option>
<option *ngFor="let country of countries" value="{{country.code}}">{{ country.name }}</option>
</select>
</form-inline>
</div>
@ -217,7 +222,7 @@
<form-inline [description]="datasourceTypeDesc" [valid]="updateGroup.get('datasourceType').valid">
<select formControlName="datasourceType" class="md-input">
<option value="">-- none selected --</option>
<option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses[key] }}</option>
<option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses.get(key) }}</option>
</select>
</form-inline>
</div>
@ -244,4 +249,4 @@
<button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button>
</div>
</form>
<pre>{{updateGroup.value|json}}</pre>

View File

@ -43,9 +43,9 @@ export class DatasourceUpdateFormComponent implements OnInit {
softwarePlatform : '',
platformName : '',
officialName : ['', Validators.required],
issn : ['', [Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')] ],
eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
issn : ['', [Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')] ],
eissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
lissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
repoDescription : ['', Validators.required],
country : '',
longtitude : '',
@ -101,30 +101,37 @@ export class DatasourceUpdateFormComponent implements OnInit {
setupUpdateForm() {
if (this.selectedRepo) {
console.log(this.mode);
this.updateGroup.setValue({
softwarePlatform: this.selectedRepo.typology,
softwarePlatform: this.selectedRepo.platform,
platformName: '',
officialName: this.selectedRepo.officialName,
officialName: this.selectedRepo.officialname,
issn: '',
eissn: '',
lissn: '',
repoDescription: this.selectedRepo.description,
country: this.selectedRepo.countryCode,
country: this.selectedRepo.organizations[0].country, // countryCode
longtitude: this.selectedRepo.longitude,
latitude: this.selectedRepo.latitude,
websiteUrl: this.selectedRepo.websiteUrl,
institutionName: this.selectedRepo.organization,
englishName: this.selectedRepo.englishName,
logoUrl: this.selectedRepo.logoUrl,
websiteUrl: this.selectedRepo.websiteurl,
institutionName: this.selectedRepo.organizations[0].legalname,
englishName: this.selectedRepo.englishname,
logoUrl: this.selectedRepo.logourl,
timezone: this.selectedRepo.timezone,
datasourceType: this.selectedRepo.datasourceClass,
adminEmail: this.selectedRepo.contactEmail
datasourceType: this.selectedRepo.typology, // TODO: rename to typology?
adminEmail: this.selectedRepo.contactemail
});
if ( this.selectedRepo.typology === '' || !this.typologies.some(x => x.value === this.selectedRepo.typology) ) {
if ( this.selectedRepo.platform === '' || !this.typologies.some(x => x.value === this.selectedRepo.platform) ) {
this.updateGroup.get('softwarePlatform').setValue('');
this.updateGroup.get('platformName').setValue(this.selectedRepo.typology);
this.updateGroup.get('platformName').setValue(this.selectedRepo.platform);
}
if (this.selectedRepo.eoscDatasourceType === 'Journal archive') {
console.log('inside journal');
this.updateGroup.get('issn').setValue(this.selectedRepo.issn);
this.updateGroup.get('eissn').setValue(this.selectedRepo.eissn);
this.updateGroup.get('lissn').setValue(this.selectedRepo.lissn);
}
// FIXME: Use eoscDatasourceType when we support the new model
@ -141,7 +148,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
} else {
this.longtitudeDesc.mandatory = true;
this.latitudeDesc.mandatory = true;
this.datasourceTypeDesc.label = 'Repository Type';
this.datasourceTypeDesc.label = 'Data source type';
}
// FIXME: Use eoscDatasourceType when we support the new model
@ -150,7 +157,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4);
this.updateGroup.get('issn').setValue(ssnToShow);
this.updateGroup.get('issn').clearValidators();
this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]);
this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]);
if (this.selectedRepo.eissn.trim().length) {
ssnToShow = this.selectedRepo.eissn.slice(0, 4) + '-' + this.selectedRepo.eissn.toString().slice(4);
@ -172,25 +179,32 @@ export class DatasourceUpdateFormComponent implements OnInit {
getDatasourceClasses() {
// FIXME: Use eoscDatasourceType when we support the new model
this.repoService.getDatasourceClasses(this.mode).subscribe(
classes => this.datasourceClasses = classes,
console.log('mode b4 getdatasourceclasses ', this.mode);
let param = this.selectedRepo.collectedfrom.split('::')[1];
if (this.selectedRepo.eoscDatasourceType === 'Journal archive') { param = 'journal'; }
if (this.selectedRepo.eoscDatasourceType === 'Aggregator') { param = 'aggregator'; }
this.repoService.getDatasourceClasses(param).subscribe(
classes => {
for (const [key, value] of Object.entries(classes)) {
this.datasourceClasses.set(key, value);
}},
error => {
this.loadingMessage = '';
this.errorMessage = noServiceMessage;
console.log(error);
},
() => {
for (const key of Object.keys(this.datasourceClasses)) {
this.classCodes.push(key);
}
console.log('gotDatasourceClasses');
this.classCodes = Array.from(this.datasourceClasses.keys());
this.getCountries();
}
);
}
getCountries() {
this.repoService.getCountries()
.subscribe(
this.repoService.getCountries().subscribe(
countries => this.countries = countries.sort( function(a, b) {
if (a.name < b.name) {
return -1;
@ -205,6 +219,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
this.errorMessage = noServiceMessage;
console.log(error);
}, () => {
console.log('gotCountries');
this.getTypologies();
});
}
@ -217,6 +232,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
console.log(error);
},
() => {
console.log('gotTypologies');
this.getTimezones();
}
);
@ -230,6 +246,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
console.log(error);
},
() => {
console.log('gotTimezones');
this.loadingMessage = '';
this.setupUpdateForm();
}
@ -243,7 +260,7 @@ export class DatasourceUpdateFormComponent implements OnInit {
window.scroll(1, 1);
if (this.updateGroup.valid) {
if ( this.selectedRepo.datasourceType !== 'journal' || this.updateGroup.get('issn').value ) {
if ( this.selectedRepo.eoscDatasourceType !== 'journal' || this.updateGroup.get('issn').value ) {
this.refreshSelectedRepo();
/*
@ -288,24 +305,28 @@ export class DatasourceUpdateFormComponent implements OnInit {
refreshSelectedRepo() {
if (this.updateGroup.get('softwarePlatform').value ) {
this.selectedRepo.typology = this.updateGroup.get('softwarePlatform').value;
this.selectedRepo.platform = this.updateGroup.get('softwarePlatform').value;
} else if (this.updateGroup.get('platformName').value) {
this.selectedRepo.typology = this.updateGroup.get('platformName').value;
this.selectedRepo.platform = this.updateGroup.get('platformName').value;
}
this.selectedRepo.officialName = this.updateGroup.get('officialName').value.toString();
this.selectedRepo.typology = this.updateGroup.get('datasourceType').value;
console.log('typology ', this.selectedRepo.typology);
console.log(this.datasourceClasses);
console.log(this.updateGroup.get('datasourceType').value);
// this.selectedRepo.eoscDatasourceType = this.datasourceClasses.get(this.updateGroup.get('datasourceType').value);
// console.warn(this.selectedRepo.eoscDatasourceType);
this.selectedRepo.officialname = this.updateGroup.get('officialName').value.toString();
this.selectedRepo.description = this.updateGroup.get('repoDescription').value.toString();
this.selectedRepo.countryCode = this.updateGroup.get('country').value;
this.selectedRepo.countryName = this.countries.filter(x => x.code === this.updateGroup.get('country').value)[0].name;
this.selectedRepo.organizations[0].country = this.updateGroup.get('country').value; // countryCode
this.selectedRepo.longitude = this.updateGroup.get('longtitude').value;
this.selectedRepo.latitude = this.updateGroup.get('latitude').value;
this.selectedRepo.websiteUrl = this.updateGroup.get('websiteUrl').value;
this.selectedRepo.organization = this.updateGroup.get('institutionName').value.toString();
this.selectedRepo.englishName = this.updateGroup.get('englishName').value.toString();
this.selectedRepo.logoUrl = this.updateGroup.get('logoUrl').value;
this.selectedRepo.websiteurl = this.updateGroup.get('websiteUrl').value;
this.selectedRepo.organizations[0].legalname = this.updateGroup.get('institutionName').value.toString();
this.selectedRepo.englishname = this.updateGroup.get('englishName').value.toString();
this.selectedRepo.logourl = this.updateGroup.get('logoUrl').value;
this.selectedRepo.timezone = this.updateGroup.get('timezone').value;
this.selectedRepo.datasourceClass = this.updateGroup.get('datasourceType').value;
this.selectedRepo.contactEmail = this.updateGroup.get('adminEmail').value;
if (this.selectedRepo.datasourceType === 'journal') {
this.selectedRepo.contactemail = this.updateGroup.get('adminEmail').value;
if (this.selectedRepo.eoscDatasourceType === 'journal') {
let ssnParts = this.updateGroup.get('issn').value.split('-');
let correctSSN = ssnParts[0] + ssnParts[1];
this.selectedRepo.issn = correctSSN;
@ -320,10 +341,13 @@ export class DatasourceUpdateFormComponent implements OnInit {
this.selectedRepo.lissn = correctSSN;
}
}
if (!this.showButton) {
this.selectedRepo.registeredBy = this.authService.getUserEmail();
this.selectedRepo.registered = true;
this.selectedRepo.registrationDate = new Date(Date.now()); // NOT NEEDED ??
if (!this.showButton) { // on register
this.selectedRepo.registeredby = this.authService.getUserEmail();
this.selectedRepo.managed = true;
const now = new Date(Date.now());
this.selectedRepo.consentTermsOfUseDate = now;
this.selectedRepo.lastConsentTermsOfUseDate = now;
this.selectedRepo.registrationdate = now;
this.emittedInfo.emit(this.selectedRepo);
}
}

View File

@ -29,9 +29,10 @@
Agree to the <a href="https://www.openaire.eu/terms-of-use-for-content-providers#consent" target="_blank">re-use of full texts</a>
</label>
</form-inline>
<!-- FIXME: replace consentTermsOfUseDate with registrationDate -->
<div class="uk-margin-top" *ngIf="selectedRepo.consentTermsOfUseDate">Data source registration date: {{selectedRepo.consentTermsOfUseDate | date}}</div>
<div class="uk-margin-small-top">Last date of acceptance of the Terms of Use: {{selectedRepo.lastConsentTermsOfUseDate ? (selectedRepo.lastConsentTermsOfUseDate | date) : '-'}}</div>
<ng-container *ngIf="showButton">
<div class="uk-margin-top" *ngIf="selectedRepo.registrationdate">Data source registration date: {{selectedRepo.registrationdate | date}}</div>
<div class="uk-margin-small-top">Last date of acceptance of the Terms of Use: {{selectedRepo.lastConsentTermsOfUseDate ? (selectedRepo.lastConsentTermsOfUseDate | date) : '-'}}</div>
</ng-container>
<p class="uk-text-meta">Note: OpenAIRE will not provide the full text files for public distribution, the users will access from the original datasource.</p>
<div *ngIf="showButton" class="form-group">
<button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button>

View File

@ -113,8 +113,8 @@
</a>
<ul [ngClass]="{'uk-display-block': visibleAdminRepo}">
<li class="act_item">
<a *ngIf="adminRepository?.officialName && adminRepository.officialName.length>30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialName.substr(0,30)}}...</a>
<a *ngIf="adminRepository?.officialName && adminRepository.officialName.length<=30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialName}}</a>
<a *ngIf="adminRepository?.officialname && adminRepository.officialname.length>30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialname.substr(0,30)}}...</a>
<a *ngIf="adminRepository?.officialname && adminRepository.officialname.length<=30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialname}}</a>
</li>
</ul>
</li>