From b9d7fb87323ee549ce5faf4b250b56b820d72c05 Mon Sep 17 00:00:00 2001 From: "andreas.mantas" <48762391+amantas@users.noreply.github.com> Date: Fri, 5 Aug 2022 08:45:51 +0000 Subject: [PATCH] svn merge -r 62321:HEAD http://svn.driver.research-infrastructures.eu/driver/dnet45/modules/uoa-repository-dashboard-gui/branches/new-datasource-mode --- src/app/app.component.ts | 2 +- src/app/domain/oa-description.ts | 2 +- src/app/domain/typeScriptClasses.ts | 761 +++++++++--------- .../adminPg-registrations.component.html | 2 +- ...lity-monitor-fullHistory-repo.component.ts | 4 +- .../compatibility-monitor-repo.component.ts | 4 +- .../dashboard/dashboard.component.html | 2 +- .../dashboard/dashboard.component.ts | 2 +- ...ent-events-of-repo-eventslist.component.ts | 4 +- .../content-events-of-repository.component.ts | 4 +- .../metrics/metrics-enable.component.html | 2 +- .../metrics/metrics-enable.component.ts | 59 +- .../metrics/metrics-show.component.ts | 16 +- .../metrics-usagestats-report.component.ts | 2 +- .../metrics/metrics-usagestats.component.html | 2 +- .../metrics/metrics-usagestats.component.ts | 4 +- .../repository/repository.component.html | 6 +- .../update/sources-update-repo.component.ts | 22 +- .../sources/sources-register.component.html | 71 +- .../sources/sources-register.component.ts | 2 +- ...-datasource-select-existing.component.html | 44 +- ...er-datasource-select-existing.component.ts | 16 +- .../register-existing-datasource.component.ts | 35 +- .../register-new-datasource.component.ts | 24 +- .../sources-register/sr-data.component.ts | 21 - ...omponent.ts => sr-repository.component.ts} | 10 +- src/app/pages/sources/sources.module.ts | 6 +- src/app/pages/sources/sources.routing.ts | 11 +- src/app/services/repository.service.ts | 3 +- .../datasource-create-form.component.html | 10 +- .../datasource-create-form.component.ts | 89 +- ...tasource-new-interface-form.component.html | 10 +- ...datasource-new-interface-form.component.ts | 95 +-- .../datasource-update-form.component.html | 29 +- .../datasource-update-form.component.ts | 106 ++- ...atasource-update-terms-form.component.html | 7 +- .../shared/sidemenu/sidemenu.component.html | 4 +- 37 files changed, 780 insertions(+), 713 deletions(-) delete mode 100755 src/app/pages/sources/sources-register/sr-data.component.ts rename src/app/pages/sources/sources-register/{sr-literature.component.ts => sr-repository.component.ts} (60%) mode change 100755 => 100644 diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 90acd3cae..38ed958e2 100755 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -67,7 +67,7 @@ export class AppComponent implements OnInit { () => { // console.log(this.reposOfUser); this.reposOfUser.forEach(repo => { - if (!repo.consentTermsOfUse || !repo.fullTextDownload) { + if (repo.consentTermsOfUse === null || repo.fullTextDownload === null) { this.addTerm(repo.officialname, repo.id, repo.consentTermsOfUse); this.isModalShown = true; } diff --git a/src/app/domain/oa-description.ts b/src/app/domain/oa-description.ts index f10f1db2e..b2a9a32d3 100755 --- a/src/app/domain/oa-description.ts +++ b/src/app/domain/oa-description.ts @@ -131,7 +131,7 @@ export const timezoneDesc = { export const datasourceTypeDesc = { desc: 'The type of your repository', - label: 'Repository Type', + label: 'Data source type', mandatory: true, recommended: false }; diff --git a/src/app/domain/typeScriptClasses.ts b/src/app/domain/typeScriptClasses.ts index f8c7270e8..265943d4c 100755 --- a/src/app/domain/typeScriptClasses.ts +++ b/src/app/domain/typeScriptClasses.ts @@ -1,159 +1,129 @@ // Generated using typescript-generator version 1.29.366 on 2018-02-05 16:06:12. export class BrowseData { - data: { [index: string]: FieldData }; - fields: string[]; + data: { [index: string]: FieldData }; + fields: string[]; } export class DataCollectionAccessProtocol { - value: string; - username: string; - password: string; + value: string; + username: string; + password: string; } export class DataCollectionInterface { - protocol: DataCollectionAccessProtocol; - baseUrl: string; - format: string; - filter: string; + protocol: DataCollectionAccessProtocol; + baseUrl: string; + format: string; + filter: string; } export class DataCollectionType { - dataCollectionInterface: DataCollectionInterface; - id: string; - label: string; - group: string; + dataCollectionInterface: DataCollectionInterface; + id: string; + label: string; + group: string; } export class Document { - map: { [index: string]: string[] }; - fieldNames: string[]; + map: { [index: string]: string[] }; + fieldNames: string[]; } export class FieldData { - fieldRowList: FieldRow[]; - count: number[]; - values: string[]; + fieldRowList: FieldRow[]; + count: number[]; + values: string[]; } export class FieldRow { - value: string; - count: number; + value: string; + count: number; } export class FormattedSearchResult { - formattedResult: string; - resultsNumber: number; + formattedResult: string; + resultsNumber: number; } export class Hint { - alternateTerm: string; - autoFollowHint: boolean; + alternateTerm: string; + autoFollowHint: boolean; } export class DriverResource implements Serializable { - resourceId: string; - resourceUri: string; - resourceKind: string; - resourceType: string; - dateOfCreation: Date; + resourceId: string; + resourceUri: string; + resourceKind: string; + resourceType: string; + dateOfCreation: Date; } export class MDFormatDataStructure extends DriverResource { - resourceName: string; - layouts: { [index: string]: LayoutField[] }; + resourceName: string; + layouts: { [index: string]: LayoutField[] }; } export class PiwikInfo implements IsSerializable { - repositoryId: string; - openaireId: string; - repositoryName: string; - country: string; - siteId: string; - authenticationToken: string; - creationDate: Date; - requestorName: string; - requestorEmail: string; - validated: boolean; - validationDate: Date; - comment: string; + repositoryId: string; + openaireId: string; + repositoryName: string; + country: string; + siteId: string; + authenticationToken: string; + creationDate: Date; + requestorName: string; + requestorEmail: string; + validated: boolean; + validationDate: Date; + comment: string; } -export class Repository extends DriverResource implements IsSerializable { +export class DatasourceDetails { id: string; - officialName: string; - englishName: string; - websiteUrl: string; - logoUrl: string; - contactEmail: string; - countryName: string; - countryCode: string; - organization: string; + openaireId: string; + officialname: string; + englishname: string; + websiteurl: string; + logourl: string; + contactemail: string; latitude: number; longitude: number; - timezone: number; - namespacePrefix: string; - odNumberOfItems: string; - odNumberOfItemsDate: string; - odPolicies: string; - odLanguages: string; - odContentTypes: string; - collectedFrom: string; - inferred: boolean; - deletedByInference: boolean; - trust: number; - inferenceProvenance: string; - dateOfValidation: Date; - datasourceClass: string; - provenanceActionClass: string; - dateOfCollection: Date; - typology: string; + namespaceprefix: string; + languages: string; + dateofvalidation: Date; + eoscDatasourceType: string; + dateofcollection: Date; + platform: string; activationId: string; - mergehomonyms: boolean; description: string; - releaseStartDate: Date; - releaseEndDate: Date; - missionStatementUrl: string; - dataProvider: boolean; - serviceProvider: boolean; - databaseAccessType: string; - dataUploadType: string; - databaseAccessRestriction: string; - dataUploadRestriction: string; - versioning: boolean; - citationGuidelineUrl: string; - qualityManagementKind: string; - pidSystems: string; - certificates: string; - aggregator: string; issn: string; eissn: string; lissn: string; - interfaces: RepositoryInterface[]; - consentTermsOfUse: boolean; - fullTextDownload: boolean; + registeredby: string; + subjects: string; + aggregator: string; + collectedfrom: string; + managed: boolean; + registrationdate: Date; consentTermsOfUseDate: Date; lastConsentTermsOfUseDate: Date; - availableDiskSpace: string; - securityParameters: string; - protocol: string; - registeredBy: string; - datasourceType: string; - datasourceAggregatorId: string; - datasourceOriginalIdValue: string; - datasourceOriginalIdProvenance: string; - datasourceAggregated: boolean; - datasourceComplianceDegreeValue: string; - datasourceComplianceDegreeEncoding: string; - numberOfObjects: number; - maxSizeOfDatastructure: number; - maxNumberOfDataStructures: number; - registered: boolean; - extraFields: { [index: string]: string }; + consentTermsOfUse: boolean; + fullTextDownload: boolean; + organizations: OrganizationDetails[] = new Array(); + identities: IdentitiesDetails[]; + status: string; + typology: string; +} + +export class Repository extends DatasourceDetails implements IsSerializable { + timezone: number; + interfaces: RepositoryInterface[]; piwikInfo: PiwikInfo; environments: string[]; - registrationDate: Date; - verified: boolean; + namespacePrefix: string; + dateOfValidation: Date; + dateOfCollection: Date; dataCollectionTypes: DataCollectionType[]; } @@ -162,16 +132,18 @@ export class RepositorySnippet { officialname: string; englishname: string; websiteurl: string; - typology: string; registeredby: string; - organizations: Organization[]; registrationdate: Date; - piwikInfo: PiwikInfo; + eoscDatasourceType: string; logoUrl: string; description: string; consentTermsOfUse: boolean; - fullTextDownload: boolean; consentTermsOfUseDate: Date; + lastConsentTermsOfUseDate: Date; + fullTextDownload: boolean; + organizations: OrganizationDetails[]; + typology: string; + piwikInfo: PiwikInfo; } export class TermsOfUse { @@ -182,231 +154,260 @@ export class TermsOfUse { consentTermsOfUseDate: Date; } -export class Organization { - country: string; - legalname: string; - websiteurl: string; - legalshortname: string; - logourl: string; -} - export class RepositoryAccessProtocol { - value: string; - username: string; - password: string; - filter: string; + value: string; + username: string; + password: string; + filter: string; } export class RepositoryBlackboard { - lastrequest: string; - lastresponse: string; - messages: RepositoryBlackboardMessage[]; + lastrequest: string; + lastresponse: string; + messages: RepositoryBlackboardMessage[]; } export class RepositoryBlackboardMessage { - id: string; - action: Action; - actionStatus: ActionStatus; - parameters: string[]; + id: string; + action: Action; + actionStatus: ActionStatus; + parameters: string[]; } export class RepositoryComparator implements Comparator { } -export class RepositoryInterface implements Serializable, IsSerializable { - desiredCompatibilityLevel: string; - complianceName: string; - upgradeToV3: string; - deleteApi: boolean; - accessSet: string; - accessFormat: string; - metadataIdentifierPath: string; - lastCollectionDate: string; - nextScheduledExecution: string; - status: string; - collectedFrom: string; +// export class RepositoryInterface implements Serializable, IsSerializable { +// desiredCompatibilityLevel: string; +// complianceName: string; +// upgradeToV3: string; +// deleteApi: boolean; +// accessSet: string; +// accessFormat: string; +// metadataIdentifierPath: string; +// lastCollectionDate: string; +// nextScheduledExecution: string; +// status: string; +// collectedFrom: string; +// id: string; +// typology: string; +// compatibility: string; +// contentdescription: string; +// protocol: string; +// baseurl: string; +// active: boolean; +// removable: boolean; +// apiParams: { [index: string]: string }; +// extraFields: { [index: string]: string }; +// comments: string; +// } + +export class ApiDetails { id: string; - typology: string; - compliance: string; - contentDescription: string; - accessProtocol: string; - baseUrl: string; - active: boolean; + protocol: string; + datasource: string; + contentdescription: string; + eoscDatasourceType: string; + compatibility: string; + compatibilityOverride: string; + lastCollectionTotal: number; + lastCollectionDate: Date; + lastAggregationTotal: number; + lastAggregationDate: Date; + lastDownloadTotal: number; + lastDownloadDate: Date; + baseurl: string; removable: boolean; - accessParams: { [index: string]: string }; - extraFields: { [index: string]: string }; + apiParams: ApiParamDetails[] = new Array(); + metadataIdentifierPath: string; + typology: string; comments: string; } +export class RepositoryInterface extends ApiDetails { + +} + +export class ApiParamDetails { + param: string; + value: string; + + constructor(param, value) { + this.param = param; + this.value = value; + } + +} + export class SearchCriteriaImpl implements SearchCriteria { - startsWith: string; - endsWith: string; - contains: string; + startsWith: string; + endsWith: string; + contains: string; } export class RepositorySearchCriteria extends SearchCriteriaImpl implements SearchCriteria { - haveDocuments: boolean; - protocolType: string; - adminInfo: string; - officialName: string; - registeredBy: string; - country: string; - verified: boolean; + haveDocuments: boolean; + protocolType: string; + adminInfo: string; + officialName: string; + registeredBy: string; + country: string; + verified: boolean; } export class SearchResult { - query: string; - locale: string; - total: number; - page: number; - size: number; - fields: string[]; - searchResults: string[]; - browseResults: string[]; + query: string; + locale: string; + total: number; + page: number; + size: number; + fields: string[]; + searchResults: string[]; + browseResults: string[]; } export class SimilarDocument { - id: string; - score: number; + id: string; + score: number; } export class StoreInfo { - serviceUrl: string; - storeId: string; + serviceUrl: string; + storeId: string; } export class StoreObjectInfo { - storeInfo: StoreInfo; - objectId: string; + storeInfo: StoreInfo; + objectId: string; } export class SuggestiveResult { - epr: EPR; - alternativeTerm: string; - autofollow: boolean; + epr: EPR; + alternativeTerm: string; + autofollow: boolean; } export class CustomProperties implements IsSerializable { - properties: { [index: string]: string }; + properties: { [index: string]: string }; } export class JobForValidation implements IsSerializable { - officialName: string; - baseUrl: string; - userEmail: string; - validationSet: string; - datasourceId: string; - interfaceId: string; - desiredCompatibilityLevel: string; - activationId: string; - repoType: string; - interfaceIdOld: string; - groupByXpath: string; - metadataPrefix: string; - records: number; - registration: boolean; - updateExisting: boolean; - cris: boolean; - crisReferentialChecks: boolean; - selectedCrisEntities: string[]; - selectedContentRules: number[]; - selectedUsageRules: number[]; - adminEmails: string[]; + officialName: string; + baseUrl: string; + userEmail: string; + validationSet: string; + datasourceId: string; + interfaceId: string; + desiredCompatibilityLevel: string; + activationId: string; + repoType: string; + interfaceIdOld: string; + groupByXpath: string; + metadataPrefix: string; + records: number; + registration: boolean; + updateExisting: boolean; + cris: boolean; + crisReferentialChecks: boolean; + selectedCrisEntities: string[]; + selectedContentRules: number[]; + selectedUsageRules: number[]; + adminEmails: string[]; } export class JobResultEntry implements IsSerializable { - name: string; - description: string; - successes: string; - weight: number; - errors: string[]; - ruleId: number; - hasErrors: boolean; - mandatory: boolean; - type: string; + name: string; + description: string; + successes: string; + weight: number; + errors: string[]; + ruleId: number; + hasErrors: boolean; + mandatory: boolean; + type: string; } export class Rule implements IsSerializable { - id: number; - name: string; - description: string; - type: string; - mandatory: boolean; - weight: number; - provider_information: string; - job_type: string; - entity_type: string; - for_cris: boolean; - configuration: CustomProperties; + id: number; + name: string; + description: string; + type: string; + mandatory: boolean; + weight: number; + provider_information: string; + job_type: string; + entity_type: string; + for_cris: boolean; + configuration: CustomProperties; } export class RuleSet implements Serializable, IsSerializable { - id: number; - name: string; - description: string; - guidelinesAcronym: string; - shortName: string; - visibility: string[]; - contentRules: Rule[]; - usageRules: Rule[]; - contentRulesIds: number[]; - usageRulesIds: number[]; + id: number; + name: string; + description: string; + guidelinesAcronym: string; + shortName: string; + visibility: string[]; + contentRules: Rule[]; + usageRules: Rule[]; + contentRulesIds: number[]; + usageRulesIds: number[]; } export class StoredJob extends JobForValidation implements IsSerializable { - contentJobStatus: string; - usageJobStatus: string; - started: string; - ended: string; - duration: string; - error: string; - validationType: string; - jobType: string; - guidelinesShortName: string; - validationStatus: string; - recordsTested: number; - id: number; - contentJobScore: number; - usageJobScore: number; - rules: number[]; - resultEntries: JobResultEntry[]; - filteredScores: { [index: string]: number }; + contentJobStatus: string; + usageJobStatus: string; + started: string; + ended: string; + duration: string; + error: string; + validationType: string; + jobType: string; + guidelinesShortName: string; + validationStatus: string; + recordsTested: number; + id: number; + contentJobScore: number; + usageJobScore: number; + rules: number[]; + resultEntries: JobResultEntry[]; + filteredScores: { [index: string]: number }; } export class AdvQueryObject implements IsSerializable { - datasource: string; - topic: string; - titles: string[]; - subjects: string[]; - authors: string[]; - dates: Range[]; - trust: Range; - page: number; + datasource: string; + topic: string; + titles: string[]; + subjects: string[]; + authors: string[]; + dates: Range[]; + trust: Range; + page: number; } export class BrowseEntry implements Comparable, IsSerializable { - value: string; - size: number; + value: string; + size: number; } export class ConditionParams implements IsSerializable { - value: string; - otherValue: string; + value: string; + otherValue: string; } export class OaBrokerRelatedDataset implements IsSerializable { - openaireId: string; - originalId: string; - title: string; - collectedFrom: string; - pids: OaBrokerTypedValue[]; - instances: OaBrokerInstance[]; + openaireId: string; + originalId: string; + title: string; + collectedFrom: string; + pids: OaBrokerTypedValue[]; + instances: OaBrokerInstance[]; } export class DatasourcesBroker implements IsSerializable { - datasourcesOfUser: Tuple[]; - sharedDatasources: Tuple[]; - datasourcesOfOthers: Tuple[]; + datasourcesOfUser: Tuple[]; + sharedDatasources: Tuple[]; + datasourcesOfOthers: Tuple[]; } export class OaBrokerRelatedDatasource implements IsSerializable { @@ -417,47 +418,47 @@ export class OaBrokerRelatedDatasource implements IsSerializable { } export class EventsPage implements IsSerializable { - datasource: string; - topic: string; - currPage: number; - totalPages: number; - total: number; - values: OaBrokerEventPayload[]; + datasource: string; + topic: string; + currPage: number; + totalPages: number; + total: number; + values: OaBrokerEventPayload[]; } export class OaBrokerExternalReference implements IsSerializable { - url: string; - sitename: string; - type: string; - refidentifier: string; + url: string; + sitename: string; + type: string; + refidentifier: string; } export class OaBrokerInstance implements IsSerializable { - url: string; - license: string; - hostedby: string; - instancetype: string; + url: string; + license: string; + hostedby: string; + instancetype: string; } export class OaBrokerJournal implements IsSerializable { - name: string; - issn: string; - eissn: string; - lissn: string; + name: string; + issn: string; + eissn: string; + lissn: string; } export class MapConditions implements IsSerializable { - field: string; - fieldType: MapValueType; - operator: ConditionOperator; - listParams: ConditionParams[]; + field: string; + fieldType: MapValueType; + operator: ConditionOperator; + listParams: ConditionParams[]; } export class OaBrokerEventPayload implements IsSerializable { - result: OaBrokerMainEntity; // old publication: Publication; ?? - highlight: OaBrokerMainEntity; - provenance: OaBrokerProvenance; - trust: number; + result: OaBrokerMainEntity; // old publication: Publication; ?? + highlight: OaBrokerMainEntity; + provenance: OaBrokerProvenance; + trust: number; } export class OaBrokerAuthor implements IsSerializable { @@ -466,32 +467,32 @@ export class OaBrokerAuthor implements IsSerializable { } export class OpenaireSubscription implements IsSerializable { - subscriber: string; - frequency: NotificationFrequency; - mode: NotificationMode; - query: AdvQueryObject; + subscriber: string; + frequency: NotificationFrequency; + mode: NotificationMode; + query: AdvQueryObject; } export class OaBrokerTypedValue implements IsSerializable { - value: string; - type: string; + value: string; + type: string; } export class OaBrokerProject implements IsSerializable { - openaireId: string; - code: string; - acronym: string; - title: string; - funder: string; - fundingProgram: string; - jurisdiction: string; + openaireId: string; + code: string; + acronym: string; + title: string; + funder: string; + fundingProgram: string; + jurisdiction: string; } export class OaBrokerProvenance implements IsSerializable { - repositoryName: string; - repositoryType: string; - url: string; - id: string; + repositoryName: string; + repositoryType: string; + url: string; + id: string; } export class OaBrokerRelatedPublication implements IsSerializable { @@ -505,41 +506,41 @@ export class OaBrokerRelatedPublication implements IsSerializable { } export class OaBrokerMainEntity implements IsSerializable { - openaireId: string; - originalId: string; - typology: string; - titles: string[]; - abstracts: string[]; - language: string; - subjects: OaBrokerTypedValue[]; - creators: OaBrokerAuthor[]; - publicationdate: string; - publisher: string; - embargoenddate: string; - contributor: string[]; - journal: OaBrokerJournal; - pids: OaBrokerTypedValue[]; - instances: OaBrokerInstance[]; - externalReferences: OaBrokerExternalReference[]; - publications: OaBrokerRelatedPublication[]; - projects: OaBrokerProject[]; - datasets: OaBrokerRelatedDataset[]; - softwares: OaBrokerRelatedSoftware[]; - datasources: OaBrokerRelatedDatasource[]; + openaireId: string; + originalId: string; + typology: string; + titles: string[]; + abstracts: string[]; + language: string; + subjects: OaBrokerTypedValue[]; + creators: OaBrokerAuthor[]; + publicationdate: string; + publisher: string; + embargoenddate: string; + contributor: string[]; + journal: OaBrokerJournal; + pids: OaBrokerTypedValue[]; + instances: OaBrokerInstance[]; + externalReferences: OaBrokerExternalReference[]; + publications: OaBrokerRelatedPublication[]; + projects: OaBrokerProject[]; + datasets: OaBrokerRelatedDataset[]; + softwares: OaBrokerRelatedSoftware[]; + datasources: OaBrokerRelatedDatasource[]; } export class Range implements IsSerializable { - min: string; - max: string; + min: string; + max: string; } export class SimpleSubscriptionDesc implements IsSerializable { - id: string; - datasource: string; - topic: string; - count: number; - creationDate: Date; - lastNotificationDate: Date; + id: string; + datasource: string; + topic: string; + count: number; + creationDate: Date; + lastNotificationDate: Date; } export class OaBrokerRelatedSoftware implements IsSerializable { @@ -551,25 +552,25 @@ export class OaBrokerRelatedSoftware implements IsSerializable { } export class Subscription implements IsSerializable { - subscriptionId: string; - subscriber: string; - topic: string; - frequency: NotificationFrequency; - mode: NotificationMode; - creationDate: Date; - lastNotificationDate: Date; - conditions: string; - conditionsAsList: MapConditions[]; + subscriptionId: string; + subscriber: string; + topic: string; + frequency: NotificationFrequency; + mode: NotificationMode; + creationDate: Date; + lastNotificationDate: Date; + conditions: string; + conditionsAsList: MapConditions[]; } export class LayoutField { - name: string; - xpath: string; - type: string; - indexable: boolean; - result: boolean; - stat: boolean; - tokenizable: boolean; + name: string; + xpath: string; + type: string; + indexable: boolean; + result: boolean; + stat: boolean; + tokenizable: boolean; } export interface IsSerializable { @@ -582,16 +583,16 @@ export interface SearchCriteria { } export class EPR { - epr: string; - address: string; - serviceName: string; - endpointName: string; - parameterNames: string[]; + epr: string; + address: string; + serviceName: string; + endpointName: string; + parameterNames: string[]; } export class Tuple implements IsSerializable { - first: K; - second: V; + first: K; + second: V; } export interface Comparator { @@ -600,18 +601,27 @@ export interface Comparator { export interface Comparable { } -export type ConditionOperator = "EXACT" | "MATCH_ANY" | "MATCH_ALL" | "RANGE"; +export type ConditionOperator = 'EXACT' | 'MATCH_ANY' | 'MATCH_ALL' | 'RANGE'; -export type MapValueType = "STRING" | "INTEGER" | "FLOAT" | "DATE" | "BOOLEAN" | "LIST_STRING" | "LIST_INTEGER" | "LIST_FLOAT" | "LIST_DATE" | "LIST_BOOLEAN"; +export type MapValueType = + 'STRING' + | 'INTEGER' + | 'FLOAT' + | 'DATE' + | 'BOOLEAN' + | 'LIST_STRING' + | 'LIST_INTEGER' + | 'LIST_FLOAT' + | 'LIST_DATE' + | 'LIST_BOOLEAN'; -export type NotificationFrequency = "never" | "realtime" | "daily" | "weekly" | "monthly"; +export type NotificationFrequency = 'never' | 'realtime' | 'daily' | 'weekly' | 'monthly'; -export type NotificationMode = "MOCK" | "EMAIL"; +export type NotificationMode = 'MOCK' | 'EMAIL'; -export type Action = "CREATE" | "DELETE" | "UPDATE" | "MANAGE" | "RELEASE" | "CANCEL"; - -export type ActionStatus = "DONE" | "ONGOING" | "FAILED" | "WAITING" | "ASSIGNED"; +export type Action = 'CREATE' | 'DELETE' | 'UPDATE' | 'MANAGE' | 'RELEASE' | 'CANCEL'; +export type ActionStatus = 'DONE' | 'ONGOING' | 'FAILED' | 'WAITING' | 'ASSIGNED'; export class Country { @@ -681,7 +691,7 @@ export class Aggregations implements IsSerializable { lastTransformation: AggregationDetails[]; } -export class UserInfo implements IsSerializable { +export class UserInfo implements IsSerializable { sub: string; role: string[]; name: string; @@ -732,3 +742,16 @@ export class User { lastName: string; email: string; } + +export class OrganizationDetails { + legalshortname: string; + legalname: string; + websiteurl: string; + logourl: string; + country: string; +} + +export class IdentitiesDetails { + pid: string; + issuertype: string; +} diff --git a/src/app/pages/adminPg/adminPg-registrations.component.html b/src/app/pages/adminPg/adminPg-registrations.component.html index e18c1c9c6..d7ec486ba 100644 --- a/src/app/pages/adminPg/adminPg-registrations.component.html +++ b/src/app/pages/adminPg/adminPg-registrations.component.html @@ -121,7 +121,7 @@
-
{{res.typology.split('::')[0]}} {{res.typology.split('::')[1]}} {{res.typology.split('::')[2]}}
+
{{res.eoscDatasourceType.split('::')[0]}} {{res.eoscDatasourceType.split('::')[1]}} {{res.eoscDatasourceType.split('::')[2]}}
ID{{res.id}}
RM{{res.registeredby}}
diff --git a/src/app/pages/repository/aggregationhistory/compatibility-monitor-fullHistory-repo.component.ts b/src/app/pages/repository/aggregationhistory/compatibility-monitor-fullHistory-repo.component.ts index ae27ce586..b9937b8a6 100755 --- a/src/app/pages/repository/aggregationhistory/compatibility-monitor-fullHistory-repo.component.ts +++ b/src/app/pages/repository/aggregationhistory/compatibility-monitor-fullHistory-repo.component.ts @@ -30,7 +30,7 @@ export class CompatibilityMonitorFullHistoryRepoComponent implements OnInit { if(this.sharedService.getRepository()) { this.repo = this.sharedService.getRepository(); - this.repoName = this.repo.officialName; + this.repoName = this.repo.officialname; this.getAllAggregationHistory(); } @@ -38,7 +38,7 @@ export class CompatibilityMonitorFullHistoryRepoComponent implements OnInit { r => { this.repo = r; if (this.repo) { - this.repoName = this.repo.officialName; + this.repoName = this.repo.officialname; this.getAllAggregationHistory(); } } diff --git a/src/app/pages/repository/aggregationhistory/compatibility-monitor-repo.component.ts b/src/app/pages/repository/aggregationhistory/compatibility-monitor-repo.component.ts index 5b4cd7de5..c0109a1ed 100755 --- a/src/app/pages/repository/aggregationhistory/compatibility-monitor-repo.component.ts +++ b/src/app/pages/repository/aggregationhistory/compatibility-monitor-repo.component.ts @@ -29,7 +29,7 @@ export class CompatibilityMonitorRepoComponent implements OnInit { if(this.sharedService.getRepository()) { this.repo = this.sharedService.getRepository(); - this.repoName = this.repo.officialName; + this.repoName = this.repo.officialname; this.getLatestAggregationHistory(); } @@ -37,7 +37,7 @@ export class CompatibilityMonitorRepoComponent implements OnInit { r => { this.repo = r; if (this.repo) { - this.repoName = this.repo.officialName; + this.repoName = this.repo.officialname; this.getLatestAggregationHistory(); } } diff --git a/src/app/pages/repository/dashboard/dashboard.component.html b/src/app/pages/repository/dashboard/dashboard.component.html index 02da9165a..30abbcab6 100755 --- a/src/app/pages/repository/dashboard/dashboard.component.html +++ b/src/app/pages/repository/dashboard/dashboard.component.html @@ -373,7 +373,7 @@
No notifications were found
    -
  • +
  • {{ sub.count | number }} diff --git a/src/app/pages/repository/dashboard/dashboard.component.ts b/src/app/pages/repository/dashboard/dashboard.component.ts index f5f16069c..3c7c161b9 100755 --- a/src/app/pages/repository/dashboard/dashboard.component.ts +++ b/src/app/pages/repository/dashboard/dashboard.component.ts @@ -283,7 +283,7 @@ export class DashboardComponent implements OnInit { } getCorrectName() { - const temp = this.repository.officialName.split('|'); + const temp = this.repository.officialname.split('|'); let correctName = temp[0]; let repoName = temp[0]; for (let i = 1; i < temp.length; i++) { diff --git a/src/app/pages/repository/events/content-events-of-repo-eventslist.component.ts b/src/app/pages/repository/events/content-events-of-repo-eventslist.component.ts index 643b1bdd1..44216237b 100755 --- a/src/app/pages/repository/events/content-events-of-repo-eventslist.component.ts +++ b/src/app/pages/repository/events/content-events-of-repo-eventslist.component.ts @@ -74,7 +74,7 @@ export class ContentEventsOfRepoEventslistComponent implements OnInit { if(this.sharedService.getRepository()) { - this.repoName = this.sharedService.getRepository().officialName; + this.repoName = this.sharedService.getRepository().officialname; this.initQuery(); this.initForm(); this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */ @@ -84,7 +84,7 @@ export class ContentEventsOfRepoEventslistComponent implements OnInit { this.sharedService.repository$.subscribe( r => { if (r) { - this.repoName = r.officialName; + this.repoName = r.officialname; this.initQuery(); this.initForm(); this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */ diff --git a/src/app/pages/repository/events/content-events-of-repository.component.ts b/src/app/pages/repository/events/content-events-of-repository.component.ts index b2b74159a..6f37e98d3 100755 --- a/src/app/pages/repository/events/content-events-of-repository.component.ts +++ b/src/app/pages/repository/events/content-events-of-repository.component.ts @@ -34,7 +34,7 @@ export class ContentEventsOfRepositoryComponent implements OnInit { ngOnInit() { if(this.sharedService.getRepository()) { - this.repoName = this.sharedService.getRepository().officialName; + this.repoName = this.sharedService.getRepository().officialname; this.getCorrectName(); this.getTopics(); } @@ -42,7 +42,7 @@ export class ContentEventsOfRepositoryComponent implements OnInit { this.sharedService.repository$.subscribe( r => { if (r) { - this.repoName = r.officialName; + this.repoName = r.officialname; this.getCorrectName(); this.getTopics(); } diff --git a/src/app/pages/repository/metrics/metrics-enable.component.html b/src/app/pages/repository/metrics/metrics-enable.component.html index d8c040602..32bc076f3 100755 --- a/src/app/pages/repository/metrics/metrics-enable.component.html +++ b/src/app/pages/repository/metrics/metrics-enable.component.html @@ -1,6 +1,6 @@
    -

    Metrics for {{repo.officialName}}

    +

    Metrics for {{repo.officialname}}

    { console.log(`enableMetrics answered: ${response}`); this.successMessage = enabledMetricsSuccess; this.loadingMessage = ''; - //save piwik and update shareRepo + // save piwik and update shareRepo this.repo.piwikInfo = piwik; this.sharedService.setRepository(this.repo); }, @@ -143,4 +149,33 @@ export class MetricsEnableComponent implements OnInit { ); } } + + getCountries() { + this.repoService.getCountries() + .subscribe( + countries => this.countries = countries.sort(function (a, b) { + if (a.name < b.name) { + return -1; + } else if (a.name > b.name) { + return 1; + } else { + return 0; + } + }), + error => { + this.loadingMessage = ''; + this.errorMessage = noServiceMessage; + console.log(error); + } + ); + } + + getCountryName(countryCode): string { + for (const country of Object.values(this.countries)) { + if (country.code === countryCode) { + return country.name; + } + } + } + } diff --git a/src/app/pages/repository/metrics/metrics-show.component.ts b/src/app/pages/repository/metrics/metrics-show.component.ts index 321778aba..b283d4fb1 100755 --- a/src/app/pages/repository/metrics/metrics-show.component.ts +++ b/src/app/pages/repository/metrics/metrics-show.component.ts @@ -37,7 +37,7 @@ export class MetricsShowComponent implements OnInit { ngOnInit() { - if(this.sharedService.getRepository()) { + if (this.sharedService.getRepository()) { this.repoId = this.sharedService.getRepository().id; this.piwik = this.sharedService.getRepository().piwikInfo; this.getMetrics(); @@ -51,11 +51,11 @@ export class MetricsShowComponent implements OnInit { } ); - let body = document.getElementsByTagName('body')[0]; - body.classList.remove("top_bar_active"); //remove the class - body.classList.remove("page_heading_active"); - body.classList.remove("landing"); - body.classList.add("dashboard"); + const body = document.getElementsByTagName('body')[0]; + body.classList.remove('top_bar_active'); // remove the class + body.classList.remove('page_heading_active'); + body.classList.remove('landing'); + body.classList.add('dashboard'); } getMetrics() { @@ -90,7 +90,7 @@ export class MetricsShowComponent implements OnInit { getViewsUrl () { - let encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly views","type":"line","query":{"name":"usagestats.views.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly views"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); + const encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly views","type":"line","query":{"name":"usagestats.views.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly views"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); this.viewsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`${this.repoMetrics.diagramsBaseURL}chart?json=${encodedURL}`); // this.viewsUrl = this.sanitizer.bypassSecurityTrustResourceUrl( @@ -112,7 +112,7 @@ export class MetricsShowComponent implements OnInit { getDownloadsUrl () { - let encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly downloads","type":"line","query":{"name":"usagestats.downloads.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly downloads"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); + const encodedURL = encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly downloads","type":"line","query":{"name":"usagestats.downloads.monthly", "parameters":["' + this.piwik.openaireId + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":""},"subtitle":{},"yAxis":{"title":{"text":"Monthly downloads"}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); this.downloadsUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`${this.repoMetrics.diagramsBaseURL}chart?json=${encodedURL}`); // this.downloadsUrl = this.sanitizer.bypassSecurityTrustResourceUrl( diff --git a/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts b/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts index 0e9a632f3..c54d30312 100755 --- a/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts +++ b/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts @@ -68,7 +68,7 @@ export class MetricsUsagestatsReportComponent implements OnInit { if (this.repo.issn && this.repo.issn !== 'null') { this.shownRepoId = this.repo.issn.slice(0, 4) + '-' + this.repo.issn.toString().slice(4); } - this.title = `${this.chosen_report} report for ${this.repo.officialName}`; + this.title = `${this.chosen_report} report for ${this.repo.officialname}`; } getParams() { diff --git a/src/app/pages/repository/metrics/metrics-usagestats.component.html b/src/app/pages/repository/metrics/metrics-usagestats.component.html index 240862c38..6fa530e35 100755 --- a/src/app/pages/repository/metrics/metrics-usagestats.component.html +++ b/src/app/pages/repository/metrics/metrics-usagestats.component.html @@ -89,7 +89,7 @@
-
+
diff --git a/src/app/pages/repository/metrics/metrics-usagestats.component.ts b/src/app/pages/repository/metrics/metrics-usagestats.component.ts index 9ae1d8595..c9bc243e7 100755 --- a/src/app/pages/repository/metrics/metrics-usagestats.component.ts +++ b/src/app/pages/repository/metrics/metrics-usagestats.component.ts @@ -27,13 +27,13 @@ export class MetricsUsagestatsComponent implements OnInit { if(this.sharedService.getRepository()) { this.repo = this.sharedService.getRepository(); - this.title = this.title + ' for ' + this.repo.officialName; + this.title = this.title + ' for ' + this.repo.officialname; } this.sharedService.repository$.subscribe( r => { this.repo = r; - this.title = this.title + ' for ' + this.repo.officialName; + this.title = this.title + ' for ' + this.repo.officialname; } ); diff --git a/src/app/pages/repository/repository.component.html b/src/app/pages/repository/repository.component.html index 20cd8d17b..97b8ab5e4 100644 --- a/src/app/pages/repository/repository.component.html +++ b/src/app/pages/repository/repository.component.html @@ -15,9 +15,9 @@

- - - {{ repository.officialName }} + + + {{ repository.officialname }}

diff --git a/src/app/pages/repository/update/sources-update-repo.component.ts b/src/app/pages/repository/update/sources-update-repo.component.ts index f1f50d2d5..0a01af3df 100755 --- a/src/app/pages/repository/update/sources-update-repo.component.ts +++ b/src/app/pages/repository/update/sources-update-repo.component.ts @@ -61,7 +61,7 @@ export class SourcesUpdateRepoComponent implements OnInit { } else if (this.repo.id.includes('aggregator')) { this.mode = 'aggregator'; } - this.logoURL = this.repo.logoUrl; + this.logoURL = this.repo.logourl; this.getRepoInterfaces(); } @@ -69,7 +69,7 @@ export class SourcesUpdateRepoComponent implements OnInit { r => { this.repo = r; if (this.repo) { - this.logoURL = this.repo.logoUrl; + this.logoURL = this.repo.logourl; this.getRepoInterfaces(); } } @@ -145,9 +145,9 @@ export class SourcesUpdateRepoComponent implements OnInit { false, i, { id: this.repo.id, - datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, - registeredBy: this.repo.registeredBy + datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, + registeredBy: this.repo.registeredby }, this.repoInterfaces[i] ]); @@ -157,9 +157,9 @@ export class SourcesUpdateRepoComponent implements OnInit { false, 0, { id: this.repo.id, - datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, - registeredBy: this.repo.registeredBy + datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, + registeredBy: this.repo.registeredby } ]); } @@ -168,8 +168,8 @@ export class SourcesUpdateRepoComponent implements OnInit { addInterfaceToList(intrf?: RepositoryInterface) { const curIndex = this.dataForInterfaceComp.length; const curRepoInfo = { - id: this.repo.id, datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy + id: this.repo.id, datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby }; if (intrf) { this.dataForInterfaceComp.push([false, curIndex, curRepoInfo, intrf]); @@ -204,7 +204,7 @@ export class SourcesUpdateRepoComponent implements OnInit { } updatedLogoUrl(event: any) { - this.repo.logoUrl = this.logoURL; + this.repo.logourl = this.logoURL; this.datasourceUpdateForm.updateGroup.get('logoUrl').setValue(this.logoURL); this.datasourceUpdateForm.updateRepo(); diff --git a/src/app/pages/sources/sources-register.component.html b/src/app/pages/sources/sources-register.component.html index ded528dfc..e832cf5fd 100755 --- a/src/app/pages/sources/sources-register.component.html +++ b/src/app/pages/sources/sources-register.component.html @@ -22,45 +22,21 @@
- +
-

Literature repository

- -
-

Make sure your repository is already registered in OpenDOAR, the - authoritative directory of institutional and thematic OA repositories, and is compatible with the - OpenAIRE Guidelines for Literature Repositories.

- - List provided by
- OpenDOAR -
-
- -
-
-
- -
-
- -
-
- -
-

Data repository

- -
-

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.

- - List provided by -
- Re3data -
+

Repository

+
+

Make sure your repository is already registered in one of the following global registries - + OpenDOAR (for Literature Repositories), + Re3data or + FAIRsharing + (for Data Repositories) - and is compatible with the + OpenAIRE Guidelines. +
For any questions please contact the OpenAIRE helpdesk. +

@@ -85,10 +61,6 @@
-
- -
-
@@ -108,6 +80,10 @@
+
+ +
+
@@ -154,23 +130,6 @@
-
-
- -
-
- -
-

CRIS systems

-
-

Stay tuned.

-
-
-
-
-
-
diff --git a/src/app/pages/sources/sources-register.component.ts b/src/app/pages/sources/sources-register.component.ts index 448b2ce77..c37791100 100755 --- a/src/app/pages/sources/sources-register.component.ts +++ b/src/app/pages/sources/sources-register.component.ts @@ -20,7 +20,7 @@ export class SourcesRegisterComponent implements OnInit { // fixme still when I click the link inside the text in overlay, this event happens as well (I go to the first step of the wizard) goTo(datasourceType: string) { - if (datasourceType === 'literature') { + if (datasourceType === 'repository') { this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`); } else if (datasourceType === 'data') { this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`); diff --git a/src/app/pages/sources/sources-register/register-datasource-select-existing.component.html b/src/app/pages/sources/sources-register/register-datasource-select-existing.component.html index c2fe038bc..24e2ab6e7 100755 --- a/src/app/pages/sources/sources-register/register-datasource-select-existing.component.html +++ b/src/app/pages/sources/sources-register/register-datasource-select-existing.component.html @@ -5,17 +5,39 @@ {{ alertMessage }}
- Please make sure your {{mode === 'cris' ? 'Research Information System': 'repository'}} is registered in - - {{ sourceTitle }} - - -
euroCRIS DRIS -
- .
- - Last Updated: {{ latestUpdate }} - + + + Please make sure your repository is registered in OpenDOAR, + Re3data or FAIRsharing. + +
Last Updated (OpenDOAR): {{ opendoarlatestUpdate }} +
+ +
Last Updated (Re3data): {{ re3datalatestUpdate }} +
+ +
Last Updated (FAIRsharing): {{ fairsharinglatestUpdate }} +
+
+ + + Please make sure your Research Information System is registered in euroCRIS. +
euroCRIS DRIS
+ +
Last Updated: {{ latestUpdate }} +
+
+ + + + + + + + + + +
diff --git a/src/app/pages/sources/sources-register/register-datasource-select-existing.component.ts b/src/app/pages/sources/sources-register/register-datasource-select-existing.component.ts index 0dac0b5ce..4e9ce1b89 100755 --- a/src/app/pages/sources/sources-register/register-datasource-select-existing.component.ts +++ b/src/app/pages/sources/sources-register/register-datasource-select-existing.component.ts @@ -28,6 +28,9 @@ export class RegisterDatasourceSelectExistingComponent implements OnInit { sourceUrl: string; sourceTitle: string; latestUpdate: string; + opendoarlatestUpdate: string; + re3datalatestUpdate: string; + fairsharinglatestUpdate: string; @Input() mode: string; @@ -44,7 +47,7 @@ export class RegisterDatasourceSelectExistingComponent implements OnInit { this.hasSelectedCountry = false; } - setUpSourceInfo() { + setUpSourceInfo() { // deprecated? if (this.mode === 'opendoar') { this.sourceUrl = 'http://v2.sherpa.ac.uk/opendoar/'; this.sourceTitle = 'OpenDOAR'; @@ -126,8 +129,15 @@ export class RegisterDatasourceSelectExistingComponent implements OnInit { } getLatestUpdate() { - return this.repoService.getListLatestUpdate(this.mode).subscribe ( - responseDate => this.latestUpdate = responseDate['lastCollectionDate'], + return this.repoService.getListLatestUpdate(this.mode).subscribe( + responseDate => { + if (this.mode === 'cris') { this.latestUpdate = responseDate['lastCollectionDate']; } + if (this.mode === 'repository') { + this.opendoarlatestUpdate = responseDate['opendoar']; + this.re3datalatestUpdate = responseDate['re3data']; + this.fairsharinglatestUpdate = responseDate['fairsharing']; + } + }, error => console.log(error) ); } diff --git a/src/app/pages/sources/sources-register/register-existing-datasource.component.ts b/src/app/pages/sources/sources-register/register-existing-datasource.component.ts index 336ce7465..34811c8bd 100644 --- a/src/app/pages/sources/sources-register/register-existing-datasource.component.ts +++ b/src/app/pages/sources/sources-register/register-existing-datasource.component.ts @@ -164,12 +164,9 @@ export class RegisterExistingDatasourceComponent implements OnInit { } addInterfaceToList(intrf?: RepositoryInterface) { - - console.log('clicked add interface to list'); - const curIndex = this.dataForInterfaceComp.length; - const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy }; + const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby }; if (intrf) { this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]); } else { @@ -185,7 +182,7 @@ export class RegisterExistingDatasourceComponent implements OnInit { } tempArray.splice(i, 1); this.dataForInterfaceComp = tempArray; - console.log(JSON.stringify(this.dataForInterfaceComp)); + // console.log(JSON.stringify(this.dataForInterfaceComp)); } getInterfaces() { @@ -224,9 +221,9 @@ export class RegisterExistingDatasourceComponent implements OnInit { this.dataForInterfaceComp.push([ true, i, { id: this.repo.id, - datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, - registeredBy: this.repo.registeredBy + datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, + registeredBy: this.repo.registeredby }, this.repoInterfaces[i] ]); @@ -235,9 +232,9 @@ export class RegisterExistingDatasourceComponent implements OnInit { this.dataForInterfaceComp.push([ true, 0, { id: this.repo.id, - datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, - registeredBy: this.repo.registeredBy + datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, + registeredBy: this.repo.registeredby } ]); } @@ -299,7 +296,7 @@ export class RegisterExistingDatasourceComponent implements OnInit { return 0; } }); - console.log(`the number of interfaces is ${this.repoInterfaces.length}`); + // console.log(`the number of interfaces is ${this.repoInterfaces.length}`); }, error => { console.log(error); @@ -316,7 +313,7 @@ export class RegisterExistingDatasourceComponent implements OnInit { ); } - //recheck if needed + // recheck if needed getTerms(repo: Repository) { this.repo = repo; } @@ -331,9 +328,9 @@ export class RegisterExistingDatasourceComponent implements OnInit { this.loadingMessage = 'Saving changes'; this.errorMessage = ''; console.log('reg this.repo', this.repo); - this.repoService.addRepository( this.repo.datasourceType, this.repo).subscribe( + this.repoService.addRepository( this.repo.eoscDatasourceType, this.repo).subscribe( //this.repo.collectedfrom response => { - console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`); + console.log(`addRepository responded: ${response.id}, ${response.registeredby}`); this.repo = response; }, error => { @@ -356,15 +353,15 @@ export class RegisterExistingDatasourceComponent implements OnInit { if (intrf.id) { let req; if (this.interfacesToDelete.some(id => id === intrf.id)) { - req = this.repoService.deleteInterface(intrf.id, this.repo.registeredBy); + req = this.repoService.deleteInterface(intrf.id, this.repo.registeredby); } else { // console.log('comments', intrf.comments); - req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf); + req = this.repoService.updateInterface(this.repo.id, this.repo.registeredby, intrf.comments, intrf); } return req; } else { // console.log('comments', intrf.comments); - return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf); + return this.repoService.addInterface(this.repo.eoscDatasourceType, this.repo.id, this.repo.registeredby, intrf.comments, intrf); } }) ).subscribe( diff --git a/src/app/pages/sources/sources-register/register-new-datasource.component.ts b/src/app/pages/sources/sources-register/register-new-datasource.component.ts index 40153ae68..c96f8fd15 100644 --- a/src/app/pages/sources/sources-register/register-new-datasource.component.ts +++ b/src/app/pages/sources/sources-register/register-new-datasource.component.ts @@ -137,8 +137,8 @@ export class RegisterNewDatasourceComponent implements OnInit { addInterfaceToList(intrf?: RepositoryInterface) { const curIndex = this.dataForInterfaceComp.length; - const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy }; + const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby }; if (intrf) { this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]); } else { @@ -180,9 +180,9 @@ export class RegisterNewDatasourceComponent implements OnInit { this.dataForInterfaceComp.push([ true, i, { id: this.repo.id, - datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, - registeredBy: this.repo.registeredBy + datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, + registeredBy: this.repo.registeredby }, this.repoInterfaces[i] ]); @@ -191,9 +191,9 @@ export class RegisterNewDatasourceComponent implements OnInit { this.dataForInterfaceComp.push([ true, 0, { id: this.repo.id, - datasourceType: this.repo.datasourceType, - datasourceClass: this.repo.datasourceClass, - registeredBy: this.repo.registeredBy + datasourceType: this.repo.eoscDatasourceType, + datasourceClass: this.repo.eoscDatasourceType, + registeredBy: this.repo.registeredby } ]); } @@ -223,9 +223,9 @@ export class RegisterNewDatasourceComponent implements OnInit { this.loadingMessage = 'Saving changes'; this.errorMessage = ''; console.log('add this.repo', this.repo); - this.repoService.addRepository(this.repo.datasourceType, this.repo).subscribe( + this.repoService.addRepository(this.repo.eoscDatasourceType, this.repo).subscribe( response => { - console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`); + console.log(`addRepository responded: ${response.id}, ${response.registeredby}`); this.repo = response; }, error => { @@ -246,10 +246,10 @@ export class RegisterNewDatasourceComponent implements OnInit { concatMap(intrf => { if (intrf.id) { // console.log('comments', intrf.comments); - return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf); + return this.repoService.updateInterface(this.repo.id, this.repo.registeredby, intrf.comments, intrf); } else { // console.log('comments', intrf.comments); - return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf); + return this.repoService.addInterface(this.repo.eoscDatasourceType, this.repo.id, this.repo.registeredby, intrf.comments, intrf); } }) ).subscribe( diff --git a/src/app/pages/sources/sources-register/sr-data.component.ts b/src/app/pages/sources/sources-register/sr-data.component.ts deleted file mode 100755 index 1d26cd40a..000000000 --- a/src/app/pages/sources/sources-register/sr-data.component.ts +++ /dev/null @@ -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(); - } - -} diff --git a/src/app/pages/sources/sources-register/sr-literature.component.ts b/src/app/pages/sources/sources-register/sr-repository.component.ts old mode 100755 new mode 100644 similarity index 60% rename from src/app/pages/sources/sources-register/sr-literature.component.ts rename to src/app/pages/sources/sources-register/sr-repository.component.ts index 73ade842d..2f479d873 --- a/src/app/pages/sources/sources-register/sr-literature.component.ts +++ b/src/app/pages/sources/sources-register/sr-repository.component.ts @@ -1,19 +1,19 @@ /* -* updated by myrto on 19/12/2018 +* created by andreas on 4/7/2022 */ import { Component, OnInit } from '@angular/core'; import { RegisterExistingDatasourceComponent } from './register-existing-datasource.component'; @Component ({ - selector: 'app-sr-literature', + selector: 'app-sr-repository', templateUrl: './register-existing-datasource.component.html' }) -export class SrLiteratureComponent extends RegisterExistingDatasourceComponent implements OnInit { +export class SrRepositoryComponent extends RegisterExistingDatasourceComponent implements OnInit { ngOnInit() { - this.datasourceType = 'literature'; - this.currentMode = 'opendoar'; + this.datasourceType = 'repository'; + this.currentMode = 'repository'; super.ngOnInit(); } diff --git a/src/app/pages/sources/sources.module.ts b/src/app/pages/sources/sources.module.ts index c07abcd24..0ca8858ab 100755 --- a/src/app/pages/sources/sources.module.ts +++ b/src/app/pages/sources/sources.module.ts @@ -4,11 +4,9 @@ import { SourcesComponent } from './sources.component'; import { SourcesRegisterComponent } from './sources-register.component'; import { CommonModule } from '@angular/common'; import { TabsModule } from 'ngx-bootstrap'; -import { SrLiteratureComponent } from './sources-register/sr-literature.component'; import { ReusableComponentsModule } from '../../shared/reusablecomponents/reusable-components.module'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RepoFilter } from './sourcesPipes'; -import { SrDataComponent } from './sources-register/sr-data.component'; import { RegisterDatasourceSelectExistingComponent } from './sources-register/register-datasource-select-existing.component'; import { SrJournalComponent } from './sources-register/sr-journal.component'; import { SrAggregatorComponent } from './sources-register/sr-aggregator.component'; @@ -16,6 +14,7 @@ import { RegisterNewDatasourceComponent } from './sources-register/register-new- import { RegisterExistingDatasourceComponent } from './sources-register/register-existing-datasource.component'; import { DatasourceUpdateTermsFormComponent } from '../../shared/reusablecomponents/sources-forms/datasource-update-terms-form.component'; import {SrCrisComponent} from './sources-register/sr-cris.component'; +import {SrRepositoryComponent} from './sources-register/sr-repository.component'; @NgModule ({ imports: [ @@ -34,8 +33,7 @@ import {SrCrisComponent} from './sources-register/sr-cris.component'; SourcesRegisterComponent, RegisterNewDatasourceComponent, RegisterExistingDatasourceComponent, - SrLiteratureComponent, - SrDataComponent, + SrRepositoryComponent, SrJournalComponent, SrAggregatorComponent, SrCrisComponent, diff --git a/src/app/pages/sources/sources.routing.ts b/src/app/pages/sources/sources.routing.ts index ee0af3b7a..b2e191a9a 100755 --- a/src/app/pages/sources/sources.routing.ts +++ b/src/app/pages/sources/sources.routing.ts @@ -1,11 +1,10 @@ import { RouterModule, Routes } from '@angular/router'; import { NgModule } from '@angular/core'; import { SourcesRegisterComponent } from './sources-register.component'; -import { SrLiteratureComponent } from './sources-register/sr-literature.component'; -import { SrDataComponent } from './sources-register/sr-data.component'; import { SrJournalComponent } from './sources-register/sr-journal.component'; import { SrAggregatorComponent } from './sources-register/sr-aggregator.component'; import {SrCrisComponent} from './sources-register/sr-cris.component'; +import {SrRepositoryComponent} from './sources-register/sr-repository.component'; const sourcesRoutes: Routes = [ { @@ -20,12 +19,8 @@ const sourcesRoutes: Routes = [ component: SourcesRegisterComponent }, { - path: 'literature', - component: SrLiteratureComponent - }, - { - path: 'data', - component: SrDataComponent + path: 'repository', + component: SrRepositoryComponent }, { path: 'journal', diff --git a/src/app/services/repository.service.ts b/src/app/services/repository.service.ts index d3a52c4e8..99b1a031b 100755 --- a/src/app/services/repository.service.ts +++ b/src/app/services/repository.service.ts @@ -47,6 +47,7 @@ export class RepositoryService { updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable { let url; + console.log(comment); if (comment == null || comment === '') { url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}`; } else { @@ -161,7 +162,7 @@ export class RepositoryService { return this.httpClient.get>(url, headerOptions); } - getDatasourceClasses(mode: string): Observable> { + getDatasourceClasses(mode: string): Observable { const url = `${this.apiUrl}getDatasourceClasses/${mode}`; console.log(`knocking on: ${url}`); return this.httpClient.get>(url, headerOptions); diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.html b/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.html index e30de2c37..c7aa08463 100755 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.html +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.html @@ -57,7 +57,7 @@ Issn needs to be of the form: "1111-1111" or "1111-111X" + 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" @@ -71,7 +71,7 @@ Eissn needs to be of the form: "1111-1111" or "1111-111X" + 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" @@ -85,7 +85,7 @@ Lissn needs to be of the form: "1111-1111" or "1111-111X" + 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" @@ -111,7 +111,7 @@ @@ -277,7 +277,7 @@ diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts b/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts index 958f723e7..c8e212411 100755 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts @@ -41,6 +41,7 @@ export class DatasourceCreateFormComponent implements OnInit { countries: Country[] = []; datasourceClasses: Map = new Map(); classCodes: string[] = []; + // classCodes: string[] = []; @Input() mode: string; @@ -57,9 +58,9 @@ export class DatasourceCreateFormComponent implements OnInit { softwarePlatform : ['', Validators.required], platformName : '', officialName : ['', Validators.required], - issn : ['', [Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')] ], - eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], - lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], + issn : ['', [Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')] ], + eissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ], + lissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ], repoDescription : ['', Validators.required], country : ['', Validators.required], longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ], @@ -110,7 +111,7 @@ export class DatasourceCreateFormComponent implements OnInit { this.group = this.fb.group(this.groupDefinition); if (this.mode === 'journal') { this.group.get('issn').clearValidators(); - this.group.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]); + this.group.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]); } this.getTypologies(); this.getTimezones(); @@ -124,29 +125,29 @@ export class DatasourceCreateFormComponent implements OnInit { setupForm() { if (this.selectedRepo) { - console.log(`my datasource type is: ${this.selectedRepo.datasourceType}`); + console.log(`my datasource type is: ${this?.selectedRepo?.eoscDatasourceType}`); this.group.setValue({ - softwarePlatform: this.selectedRepo.typology, + softwarePlatform: this.selectedRepo.platform, platformName: '', - officialName: this.selectedRepo.officialName, + officialName: this.selectedRepo.officialname, issn: '', eissn: '', lissn: '', repoDescription: this.selectedRepo.description, - country: this.selectedRepo.countryCode, + country: this.selectedRepo.organizations[0].country, // countryCode longtitude: this.selectedRepo.longitude, latitude: this.selectedRepo.latitude, - websiteUrl: this.selectedRepo.websiteUrl, - institutionName: this.selectedRepo.organization, - englishName: this.selectedRepo.englishName, - logoUrl: this.selectedRepo.logoUrl, + websiteUrl: this.selectedRepo.websiteurl, + institutionName: this.selectedRepo.organizations[0].legalname, + englishName: this.selectedRepo.englishname, + logoUrl: this.selectedRepo.logourl, timezone: this.selectedRepo.timezone, - datasourceType: this.selectedRepo.datasourceClass, - adminEmail: this.selectedRepo.contactEmail + datasourceType: this.selectedRepo.eoscDatasourceType, // TODO: still needed? + adminEmail: this.selectedRepo.contactemail }); - if (this.selectedRepo.datasourceType === 'journal') { + if (this.selectedRepo.eoscDatasourceType === 'Journal archive') { let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4); this.group.get('issn').setValue(ssnToShow); @@ -185,15 +186,17 @@ export class DatasourceCreateFormComponent implements OnInit { getDatasourceClasses() { this.repoService.getDatasourceClasses(this.mode).subscribe( - classes => this.datasourceClasses = classes, + classes => { + for (const [key, value] of Object.entries(classes)) { + this.datasourceClasses.set(key, value); + } + }, error => { this.errorMessage = noServiceMessage; console.log(error); }, () => { - for (const key of Object.keys(this.datasourceClasses)) { - this.classCodes.push(key); - } + this.classCodes = Array.from(this.datasourceClasses.keys()); } ); } @@ -227,25 +230,32 @@ export class DatasourceCreateFormComponent implements OnInit { } createNewRepository(): Repository { - const newRepo: Repository = new Repository(); - newRepo.officialName = this.group.get('officialName').value.toString(); - newRepo.englishName = this.group.get('englishName').value.toString(); - newRepo.websiteUrl = this.group.get('websiteUrl').value; - newRepo.logoUrl = this.group.get('logoUrl').value; - newRepo.contactEmail = this.group.get('adminEmail').value; - newRepo.countryName = this.countries.filter(x => x.code === this.group.get('country').value)[0].name; - newRepo.countryCode = this.group.get('country').value; - newRepo.organization = this.group.get('institutionName').value.toString(); + const newRepo = new Repository(); + newRepo.officialname = this.group.get('officialName').value.toString(); + newRepo.englishname = this.group.get('englishName').value.toString(); + newRepo.websiteurl = this.group.get('websiteUrl').value; + newRepo.logourl = this.group.get('logoUrl').value; + newRepo.contactemail = this.group.get('adminEmail').value; + newRepo.organizations.push({ + legalshortname: null, + legalname: this.group.get('institutionName').value.toString(), + websiteurl: null, + logourl: null, + country: this.group.get('country').value + }); newRepo.latitude = this.group.get('latitude').value; newRepo.longitude = this.group.get('longtitude').value; newRepo.timezone = this.group.get('timezone').value; - newRepo.datasourceClass = this.group.get('datasourceType').value; - if (this.group.get('softwarePlatform').value ) { - newRepo.typology = this.group.get('softwarePlatform').value; + if (this.group.get('softwarePlatform').value !== '') { + console.log('1//', this.group.get('softwarePlatform').value); + newRepo.platform = this.group.get('softwarePlatform').value; } else if (this.group.get('platformName').value) { - newRepo.typology = this.group.get('platformName').value; + newRepo.platform = this.group.get('platformName').value; + console.log('2//', this.group.get('platformName').value); } - // newRepo.typology = this.group.get('softwarePlatform').value; + newRepo.typology = this.group.get('datasourceType').value; + // newRepo.eoscDatasourceType = this.datasourceClasses.get(this.group.get('datasourceType').value); + // console.warn(newRepo.eoscDatasourceType); newRepo.description = this.group.get('repoDescription').value.toString(); newRepo.issn = ''; newRepo.eissn = ''; @@ -267,14 +277,17 @@ export class DatasourceCreateFormComponent implements OnInit { } } - newRepo.registeredBy = this.authService.getUserEmail(); + newRepo.registeredby = this.authService.getUserEmail(); /* THE BELOW FIELDS ARE NOT SET IN GWT CODE*/ - newRepo.datasourceType = this.mode; - newRepo.dateOfCreation = new Date(Date.now()); // NOT NEEDED ?? - newRepo.registered = true; - newRepo.registrationDate = new Date(Date.now()); // NOT NEEDED ?? + newRepo.eoscDatasourceType = this.mode; // TODO: delete this? + console.warn(newRepo.eoscDatasourceType); + newRepo.managed = true; + const now = new Date(Date.now()); + newRepo.consentTermsOfUseDate = now; + newRepo.lastConsentTermsOfUseDate = now; + newRepo.registrationdate = now; return newRepo; } diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html index 8df46e226..c9b009ce3 100644 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html @@ -29,22 +29,22 @@
{{ errorMessage }}
-
- +
+ Identified - +
- + - + diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts index 37dc622e6..cb0534d92 100644 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { baseUrlDesc, compatibilityLevelDesc, customValSetDesc, Description, existingValSetDesc, commentDesc } from '../../../domain/oa-description'; -import { InterfaceInformation, RepositoryInterface } from '../../../domain/typeScriptClasses'; +import {ApiParamDetails, InterfaceInformation, RepositoryInterface} from '../../../domain/typeScriptClasses'; import { ValidatorService } from '../../../services/validator.service'; import { RepositoryService } from '../../../services/repository.service'; import { formErrorWasntSaved, formInfoLoading, formSubmitting, formSuccessAddedInterface, formSuccessUpdatedInterface, invalidCustomBaseUrl, @@ -37,7 +37,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { repoInterfaceForm: FormGroup; readonly repoInterfaceFormDef = { - baseUrl: ['', Validators.required], + baseurl: ['', Validators.required], selectValidationSet: [''], customValidationSet: [''], compatibilityLevel: [''], @@ -71,8 +71,8 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { this.chooseValSet(true); if (this.data[3]) { this.currentInterface = this.data[3]; - this.repoInterfaceForm.get('baseUrl').setValue(this.currentInterface.baseUrl); - this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.desiredCompatibilityLevel); + this.repoInterfaceForm.get('baseurl').setValue(this.currentInterface.baseurl); + this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.compatibilityOverride); } this.getInterfaceInfo(); this.getCompatibilityClasses(); @@ -84,10 +84,10 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { this.successMessage = ''; this.errorMessage = ''; - const baseUrl = this.repoInterfaceForm.get('baseUrl').value; - if (baseUrl) { + const baseurl = this.repoInterfaceForm.get('baseurl').value; + if (baseurl) { this.loadingMessage = formInfoLoading; - this.valService.getInterfaceInformation(baseUrl).subscribe( + this.valService.getInterfaceInformation(baseurl).subscribe( info => { this.interfaceInfo = info; if (this.interfaceInfo.identified) { @@ -95,12 +95,12 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { this.showIdentifiedBaseUrl = true; } else { this.errorMessage = invalidCustomBaseUrl; - this.identifiedBaseUrl = true; // pass interface without baseUrl identification + this.identifiedBaseUrl = true; // pass interface without baseurl identification this.showIdentifiedBaseUrl = false; } if (this.interfaceInfo.sets) { this.valsetList = this.interfaceInfo.sets; - console.log(this.valsetList); + // console.log(this.valsetList); } }, error => { @@ -110,11 +110,11 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { this.errorMessage = noServiceMessage; }, () => { - if ( this.currentInterface && this.currentInterface.accessParams && this.currentInterface.accessParams['set'] ) { - if ( this.valsetList.some( x => x === this.currentInterface.accessParams['set']) ) { - this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.accessParams['set']); + if ( this.currentInterface && this.currentInterface.apiParams && this.currentInterface.apiParams.find(entry => entry.param === 'set')) { + if ( this.valsetList.some( x => x === this.currentInterface.apiParams['set']) ) { + this.repoInterfaceForm.get('selectValidationSet').setValue(this.currentInterface.apiParams.find(entry => entry.param === 'set').value); } else { - this.repoInterfaceForm.get('customValidationSet').setValue(this.currentInterface.accessParams['set']); + this.repoInterfaceForm.get('customValidationSet').setValue(this.currentInterface.apiParams.find(entry => entry.param === 'set').value); } } this.loadingMessage = ''; @@ -148,12 +148,12 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { getExistingCompatibilityLevel() { if (this.currentInterface) { - if (this.currentInterface.desiredCompatibilityLevel && - this.classCodes.some( x => x === this.currentInterface.desiredCompatibilityLevel ) ) { - this.existingCompLevel = this.compClasses[this.currentInterface.desiredCompatibilityLevel]; + if (this.currentInterface.compatibilityOverride && + this.classCodes.some( x => x === this.currentInterface.compatibilityOverride ) ) { + this.existingCompLevel = this.compClasses[this.currentInterface.compatibilityOverride]; } else { this.repoInterfaceForm.get('compatibilityLevel').setValue(''); - this.existingCompLevel = this.currentInterface.desiredCompatibilityLevel; + this.existingCompLevel = this.currentInterface.compatibilityOverride; } } } @@ -199,7 +199,7 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { this.errorMessage = ''; this.successMessage = ''; if (this.formIsValid()) { - const baseUrl = this.repoInterfaceForm.get('baseUrl').value; + const baseurl = this.repoInterfaceForm.get('baseurl').value; let valset = ''; if (this.existingValSet) { valset = this.repoInterfaceForm.get('selectValidationSet').value; @@ -220,9 +220,9 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { } if (this.currentInterface) { - this.updateCurrent(baseUrl, valset, compLvl, comment); + this.updateCurrent(baseurl, valset, compLvl, comment); } else { - this.addCurrent(baseUrl, valset, compLvl, comment); + this.addCurrent(baseurl, valset, compLvl, comment); } } else { this.interfaceToExport = null; @@ -231,37 +231,43 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { } getCurrentValues() { + console.log('getcurrentvalues'); let intrf = this.currentInterface; if (intrf == null) { intrf = new RepositoryInterface(); } - intrf.baseUrl = this.repoInterfaceForm.get('baseUrl').value; - if (this.existingValSet) { - intrf.accessSet = this.repoInterfaceForm.get('selectValidationSet').value; - intrf.accessParams = {'set': this.repoInterfaceForm.get('selectValidationSet').value}; - } else { - intrf.accessSet = this.repoInterfaceForm.get('customValidationSet').value; - intrf.accessParams = {'set': this.repoInterfaceForm.get('customValidationSet').value}; - } + intrf.baseurl = this.repoInterfaceForm.get('baseurl').value; + this.updateValidationSet(intrf, this.repoInterfaceForm.get(this.existingValSet ? 'selectValidationSet' : 'customValidationSet').value); + console.log(intrf); if (this.repoInterfaceForm.get('compatibilityLevel').value) { - intrf.desiredCompatibilityLevel = this.repoInterfaceForm.get('compatibilityLevel').value; - intrf.compliance = this.repoInterfaceForm.get('compatibilityLevel').value; + intrf.compatibilityOverride = this.repoInterfaceForm.get('compatibilityLevel').value; + intrf.compatibility = this.repoInterfaceForm.get('compatibilityLevel').value; } else { - intrf.desiredCompatibilityLevel = this.existingCompLevel; - intrf.compliance = this.existingCompLevel; + intrf.compatibilityOverride = this.existingCompLevel; + intrf.compatibility = this.existingCompLevel; } intrf.typology = this.currentRepo.datasourceClass; return intrf; } - addCurrent (baseUrl: string, valset: string, compLvl: string, comment: string) { + updateValidationSet(intrf: RepositoryInterface, value: string) { + let validationSet = intrf.apiParams.find(element => element.param === 'set'); + if (!validationSet) { + validationSet = new ApiParamDetails('set', value); + intrf.apiParams.push(validationSet); + } else { + validationSet.value = this.repoInterfaceForm.get(this.existingValSet ? 'selectValidationSet' : 'customValidationSet').value; + } + } + + addCurrent (baseurl: string, valset: string, compLvl: string, comment: string) { + console.log('add current'); const currentInterface = new RepositoryInterface(); - currentInterface.baseUrl = baseUrl; - currentInterface.accessSet = valset; - currentInterface.accessParams = {'set': valset}; - currentInterface.desiredCompatibilityLevel = compLvl; - currentInterface.compliance = compLvl; + this.updateValidationSet(currentInterface, valset); + currentInterface.baseurl = baseurl; + currentInterface.compatibilityOverride = compLvl; + currentInterface.compatibility = compLvl; currentInterface.typology = this.currentRepo.datasourceClass; currentInterface.comments = comment; @@ -304,13 +310,12 @@ export class DatasourceNewInterfaceFormComponent implements OnInit { } - - updateCurrent (baseUrl: string, valset: string, compLvl: string, comment: string) { - this.currentInterface.baseUrl = baseUrl; - this.currentInterface.accessSet = valset; - this.currentInterface.accessParams['set'] = valset; - this.currentInterface.desiredCompatibilityLevel = compLvl; - this.currentInterface.compliance = compLvl; + updateCurrent (baseurl: string, valset: string, compLvl: string, comment: string) { + console.log('update current'); + this.updateValidationSet(this.currentInterface, valset); + this.currentInterface.baseurl = baseurl; + this.currentInterface.compatibilityOverride = compLvl; + this.currentInterface.compatibility = compLvl; this.currentInterface.typology = this.currentRepo.datasourceClass; this.currentInterface.comments = comment; diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.html b/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.html index 1f09bf712..4d77e3867 100755 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.html +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.html @@ -12,15 +12,20 @@ Basic information
-
+
The following fields are completed by OpenDOAR.
If you want to edit them, you can do it by using this - OpenDOAR link + OpenDOAR link.
-
+
The following fields are completed by Re3data.
If you want to edit them, you can do it by using this - Re3data link + Re3data link. +
+
+ The following fields are completed by FAIRsharing.
+ If you want to edit them, you can do it by using this + FAIRsharing link.
@@ -59,14 +64,14 @@
-
+
-
+
Issn needs to be of the form: "1111-1111" or "1111-111X" + 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" @@ -80,7 +85,7 @@ Eissn needs to be of the form: "1111-1111" or "1111-111X" + 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" @@ -94,7 +99,7 @@ Lissn needs to be of the form: "1111-1111" or "1111-111X" + 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" @@ -120,7 +125,7 @@
@@ -217,7 +222,7 @@
@@ -244,4 +249,4 @@
- +
{{updateGroup.value|json}}
diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts b/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts index 6429f29da..dc7f997a2 100755 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts @@ -43,9 +43,9 @@ export class DatasourceUpdateFormComponent implements OnInit { softwarePlatform : '', platformName : '', officialName : ['', Validators.required], - issn : ['', [Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')] ], - eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], - lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], + issn : ['', [Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')] ], + eissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ], + lissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ], repoDescription : ['', Validators.required], country : '', longtitude : '', @@ -101,30 +101,37 @@ export class DatasourceUpdateFormComponent implements OnInit { setupUpdateForm() { if (this.selectedRepo) { - +console.log(this.mode); this.updateGroup.setValue({ - softwarePlatform: this.selectedRepo.typology, + softwarePlatform: this.selectedRepo.platform, platformName: '', - officialName: this.selectedRepo.officialName, + officialName: this.selectedRepo.officialname, issn: '', eissn: '', lissn: '', repoDescription: this.selectedRepo.description, - country: this.selectedRepo.countryCode, + country: this.selectedRepo.organizations[0].country, // countryCode longtitude: this.selectedRepo.longitude, latitude: this.selectedRepo.latitude, - websiteUrl: this.selectedRepo.websiteUrl, - institutionName: this.selectedRepo.organization, - englishName: this.selectedRepo.englishName, - logoUrl: this.selectedRepo.logoUrl, + websiteUrl: this.selectedRepo.websiteurl, + institutionName: this.selectedRepo.organizations[0].legalname, + englishName: this.selectedRepo.englishname, + logoUrl: this.selectedRepo.logourl, timezone: this.selectedRepo.timezone, - datasourceType: this.selectedRepo.datasourceClass, - adminEmail: this.selectedRepo.contactEmail + datasourceType: this.selectedRepo.typology, // TODO: rename to typology? + adminEmail: this.selectedRepo.contactemail }); - if ( this.selectedRepo.typology === '' || !this.typologies.some(x => x.value === this.selectedRepo.typology) ) { + if ( this.selectedRepo.platform === '' || !this.typologies.some(x => x.value === this.selectedRepo.platform) ) { this.updateGroup.get('softwarePlatform').setValue(''); - this.updateGroup.get('platformName').setValue(this.selectedRepo.typology); + this.updateGroup.get('platformName').setValue(this.selectedRepo.platform); + } + + if (this.selectedRepo.eoscDatasourceType === 'Journal archive') { + console.log('inside journal'); + this.updateGroup.get('issn').setValue(this.selectedRepo.issn); + this.updateGroup.get('eissn').setValue(this.selectedRepo.eissn); + this.updateGroup.get('lissn').setValue(this.selectedRepo.lissn); } // FIXME: Use eoscDatasourceType when we support the new model @@ -141,7 +148,7 @@ export class DatasourceUpdateFormComponent implements OnInit { } else { this.longtitudeDesc.mandatory = true; this.latitudeDesc.mandatory = true; - this.datasourceTypeDesc.label = 'Repository Type'; + this.datasourceTypeDesc.label = 'Data source type'; } // FIXME: Use eoscDatasourceType when we support the new model @@ -150,7 +157,7 @@ export class DatasourceUpdateFormComponent implements OnInit { let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4); this.updateGroup.get('issn').setValue(ssnToShow); this.updateGroup.get('issn').clearValidators(); - this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]); + this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]); if (this.selectedRepo.eissn.trim().length) { ssnToShow = this.selectedRepo.eissn.slice(0, 4) + '-' + this.selectedRepo.eissn.toString().slice(4); @@ -172,25 +179,32 @@ export class DatasourceUpdateFormComponent implements OnInit { getDatasourceClasses() { // FIXME: Use eoscDatasourceType when we support the new model - this.repoService.getDatasourceClasses(this.mode).subscribe( - classes => this.datasourceClasses = classes, + console.log('mode b4 getdatasourceclasses ', this.mode); + + let param = this.selectedRepo.collectedfrom.split('::')[1]; + if (this.selectedRepo.eoscDatasourceType === 'Journal archive') { param = 'journal'; } + if (this.selectedRepo.eoscDatasourceType === 'Aggregator') { param = 'aggregator'; } + + this.repoService.getDatasourceClasses(param).subscribe( + classes => { + for (const [key, value] of Object.entries(classes)) { + this.datasourceClasses.set(key, value); + }}, error => { this.loadingMessage = ''; this.errorMessage = noServiceMessage; console.log(error); }, () => { - for (const key of Object.keys(this.datasourceClasses)) { - this.classCodes.push(key); - } + console.log('gotDatasourceClasses'); + this.classCodes = Array.from(this.datasourceClasses.keys()); this.getCountries(); } ); } getCountries() { - this.repoService.getCountries() - .subscribe( + this.repoService.getCountries().subscribe( countries => this.countries = countries.sort( function(a, b) { if (a.name < b.name) { return -1; @@ -205,6 +219,7 @@ export class DatasourceUpdateFormComponent implements OnInit { this.errorMessage = noServiceMessage; console.log(error); }, () => { + console.log('gotCountries'); this.getTypologies(); }); } @@ -217,6 +232,7 @@ export class DatasourceUpdateFormComponent implements OnInit { console.log(error); }, () => { + console.log('gotTypologies'); this.getTimezones(); } ); @@ -230,6 +246,7 @@ export class DatasourceUpdateFormComponent implements OnInit { console.log(error); }, () => { + console.log('gotTimezones'); this.loadingMessage = ''; this.setupUpdateForm(); } @@ -243,7 +260,7 @@ export class DatasourceUpdateFormComponent implements OnInit { window.scroll(1, 1); if (this.updateGroup.valid) { - if ( this.selectedRepo.datasourceType !== 'journal' || this.updateGroup.get('issn').value ) { + if ( this.selectedRepo.eoscDatasourceType !== 'journal' || this.updateGroup.get('issn').value ) { this.refreshSelectedRepo(); /* @@ -288,24 +305,28 @@ export class DatasourceUpdateFormComponent implements OnInit { refreshSelectedRepo() { if (this.updateGroup.get('softwarePlatform').value ) { - this.selectedRepo.typology = this.updateGroup.get('softwarePlatform').value; + this.selectedRepo.platform = this.updateGroup.get('softwarePlatform').value; } else if (this.updateGroup.get('platformName').value) { - this.selectedRepo.typology = this.updateGroup.get('platformName').value; + this.selectedRepo.platform = this.updateGroup.get('platformName').value; } - this.selectedRepo.officialName = this.updateGroup.get('officialName').value.toString(); + this.selectedRepo.typology = this.updateGroup.get('datasourceType').value; + console.log('typology ', this.selectedRepo.typology); + console.log(this.datasourceClasses); + console.log(this.updateGroup.get('datasourceType').value); + // this.selectedRepo.eoscDatasourceType = this.datasourceClasses.get(this.updateGroup.get('datasourceType').value); + // console.warn(this.selectedRepo.eoscDatasourceType); + this.selectedRepo.officialname = this.updateGroup.get('officialName').value.toString(); this.selectedRepo.description = this.updateGroup.get('repoDescription').value.toString(); - this.selectedRepo.countryCode = this.updateGroup.get('country').value; - this.selectedRepo.countryName = this.countries.filter(x => x.code === this.updateGroup.get('country').value)[0].name; + this.selectedRepo.organizations[0].country = this.updateGroup.get('country').value; // countryCode this.selectedRepo.longitude = this.updateGroup.get('longtitude').value; this.selectedRepo.latitude = this.updateGroup.get('latitude').value; - this.selectedRepo.websiteUrl = this.updateGroup.get('websiteUrl').value; - this.selectedRepo.organization = this.updateGroup.get('institutionName').value.toString(); - this.selectedRepo.englishName = this.updateGroup.get('englishName').value.toString(); - this.selectedRepo.logoUrl = this.updateGroup.get('logoUrl').value; + this.selectedRepo.websiteurl = this.updateGroup.get('websiteUrl').value; + this.selectedRepo.organizations[0].legalname = this.updateGroup.get('institutionName').value.toString(); + this.selectedRepo.englishname = this.updateGroup.get('englishName').value.toString(); + this.selectedRepo.logourl = this.updateGroup.get('logoUrl').value; this.selectedRepo.timezone = this.updateGroup.get('timezone').value; - this.selectedRepo.datasourceClass = this.updateGroup.get('datasourceType').value; - this.selectedRepo.contactEmail = this.updateGroup.get('adminEmail').value; - if (this.selectedRepo.datasourceType === 'journal') { + this.selectedRepo.contactemail = this.updateGroup.get('adminEmail').value; + if (this.selectedRepo.eoscDatasourceType === 'journal') { let ssnParts = this.updateGroup.get('issn').value.split('-'); let correctSSN = ssnParts[0] + ssnParts[1]; this.selectedRepo.issn = correctSSN; @@ -320,10 +341,13 @@ export class DatasourceUpdateFormComponent implements OnInit { this.selectedRepo.lissn = correctSSN; } } - if (!this.showButton) { - this.selectedRepo.registeredBy = this.authService.getUserEmail(); - this.selectedRepo.registered = true; - this.selectedRepo.registrationDate = new Date(Date.now()); // NOT NEEDED ?? + if (!this.showButton) { // on register + this.selectedRepo.registeredby = this.authService.getUserEmail(); + this.selectedRepo.managed = true; + const now = new Date(Date.now()); + this.selectedRepo.consentTermsOfUseDate = now; + this.selectedRepo.lastConsentTermsOfUseDate = now; + this.selectedRepo.registrationdate = now; this.emittedInfo.emit(this.selectedRepo); } } diff --git a/src/app/shared/reusablecomponents/sources-forms/datasource-update-terms-form.component.html b/src/app/shared/reusablecomponents/sources-forms/datasource-update-terms-form.component.html index a4c308093..196e85c63 100644 --- a/src/app/shared/reusablecomponents/sources-forms/datasource-update-terms-form.component.html +++ b/src/app/shared/reusablecomponents/sources-forms/datasource-update-terms-form.component.html @@ -29,9 +29,10 @@ Agree to the re-use of full texts - -
Data source registration date: {{selectedRepo.consentTermsOfUseDate | date}}
-
Last date of acceptance of the Terms of Use: {{selectedRepo.lastConsentTermsOfUseDate ? (selectedRepo.lastConsentTermsOfUseDate | date) : '-'}}
+ +
Data source registration date: {{selectedRepo.registrationdate | date}}
+
Last date of acceptance of the Terms of Use: {{selectedRepo.lastConsentTermsOfUseDate ? (selectedRepo.lastConsentTermsOfUseDate | date) : '-'}}
+

Note: OpenAIRE will not provide the full text files for public distribution, the users will access from the original datasource.

diff --git a/src/app/shared/sidemenu/sidemenu.component.html b/src/app/shared/sidemenu/sidemenu.component.html index 8a1baffa2..3a7f59420 100644 --- a/src/app/shared/sidemenu/sidemenu.component.html +++ b/src/app/shared/sidemenu/sidemenu.component.html @@ -113,8 +113,8 @@