Added models

This commit is contained in:
Efstratios Giannopoulos 2024-03-01 17:27:39 +02:00
parent bffe4d8d62
commit 626a7e12e9
44 changed files with 2285 additions and 28 deletions

28
.gitignore vendored
View File

@ -1,26 +1,2 @@
# ---> Java
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
.idea/
target/

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
FROM maven:3-eclipse-temurin-21
RUN apt-get update
RUN apt-get install gpg -y
ARG MAVEN_ACCOUNT_USR
ARG MAVEN_ACCOUNT_PSW
ARG REVISION
ARG MAVEN_GPG_PASSPHRASE
ARG MAVEN_GPG_KEYNAME
ARG PROFILE
ARG DEV_PROFILE_URL_DEPOSIT
ARG DEV_PROFILE_URL
ENV gpg_keyname=$MAVEN_GPG_KEYNAME
ENV gpg_passphrase=$MAVEN_GPG_PASSPHRASE
ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
COPY settings.xml /root/.m2/settings.xml
COPY keypair.asc /tmp/keypair.asc
RUN if [ "$PROFILE" = "ossrh" ]; then \
gpg --batch --import /tmp/keypair.asc; \
fi
WORKDIR /build/
COPY . .
RUN mvn -Drevision=${REVISION} -DdevProfileUrlDeposit=${DEV_PROFILE_URL_DEPOSIT} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean deploy

37
Dockerfile.Sonar Normal file
View File

@ -0,0 +1,37 @@
FROM maven:3-eclipse-temurin-21
RUN apt-get update \
&& apt-get install gpg -y \
&& apt-get clean
ARG MAVEN_ACCOUNT_USR
ARG MAVEN_ACCOUNT_PSW
ARG REVISION
ARG MAVEN_GPG_PASSPHRASE
ARG MAVEN_GPG_KEYNAME
ARG PROFILE
ARG DEV_PROFILE_URL_DEPOSIT
ARG DEV_PROFILE_URL
ARG ORACLE_URL
ARG ORACLE_TOKEN
ENV gpg_keyname=$MAVEN_GPG_KEYNAME
ENV gpg_passphrase=$MAVEN_GPG_PASSPHRASE
ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
COPY settings.xml /root/.m2/settings.xml
COPY keypair.asc /tmp/keypair.asc
RUN if [ "$PROFILE" = "ossrh" ]; then \
gpg --batch --import /tmp/keypair.asc; \
fi
COPY oracle.local.cite.gr.crt $JAVA_HOME/conf/security
RUN cd $JAVA_HOME/conf/security && keytool -cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias oraclecert -file oracle.local.cite.gr.crt
WORKDIR /build/
COPY . .
RUN mvn -Drevision=${REVISION} -DdevProfileUrlDeposit=${DEV_PROFILE_URL_DEPOSIT} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean install
RUN mvn sonar:sonar -Dsonar.projectKey=OpenDMP:common-models -Dsonar.login=${ORACLE_TOKEN} -Dsonar.host.url=${ORACLE_URL} -Dsonar.projectName='OpenDMP common-models'

21
LICENSE.txt Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-2020 OpenAIRE AMKE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,2 +1 @@
# common-models
The common-models module inlcudes the common dmp models

426
THIRD-PARTY-NOTICES.txt Normal file
View File

@ -0,0 +1,426 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize
This component uses third party material from the projects listed below.
The original copyright notice and the license under which CITE
received such third party material are set forth below. CITE
reserves all other rights not expressly granted, whether by
implication, estoppel or otherwise.
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us: reception@cite.gr
1. spring-boot-starter-parent
2. spring-boot-starter-web
spring-boot-starter-parent NOTICES, INFORMATION, AND LICENSE BEGIN HERE
=========================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================
END OF spring-boot-starter-parent NOTICES, INFORMATION, AND LICENSE
spring-boot-starter-web NOTICES, INFORMATION, AND LICENSE BEGIN HERE
=========================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================
END OF spring-boot-starter-web NOTICES, INFORMATION, AND LICENSE

168
pom.xml Normal file
View File

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.4</version>
<relativePath/>
</parent>
<groupId>gr.cite.opendmp</groupId>
<artifactId>common-models</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>
<name>OpenDMP Common Models</name>
<description>OpenDMP Common Models</description>
<url>https://code-repo.d4science.org/MaDgiK-CITE/common-models</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://code-repo.d4science.org/MaDgiK-CITE/common-models/src/branch/master/LICENSE.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>CITE S.A.</name>
<email>maven-central@cite.gr</email>
<organization>CITE S.A.</organization>
<organizationUrl>https://www.cite.gr</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://code-repo.d4science.org</connection>
<developerConnection>scm:git:ssh://code-repo.d4science.org</developerConnection>
<url>https://code-repo.d4science.org/MaDgiK-CITE/common-models</url>
</scm>
<properties>
<revision>1.0.0-SNAPSHOT</revision>
<java.version>21</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ossrh</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<createChecksum>true</createChecksum>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<id>javadoc-generation</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<excludes>
<exclude>gr/**</exclude>
</excludes>
<includes>
<include>README.txt</include>
</includes>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</execution>
<execution>
<id>sources-generation</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<excludes>
<exclude>gr/**</exclude>
</excludes>
<includes>
<include>README.txt</include>
</includes>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dev</id>
<repositories>
<repository>
<id>dev</id>
<name>Dev Profile</name>
<url>${devProfileUrl}</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>dev</id>
<name>Dev Profile</name>
<url>${devProfileUrlDeposit}</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>

23
settings.xml Normal file
View File

@ -0,0 +1,23 @@
<settings>
<servers>
<server>
<id>ossrh</id>
<username>${server_username}</username>
<password>${server_password}</password>
</server>
<server>
<id>dev</id>
<username>${server_username}</username>
<password>${server_password}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<properties>
<gpg.passphrase>${gpg_passphrase}</gpg.passphrase>
<gpg.keyname>${gpg_keyname}</gpg.keyname>
</properties>
</profile>
</profiles>
</settings>

View File

@ -0,0 +1,29 @@
package eu.eudat.commonmodels.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Map;
public enum DmpAccessType implements EnumValueProvider<Short> {
Public((short) 0), Restricted((short) 1);
private final Short value;
DmpAccessType(Short value) {
this.value = value;
}
@Override
@JsonValue
public Short getValue() {
return value;
}
private static final Map<Short, DmpAccessType> map = EnumUtils.getEnumValueMap(DmpAccessType.class);
public static DmpAccessType of(Short i) {
return map.get(i);
}
}

View File

@ -0,0 +1,32 @@
package eu.eudat.commonmodels.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Map;
public enum DmpUserRole implements EnumValueProvider<Short> {
Owner((short) 0),
User((short) 1),
DescriptionContributor((short) 2),
Reviewer((short) 3);
private final Short value;
DmpUserRole(Short value) {
this.value = value;
}
@Override
@JsonValue
public Short getValue() {
return value;
}
private static final Map<Short, DmpUserRole> map = EnumUtils.getEnumValueMap(DmpUserRole.class);
public static DmpUserRole of(Short i) {
return map.get(i);
}
}

View File

@ -0,0 +1,14 @@
package eu.eudat.commonmodels.enums;
import java.util.HashMap;
import java.util.Map;
public class EnumUtils {
public static <EnumType extends Enum<EnumType> & EnumValueProvider<EnumValue>, EnumValue> Map<EnumValue, EnumType> getEnumValueMap(Class<EnumType> enumType){
HashMap<EnumValue, EnumType> map = new HashMap<>();
for (EnumType v : enumType.getEnumConstants()) {
map.put(v.getValue(), v);
}
return map;
}
}

View File

@ -0,0 +1,8 @@
package eu.eudat.commonmodels.enums;
import com.fasterxml.jackson.annotation.JsonValue;
public interface EnumValueProvider<T> {
@JsonValue
T getValue();
}

View File

@ -0,0 +1,62 @@
package eu.eudat.commonmodels.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Map;
public enum FieldType implements EnumValueProvider<String> {
SELECT(Names.Select),
BOOLEAN_DECISION(Names.BooleanDecision),
RADIO_BOX(Names.RadioBox),
INTERNAL_ENTRIES_DMPS(Names.InternalEntitiesDmps),
INTERNAL_ENTRIES_DESCRIPTIONS(Names.InternalEntitiesDescriptions),
CHECK_BOX(Names.CheckBox),
FREE_TEXT(Names.FreeText),
TEXT_AREA(Names.TextArea),
RICH_TEXT_AREA(Names.RichTextarea),
UPLOAD(Names.Upload),
DATE_PICKER(Names.DatePicker),
TAGS(Names.Tags),
REFERENCE_TYPES(Names.ReferenceTypes),
DATASET_IDENTIFIER(Names.DatasetIdentifier),
CURRENCY(Names.Currency),
VALIDATION(Names.Validation);
private final String value;
public static class Names {
public static final String Select = "select";
public static final String BooleanDecision = "booleanDecision";
public static final String RadioBox = "radiobox";
public static final String InternalEntitiesDmps = "internalEntitiesDmps";
public static final String InternalEntitiesDescriptions = "internalEntitiesDescriptions";
public static final String CheckBox = "checkBox";
public static final String FreeText = "freetext";
public static final String TextArea = "textarea";
public static final String RichTextarea = "richTextarea";
public static final String Upload = "upload";
public static final String DatePicker = "datePicker";
public static final String Tags = "tags";
public static final String DatasetIdentifier = "datasetIdentifier";
public static final String Currency = "currency";
public static final String Validation = "validation";
public static final String ReferenceTypes = "referenceTypes";
}
FieldType(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
private static final Map<String, FieldType> map = EnumUtils.getEnumValueMap(FieldType.class);
public static FieldType of(String i) {
return map.get(i);
}
}

View File

@ -0,0 +1,30 @@
package eu.eudat.commonmodels.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Map;
public enum FieldValidationType implements EnumValueProvider<Short> {
None((short) 0),
Required((short) 1),
Url((short) 2);
private final Short value;
FieldValidationType(Short value) {
this.value = value;
}
@JsonValue
public Short getValue() {
return value;
}
private static final Map<Short, FieldValidationType> map = EnumUtils.getEnumValueMap(FieldValidationType.class);
public static FieldValidationType of(Short i) {
return map.get(i);
}
}

View File

@ -0,0 +1,26 @@
package eu.eudat.commonmodels.enums;
import java.util.Map;
public enum ReferenceSourceType implements EnumValueProvider<Short> {
Internal((short) 0),
External((short) 1);
private final Short value;
ReferenceSourceType(Short value) {
this.value = value;
}
@Override
public Short getValue() {
return value;
}
private static final Map<Short, ReferenceSourceType> map = EnumUtils.getEnumValueMap(ReferenceSourceType.class);
public static ReferenceSourceType of(Short i) {
return map.get(i);
}
}

View File

@ -0,0 +1,129 @@
package eu.eudat.commonmodels.models;
import eu.eudat.commonmodels.enums.DmpAccessType;
import eu.eudat.commonmodels.models.description.DescriptionModel;
import eu.eudat.commonmodels.models.reference.ReferenceModel;
import java.time.Instant;
import java.util.UUID;
import java.util.List;
public class DmpModel {
private UUID id;
private short version;
private String label;
private String description;
private DmpAccessType accessType;
private List<DescriptionModel> descriptions;
private List<DmpUserModel> users;
private List<ReferenceModel> references;
private FileEnvelopeModel pdfFile;
private FileEnvelopeModel rdaJsonFile;
private FileEnvelopeModel supportingFilesZip;
private String previousDOI;
private Instant finalizedAt;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public short getVersion() {
return version;
}
public void setVersion(short version) {
this.version = version;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public DmpAccessType getAccessType() {
return accessType;
}
public void setAccessType(DmpAccessType accessType) {
this.accessType = accessType;
}
public List<DmpUserModel> getUsers() {
return users;
}
public void setUsers(List<DmpUserModel> users) {
this.users = users;
}
public List<ReferenceModel> getReferences() {
return references;
}
public void setReferences(List<ReferenceModel> references) {
this.references = references;
}
public FileEnvelopeModel getPdfFile() {
return pdfFile;
}
public void setPdfFile(FileEnvelopeModel pdfFile) {
this.pdfFile = pdfFile;
}
public FileEnvelopeModel getRdaJsonFile() {
return rdaJsonFile;
}
public void setRdaJsonFile(FileEnvelopeModel rdaJsonFile) {
this.rdaJsonFile = rdaJsonFile;
}
public FileEnvelopeModel getSupportingFilesZip() {
return supportingFilesZip;
}
public void setSupportingFilesZip(FileEnvelopeModel supportingFilesZip) {
this.supportingFilesZip = supportingFilesZip;
}
public String getPreviousDOI() {
return previousDOI;
}
public void setPreviousDOI(String previousDOI) {
this.previousDOI = previousDOI;
}
public Instant getFinalizedAt() {
return finalizedAt;
}
public void setFinalizedAt(Instant finalizedAt) {
this.finalizedAt = finalizedAt;
}
public List<DescriptionModel> getDescriptions() {
return descriptions;
}
public void setDescriptions(List<DescriptionModel> descriptions) {
this.descriptions = descriptions;
}
}

View File

@ -0,0 +1,24 @@
package eu.eudat.commonmodels.models;
import eu.eudat.commonmodels.enums.DmpUserRole;
public class DmpUserModel {
private UserModel user;
private DmpUserRole role;
public UserModel getUser() {
return user;
}
public void setUser(UserModel user) {
this.user = user;
}
public DmpUserRole getRole() {
return role;
}
public void setRole(DmpUserRole role) {
this.role = role;
}
}

View File

@ -0,0 +1,22 @@
package eu.eudat.commonmodels.models;
public class FileEnvelopeModel {
private String filename;
private byte[] file;
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public byte[] getFile() {
return file;
}
public void setFile(byte[] file) {
this.file = file;
}
}

View File

@ -0,0 +1,13 @@
package eu.eudat.commonmodels.models;
public class UserModel {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,44 @@
package eu.eudat.commonmodels.models.description;
import eu.eudat.commonmodels.models.descriptiotemplate.DescriptionTemplateModel;
public class DescriptionModel {
private String label;
private String description;
private DescriptionTemplateModel descriptionTemplate;
private PropertyDefinitionModel properties;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public PropertyDefinitionModel getProperties() {
return properties;
}
public void setProperties(PropertyDefinitionModel properties) {
this.properties = properties;
}
public DescriptionTemplateModel getDescriptionTemplate() {
return descriptionTemplate;
}
public void setDescriptionTemplate(DescriptionTemplateModel descriptionTemplate) {
this.descriptionTemplate = descriptionTemplate;
}
}

View File

@ -0,0 +1,24 @@
package eu.eudat.commonmodels.models.description;
public class ExternalIdentifierModel {
private String identifier;
private String type;
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -0,0 +1,59 @@
package eu.eudat.commonmodels.models.description;
import eu.eudat.commonmodels.models.reference.ReferenceModel;
import java.time.Instant;
import java.util.List;
public class FieldModel {
private String textValue;
private List<String> textListValue;
private Instant dateValue;
private List<ReferenceModel> references;
private ExternalIdentifierModel externalIdentifier;
public String getTextValue() {
return textValue;
}
public void setTextValue(String textValue) {
this.textValue = textValue;
}
public List<String> getTextListValue() {
return textListValue;
}
public void setTextListValue(List<String> textListValue) {
this.textListValue = textListValue;
}
public Instant getDateValue() {
return dateValue;
}
public void setDateValue(Instant dateValue) {
this.dateValue = dateValue;
}
public List<ReferenceModel> getReferences() {
return references;
}
public void setReferences(List<ReferenceModel> references) {
this.references = references;
}
public ExternalIdentifierModel getExternalIdentifier() {
return externalIdentifier;
}
public void setExternalIdentifier(ExternalIdentifierModel externalIdentifier) {
this.externalIdentifier = externalIdentifier;
}
}

View File

@ -0,0 +1,36 @@
package eu.eudat.commonmodels.models.description;
import java.util.Map;
public class PropertyDefinitionFieldSetItemModel {
private Map<String, FieldModel> fields;
private String comment;
private Integer ordinal;
public Map<String, FieldModel> getFields() {
return fields;
}
public void setFields(Map<String, FieldModel> fields) {
this.fields = fields;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Integer getOrdinal() {
return ordinal;
}
public void setOrdinal(Integer ordinal) {
this.ordinal = ordinal;
}
}

View File

@ -0,0 +1,16 @@
package eu.eudat.commonmodels.models.description;
import java.util.List;
public class PropertyDefinitionFieldSetModel {
private List<PropertyDefinitionFieldSetItemModel> items;
public List<PropertyDefinitionFieldSetItemModel> getItems() {
return items;
}
public void setItems(List<PropertyDefinitionFieldSetItemModel> items) {
this.items = items;
}
}

View File

@ -0,0 +1,16 @@
package eu.eudat.commonmodels.models.description;
import java.util.Map;
public class PropertyDefinitionModel {
private Map<String, PropertyDefinitionFieldSetModel> fieldSets;
public Map<String, PropertyDefinitionFieldSetModel> getFieldSets() {
return fieldSets;
}
public void setFieldSets(Map<String, PropertyDefinitionFieldSetModel> fieldSets) {
this.fieldSets = fieldSets;
}
}

View File

@ -0,0 +1,47 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
import java.util.ArrayList;
import java.util.List;
public class DefinitionModel {
private List<PageModel> pages;
public List<PageModel> getPages() {
return pages;
}
public void setPages(List<PageModel> pages) {
this.pages = pages;
}
public List<FieldModel> getAllField(){
List<FieldModel> fieldEntities = new ArrayList<>();
if (this.getPages() != null){
for (PageModel pageModel: this.getPages()) {
fieldEntities.addAll(pageModel.getAllField());
}
}
return fieldEntities;
}
public List<FieldSetModel> getAllFieldSets(){
List<FieldSetModel> fieldSetsEntities = new ArrayList<>();
if (this.getPages() != null){
for (PageModel pageModel: this.getPages()) {
fieldSetsEntities.addAll(pageModel.getAllFieldSets());
}
}
return fieldSetsEntities;
}
public List<FieldSetModel> getFieldSetById(String id) {
return this.getAllFieldSets().stream().filter(x-> id.equals(x.getId())).toList();
}
public List<FieldModel> getFieldById(String id) {
return this.getAllField().stream().filter(x-> id.equals(x.getId())).toList();
}
}

View File

@ -0,0 +1,79 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
import java.util.UUID;
public class DescriptionTemplateModel {
private UUID id;
private String label;
private String description;
private UUID groupId;
private Short version;
private String language;
private DefinitionModel definition;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public UUID getGroupId() {
return groupId;
}
public void setGroupId(UUID groupId) {
this.groupId = groupId;
}
public Short getVersion() {
return version;
}
public void setVersion(Short version) {
this.version = version;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public DefinitionModel getDefinition() {
return definition;
}
public void setDefinition(DefinitionModel definition) {
this.definition = definition;
}
}

View File

@ -0,0 +1,99 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
import eu.eudat.commonmodels.enums.FieldValidationType;
import eu.eudat.commonmodels.models.descriptiotemplate.fielddata.BaseFieldDataModel;
import java.util.List;
public class FieldModel {
private String id;
private Integer ordinal;
private String numbering;
private List<String> schematics;
private String defaultValue;
private List<RuleModel> visibilityRules;
private List<FieldValidationType> validations;
private Boolean includeInExport;
private BaseFieldDataModel data;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getOrdinal() {
return ordinal;
}
public void setOrdinal(Integer ordinal) {
this.ordinal = ordinal;
}
public String getNumbering() {
return numbering;
}
public void setNumbering(String numbering) {
this.numbering = numbering;
}
public List<String> getSchematics() {
return schematics;
}
public void setSchematics(List<String> schematics) {
this.schematics = schematics;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public List<RuleModel> getVisibilityRules() {
return visibilityRules;
}
public void setVisibilityRules(List<RuleModel> visibilityRules) {
this.visibilityRules = visibilityRules;
}
public List<FieldValidationType> getValidations() {
return validations;
}
public void setValidations(List<FieldValidationType> validations) {
this.validations = validations;
}
public Boolean getIncludeInExport() {
return includeInExport;
}
public void setIncludeInExport(Boolean includeInExport) {
this.includeInExport = includeInExport;
}
public BaseFieldDataModel getData() {
return data;
}
public void setData(BaseFieldDataModel data) {
this.data = data;
}
}

View File

@ -0,0 +1,118 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
import java.util.ArrayList;
import java.util.List;
public class FieldSetModel {
private String id;
private Integer ordinal;
private String numbering;
private String title;
private String description;
private String extendedDescription;
private String additionalInformation;
private MultiplicityModel multiplicity;
private Boolean hasCommentField;
private List<FieldModel> fields;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getOrdinal() {
return ordinal;
}
public void setOrdinal(Integer ordinal) {
this.ordinal = ordinal;
}
public String getNumbering() {
return numbering;
}
public void setNumbering(String numbering) {
this.numbering = numbering;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getExtendedDescription() {
return extendedDescription;
}
public void setExtendedDescription(String extendedDescription) {
this.extendedDescription = extendedDescription;
}
public String getAdditionalInformation() {
return additionalInformation;
}
public void setAdditionalInformation(String additionalInformation) {
this.additionalInformation = additionalInformation;
}
public MultiplicityModel getMultiplicity() {
return multiplicity;
}
public void setMultiplicity(MultiplicityModel multiplicity) {
this.multiplicity = multiplicity;
}
public Boolean getHasCommentField() {
return hasCommentField;
}
public void setHasCommentField(Boolean hasCommentField) {
this.hasCommentField = hasCommentField;
}
public List<FieldModel> getFields() {
return fields;
}
public void setFields(List<FieldModel> fields) {
this.fields = fields;
}
public List<FieldModel> getAllField() {
return this.getFields() == null ? new ArrayList<>() : this.getFields();
}
public List<FieldModel> getFieldById(String id) {
return this.getAllField().stream().filter(x-> id.equals(x.getId())).toList();
}
}

View File

@ -0,0 +1,44 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
public class MultiplicityModel {
private Integer min;
private Integer max;
private String placeholder;
private Boolean tableView;
public Integer getMin() {
return min;
}
public void setMin(Integer min) {
this.min = min;
}
public Integer getMax() {
return max;
}
public void setMax(Integer max) {
this.max = max;
}
public String getPlaceholder() {
return placeholder;
}
public void setPlaceholder(String placeholder) {
this.placeholder = placeholder;
}
public Boolean getTableView() {
return tableView;
}
public void setTableView(Boolean tableView) {
this.tableView = tableView;
}
}

View File

@ -0,0 +1,66 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
import java.util.ArrayList;
import java.util.List;
public class PageModel {
private String id;
private Integer ordinal;
private String title;
private List<SectionModel> sections;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getOrdinal() {
return ordinal;
}
public void setOrdinal(Integer ordinal) {
this.ordinal = ordinal;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public List<SectionModel> getSections() {
return sections;
}
public void setSections(List<SectionModel> sections) {
this.sections = sections;
}
public List<FieldModel> getAllField(){
List<FieldModel> fieldEntities = new ArrayList<>();
if (this.getSections() != null){
for (SectionModel sectionModel: this.getSections()) {
fieldEntities.addAll(sectionModel.getAllField());
}
}
return fieldEntities;
}
public List<FieldSetModel> getAllFieldSets(){
List<FieldSetModel> fieldSetsEntities = new ArrayList<>();
if (this.getSections() != null){
for (SectionModel sectionModel: this.getSections()) {
fieldSetsEntities.addAll(sectionModel.getAllFieldSets());
}
}
return fieldSetsEntities;
}
}

View File

@ -0,0 +1,24 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
public class RuleModel {
private String target;
private String value;
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,135 @@
package eu.eudat.commonmodels.models.descriptiotemplate;
import java.util.ArrayList;
import java.util.List;
public class SectionModel {
private String id;
private Integer ordinal;
private Boolean defaultVisibility;
private Boolean multiplicity;
private String numbering;
private String title;
private String description;
private String extendedDescription;
private List<SectionModel> sections;
private List<FieldSetModel> fieldSets;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getOrdinal() {
return ordinal;
}
public void setOrdinal(Integer ordinal) {
this.ordinal = ordinal;
}
public Boolean getDefaultVisibility() {
return defaultVisibility;
}
public void setDefaultVisibility(Boolean defaultVisibility) {
this.defaultVisibility = defaultVisibility;
}
public Boolean getMultiplicity() {
return multiplicity;
}
public void setMultiplicity(Boolean multiplicity) {
this.multiplicity = multiplicity;
}
public String getNumbering() {
return numbering;
}
public void setNumbering(String numbering) {
this.numbering = numbering;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getExtendedDescription() {
return extendedDescription;
}
public void setExtendedDescription(String extendedDescription) {
this.extendedDescription = extendedDescription;
}
public List<SectionModel> getSections() {
return sections;
}
public void setSections(List<SectionModel> sections) {
this.sections = sections;
}
public List<FieldSetModel> getFieldSets() {
return fieldSets;
}
public void setFieldSets(List<FieldSetModel> fieldSets) {
this.fieldSets = fieldSets;
}
public List<FieldModel> getAllField(){
List<FieldModel> fieldEntities = new ArrayList<>();
if (this.getFieldSets() != null){
for (FieldSetModel fieldSetModel: this.getFieldSets()) {
fieldEntities.addAll(fieldSetModel.getAllField());
}
}
if (this.getSections() != null){
for (SectionModel sectionModel: this.getSections()) {
fieldEntities.addAll(sectionModel.getAllField());
}
}
return fieldEntities;
}
public List<FieldSetModel> getAllFieldSets(){
List<FieldSetModel> fieldSetEntities = new ArrayList<>();
if (this.getFieldSets() != null){
fieldSetEntities.addAll(this.getFieldSets());
}
if (this.getSections() != null){
for (SectionModel sectionModel: this.getSections()) {
fieldSetEntities.addAll(sectionModel.getAllFieldSets());
}
}
return fieldSetEntities;
}
}

View File

@ -0,0 +1,53 @@
package eu.eudat.commonmodels.models.descriptiotemplate.fielddata;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import eu.eudat.commonmodels.enums.FieldType;
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "fieldType",
visible = true,
defaultImpl = LabelDataModel.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.BooleanDecision),
@JsonSubTypes.Type(value = LabelAndMultiplicityDataModel.class, name = FieldType.Names.InternalEntitiesDescriptions),
@JsonSubTypes.Type(value = LabelAndMultiplicityDataModel.class, name = FieldType.Names.InternalEntitiesDmps),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.CheckBox),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.DatePicker),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.FreeText),
@JsonSubTypes.Type(value = ReferenceTypeDataModel.class, name = FieldType.Names.ReferenceTypes),
@JsonSubTypes.Type(value = RadioBoxDataModel.class, name = FieldType.Names.RadioBox),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.RichTextarea),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.Tags),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.TextArea),
@JsonSubTypes.Type(value = UploadDataModel.class, name = FieldType.Names.Upload),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.Validation),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.DatasetIdentifier),
@JsonSubTypes.Type(value = LabelDataModel.class, name = FieldType.Names.Currency),
@JsonSubTypes.Type(value = SelectDataModel.class, name = FieldType.Names.Select)
})
public abstract class BaseFieldDataModel {
private String label;
private FieldType fieldType;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public FieldType getFieldType() {
return fieldType;
}
public void setFieldType(FieldType fieldType) {
this.fieldType = fieldType;
}
}

View File

@ -0,0 +1,13 @@
package eu.eudat.commonmodels.models.descriptiotemplate.fielddata;
public class LabelAndMultiplicityDataModel extends BaseFieldDataModel {
private Boolean multipleSelect;
public Boolean getMultipleSelect() {
return multipleSelect;
}
public void setMultipleSelect(Boolean multipleSelect) {
this.multipleSelect = multipleSelect;
}
}

View File

@ -0,0 +1,5 @@
package eu.eudat.commonmodels.models.descriptiotemplate.fielddata;
public class LabelDataModel extends BaseFieldDataModel {
}

View File

@ -0,0 +1,37 @@
package eu.eudat.commonmodels.models.descriptiotemplate.fielddata;
import java.util.List;
public class RadioBoxDataModel extends BaseFieldDataModel {
private List<RadioBoxOptionModel> options;
public List<RadioBoxOptionModel> getOptions() {
return options;
}
public void setOptions(List<RadioBoxOptionModel> options) {
this.options = options;
}
public static class RadioBoxOptionModel {
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.commonmodels.models.descriptiotemplate.fielddata;
import eu.eudat.commonmodels.models.reference.ReferenceTypeModel;
public class ReferenceTypeDataModel extends BaseFieldDataModel {
private Boolean multipleSelect;
private ReferenceTypeModel referenceType;
public Boolean getMultipleSelect() {
return multipleSelect;
}
public void setMultipleSelect(Boolean multipleSelect) {
this.multipleSelect = multipleSelect;
}
public ReferenceTypeModel getReferenceType() {
return referenceType;
}
public void setReferenceType(ReferenceTypeModel referenceType) {
this.referenceType = referenceType;
}
}

View File

@ -0,0 +1,36 @@
package eu.eudat.commonmodels.models.descriptiotemplate.fielddata;
import java.util.List;
public class SelectDataModel extends LabelAndMultiplicityDataModel {
private List<OptionModel> options;
public List<OptionModel> getOptions() {
return options;
}
public void setOptions(List<OptionModel> options) {
this.options = options;
}
public static class OptionModel {
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}

View File

@ -0,0 +1,36 @@
package eu.eudat.commonmodels.models.descriptiotemplate.fielddata;
import java.util.List;
public class UploadDataModel extends BaseFieldDataModel {
private List<UploadOptionModel> types;
public List<UploadOptionModel> getTypes() {
return types;
}
public void setTypes(List<UploadOptionModel> types) {
this.types = types;
}
public static class UploadOptionModel {
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}

View File

@ -0,0 +1,16 @@
package eu.eudat.commonmodels.models.reference;
import java.util.List;
public class ReferenceDefinitionModel {
private List<ReferenceFieldModel> fields;
public List<ReferenceFieldModel> getFields() {
return fields;
}
public void setFields(List<ReferenceFieldModel> fields) {
this.fields = fields;
}
}

View File

@ -0,0 +1,26 @@
package eu.eudat.commonmodels.models.reference;
public class ReferenceFieldModel {
private String code;
private String value;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,99 @@
package eu.eudat.commonmodels.models.reference;
import eu.eudat.commonmodels.enums.ReferenceSourceType;
import java.util.UUID;
public class ReferenceModel {
private UUID id;
private String label;
private ReferenceTypeModel type;
private String description;
private ReferenceDefinitionModel definition;
private String reference;
private String abbreviation;
private String source;
private ReferenceSourceType sourceType;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ReferenceDefinitionModel getDefinition() {
return definition;
}
public void setDefinition(ReferenceDefinitionModel definition) {
this.definition = definition;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public ReferenceSourceType getSourceType() {
return sourceType;
}
public void setSourceType(ReferenceSourceType sourceType) {
this.sourceType = sourceType;
}
public ReferenceTypeModel getType() {
return type;
}
public void setType(ReferenceTypeModel type) {
this.type = type;
}
}

View File

@ -0,0 +1,36 @@
package eu.eudat.commonmodels.models.reference;
import java.util.UUID;
public class ReferenceTypeModel {
private UUID id;
private String name;
private String code;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}