Commit 81da6a7b authored by Malo Toudic's avatar Malo Toudic
Browse files

Master

parent 070509da
......@@ -24,7 +24,7 @@
<parent>
<artifactId>EVSClient</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>5.13.4-SNAPSHOT</version>
<version>5.13.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -24,7 +24,7 @@
<parent>
<artifactId>EVSClient</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>5.13.4-SNAPSHOT</version>
<version>5.13.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -98,7 +98,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gazelle-evsclient-common</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
<dependency>
......
......@@ -158,60 +158,47 @@ public class RemoteValidator implements Serializable {
@Create
public void retrieveFilename() {
final Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
final String key = params.get("file");
String path = params.get("filePath");
final String key = params.get("key");
final String validationType = params.get("validationType");
final String sOffset = params.get("startOffset");
final String eOffset = params.get("endOffset");
final String luckyStr = params.get("lucky");
this.toolOid = params.get(this.TOOL_OID);
this.externalId = params.get("externalId");
this.proxyType = params.get("proxyType");
this.messageContentAnalyzerOid = params.get("messageContentAnalyzerOid");
this.lucky = Boolean.parseBoolean(luckyStr);
// Message Content Analyzer
if (path != null) {
// Padding of the B64 encoded path may be lost in the URL encoding. Need to add "=" removed from the URL
while (path.length() % 4 != 0) {
path += "=";
}
final byte[] decodedObjectPathBytes = DatatypeConverter.parseBase64Binary(path);
final String decodedObjectPath;
decodedObjectPath = new String(decodedObjectPathBytes, StandardCharsets.UTF_8);
LOGGER.info(decodedObjectPath);
this.fileName = decodedObjectPath;
if(sOffset != null && !sOffset.isEmpty()){
this.setStartOffset(Integer.valueOf(sOffset));
}
if(eOffset != null && !eOffset.isEmpty()) {
this.setEndOffset(Integer.valueOf(eOffset));
this.setDisplayPanel(false);
} else { // Here we are coming from the proxy or TM "
this.fileName = Upload.getFile(key);
}
// Here we are coming from Message Content Analyzer, proxy or TM
this.fileName = Upload.getFile(key);
FileOutputStream fos = null;
try {
if (path == null && this.externalId != null) {
if (this.externalId != null || this.messageContentAnalyzerOid != null) {
// Decode base64 file from an external tool
Util.base64Decoding(new File(this.fileName), new File(this.fileName));
this.setBase64Decoded(true);
}
// Decode for example base 64 dicom file part BEFORE send it to Dicom validation (we are not Dicom and we are not TLS
else if (this.proxyType == null || !"DICOM".equals(this.proxyType) || validationType == null || !"TLS"
.equals(validationType)) {
final FileInputStream fileStream = new FileInputStream(new File(this.fileName));
String str = Streams.asString(fileStream);
IOUtils.closeQuietly(fileStream);
// Split file if offset
if (this.getStartOffset() != 0 && this.getEndOffset() != 0) {
str = str.substring(this.getStartOffset(), this.getEndOffset());
}
this.setBase64Decoded(true);
// if we are not coming from MCA or tool with externalId
// TODO : Check if DICOM previous condition is still necessary
final FileInputStream fileStream = new FileInputStream(new File(this.fileName));
String str = Streams.asString(fileStream);
IOUtils.closeQuietly(fileStream);
// Split file if offset
if (this.getStartOffset() != 0 || this.getEndOffset() != 0) {
str = str.substring(this.getStartOffset(), this.getEndOffset());
}
if (this.fileName != null) {
// Detection of message type when validating using Proxy->EVSClient
final String fileExtension = this.fileName.substring(this.fileName.lastIndexOf('.') + 1);
......
......@@ -24,7 +24,7 @@
<parent>
<artifactId>EVSClient</artifactId>
<groupId>net.ihe.gazelle</groupId>
<version>5.13.4-SNAPSHOT</version>
<version>5.13.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.ihe.gazelle</groupId>
<artifactId>EVSClient</artifactId>
<version>5.13.4-SNAPSHOT</version>
<version>5.13.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>EVSClient</name>
<description>EVSClient project, External Validation Service Front-end</description>
......@@ -89,7 +89,7 @@
<mockito.version>1.10.19</mockito.version>
<jacoco.version>0.8.1</jacoco.version>
<gazelle.calling.tools.version>1.0.2</gazelle.calling.tools.version>
<message.content.analyzer.version>2.3.3</message.content.analyzer.version>
<message.content.analyzer.version>2.3.4</message.content.analyzer.version>
<sonar.maven.plugin>3.7.0.1746</sonar.maven.plugin>
<nexus.url>https://gazelle.ihe.net/nexus</nexus.url>
<nexus.path>/content/groups/public/</nexus.path>
......@@ -218,13 +218,13 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>EVSClient-ejb</artifactId>
<version>5.13.4-SNAPSHOT</version>
<version>5.13.5-SNAPSHOT</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>EVSClient-ui</artifactId>
<version>5.13.4-SNAPSHOT</version>
<version>5.13.5-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment