Skip to content

Commit

Permalink
Merge pull request #2372 from dzhw/release
Browse files Browse the repository at this point in the history
Release v1.0.91
  • Loading branch information
René Reitmann authored Sep 16, 2019
2 parents bd5715b + 883fc77 commit 27cc6cf
Show file tree
Hide file tree
Showing 116 changed files with 1,565 additions and 525 deletions.
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ addons:
- g++-4.9
stages:
- name: build
if: NOT (branch =~ /^saikotitis.*$/ || branch =~ /^(development|master|test)$/)
if: NOT branch =~ /^(development|master|test)$/
- name: build and deploy
if: branch =~ /^(development|master|test)$/
- name: e2e smoketests
if: type = cron || branch =~ /^saikotitis.*$/
if: type = cron
- name: nightly e2e tests publicuser
if: type = cron || branch =~ /^saikotitis.*$/
if: type = cron
- name: nightly e2e tests dataprovider
if: type = cron || branch =~ /^saikotitis.*$/
if: type = cron
- name: nightly e2e tests publisher
if: type = cron || branch =~ /^saikotitis.*$/
if: type = cron
jobs:
include:
- stage: build
Expand Down Expand Up @@ -202,5 +202,4 @@ jobs:
notifications:
email:
recipients:
- secure: "oyEkjrcti+bTYz/TLA6tw6F6aTpeiWxMGyAsKOyYxYCjWw8sNsagiqzzLxcIdqy62ETCKmkGrYlJr1dofPT27j4pQgSuPT9EWkaviNfFG6AllGkW4+N6RdpMw3gXr0O/qtpy2LdXr1D8cP8Pji4V9DKriPkOMcE7tlBUHTCuDlchheenqszKpWBhQGtSipR0dDGo9AyhmbfUu9mnyl73A8Xi2XegKeie5J0JZzuiacwjbVZXO8JexyYN06rFpcyMIkdTUq4JHMENenszqYmZ4/P8QIymdxY/rBsNRXVl2vIXoFtOkIA+fjcPj6CuOxlGrs6+C5BvGc951uaicwFHDeZ15Csx2YpTTuqjNclgUYffGvaqwlUDrQhQ45paxYTqqLzStdbNJBaQEw8Oh3P6BdUKldDv93Y6ydkOeQlLBNS/+F1irNo8HtzUmHew3aF9unNAB1BD6x5jFlGUrO/xXra0RWiVD2p/q97cF8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4iiu008WMFqP6V58dlxC3PJax3rPugXTUNzOHU1qiHdTA17R4q47hsmdJGtCNsAjemo+/D+w8nWp+DJokHsYv/SSngB5GprKv22vXiZWy3wnqjagvOfPHYZGfMYEtc7kMylOmrxrjx15cQiyIncJQKjabYCDQ2lkjjNS1bZTnobe/CHy+IkWxT/qiV/miDLOI0Tm6B6OQGJRhJoErBjRSnihZZo9fg8YVRJdApG3ZoWmuXwwOTi41rsHRdhClKzJzmSO+7paea7CPaobzvn54n2Lu1azp05GNG1hlxtNVlp7r7xh+e+W0JHj9trFmXq+vkO7nQtS3rtnnWnz8xqDBqXE3xWtRD0tiG0f9qev7AiMo+UTWEsvXuXI68ywHThppO2rHFN6RntLNgAwFzwwGBG0U4AblljYV7zT56f1xiEaAbe77Fyryi6uFTX7wJPLBLKfylWwt9vLgcDon/plVRuDivEvwBdgwQ8="
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.. java:import:: org.springframework.data.mongodb.core.index Indexed
.. java:import:: eu.dzhw.fdz.metadatamanagement.common.domain.validation ValidHiddenShadow
.. java:import:: lombok AccessLevel
.. java:import:: lombok Data
Expand All @@ -16,12 +18,20 @@ AbstractShadowableRdcDomainObject
.. java:package:: eu.dzhw.fdz.metadatamanagement.common.domain
:noindex:

.. java:type:: @Data @EqualsAndHashCode public abstract class AbstractShadowableRdcDomainObject extends AbstractRdcDomainObject
.. java:type:: @Data @EqualsAndHashCode @ValidHiddenShadow public abstract class AbstractShadowableRdcDomainObject extends AbstractRdcDomainObject
Base class for all rdc domain objects which can exist as multiple versions.
Base class for all rdc domain objects which can exist as multiple versions (shadows).

Fields
------
hidden
^^^^^^

.. java:field:: private boolean hidden
:outertype: AbstractShadowableRdcDomainObject

True if and only if the shadow copy must not be available for the public user. Only shadow copies which have a successor may be hidden.

serialVersionUID
^^^^^^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,3 @@ DATA_SET_REPORT
.. java:field:: public static final Task.TaskType DATA_SET_REPORT
:outertype: Task.TaskType

PROJECT_RELEASE
^^^^^^^^^^^^^^^

.. java:field:: public static final Task.TaskType PROJECT_RELEASE
:outertype: Task.TaskType

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. java:import:: java.time LocalDateTime
.. java:import:: javax.validation.constraints NotNull
.. java:import:: org.springframework.data.annotation Id
.. java:import:: org.springframework.data.mongodb.core.mapping Document
.. java:import:: eu.dzhw.fdz.metadatamanagement.common.domain AbstractRdcDomainObject
.. java:import:: lombok AllArgsConstructor
.. java:import:: lombok Data
.. java:import:: lombok EqualsAndHashCode
.. java:import:: lombok NoArgsConstructor
ShadowCopyQueueItem.Action
==========================

.. java:package:: eu.dzhw.fdz.metadatamanagement.projectmanagement.domain
:noindex:

.. java:type:: public enum Action
:outertype: ShadowCopyQueueItem

The action which will be performed for the shadows.

Enum Constants
--------------
CREATE
^^^^^^

.. java:field:: public static final ShadowCopyQueueItem.Action CREATE
:outertype: ShadowCopyQueueItem.Action

HIDE
^^^^

.. java:field:: public static final ShadowCopyQueueItem.Action HIDE
:outertype: ShadowCopyQueueItem.Action

UNHIDE
^^^^^^

.. java:field:: public static final ShadowCopyQueueItem.Action UNHIDE
:outertype: ShadowCopyQueueItem.Action

Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ ShadowCopyQueueItem

Fields
------
action
^^^^^^

.. java:field:: @NotNull private Action action
:outertype: ShadowCopyQueueItem

The action which will be performed for the shadow copies.

dataAcquisitionProjectId
^^^^^^^^^^^^^^^^^^^^^^^^

.. java:field:: @NotNull private String dataAcquisitionProjectId
:outertype: ShadowCopyQueueItem

Project id for which a shadow copy should be created.
Project id for which a shadow copy should be created or hidden or unhidden.

id
^^
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ShadowHidingNotAllowedException
===============================

.. java:package:: eu.dzhw.fdz.metadatamanagement.projectmanagement.domain
:noindex:

.. java:type:: public class ShadowHidingNotAllowedException extends Exception
Exception which is thrown when the user tries to hide a master or the most recent shadow copy.

:author: René Reitmann

Fields
------
serialVersionUID
^^^^^^^^^^^^^^^^

.. java:field:: private static final long serialVersionUID
:outertype: ShadowHidingNotAllowedException

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ShadowUnhidingNotAllowedException
=================================

.. java:package:: eu.dzhw.fdz.metadatamanagement.projectmanagement.domain
:noindex:

.. java:type:: public class ShadowUnhidingNotAllowedException extends Exception
Exception which is thrown when the user tries to unhide shadows which are already unhidden.

:author: René Reitmann

Fields
------
serialVersionUID
^^^^^^^^^^^^^^^^

.. java:field:: private static final long serialVersionUID
:outertype: ShadowUnhidingNotAllowedException

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ Domain objects describing \ :java:ref:`eu.dzhw.fdz.metadatamanagement.projectman
Release
Requirements
ShadowCopyQueueItem
ShadowCopyQueueItem-Action
ShadowCopyReleaseToDaraNotAllowed
ShadowHidingNotAllowedException
ShadowUnhidingNotAllowedException

3 changes: 3 additions & 0 deletions docs/source/questions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ meist "erkennbare" Nummerierung. Es wird zwischen fünf Fragetypen differenziert

Die technische Dokumentation zum erstellen der Frage-Metadaten finden Sie hier:
https://dzhw.github.io/questionMetadataPreparation/index.html

Die Anleitung zur Zusammenstellung der Metadaten (inkl. Beschreibung der Attribute) finden Sie hier:
https://dzhw.github.io/questionMetadataPreparation/articles/question_metadata_preparation_introduction.html
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
<version>2.1.8.RELEASE</version>
<relativePath />
</parent>

<groupId>eu.dzhw.fdz.metadatamanagement</groupId>
<artifactId>metadatamanagement</artifactId>
<version>1.0.90</version>
<version>1.0.91</version>
<packaging>war</packaging>
<name>metadatamanagement</name>

Expand Down Expand Up @@ -135,7 +135,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
<version>2.11.2</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
Expand All @@ -149,7 +149,7 @@
<dependency>
<groupId>org.javers</groupId>
<artifactId>javers-spring-boot-starter-mongo</artifactId>
<version>5.6.3</version>
<version>5.7.2</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@

import org.springframework.data.mongodb.core.index.Indexed;

import eu.dzhw.fdz.metadatamanagement.common.domain.validation.ValidHiddenShadow;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Setter;

/**
* Base class for all rdc domain objects which can exist as multiple versions.
* Base class for all rdc domain objects which can exist as multiple versions (shadows).
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ValidHiddenShadow
public abstract class AbstractShadowableRdcDomainObject extends AbstractRdcDomainObject {

private static final long serialVersionUID = 8006229461938445620L;
Expand All @@ -30,9 +32,16 @@ public abstract class AbstractShadowableRdcDomainObject extends AbstractRdcDomai
@Indexed
private boolean shadow;

/**
* True if and only if the shadow copy must not be available for the public user.
* Only shadow copies which have a successor may be hidden.
*/
private boolean hidden = false;

/**
* Set the master id for the document. This will modify it's
* {@link AbstractShadowableRdcDomainObject#shadow} field as well.
*
* @param masterId Master id
*/
public final void setMasterId(String masterId) {
Expand All @@ -43,6 +52,7 @@ public final void setMasterId(String masterId) {
/**
* Set the id for the document. This will modify it's
* {@link AbstractShadowableRdcDomainObject#shadow} field as well.
*
* @param id Document id
*/
public final void setId(String id) {
Expand All @@ -52,12 +62,14 @@ public final void setId(String id) {

/**
* Set masterId on implementations of {@link AbstractShadowableRdcDomainObject}.
*
* @param masterId Master Id
*/
protected abstract void setMasterIdInternal(String masterId);

/**
* Set id on implementation of {@link AbstractShadowableRdcDomainObject}.
*
* @param id Id
*/
protected abstract void setIdInternal(String id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public enum TaskState {
*
*/
public enum TaskType {
DATA_SET_REPORT,
PROJECT_RELEASE
DATA_SET_REPORT
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package eu.dzhw.fdz.metadatamanagement.common.domain.validation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject;

/**
* Validates that {@link AbstractShadowableRdcDomainObject} {@code hidden} is true if and only if
* the domain object is a shadow and has a successor.
*/
@Documented
@Constraint(validatedBy = ValidHiddenShadowValidator.class)
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidHiddenShadow {

/**
* Defines the default error message.
*/
String message() default "{common.domain.validation.error.invalid-hidden-shadow}";

/**
* Groups parameter.
*/
Class<?>[] groups() default {};

/**
* Payload parameter.
*/
Class<? extends Payload>[] payload() default {};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package eu.dzhw.fdz.metadatamanagement.common.domain.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import org.springframework.util.StringUtils;

import eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject;

/**
* Default validator implementation for {@link ValidHiddenShadow} validation.
*/
public class ValidHiddenShadowValidator
implements ConstraintValidator<ValidHiddenShadow, AbstractShadowableRdcDomainObject> {

@Override
public boolean isValid(AbstractShadowableRdcDomainObject abstractShadowableRdcDomainObject,
ConstraintValidatorContext constraintValidatorContext) {

if (!abstractShadowableRdcDomainObject.isHidden()) {
return true;
}

if (abstractShadowableRdcDomainObject.isShadow()
&& StringUtils.hasText(abstractShadowableRdcDomainObject.getSuccessorId())) {
return true;
}

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class GenericDomainObjectResourceController
<T extends AbstractRdcDomainObject, S extends CrudService<T>> {

private final CrudService<T> crudService;

private final UserInformationProvider userInformationProvider;

/**
Expand All @@ -53,6 +53,11 @@ public ResponseEntity<T> getDomainObject(String id) {
return ResponseEntity.notFound().build();
} else {
T domainObject = optional.get();
if (userInformationProvider.isUserAnonymous()
&& AbstractShadowableRdcDomainObject.class.isAssignableFrom(domainObject.getClass())
&& ((AbstractShadowableRdcDomainObject) domainObject).isHidden()) {
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok()
.cacheControl(CacheControl.maxAge(0, TimeUnit.DAYS).mustRevalidate().cachePublic())
.eTag(domainObject.getVersion().toString()).lastModified(domainObject
Expand Down
Loading

0 comments on commit 27cc6cf

Please sign in to comment.