Skip to content

Commit

Permalink
Merge pull request #166 from EsupPortail/test
Browse files Browse the repository at this point in the history
1.15.1-SNAPSHOT
  • Loading branch information
dlemaignent authored Oct 27, 2021
2 parents 50ab9ce + 0e73658 commit 5a9cd72
Show file tree
Hide file tree
Showing 65 changed files with 394 additions and 442 deletions.
7 changes: 5 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ build2:
script: mvn clean initialize && mvn -Dspring.config.location=/opt/tomcat-esup-signature/conf/app_config/application.yml clean package && cp -rf target/esup-signature.war /opt/tomcat-esup-signature/webapps/ROOT.war
only:
- tags
except:
- dev
- test
- master
tags:
- prod

- prod
29 changes: 22 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</parent>
<groupId>org.esupportail</groupId>
<artifactId>esup-signature</artifactId>
<version>1.15</version>
<version>1.15.1-SNAPSHOT</version>
<name>esup-signature</name>
<properties>
<start-class>org.esupportail.esupsignature.EsupSignatureApplication</start-class>
Expand All @@ -28,11 +28,6 @@
<swagger.version>3.0.0</swagger.version>
</properties>
<repositories>
<repository>
<id>spring-maven-release</id>
<name>Spring Maven Release Repository</name>
<url>https://maven.springframework.org/release</url>
</repository>
<repository>
<id>cefdigital</id>
<name>cefdigital</name>
Expand Down Expand Up @@ -213,7 +208,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.0.1</version>
<version>5.0.2</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand Down Expand Up @@ -745,6 +740,26 @@
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<target>
<replace token="@version@"
value="${project.version}">
<fileset dir="target/classes/static/js/" includes="**/*" />
</replace>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public FsProperties getFsProperties() {
}

@Bean
@ConditionalOnProperty({"fs.smb-uri"})
@ConditionalOnProperty({"fs.smb-test-uri"})
public SmbAccessImpl smbAccessImpl(){
SmbAccessImpl smbAccessImpl = new SmbAccessImpl();
smbAccessImpl.setDriveName("CIFS");
smbAccessImpl.setUri(fsProperties.getSmbUri());
smbAccessImpl.setUri(fsProperties.getSmbTestUri());
smbAccessImpl.setJcifsConfigProperties(smbProperties());
smbAccessImpl.setLogin(fsProperties.getSmbLogin());
smbAccessImpl.setPassword(fsProperties.getSmbPassword());
Expand All @@ -52,9 +52,7 @@ public Properties smbProperties(){
public VfsAccessImpl vfsAccessImpl(){
VfsAccessImpl vfsAccessImpl = new VfsAccessImpl();
vfsAccessImpl.setDriveName("VFS");
vfsAccessImpl.setUri(fsProperties.getVfsUri());
//vfsAccessImpl.setLogin(login);
//vfsAccessImpl.setPassword(password);
vfsAccessImpl.setUri(fsProperties.getVfsTestUri());
return vfsAccessImpl;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
@ConfigurationProperties(prefix="fs")
public class FsProperties {

private String smbUri;
private String smbTestUri;
private String smbLogin;
private String smbPassword;
private String smbDomain;
private String vfsUri;
private String vfsTestUri;
private String cmisUri;
private String cmisLogin;
private String cmisPassword;
private String cmisRespositoryId;
private String cmisRootPath;

public String getSmbUri() {
return smbUri;
public String getSmbTestUri() {
return smbTestUri;
}

public void setSmbUri(String smbUri) {
this.smbUri = smbUri;
public void setSmbTestUri(String smbTestUri) {
this.smbTestUri = smbTestUri;
}

public String getSmbLogin() {
Expand All @@ -48,12 +48,12 @@ public void setSmbDomain(String smbDomain) {
this.smbDomain = smbDomain;
}

public String getVfsUri() {
return vfsUri;
public String getVfsTestUri() {
return vfsTestUri;
}

public void setVfsUri(String vfsUri) {
this.vfsUri = vfsUri;
public void setVfsTestUri(String vfsTestUri) {
this.vfsTestUri = vfsTestUri;
}

public String getCmisUri() {
Expand Down
34 changes: 20 additions & 14 deletions src/main/java/org/esupportail/esupsignature/entity/Target.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package org.esupportail.esupsignature.entity;

import org.esupportail.esupsignature.entity.enums.DocumentIOType;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Entity
public class Target {
Expand All @@ -11,9 +14,6 @@ public class Target {
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Enumerated(EnumType.STRING)
private DocumentIOType targetType;

private String targetUri;

private Boolean targetOk = false;
Expand All @@ -26,14 +26,6 @@ public void setTargetOk(Boolean targetOk) {
this.targetOk = targetOk;
}

public DocumentIOType getTargetType() {
return targetType;
}

public void setTargetType(DocumentIOType targetType) {
this.targetType = targetType;
}

public String getTargetUri() {
return targetUri;
}
Expand All @@ -49,4 +41,18 @@ public void setId(Long id) {
public Long getId() {
return id;
}

public String getProtectedTargetUri() {
if(targetUri != null) {
Pattern p = Pattern.compile("[^@]*:\\/\\/[^:]*:([^@]*)@.*?$");
Matcher m = p.matcher(targetUri);
StringBuffer sb = new StringBuffer();
while (m.find()) {
m.appendReplacement(sb, m.group(0).replaceFirst(Pattern.quote(m.group(1)), "********"));
}
m.appendTail(sb);
return sb.toString();
}
return "";
}
}
48 changes: 19 additions & 29 deletions src/main/java/org/esupportail/esupsignature/entity/Workflow.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package org.esupportail.esupsignature.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.esupportail.esupsignature.entity.enums.DocumentIOType;
import org.esupportail.esupsignature.entity.enums.ShareType;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Entity
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"}, ignoreUnknown = true)
Expand Down Expand Up @@ -50,9 +53,6 @@ public class Workflow {

private Boolean sendAlertToAllRecipients = false;

@Enumerated(EnumType.STRING)
private DocumentIOType sourceType;

private String documentsSourceUri;

@ElementCollection(targetClass=String.class)
Expand Down Expand Up @@ -151,18 +151,24 @@ public void setPublicUsage(Boolean publicUsage) {
this.publicUsage = publicUsage;
}

public DocumentIOType getSourceType() {
return sourceType;
}

public void setSourceType(DocumentIOType sourceType) {
this.sourceType = sourceType;
}

public String getDocumentsSourceUri() {
return documentsSourceUri;
}

public String getProtectedDocumentsSourceUri() {
if(documentsSourceUri != null) {
Pattern p = Pattern.compile("[^@]*:\\/\\/[^:]*:([^@]*)@.*?$");
Matcher m = p.matcher(documentsSourceUri);
StringBuffer sb = new StringBuffer();
while (m.find()) {
m.appendReplacement(sb, m.group(0).replaceFirst(Pattern.quote(m.group(1)), "********"));
}
m.appendTail(sb);
return sb.toString();
}
return "";
}

public void setDocumentsSourceUri(String documentsSourceUri) {
this.documentsSourceUri = documentsSourceUri;
}
Expand Down Expand Up @@ -191,22 +197,6 @@ public void setWorkflowSteps(List<WorkflowStep> workflowSteps) {
this.workflowSteps = workflowSteps;
}

// public DocumentIOType getTargetType() {
// return targetType;
// }
//
// public void setTargetType(DocumentIOType targetType) {
// this.targetType = targetType;
// }
//
// public String getDocumentsTargetUri() {
// return documentsTargetUri;
// }
//
// public void setDocumentsTargetUri(String documentsTargetUri) {
// this.documentsTargetUri = documentsTargetUri;
// }

public List<String> getRoles() {
return roles;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
import org.esupportail.esupsignature.entity.User;
import org.esupportail.esupsignature.entity.Workflow;
import org.esupportail.esupsignature.entity.enums.SignRequestStatus;
import org.esupportail.esupsignature.repository.custom.SignBookRepositoryCustom;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SignBookRepository extends CrudRepository<SignBook, Long>, SignBookRepositoryCustom {
public interface SignBookRepository extends CrudRepository<SignBook, Long> {
List<SignBook> findByCreateByEppn(String createByEppn);
List<SignBook> findByStatus(SignRequestStatus signRequestStatus);
@Query("select count(s.id) from SignBook s join s.liveWorkflow.currentStep.recipients r where s.status = 'pending' and r.user.eppn = :recipientUserEppn and r.signed is false")
Long countByRecipientUserToSign(@Param("recipientUserEppn") String recipientUserEppn);
@Query("select s from SignBook s where s.liveWorkflow.workflow.id = :workflowId")
List<SignBook> findByWorkflowId(Long workflowId);
@Query("select s from SignBook s where s.liveWorkflow.workflow = :workflow")
@Query("select s from SignBook s where s.liveWorkflow.workflow = :workflow order by s.id")
List<SignBook> findByLiveWorkflowWorkflow(Workflow workflow);
@Query("select count(s) from SignBook s where s.liveWorkflow.workflow = :workflow")
int countByLiveWorkflowWorkflow(Workflow workflow);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5a9cd72

Please sign in to comment.