diff --git a/backend/core/src/main/java/org/opencdmp/query/UserContactInfoQuery.java b/backend/core/src/main/java/org/opencdmp/query/UserContactInfoQuery.java index 833ba0101..9a4f46803 100644 --- a/backend/core/src/main/java/org/opencdmp/query/UserContactInfoQuery.java +++ b/backend/core/src/main/java/org/opencdmp/query/UserContactInfoQuery.java @@ -11,8 +11,11 @@ import org.opencdmp.authorization.AuthorizationFlags; import org.opencdmp.authorization.Permission; import org.opencdmp.commons.enums.ContactInfoType; import org.opencdmp.commons.scope.user.UserScope; +import org.opencdmp.data.DmpUserEntity; import org.opencdmp.data.UserContactInfoEntity; import org.opencdmp.model.UserContactInfo; +import org.opencdmp.query.utils.BuildSubQueryInput; +import org.opencdmp.query.utils.QueryUtilsService; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -31,11 +34,12 @@ public class UserContactInfoQuery extends QueryBase { private Collection types; private EnumSet authorize = EnumSet.of(AuthorizationFlags.None); - + private final QueryUtilsService queryUtilsService; private final UserScope userScope; private final AuthorizationService authService; - public UserContactInfoQuery(UserScope userScope, AuthorizationService authService) { - this.userScope = userScope; + public UserContactInfoQuery(QueryUtilsService queryUtilsService, UserScope userScope, AuthorizationService authService) { + this.queryUtilsService = queryUtilsService; + this.userScope = userScope; this.authService = authService; } @@ -168,7 +172,17 @@ public class UserContactInfoQuery extends QueryBase { List predicates = new ArrayList<>(); if (userId != null) { - predicates.add(queryContext.CriteriaBuilder.in(queryContext.Root.get(UserContactInfoEntity._userId)).value(userId)); + predicates.add(queryContext.CriteriaBuilder.or( + queryContext.CriteriaBuilder.in(queryContext.Root.get(UserContactInfoEntity._userId)).value(userId), //Creates a false query + queryContext.CriteriaBuilder.in(queryContext.Root.get(UserContactInfoEntity._userId)).value(this.queryUtilsService.buildSubQuery(new BuildSubQueryInput<>(new BuildSubQueryInput.Builder<>(DmpUserEntity.class, UUID.class) + .query(queryContext.Query) + .criteriaBuilder(queryContext.CriteriaBuilder) + .keyPathFunc((subQueryRoot) -> subQueryRoot.get(DmpUserEntity._userId)) + .filterFunc((subQueryRoot, cb) -> + cb.in(subQueryRoot.get(DmpUserEntity._dmpId)).value(this.queryUtilsService.buildDmpAuthZSubQuery(queryContext.Query, queryContext.CriteriaBuilder, userId, false)) + ) + ))) + )); } if (!predicates.isEmpty()) { Predicate[] predicatesArray = predicates.toArray(new Predicate[0]); @@ -187,6 +201,12 @@ public class UserContactInfoQuery extends QueryBase { inClause.value(item); predicates.add(inClause); } + if (this.types != null) { + CriteriaBuilder.In inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(UserContactInfoEntity._type)); + for (ContactInfoType item : this.types) + inClause.value(item); + predicates.add(inClause); + } if (this.userIds != null) { CriteriaBuilder.In inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(UserContactInfoEntity._userId)); for (UUID item : this.userIds) diff --git a/backend/web/src/main/resources/Semantics.json b/backend/web/src/main/resources/Semantics.json index 717c61434..159b4c784 100644 --- a/backend/web/src/main/resources/Semantics.json +++ b/backend/web/src/main/resources/Semantics.json @@ -75,6 +75,14 @@ "category": "rda", "name": "rda.dataset.distribution.host.url" }, + { + "category": "rda", + "name": "rda.dataset.distribution.host.support_versioning" + }, + { + "category": "rda", + "name": "rda.dataset.distribution.license" + }, { "category": "rda", "name": "rda.dataset.distribution.license.license_ref" diff --git a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts index eb28daed4..a26e4464b 100644 --- a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts +++ b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts @@ -154,7 +154,7 @@ export class ConfigurationService extends BaseComponent { get authProviders(): AuthProviders { return this._authProviders; } - + private _analyticsProviders: AnalyticsProviders; get analyticsProviders(): AnalyticsProviders { return this._analyticsProviders; @@ -175,6 +175,11 @@ export class ConfigurationService extends BaseComponent { return this._organizationId; } + private _depositRecordUrlIdPlaceholder: string; + get depositRecordUrlIdPlaceholder(): string { + return this._depositRecordUrlIdPlaceholder; + } + public loadConfiguration(): Promise { return new Promise((r, e) => { // We need to exclude all interceptors here, for the initial configuration request. @@ -249,6 +254,7 @@ export class ConfigurationService extends BaseComponent { this._researcherId = config.referenceTypes.researcherId; this._grantId = config.referenceTypes.grantId; this._organizationId = config.referenceTypes.organizationId; + this._depositRecordUrlIdPlaceholder = config.deposit.recordUrlIdPlaceholder; } diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html index f7dce47cf..7a021157b 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html @@ -32,7 +32,7 @@ -
+