Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
6a89feb31b
|
@ -10,12 +10,11 @@ ENV server_username=$MAVEN_ACCOUNT_USR
|
||||||
ENV server_password=$MAVEN_ACCOUNT_PSW
|
ENV server_password=$MAVEN_ACCOUNT_PSW
|
||||||
|
|
||||||
COPY pom.xml /build/
|
COPY pom.xml /build/
|
||||||
#COPY data /build/data/
|
COPY core /build/core/
|
||||||
#COPY elastic /build/elastic/
|
|
||||||
#COPY logging /build/logging/
|
|
||||||
#COPY queryable /build/queryable/
|
|
||||||
COPY web /build/web/
|
COPY web /build/web/
|
||||||
RUN rm -f /build/web/src/main/resources/config/*-dev.yml
|
COPY settings.xml /root/.m2/settings.xml
|
||||||
|
RUN rm -f /build/web/src/main/resources/config/*-devel.yml
|
||||||
|
RUN rm -f /build/annotation-web/src/main/resources/logging/*.xml
|
||||||
|
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
|
|
||||||
|
@ -31,7 +30,9 @@ WORKDIR /app
|
||||||
|
|
||||||
ARG PROFILE
|
ARG PROFILE
|
||||||
ARG REVISION
|
ARG REVISION
|
||||||
|
ENV SERVER_PORT=8080
|
||||||
|
EXPOSE ${SERVER_PORT}
|
||||||
|
|
||||||
COPY --from=build-stage /build/web/target/web-${REVISION}.jar /app.jar
|
COPY --from=build-stage /build/web/target/web-${REVISION}.jar /app.jar
|
||||||
|
|
||||||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"]
|
ENTRYPOINT ["java","-Dspring.config.additional-location=file:/config/","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"]
|
|
@ -14,6 +14,7 @@ import eu.eudat.model.persist.descriptionproperties.PropertyDefinitionPersist;
|
||||||
import eu.eudat.query.DescriptionQuery;
|
import eu.eudat.query.DescriptionQuery;
|
||||||
import eu.eudat.query.DmpDescriptionTemplateQuery;
|
import eu.eudat.query.DmpDescriptionTemplateQuery;
|
||||||
import gr.cite.tools.data.query.QueryFactory;
|
import gr.cite.tools.data.query.QueryFactory;
|
||||||
|
import gr.cite.tools.validation.ValidatorFactory;
|
||||||
import gr.cite.tools.validation.specification.Specification;
|
import gr.cite.tools.validation.specification.Specification;
|
||||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
|
@ -25,7 +26,6 @@ import javax.management.InvalidApplicationException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class DescriptionPersist {
|
public class DescriptionPersist {
|
||||||
|
|
||||||
|
@ -157,13 +157,16 @@ public class DescriptionPersist {
|
||||||
private final TenantEntityManager entityManager;
|
private final TenantEntityManager entityManager;
|
||||||
private final XmlHandlingService xmlHandlingService;
|
private final XmlHandlingService xmlHandlingService;
|
||||||
private final QueryFactory queryFactory;
|
private final QueryFactory queryFactory;
|
||||||
|
private final ValidatorFactory validatorFactory;
|
||||||
|
|
||||||
protected DescriptionPersistValidator(ConventionService conventionService, ErrorThesaurusProperties errors, MessageSource messageSource, TenantEntityManager entityManager, XmlHandlingService xmlHandlingService, QueryFactory queryFactory) {
|
|
||||||
|
protected DescriptionPersistValidator(ConventionService conventionService, ErrorThesaurusProperties errors, MessageSource messageSource, TenantEntityManager entityManager, XmlHandlingService xmlHandlingService, QueryFactory queryFactory, ValidatorFactory validatorFactory) {
|
||||||
super(conventionService, errors);
|
super(conventionService, errors);
|
||||||
this.messageSource = messageSource;
|
this.messageSource = messageSource;
|
||||||
this.entityManager = entityManager;
|
this.entityManager = entityManager;
|
||||||
this.xmlHandlingService = xmlHandlingService;
|
this.xmlHandlingService = xmlHandlingService;
|
||||||
this.queryFactory = queryFactory;
|
this.queryFactory = queryFactory;
|
||||||
|
this.validatorFactory = validatorFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -220,12 +223,12 @@ public class DescriptionPersist {
|
||||||
.failOn(DescriptionPersist._properties).failWith(messageSource.getMessage("Validation_Required", new Object[]{DescriptionPersist._properties}, LocaleContextHolder.getLocale())),
|
.failOn(DescriptionPersist._properties).failWith(messageSource.getMessage("Validation_Required", new Object[]{DescriptionPersist._properties}, LocaleContextHolder.getLocale())),
|
||||||
this.spec()
|
this.spec()
|
||||||
.must(() -> this.isDescriptionTemplateMaxMultiplicityValid(finalDmpBlueprintEntity, item.getDmpId(), item.getDmpDescriptionTemplateId(), this.isValidGuid(item.getId())))
|
.must(() -> this.isDescriptionTemplateMaxMultiplicityValid(finalDmpBlueprintEntity, item.getDmpId(), item.getDmpDescriptionTemplateId(), this.isValidGuid(item.getId())))
|
||||||
.failOn(DescriptionPersist._descriptionTemplateId).failWith(messageSource.getMessage("Validation.InvalidDescriptionTemplateMultiplicity", new Object[]{DescriptionPersist._descriptionTemplateId}, LocaleContextHolder.getLocale()))
|
.failOn(DescriptionPersist._descriptionTemplateId).failWith(messageSource.getMessage("Validation.InvalidDescriptionTemplateMultiplicity", new Object[]{DescriptionPersist._descriptionTemplateId}, LocaleContextHolder.getLocale())),
|
||||||
// this.refSpec()
|
this.refSpec()
|
||||||
// .iff(() -> !this.isNull(item.getProperties()))
|
.iff(() -> item.getStatus() == DescriptionStatus.Finalized)
|
||||||
// .on(DescriptionPersist._properties)
|
.on(DescriptionPersist._properties)
|
||||||
// .over(item.getProperties())
|
.over(item.getProperties())
|
||||||
// .using(() -> this.validatorFactory.validator(PropertyDefinitionPersist.PropertyDefinitionPersistValidator.class).setStatus(item.getStatus()).withDefinition(definition))
|
.using(() -> this.validatorFactory.validator(PropertyDefinitionPersist.PropertyDefinitionPersistValidator.class).setStatus(item.getStatus()).withDefinition(definition))
|
||||||
// this.navSpec()
|
// this.navSpec()
|
||||||
// .iff(() -> !this.isNull(item.getTags()))
|
// .iff(() -> !this.isNull(item.getTags()))
|
||||||
// .on(DescriptionPersist._tags)
|
// .on(DescriptionPersist._tags)
|
||||||
|
|
|
@ -813,7 +813,7 @@ public class DescriptionServiceImpl implements DescriptionService {
|
||||||
if (descriptionTemplateEntity == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{data.getDescriptionTemplateId(), DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
if (descriptionTemplateEntity == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{data.getDescriptionTemplateId(), DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
|
|
||||||
persist.setLabel(data.getLabel());
|
persist.setLabel(data.getLabel());
|
||||||
persist.setStatus(data.getStatus());
|
persist.setStatus(DescriptionStatus.Finalized);
|
||||||
persist.setDescription(data.getDescription());
|
persist.setDescription(data.getDescription());
|
||||||
persist.setDescriptionTemplateId(data.getDescriptionTemplateId());
|
persist.setDescriptionTemplateId(data.getDescriptionTemplateId());
|
||||||
persist.setDmpId(data.getDmpId());
|
persist.setDmpId(data.getDmpId());
|
||||||
|
|
|
@ -329,14 +329,14 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
||||||
if (!this.conventionService.isListNullOrEmpty(persist.getFieldSets())) {
|
if (!this.conventionService.isListNullOrEmpty(persist.getFieldSets())) {
|
||||||
data.setFieldSets(new ArrayList<>());
|
data.setFieldSets(new ArrayList<>());
|
||||||
for (FieldSetPersist fieldSetPersist : persist.getFieldSets()) {
|
for (FieldSetPersist fieldSetPersist : persist.getFieldSets()) {
|
||||||
data.getFieldSets().add(this.buildFieldSetEntity(fieldSetPersist));
|
data.getFieldSets().add(this.buildFieldSetEntity(fieldSetPersist, persist.getMultiplicity()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private @NotNull FieldSetEntity buildFieldSetEntity(FieldSetPersist persist) throws InvalidApplicationException {
|
private @NotNull FieldSetEntity buildFieldSetEntity(FieldSetPersist persist, Boolean multiplicity) throws InvalidApplicationException {
|
||||||
FieldSetEntity data = new FieldSetEntity();
|
FieldSetEntity data = new FieldSetEntity();
|
||||||
if (persist == null)
|
if (persist == null)
|
||||||
return data;
|
return data;
|
||||||
|
@ -348,7 +348,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
||||||
data.setNumbering(persist.getNumbering());
|
data.setNumbering(persist.getNumbering());
|
||||||
data.setAdditionalInformation(persist.getAdditionalInformation());
|
data.setAdditionalInformation(persist.getAdditionalInformation());
|
||||||
data.setExtendedDescription(persist.getExtendedDescription());
|
data.setExtendedDescription(persist.getExtendedDescription());
|
||||||
if (persist.getMultiplicity() != null)
|
if (persist.getMultiplicity() != null && multiplicity)
|
||||||
data.setMultiplicity(this.buildMultiplicityEntity(persist.getMultiplicity()));
|
data.setMultiplicity(this.buildMultiplicityEntity(persist.getMultiplicity()));
|
||||||
data.setHasCommentField(persist.getHasCommentField());
|
data.setHasCommentField(persist.getHasCommentField());
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled);
|
this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.dmp.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active);
|
if (data.entityDois && data.entityDois.length > 0) this.dmp.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active);
|
||||||
this.selectedBlueprint = data.blueprint;
|
this.selectedBlueprint = data.blueprint;
|
||||||
this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.dmpReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.dmpReferences, [this.referenceTypeService.getResearcherReferenceType()]);
|
||||||
if (!this.hasDoi()) {
|
if (!this.hasDoi()) {
|
||||||
|
|
Loading…
Reference in New Issue