Skip to content

Commit

Permalink
Merge pull request #141 in TELIMA/karnak from feat/update_prod_from_c…
Browse files Browse the repository at this point in the history
…ert to master

* commit '7db433921a5c51a1b43eeaf41a8acc96d1aa8ea9':
  feat: feat update from release
  • Loading branch information
jdcshug committed May 5, 2022
2 parents 8cb0e1f + 7db4339 commit 833d222
Show file tree
Hide file tree
Showing 19 changed files with 168 additions and 49 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ RUN java -Djarmode=layertools -jar application.jar extract
FROM adoptopenjdk:15-jre-hotspot
WORKDIR app
COPY --from=builder /app/bin/dependencies/ ./
RUN true
COPY --from=builder /app/bin/spring-boot-loader/ ./
RUN true
COPY --from=builder /app/bin/snapshot-dependencies/ ./
RUN true
COPY --from=builder /app/bin/application/ ./
RUN true
COPY tools/docker-entrypoint.sh .

EXPOSE 8080
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@Library('hug-dsi@hugflow') _
@Library('hug-dsi@master') _
import ch.hcuge.dsi.jenkins.BuildImage;
newGenHugFlowMavenPipeline (mavenImage: BuildImage.MVN_36_JDK15)
newGenMavenPipeline(mavenImage: BuildImage.MVN_36_JDK15)
43 changes: 25 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</licenses>

<!-- Version -->
<version>1.0.16</version>
<version>1.0.17</version>

<!-- Packaging -->
<packaging>jar</packaging>
Expand All @@ -28,7 +28,7 @@
<enforcer.jdk-version>[${java.version},)</enforcer.jdk-version>
<enforcer.maven-version>[3.2.0,)</enforcer.maven-version>
<java.version>15</java.version>
<springframework.version>2.6.1</springframework.version>
<springframework.version>2.6.6</springframework.version>
<javax.el.version>3.0.0</javax.el.version>
<javax.mail.version>1.6.2</javax.mail.version>
<vaadin.version>21.0.9</vaadin.version>
Expand All @@ -37,7 +37,7 @@
<springdoc.version>1.6.0</springdoc.version>
<mockito.version>4.2.0</mockito.version>
<h2.version>1.4.200</h2.version>
<hug.springcloud.version>2.3.11-HSR11-1.0</hug.springcloud.version>
<hug.springcloud.version>2.6.6-2021.0.1-1.0</hug.springcloud.version>
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
Expand All @@ -49,7 +49,7 @@
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<org.json.version>20211205</org.json.version>
<logback.version>1.2.9</logback.version>
<hazelcast.version>5.0.2</hazelcast.version>
<hazelcast.version>5.1.1</hazelcast.version>
<liquibase.version>4.3.5</liquibase.version>
<opencsv.version>5.5.2</opencsv.version>
</properties>
Expand Down Expand Up @@ -313,14 +313,14 @@
</licenseHeader>
</java>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>verify</phase>-->
<!-- <goals>-->
<!-- <goal>check</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
</plugin>
</plugins>
<resources>
Expand Down Expand Up @@ -369,6 +369,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
Expand All @@ -380,17 +386,18 @@
<version>1.1.1</version>
</dependency>

<!-- Hazelcast -->
<dependency>
<artifactId>hazelcast-spring</artifactId>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-spring</artifactId>
<version>${hazelcast.version}</version>
</dependency>

<!-- <dependency>-->
<!-- <artifactId>hazelcast</artifactId>-->
<!-- <groupId>com.hazelcast</groupId>-->
<!-- <version>4.1</version>-->
<!-- </dependency>-->
<!-- Monitoring-->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

<dependency>
<artifactId>liquibase-maven-plugin</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# docker build -t osirixfoundation/karnak:latest -f src/main/docker/Dockerfile .

# Based on build image containing maven, jdk and git
FROM adoptopenjdk:15-jre-hotspot as builder
FROM maven:3.6-adoptopenjdk-15 as builder
ARG JAR_FILE=target/karnak*.jar
WORKDIR /app
COPY ${JAR_FILE} application.jar
Expand All @@ -13,9 +13,13 @@ RUN java -Djarmode=layertools -jar application.jar extract
FROM adoptopenjdk:15-jre-hotspot
WORKDIR app
COPY --from=builder /app/dependencies/ ./
RUN true
COPY --from=builder /app/spring-boot-loader/ ./
RUN true
COPY --from=builder /app/snapshot-dependencies/ ./
RUN true
COPY --from=builder /app/application/ ./
RUN true
COPY tools/docker-entrypoint.sh .

EXPOSE 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,10 @@ public boolean tagValueEndsWith(int tag, String value) {

public boolean tagIsPresent(String tag) {
int cleanTag = intFromHexString(tag);
if (dcm.getString(cleanTag) != null) {
return true;
}
return false;
return dcm.getString(cleanTag) != null;
}

public boolean tagIsPresent(int tag) {
if (dcm.getString(tag) != null) {
return true;
}
return false;
return dcm.getString(tag) != null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public NotificationService(
* notifications and send them via email.
*/
@Scheduled(fixedRate = 10 * 1000)
private void determineNotificationToSend() {
public void determineNotificationToSend() {
buildNotificationsToSend().forEach(this::prepareAndSendNotification);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/karnak/frontend/dicom/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static boolean getNetworkResponse(
boolean reachable = false;
boolean xml = "XML".equalsIgnoreCase(format);
try {
if ("XML".equals(format.toUpperCase())) {
if ("XML".equalsIgnoreCase(format)) {
result.append("<DcmNetworkStatus>");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.select.Select;
import com.vaadin.flow.component.tabs.Tab;
import com.vaadin.flow.data.binder.BeanValidationBinder;
import com.vaadin.flow.data.binder.Binder;
Expand All @@ -39,6 +40,7 @@
import org.karnak.frontend.forwardnode.edit.destination.component.FilterBySOPClassesForm;
import org.karnak.frontend.forwardnode.edit.destination.component.NewUpdateDestination;
import org.karnak.frontend.forwardnode.edit.destination.component.NotificationComponent;
import org.karnak.frontend.forwardnode.edit.destination.component.TranscodeOnlyUncompressedComponent;
import org.karnak.frontend.forwardnode.edit.source.SourceView;
import org.karnak.frontend.forwardnode.edit.source.component.NewUpdateSourceNode;
import org.karnak.frontend.util.UIS;
Expand Down Expand Up @@ -124,6 +126,12 @@ private void addEvents() {
newUpdateDestination.getFormDICOM().getDeIdentificationComponent());
addEventCheckboxLayoutDesidentification(
newUpdateDestination.getFormSTOW().getDeIdentificationComponent());
addEventTranscodeOnlyUncompressedWhenSomeTransferSyntax(
newUpdateDestination.getFormSTOW().getTransferSyntaxComponent().getTransferSyntaxSelect(),
newUpdateDestination.getFormSTOW().getTranscodeOnlyUncompressedComponent());
addEventTranscodeOnlyUncompressedWhenSomeTransferSyntax(
newUpdateDestination.getFormDICOM().getTransferSyntaxComponent().getTransferSyntaxSelect(),
newUpdateDestination.getFormDICOM().getTranscodeOnlyUncompressedComponent());
setEventChangeTabValue();
setEventBinderForwardNode();
setEventDestination();
Expand Down Expand Up @@ -625,4 +633,17 @@ public void addBinderExtidInDicomTag(DeIdentificationComponent deIdentificationC
.forField(deIdentificationComponent.getPseudonymInDicomTagComponent().getSavePseudonym())
.bind(DestinationEntity::getSavePseudonym, DestinationEntity::setSavePseudonym);
}

/**
* Event on checkbox Transcode Only Uncompressed: deactivate for some transfer syntax Keep
* original + Explicit VR
*/
private void addEventTranscodeOnlyUncompressedWhenSomeTransferSyntax(
Select<String> transferSyntaxSelect,
TranscodeOnlyUncompressedComponent transcodeOnlyUncompressedComponent) {
transferSyntaxSelect.addValueChangeListener(
value ->
newUpdateDestination.handleEventTranscodeOnlyUncompressedWhenSomeTransferSyntax(
transcodeOnlyUncompressedComponent, value.getValue(), true));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@

public class DestinationCondition extends Div {
private static final String LABEL_CONDITION = "Condition (Leave blank if no condition)";
private TextField condition;
private Span textErrorConditionMsg;

private final TextField condition;

private final Span textErrorConditionMsg;

public DestinationCondition() {
this.setWidthFull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,12 @@ public FilterBySOPClassesForm getFilterBySOPClassesForm() {
public NotificationComponent getNotificationComponent() {
return notificationComponent;
}

public TransferSyntaxComponent getTransferSyntaxComponent() {
return transferSyntaxComponent;
}

public TranscodeOnlyUncompressedComponent getTranscodeOnlyUncompressedComponent() {
return transcodeOnlyUncompressedComponent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,12 @@ public FilterBySOPClassesForm getFilterBySOPClassesForm() {
public NotificationComponent getNotificationComponent() {
return notificationComponent;
}

public TransferSyntaxComponent getTransferSyntaxComponent() {
return transferSyntaxComponent;
}

public TranscodeOnlyUncompressedComponent getTranscodeOnlyUncompressedComponent() {
return transcodeOnlyUncompressedComponent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Objects;
import org.karnak.backend.data.entity.DestinationEntity;
import org.karnak.backend.enums.DestinationType;
import org.karnak.backend.enums.UIDType;
import org.karnak.frontend.forwardnode.edit.component.ButtonSaveDeleteCancel;

@SuppressWarnings("serial")
Expand Down Expand Up @@ -68,9 +69,46 @@ public void setView(DestinationType type) {
if (type == DestinationType.stow) {
add(formSTOW);
binderFormSTOW.readBean(currentDestinationEntity);
handleEventTranscodeOnlyUncompressedWhenSomeTransferSyntax(
formSTOW.getTranscodeOnlyUncompressedComponent(),
currentDestinationEntity.getTransferSyntax(),
false);
} else if (type == DestinationType.dicom) {
add(formDICOM);
binderFormDICOM.readBean(currentDestinationEntity);
handleEventTranscodeOnlyUncompressedWhenSomeTransferSyntax(
formDICOM.getTranscodeOnlyUncompressedComponent(),
currentDestinationEntity.getTransferSyntax(),
false);
}
}

/**
* For transfer syntax: EXPLICIT_VR_LITTLE_ENDIAN and Keep original, transcode only uncompressed
* is deactivated and the value is set to false
*
* @param transcodeOnlyUncompressedComponent Transcode Only Uncompressed Component
* @param transferSyntax Transfer Syntax to evaluate
* @param forceTranscodeOnlyUncompressed Used to know if we reset the value of transcode only
* uncompressed checkbox
*/
public void handleEventTranscodeOnlyUncompressedWhenSomeTransferSyntax(
TranscodeOnlyUncompressedComponent transcodeOnlyUncompressedComponent,
String transferSyntax,
boolean forceTranscodeOnlyUncompressed) {
UIDType uidTypeSelected = UIDType.fromCode(transferSyntax);
if (uidTypeSelected == null
|| Objects.equals(UIDType.EXPLICIT_VR_LITTLE_ENDIAN, uidTypeSelected)) {
if (forceTranscodeOnlyUncompressed) {
transcodeOnlyUncompressedComponent.getTranscodeOnlyUncompressedCheckBox().setValue(false);
}
transcodeOnlyUncompressedComponent.setEnabled(false);

} else {
transcodeOnlyUncompressedComponent.setEnabled(true);
if (forceTranscodeOnlyUncompressed) {
transcodeOnlyUncompressedComponent.getTranscodeOnlyUncompressedCheckBox().setValue(true);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ public void init(Binder<DestinationEntity> binder) {
DestinationEntity::isTranscodeOnlyUncompressed,
DestinationEntity::setTranscodeOnlyUncompressed);
}

public Checkbox getTranscodeOnlyUncompressedCheckBox() {
return transcodeOnlyUncompressedCheckBox;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,8 @@ public void init(Binder<DestinationEntity> binder) {
.forField(transferSyntaxSelect)
.bind(DestinationEntity::getTransferSyntax, DestinationEntity::setTransferSyntax);
}

public Select<String> getTransferSyntaxSelect() {
return transferSyntaxSelect;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public class ProfileMetadata extends VerticalLayout {
private final Button validateEditButton = new Button(new Icon(VaadinIcon.CHECK));
private final Button disabledEditButton = new Button(new Icon(VaadinIcon.CLOSE));

private String title;
private final String title;

private String value;

public ProfileMetadata() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Karnak Application Profiles
# --------------------------------------------------------
name: KARNAK-Profile
environment: LOCAL
#environment: LOCAL
karnakadmin: ${KARNAK_ADMIN:admin}
karnakpassword: ${KARNAK_PASSWORD:admin}
mainzelliste:
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/db/changelog/changes/db.changelog-1.3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,18 @@
referencedTableName="project" validate="true"/>
</changeSet>

<changeSet author="karnak" id="1.3-18">
<dropNotNullConstraint
columnDataType="TIMESTAMP"
columnName="study_date_original"
tableName="transfer_status"/>
</changeSet>

<changeSet author="karnak" id="1.3-19">
<dropNotNullConstraint
columnDataType="TIMESTAMP"
columnName="serie_date_original"
tableName="transfer_status"/>
</changeSet>

</databaseChangeLog>
7 changes: 7 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# --------------------------------------------------------
# Karnak Application Profiles
# --------------------------------------------------------
# - Info
info:
component: Karnak
app:
name: Karnak
description: Karnak

name: test-YAML
environment: LOCAL
karnakadmin: admin
Expand Down
Loading

0 comments on commit 833d222

Please sign in to comment.