diff --git a/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/AbstractGroupSynchronizer.java b/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/AbstractGroupSynchronizer.java index a4f812f720..4956267686 100644 --- a/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/AbstractGroupSynchronizer.java +++ b/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/AbstractGroupSynchronizer.java @@ -134,7 +134,7 @@ public GroupLink synchronize(CanonicalGroup canonical) { Group group = this.gnGroupRepository.findByName(canonical.getName()); if (null == group) { group = new Group(); - log.info("Creatinng GN group {} (Id: {}, version '{}')", // + log.info("Creating GN group {} (Id: {}, version '{}')", // canonical.getName(), canonical.getId(), canonical.getLastUpdated()); } else { log.info("Reconciling existing GN group {} with canonical group (id: {})", group.getName(), @@ -157,6 +157,7 @@ public GroupLink synchronize(CanonicalGroup canonical) { group.setName(canonical.getName()); group.setDescription(canonical.getDescription()); group.setWebsite(canonical.getLinkage()); + group.setEmail(canonical.getMail()); link.setCanonical(canonical); link = externalGroupLinks.save(link); assert link.isUpToDateWith(canonical); diff --git a/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroup.java b/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroup.java index 54b8f4dc89..0d905f4a27 100644 --- a/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroup.java +++ b/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroup.java @@ -68,6 +68,8 @@ public interface CanonicalGroup { */ String getLinkage(); + String getMail(); + static CanonicalGroupImpl.Builder builder() { return CanonicalGroupImpl.builder(); } diff --git a/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroupImpl.java b/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroupImpl.java index 2d06c26086..9c32c29c67 100644 --- a/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroupImpl.java +++ b/georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/CanonicalGroupImpl.java @@ -41,6 +41,7 @@ public class CanonicalGroupImpl implements CanonicalGroup { private String linkage; private String orgTitle; + private String orgMail; private GroupSyncMode origin; @Generated("SparkTools") @@ -52,6 +53,7 @@ private CanonicalGroupImpl(Builder builder) { this.lastUpdated = builder.lastUpdated; this.origin = builder.origin; this.orgTitle = builder.orgTitle; + this.orgMail = builder.orgMail; } public @Override String getId() { @@ -78,6 +80,9 @@ private CanonicalGroupImpl(Builder builder) { return linkage; } + @Override + public String getMail() { return orgMail; } + public @Override String getLastUpdated() { return lastUpdated; } @@ -122,6 +127,8 @@ public static final class Builder { private String linkage; private String lastUpdated; private String orgTitle; + + private String orgMail; private GroupSyncMode origin; private Builder() { @@ -135,6 +142,7 @@ public Builder init(CanonicalGroup group) { this.linkage = group.getLinkage(); this.lastUpdated = group.getLastUpdated(); this.origin = group.getOrigin(); + this.orgMail = group.getMail(); return this; } @@ -173,6 +181,12 @@ public Builder withOrigin(GroupSyncMode origin) { return this; } + public Builder withMail(String mail) { + this.orgMail = mail; + return this; + } + + public CanonicalGroup build() { return new CanonicalGroupImpl(this); } diff --git a/georchestra-integration/georchestra-authnz/src/main/java/org/georchestra/geonetwork/security/integration/CanonicalModelMapper.java b/georchestra-integration/georchestra-authnz/src/main/java/org/georchestra/geonetwork/security/integration/CanonicalModelMapper.java index c542797d28..c6f5039a8e 100644 --- a/georchestra-integration/georchestra-authnz/src/main/java/org/georchestra/geonetwork/security/integration/CanonicalModelMapper.java +++ b/georchestra-integration/georchestra-authnz/src/main/java/org/georchestra/geonetwork/security/integration/CanonicalModelMapper.java @@ -55,6 +55,7 @@ public CanonicalGroup toCanonical(Organization org) { .withLastUpdated(org.getLastUpdated())// .withLinkage(org.getLinkage())// .withOrigin(GroupSyncMode.orgs)// + .withMail(org.getMail())// .build(); } diff --git a/georchestra-integration/pom.xml b/georchestra-integration/pom.xml index 0da15e9254..84ab0ec5a9 100644 --- a/georchestra-integration/pom.xml +++ b/georchestra-integration/pom.xml @@ -12,7 +12,7 @@ geOrchestra integration ${basedir}/.. - 23.0.3-SNAPSHOT + 23.1-SNAPSHOT georchestra-utils