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); // console.log(this.reposOfUser);
this.reposOfUser.forEach(repo => { 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.addTerm(repo.officialname, repo.id, repo.consentTermsOfUse);
this.isModalShown = true; this.isModalShown = true;
} }

View File

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

View File

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

View File

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

View File

@ -373,7 +373,7 @@
<div *ngIf="!brokerSummary || !brokerSummary.userSubs">No notifications were found</div> <div *ngIf="!brokerSummary || !brokerSummary.userSubs">No notifications were found</div>
<div *ngIf="brokerSummary && brokerSummary.userSubs"> <div *ngIf="brokerSummary && brokerSummary.userSubs">
<ul class="md-list md-list-addon gmap_list"> <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"> <div class="md-list-addon-element">
<span>{{ sub.count | number }}</span> <span>{{ sub.count | number }}</span>
<!--<img class="md-user-image md-list-addon-avatar" src="assets/img/avatars/avatar_01_tn.png" alt="">--> <!--<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() { getCorrectName() {
const temp = this.repository.officialName.split('|'); const temp = this.repository.officialname.split('|');
let correctName = temp[0]; let correctName = temp[0];
let repoName = temp[0]; let repoName = temp[0];
for (let i = 1; i < temp.length; i++) { for (let i = 1; i < temp.length; i++) {

View File

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

View File

@ -1,6 +1,6 @@
<div id="page_content_inner"> <div id="page_content_inner">
<!--<h2 class="heading_b uk-margin-bottom">Metrics for repository....</h2>--> <!--<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 --> <!-- TOP HELP CONTENT -->
<help-content #topHelperContent [position]="'top'" <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 { ConfirmationDialogComponent } from '../../../shared/reusablecomponents/confirmation-dialog.component';
import { PiwikService } from '../../../services/piwik.service'; import { PiwikService } from '../../../services/piwik.service';
import { RepositoryService } from '../../../services/repository.service'; import { RepositoryService } from '../../../services/repository.service';
import { PiwikInfo, Repository } from '../../../domain/typeScriptClasses'; import {Country, PiwikInfo, Repository} from '../../../domain/typeScriptClasses';
import { enabledMetricsError, enabledMetricsSuccess, enablingMetrics, import {
loadingRepoError, loadingRepoMessage } from '../../../domain/shared-messages'; enabledMetricsError, enabledMetricsSuccess, enablingMetrics,
loadingRepoError, loadingRepoMessage, noServiceMessage
} from '../../../domain/shared-messages';
import { AuthenticationService } from '../../../services/authentication.service'; import { AuthenticationService } from '../../../services/authentication.service';
import { SharedService } from "../../../services/shared.service"; import { SharedService } from "../../../services/shared.service";
@ -25,6 +27,8 @@ export class MetricsEnableComponent implements OnInit {
repo: Repository; repo: Repository;
oaId: string; oaId: string;
countries: Country[] = [];
modalTitle = 'Confirmation'; modalTitle = 'Confirmation';
modalButton = 'Yes, enable it'; modalButton = 'Yes, enable it';
isModalShown: boolean; isModalShown: boolean;
@ -60,11 +64,13 @@ export class MetricsEnableComponent implements OnInit {
// this.getRepo(); // this.getRepo();
this.isModalShown = false; this.isModalShown = false;
let body = document.getElementsByTagName('body')[0]; const body = document.getElementsByTagName('body')[0];
body.classList.remove("top_bar_active"); //remove the class body.classList.remove('top_bar_active'); // remove the class
body.classList.remove("page_heading_active"); body.classList.remove('page_heading_active');
body.classList.remove("landing"); body.classList.remove('landing');
body.classList.add("dashboard"); body.classList.add('dashboard');
this.getCountries();
} }
// getRepo(): void { // getRepo(): void {
@ -109,8 +115,8 @@ export class MetricsEnableComponent implements OnInit {
const piwik: PiwikInfo = { const piwik: PiwikInfo = {
repositoryId: this.repo.id, repositoryId: this.repo.id,
openaireId: this.oaId, openaireId: this.oaId,
repositoryName: this.repo.officialName, repositoryName: this.repo.officialname,
country: this.repo.countryName, country: this.getCountryName(this.repo.organizations[0].country),
siteId: '', siteId: '',
authenticationToken: this.authenticationToken, authenticationToken: this.authenticationToken,
creationDate: null, creationDate: null,
@ -121,13 +127,13 @@ export class MetricsEnableComponent implements OnInit {
comment: '' comment: ''
}; };
this.piwikService.enableMetricsForRepository(this.repo.officialName, this.repo.websiteUrl, piwik).subscribe( this.piwikService.enableMetricsForRepository(this.repo.officialname, this.repo.websiteurl, piwik).subscribe(
response => { response => {
console.log(`enableMetrics answered: ${response}`); console.log(`enableMetrics answered: ${response}`);
this.successMessage = enabledMetricsSuccess; this.successMessage = enabledMetricsSuccess;
this.loadingMessage = ''; this.loadingMessage = '';
//save piwik and update shareRepo // save piwik and update shareRepo
this.repo.piwikInfo = piwik; this.repo.piwikInfo = piwik;
this.sharedService.setRepository(this.repo); 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() { ngOnInit() {
if(this.sharedService.getRepository()) { if (this.sharedService.getRepository()) {
this.repoId = this.sharedService.getRepository().id; this.repoId = this.sharedService.getRepository().id;
this.piwik = this.sharedService.getRepository().piwikInfo; this.piwik = this.sharedService.getRepository().piwikInfo;
this.getMetrics(); this.getMetrics();
@ -51,11 +51,11 @@ export class MetricsShowComponent implements OnInit {
} }
); );
let body = document.getElementsByTagName('body')[0]; const body = document.getElementsByTagName('body')[0];
body.classList.remove("top_bar_active"); //remove the class body.classList.remove('top_bar_active'); // remove the class
body.classList.remove("page_heading_active"); body.classList.remove('page_heading_active');
body.classList.remove("landing"); body.classList.remove('landing');
body.classList.add("dashboard"); body.classList.add('dashboard');
} }
getMetrics() { getMetrics() {
@ -90,7 +90,7 @@ export class MetricsShowComponent implements OnInit {
getViewsUrl () { 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(`${this.repoMetrics.diagramsBaseURL}chart?json=${encodedURL}`);
// this.viewsUrl = this.sanitizer.bypassSecurityTrustResourceUrl( // this.viewsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(
@ -112,7 +112,7 @@ export class MetricsShowComponent implements OnInit {
getDownloadsUrl () { 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(`${this.repoMetrics.diagramsBaseURL}chart?json=${encodedURL}`);
// this.downloadsUrl = this.sanitizer.bypassSecurityTrustResourceUrl( // this.downloadsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(

View File

@ -68,7 +68,7 @@ export class MetricsUsagestatsReportComponent implements OnInit {
if (this.repo.issn && this.repo.issn !== 'null') { if (this.repo.issn && this.repo.issn !== 'null') {
this.shownRepoId = this.repo.issn.slice(0, 4) + '-' + this.repo.issn.toString().slice(4); 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() { getParams() {

View File

@ -89,7 +89,7 @@
</div> </div>
</div> </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=""> <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> <a [routerLink]="['JR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="uk-card-media-top"> <div class="uk-card-media-top">

View File

@ -27,13 +27,13 @@ export class MetricsUsagestatsComponent implements OnInit {
if(this.sharedService.getRepository()) { if(this.sharedService.getRepository()) {
this.repo = 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( this.sharedService.repository$.subscribe(
r => { r => {
this.repo = 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-margin-medium-left uk-margin-medium-right">
<div class="uk-padding-small"> <div class="uk-padding-small">
<h3 *ngIf="repository" class="heading_b"> <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="../../../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"> <img *ngIf="repository.logourl" src="{{ repository.logourl }}" style="margin-right: 15px; margin-top:-8px" width="60">
{{ repository.officialName }} {{ repository.officialname }}
</h3> </h3>
</div> </div>

View File

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

View File

@ -22,45 +22,21 @@
<div class="uk-row-first"> <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 <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"> 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="md-card-content large-padding uk-margin-medium-top uk-margin-bottom">
<div class=""> <div class="">
<img class="el-image" src="../../../assets/imgs/datasourcetypes/Literature%20repository.svg" alt="" width="51"> <img class="el-image" src="../../../assets/imgs/datasourcetypes/Literature%20repository.svg" alt="" width="51">
</div> </div>
<h3>Literature repository</h3> <h3>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('repository')" style="cursor: pointer">
<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 one of the following global registries -
<p class="uk-margin-remove">Make sure your repository is already registered in OpenDOAR, the <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),
authoritative directory of institutional and thematic OA repositories, and is compatible with the <a href="http://www.re3data.org/">Re3data<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a> or
OpenAIRE Guidelines for Literature Repositories.</p> <a href="https://fairsharing.org/search?fairsharingRegistry=Database">FAIRsharing<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a>
<a href="http://v2.sherpa.ac.uk/opendoar/" target="_blank"> (for Data Repositories) - and is compatible with the
List provided by<br> <a href="https://guidelines.openaire.eu/en/latest/">OpenAIRE Guidelines<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i></a>.
OpenDOAR<i class="fas fa-external-link-alt" style="margin-left: 3px !important;"></i> <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>
</a> </p>
</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>
</div> </div>
</div> </div>
</div> </div>
@ -85,10 +61,6 @@
</div> </div>
</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-row-first">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium <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"> datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
@ -108,6 +80,10 @@
</div> </div>
</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="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium <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"> datasourceTypeCard uk-inline-clip uk-transition-toggle" uk-scrollspy-class="" tabindex="0">
@ -154,23 +130,6 @@
</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 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="">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium <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"> 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) // 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) { goTo(datasourceType: string) {
if (datasourceType === 'literature') { if (datasourceType === 'repository') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`); this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
} else if (datasourceType === 'data') { } else if (datasourceType === 'data') {
this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`); this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);

View File

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

View File

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

View File

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

View File

@ -137,8 +137,8 @@ export class RegisterNewDatasourceComponent implements OnInit {
addInterfaceToList(intrf?: RepositoryInterface) { addInterfaceToList(intrf?: RepositoryInterface) {
const curIndex = this.dataForInterfaceComp.length; const curIndex = this.dataForInterfaceComp.length;
const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType, const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy }; datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby };
if (intrf) { if (intrf) {
this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]); this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]);
} else { } else {
@ -180,9 +180,9 @@ export class RegisterNewDatasourceComponent implements OnInit {
this.dataForInterfaceComp.push([ this.dataForInterfaceComp.push([
true, i, true, i,
{ id: this.repo.id, { id: this.repo.id,
datasourceType: this.repo.datasourceType, datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.datasourceClass, datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredBy registeredBy: this.repo.registeredby
}, },
this.repoInterfaces[i] this.repoInterfaces[i]
]); ]);
@ -191,9 +191,9 @@ export class RegisterNewDatasourceComponent implements OnInit {
this.dataForInterfaceComp.push([ this.dataForInterfaceComp.push([
true, 0, true, 0,
{ id: this.repo.id, { id: this.repo.id,
datasourceType: this.repo.datasourceType, datasourceType: this.repo.eoscDatasourceType,
datasourceClass: this.repo.datasourceClass, datasourceClass: this.repo.eoscDatasourceType,
registeredBy: this.repo.registeredBy registeredBy: this.repo.registeredby
} }
]); ]);
} }
@ -223,9 +223,9 @@ export class RegisterNewDatasourceComponent implements OnInit {
this.loadingMessage = 'Saving changes'; this.loadingMessage = 'Saving changes';
this.errorMessage = ''; this.errorMessage = '';
console.log('add this.repo', this.repo); 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 => { response => {
console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`); console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
this.repo = response; this.repo = response;
}, },
error => { error => {
@ -246,10 +246,10 @@ export class RegisterNewDatasourceComponent implements OnInit {
concatMap(intrf => { concatMap(intrf => {
if (intrf.id) { if (intrf.id) {
// console.log('comments', intrf.comments); // 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 { } else {
// console.log('comments', intrf.comments); // 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( ).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 { Component, OnInit } from '@angular/core';
import { RegisterExistingDatasourceComponent } from './register-existing-datasource.component'; import { RegisterExistingDatasourceComponent } from './register-existing-datasource.component';
@Component ({ @Component ({
selector: 'app-sr-literature', selector: 'app-sr-repository',
templateUrl: './register-existing-datasource.component.html' templateUrl: './register-existing-datasource.component.html'
}) })
export class SrLiteratureComponent extends RegisterExistingDatasourceComponent implements OnInit { export class SrRepositoryComponent extends RegisterExistingDatasourceComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.datasourceType = 'literature'; this.datasourceType = 'repository';
this.currentMode = 'opendoar'; this.currentMode = 'repository';
super.ngOnInit(); super.ngOnInit();
} }

View File

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

View File

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

View File

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

View File

@ -57,7 +57,7 @@
<form-inline [description]="issnDesc" [valid]="group.get('issn').valid"> <form-inline [description]="issnDesc" [valid]="group.get('issn').valid">
<span *ngIf="group.get('issn').invalid && group.get('issn').touched && group.get('issn').dirty" <span *ngIf="group.get('issn').invalid && group.get('issn').touched && group.get('issn').dirty"
class="help-block inline uk-text-danger" 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" <input formControlName="issn" class="md-input" type="text"
(focus)="group.get('issn').markAsUntouched()" (blur)="group.get('issn').updateValueAndValidity()"> (focus)="group.get('issn').markAsUntouched()" (blur)="group.get('issn').updateValueAndValidity()">
</form-inline> </form-inline>
@ -71,7 +71,7 @@
<form-inline [description]="eissnDesc" [valid]="group.get('eissn').valid"> <form-inline [description]="eissnDesc" [valid]="group.get('eissn').valid">
<span *ngIf="group.get('eissn').invalid && group.get('eissn').touched && group.get('eissn').dirty" <span *ngIf="group.get('eissn').invalid && group.get('eissn').touched && group.get('eissn').dirty"
class="help-block inline uk-text-danger" 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" <input formControlName="eissn" class="md-input" type="text"
(focus)="group.get('eissn').markAsUntouched()" (blur)="group.get('eissn').updateValueAndValidity()"> (focus)="group.get('eissn').markAsUntouched()" (blur)="group.get('eissn').updateValueAndValidity()">
</form-inline> </form-inline>
@ -85,7 +85,7 @@
<form-inline [description]="lissnDesc" [valid]="group.get('lissn').valid"> <form-inline [description]="lissnDesc" [valid]="group.get('lissn').valid">
<span *ngIf="group.get('lissn').invalid && group.get('lissn').touched && group.get('lissn').dirty" <span *ngIf="group.get('lissn').invalid && group.get('lissn').touched && group.get('lissn').dirty"
class="help-block inline uk-text-danger" 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" <input formControlName="lissn" class="md-input" type="text"
(focus)="group.get('lissn').markAsUntouched()" (blur)="group.get('lissn').updateValueAndValidity()"> (focus)="group.get('lissn').markAsUntouched()" (blur)="group.get('lissn').updateValueAndValidity()">
</form-inline> </form-inline>
@ -111,7 +111,7 @@
<form-inline [description]="countryDesc" [valid]="group.get('country')"> <form-inline [description]="countryDesc" [valid]="group.get('country')">
<select formControlName="country" class="md-input"> <select formControlName="country" class="md-input">
<option value="">-- none selected --</option> <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> </select>
</form-inline> </form-inline>
</div> </div>
@ -277,7 +277,7 @@
<form-inline [description]="datasourceTypeDesc" [valid]="group.get('datasourceType').valid"> <form-inline [description]="datasourceTypeDesc" [valid]="group.get('datasourceType').valid">
<select formControlName="datasourceType" class="md-input"> <select formControlName="datasourceType" class="md-input">
<option value="">-- none selected --</option> <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> </select>
</form-inline> </form-inline>
</div> </div>

View File

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

View File

@ -29,22 +29,22 @@
<div *ngIf="errorMessage" class="uk-alert" [ngClass]="{'uk-alert-warning': errorMessage == invalidCustomBaseUrl, <div *ngIf="errorMessage" class="uk-alert" [ngClass]="{'uk-alert-warning': errorMessage == invalidCustomBaseUrl,
'uk-alert-danger': errorMessage != invalidCustomBaseUrl}" style="clear: both">{{ errorMessage }}</div> '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' : '' }}"> <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> <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;"> <span *ngIf="showIdentifiedBaseUrl" class="help-block inline" style="margin-top: 8px; margin-bottom: 0px; padding-left: 10px; display: block;">
Identified Identified
</span> </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> <span class="md-input-bar"></span>
</div> </div>
<!--<div class="form-group has-success">--> <!--<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;">--> <!--<span *ngIf="identifiedBaseUrl" class="help-block inline" style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">-->
<!--Identified--> <!--Identified-->
<!--</span>--> <!--</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>--> <!--</div>-->

View File

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

View File

@ -12,15 +12,20 @@
Basic information Basic information
</h4> </h4>
</div> </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> The following fields are completed by OpenDOAR.<br>
If you want to edit them, you can do it by using this 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>
<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> The following fields are completed by Re3data.<br>
If you want to edit them, you can do it by using this 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>
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> <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> </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 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="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"> <form-inline [description]="issnDesc" [valid]="updateGroup.get('issn').valid">
<span *ngIf="updateGroup.get('issn').invalid && updateGroup.get('issn').touched && updateGroup.get('issn').dirty" <span *ngIf="updateGroup.get('issn').invalid && updateGroup.get('issn').touched && updateGroup.get('issn').dirty"
class="help-block inline uk-text-danger" 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" <input formControlName="issn" class="md-input" type="text"
(focus)="updateGroup.get('issn').markAsUntouched()" (blur)="updateGroup.get('issn').updateValueAndValidity()"> (focus)="updateGroup.get('issn').markAsUntouched()" (blur)="updateGroup.get('issn').updateValueAndValidity()">
</form-inline> </form-inline>
@ -80,7 +85,7 @@
<form-inline [description]="eissnDesc" [valid]="updateGroup.get('eissn').valid"> <form-inline [description]="eissnDesc" [valid]="updateGroup.get('eissn').valid">
<span *ngIf="updateGroup.get('eissn').invalid && updateGroup.get('eissn').touched && updateGroup.get('eissn').dirty" <span *ngIf="updateGroup.get('eissn').invalid && updateGroup.get('eissn').touched && updateGroup.get('eissn').dirty"
class="help-block inline uk-text-danger" 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" <input formControlName="eissn" class="md-input" type="text"
(focus)="updateGroup.get('eissn').markAsUntouched()" (blur)="updateGroup.get('eissn').updateValueAndValidity()"> (focus)="updateGroup.get('eissn').markAsUntouched()" (blur)="updateGroup.get('eissn').updateValueAndValidity()">
</form-inline> </form-inline>
@ -94,7 +99,7 @@
<form-inline [description]="lissnDesc" [valid]="updateGroup.get('lissn').valid"> <form-inline [description]="lissnDesc" [valid]="updateGroup.get('lissn').valid">
<span *ngIf="updateGroup.get('lissn').invalid && updateGroup.get('lissn').touched && updateGroup.get('lissn').dirty" <span *ngIf="updateGroup.get('lissn').invalid && updateGroup.get('lissn').touched && updateGroup.get('lissn').dirty"
class="help-block inline uk-text-danger" 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" <input formControlName="lissn" class="md-input" type="text"
(focus)="updateGroup.get('lissn').markAsUntouched()" (blur)="updateGroup.get('lissn').updateValueAndValidity()"> (focus)="updateGroup.get('lissn').markAsUntouched()" (blur)="updateGroup.get('lissn').updateValueAndValidity()">
</form-inline> </form-inline>
@ -120,7 +125,7 @@
<form-inline [description]="countryDesc" [valid]="updateGroup.get('country')"> <form-inline [description]="countryDesc" [valid]="updateGroup.get('country')">
<select formControlName="country" class="md-input"> <select formControlName="country" class="md-input">
<option value="">-- none selected --</option> <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> </select>
</form-inline> </form-inline>
</div> </div>
@ -217,7 +222,7 @@
<form-inline [description]="datasourceTypeDesc" [valid]="updateGroup.get('datasourceType').valid"> <form-inline [description]="datasourceTypeDesc" [valid]="updateGroup.get('datasourceType').valid">
<select formControlName="datasourceType" class="md-input"> <select formControlName="datasourceType" class="md-input">
<option value="">-- none selected --</option> <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> </select>
</form-inline> </form-inline>
</div> </div>
@ -244,4 +249,4 @@
<button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button> <button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button>
</div> </div>
</form> </form>
<pre>{{updateGroup.value|json}}</pre>

View File

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

View File

@ -113,8 +113,8 @@
</a> </a>
<ul [ngClass]="{'uk-display-block': visibleAdminRepo}"> <ul [ngClass]="{'uk-display-block': visibleAdminRepo}">
<li class="act_item"> <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.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}}</a>
</li> </li>
</ul> </ul>
</li> </li>