diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f9b20ea..05efa075 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +### Added +- Add retrofit information to the mapping set class [#252](https://github.com/IN-CORE/incore-services/issues/252) ## [1.24.0] - 2024-02-07 diff --git a/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingEntryKey.java b/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingEntryKey.java new file mode 100644 index 00000000..a9e3f35a --- /dev/null +++ b/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingEntryKey.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2024 University of Illinois and others. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Mozilla Public License v2.0 which accompanies this distribution, + * and is available at https://www.mozilla.org/en-US/MPL/2.0/ + * + * Contributors: + * Chen Wang + */ + +package edu.illinois.ncsa.incore.service.dfr3.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import dev.morphia.annotations.Embedded; + +@Embedded +public class MappingEntryKey { + private String name; + private String description; + private Boolean defaultKey; + + @JsonProperty("config") + private MappingEntryKeyConfig config; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription(){ + return description; + } + + public void setDescription(String description){ + this.description = description; + } + + public Boolean getDefaultKey(){ + return defaultKey; + } + + public void setDefaultKey(Boolean defaultKey){ + this.defaultKey = defaultKey; + } + + public MappingEntryKeyConfig getConfig(){ + return config; + } + + public void setConfig(MappingEntryKeyConfig config){ + this.config = config; + } + +} diff --git a/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingEntryKeyConfig.java b/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingEntryKeyConfig.java new file mode 100644 index 00000000..0b51ae00 --- /dev/null +++ b/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingEntryKeyConfig.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2024 University of Illinois and others. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Mozilla Public License v2.0 which accompanies this distribution, + * and is available at https://www.mozilla.org/en-US/MPL/2.0/ + * + * Contributors: + * Chen Wang + */ + +package edu.illinois.ncsa.incore.service.dfr3.models; + +import dev.morphia.annotations.Embedded; + +@Embedded +public class MappingEntryKeyConfig { + private String unit; + private String type; + private String targetColumn; + private String expression; + + public String getUnit(){ + return unit; + } + + public void setUnit(String unit){ + this.unit = unit; + } + + public String getType(){ + return type; + } + + public void setType(String type){ + this.type = type; + } + + public String getTargetColumn(){ + return targetColumn; + } + + public void setTargetColumn(String targetColumn){ + this.targetColumn = targetColumn; + } + + public String getExpression(){ + return expression; + } + + public void setExpression(String expression){ + this.expression = expression; + } +} diff --git a/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingSet.java b/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingSet.java index a2950bc1..6ab40b35 100644 --- a/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingSet.java +++ b/server/dfr3-service/src/main/java/edu/illinois/ncsa/incore/service/dfr3/models/MappingSet.java @@ -39,6 +39,8 @@ public class MappingSet { private String creator; private String owner; + private MappingEntryKey[] mappingEntryKeys; + /** * spaces the object belongs to. Calculated at runtime. */ @@ -96,4 +98,12 @@ public String getMappingType() { public void setMappingType(String mappingType) { this.mappingType = mappingType; } + + public MappingEntryKey[] getMappingEntryKeys() { + return mappingEntryKeys; + } + + public void setRetrofitDefinitions(MappingEntryKey[] mappingEntryKeys) { + this.mappingEntryKeys = mappingEntryKeys; + } }