Permalink
Browse files

Gestion des courriers et 0.9.11

Change-Id: Icf08ab6dbaa135426d182483f67ff5cfda179177
  • Loading branch information...
cvagner committed Dec 8, 2016
1 parent 3307b05 commit 57ce3c62ad6a4a7177c7c358cb0fcfdf97919523
Showing with 4,960 additions and 702 deletions.
  1. +70 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument.java
  2. +13 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument_Roo_Configurable.aj
  3. +43 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument_Roo_Finder.aj
  4. +69 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument_Roo_JavaBean.aj
  5. +101 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument_Roo_Jpa_ActiveRecord.aj
  6. +13 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument_Roo_Jpa_Entity.aj
  7. +45 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument_Roo_Json.aj
  8. +16 −0 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/CourrierDocument_Roo_ToString.aj
  9. +3 −1 remocra/src/main/java/fr/sdis83/remocra/domain/remocra/Document.java
  10. +32 −0 remocra/src/main/java/fr/sdis83/remocra/service/TelechargementService.java
  11. +77 −4 remocra/src/main/java/fr/sdis83/remocra/util/DocumentUtil.java
  12. +39 −0 remocra/src/main/java/fr/sdis83/remocra/web/CourrierController.java
  13. +1 −1 remocra/src/main/java/fr/sdis83/remocra/web/RemocraController.java
  14. +13 −77 remocra/src/main/java/fr/sdis83/remocra/web/TelechargementController.java
  15. +17 −0 remocra/src/main/resources/dbre.xml
  16. +0 −10 server/sdis-remocra/home/postgres/pdi/.gitignore
  17. BIN server/sdis-remocra/home/postgres/pdi/libext/bcmail-jdk14-138.jar
  18. BIN server/sdis-remocra/home/postgres/pdi/libext/bcprov-jdk14-138.jar
  19. BIN ...er/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextReport/OpenDocumentTextReport.jar
  20. BIN ...er/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextReport/OpenDocumentTextReport.png
  21. BIN server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextReport/lib/freemarker.jar
  22. BIN server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextReport/lib/jodreports-2.4.0.jar
  23. BIN server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextReport/lib/xom-1.2.5.jar
  24. +27 −0 server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextReport/plugin.xml
  25. BIN server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextToPdf/OdtToPdfConverter.jar
  26. BIN server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextToPdf/OdtToPdfConverter.png
  27. BIN ...es/pdi/plugins/steps/OpenDocumentTextToPdf/lib/fr.opensagres.xdocreport.itext.extension-1.0.0.jar
  28. BIN server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextToPdf/lib/odfdom-java-0.8.7.jar
  29. BIN ...stgres/pdi/plugins/steps/OpenDocumentTextToPdf/lib/org.odftoolkit.odfdom.converter.core-1.0.0.jar
  30. BIN ...ostgres/pdi/plugins/steps/OpenDocumentTextToPdf/lib/org.odftoolkit.odfdom.converter.pdf-1.0.0.jar
  31. BIN ...tgres/pdi/plugins/steps/OpenDocumentTextToPdf/lib/org.odftoolkit.odfdom.converter.xhtml-1.0.0.jar
  32. +28 −0 server/sdis-remocra/home/postgres/pdi/plugins/steps/OpenDocumentTextToPdf/plugin.xml
  33. +3,588 −608 server/sdis-remocra/home/postgres/pdi_db/000_remocra_pdi_all.sql
  34. +1 −1 server/sdis-remocra/home/postgres/remocra_db/patches/056/056.sql
  35. +335 −0 server/sdis-remocra/home/postgres/remocra_db/patches/057/057.sql
  36. +1 −0 server/sdis-remocra/home/postgres/remocra_db/patches/all_patches.sql
  37. BIN ...-remocra/var/remocra/modeles/83/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_INFORMATION_MAIRIE.OTT
  38. BIN .../var/remocra/modeles/83/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_INFORMATION_PRESIDENT_EPCI.OTT
  39. BIN ...sdis-remocra/var/remocra/modeles/83/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_RAPPORT_MAIRIE.OTT
  40. BIN ...ocra/var/remocra/modeles/83/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_RAPPORT_PRESIDENT_EPCI.OTT
  41. BIN ...dis-remocra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_INFORMATION_MAIRIE.OTT
  42. +41 −0 ...dis-remocra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_INFORMATION_MAIRIE.SQL
  43. BIN ...cra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_INFORMATION_PRESIDENT_EPCI.OTT
  44. +41 −0 ...cra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_INFORMATION_PRESIDENT_EPCI.SQL
  45. BIN ...er/sdis-remocra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_RAPPORT_MAIRIE.OTT
  46. +173 −0 ...er/sdis-remocra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_RAPPORT_MAIRIE.SQL
  47. BIN ...remocra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_RAPPORT_PRESIDENT_EPCI.OTT
  48. +173 −0 ...remocra/var/remocra/modeles/RECONNAISSANCE_OPERATIONNELLE_PEI_COURRIER_RAPPORT_PRESIDENT_EPCI.SQL
@@ -0,0 +1,70 @@
package fr.sdis83.remocra.domain.remocra;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.json.RooJson;
import org.springframework.roo.addon.tostring.RooToString;

import fr.sdis83.remocra.domain.utils.RemocraDateHourTransformer;

@RooJavaBean
@RooToString
@RooJson
@RooJpaActiveRecord(versionField = "", finders = { "findCourrierDocumentsByCodeEquals" })
public class CourrierDocument {

public enum TypeDestinataire {
ORGANISME, UTILISATEUR, AUTRE
}

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@ManyToOne(optional = false)
@OnDelete(action = OnDeleteAction.CASCADE)
@NotNull
private Document document;

@NotNull
@Column(name = "code", columnDefinition = "character varying NOT NULL DEFAULT md5(((('courrier-destinataire-'::text || (now())::text) || '-'::text) || floor(((random() * (10000)::double precision) + (1)::double precision))))")
private String code;

private String nomDestinataire;

@Enumerated(EnumType.STRING)
@NotNull
private TypeDestinataire typeDestinataire;

@NotNull
private String idDestinataire;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(pattern = RemocraDateHourTransformer.FORMAT)
@Column(name = "accuse", columnDefinition = "timestamp without time zone")
private Date accuse;

@DateTimeFormat(pattern = RemocraDateHourTransformer.FORMAT)
Date getDateDoc() {
return document.getDateDoc();
}
}
@@ -0,0 +1,13 @@
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).

package fr.sdis83.remocra.domain.remocra;

import fr.sdis83.remocra.domain.remocra.CourrierDocument;
import org.springframework.beans.factory.annotation.Configurable;

privileged aspect CourrierDocument_Roo_Configurable {

declare @type: CourrierDocument: @Configurable;

}
@@ -0,0 +1,43 @@
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).

package fr.sdis83.remocra.domain.remocra;

import fr.sdis83.remocra.domain.remocra.CourrierDocument;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;

privileged aspect CourrierDocument_Roo_Finder {

public static Long CourrierDocument.countFindCourrierDocumentsByCodeEquals(String code) {
if (code == null || code.length() == 0) throw new IllegalArgumentException("The code argument is required");
EntityManager em = CourrierDocument.entityManager();
TypedQuery q = em.createQuery("SELECT COUNT(o) FROM CourrierDocument AS o WHERE o.code = :code", Long.class);
q.setParameter("code", code);
return ((Long) q.getSingleResult());
}

public static TypedQuery<CourrierDocument> CourrierDocument.findCourrierDocumentsByCodeEquals(String code) {
if (code == null || code.length() == 0) throw new IllegalArgumentException("The code argument is required");
EntityManager em = CourrierDocument.entityManager();
TypedQuery<CourrierDocument> q = em.createQuery("SELECT o FROM CourrierDocument AS o WHERE o.code = :code", CourrierDocument.class);
q.setParameter("code", code);
return q;
}

public static TypedQuery<CourrierDocument> CourrierDocument.findCourrierDocumentsByCodeEquals(String code, String sortFieldName, String sortOrder) {
if (code == null || code.length() == 0) throw new IllegalArgumentException("The code argument is required");
EntityManager em = CourrierDocument.entityManager();
String jpaQuery = "SELECT o FROM CourrierDocument AS o WHERE o.code = :code";
if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {
jpaQuery = jpaQuery + " ORDER BY " + sortFieldName;
if ("ASC".equalsIgnoreCase(sortOrder) || "DESC".equalsIgnoreCase(sortOrder)) {
jpaQuery = jpaQuery + " " + sortOrder;
}
}
TypedQuery<CourrierDocument> q = em.createQuery(jpaQuery, CourrierDocument.class);
q.setParameter("code", code);
return q;
}

}
@@ -0,0 +1,69 @@
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).

package fr.sdis83.remocra.domain.remocra;

import fr.sdis83.remocra.domain.remocra.CourrierDocument;
import fr.sdis83.remocra.domain.remocra.CourrierDocument.TypeDestinataire;
import fr.sdis83.remocra.domain.remocra.Document;
import java.util.Date;
import java.util.Set;

privileged aspect CourrierDocument_Roo_JavaBean {

public Long CourrierDocument.getId() {
return this.id;
}

public void CourrierDocument.setId(Long id) {
this.id = id;
}

public Document CourrierDocument.getDocument() {
return this.document;
}

public void CourrierDocument.setDocument(Document document) {
this.document = document;
}

public String CourrierDocument.getCode() {
return this.code;
}

public void CourrierDocument.setCode(String code) {
this.code = code;
}

public String CourrierDocument.getNomDestinataire() {
return this.nomDestinataire;
}

public void CourrierDocument.setNomDestinataire(String nomDestinataire) {
this.nomDestinataire = nomDestinataire;
}

public TypeDestinataire CourrierDocument.getTypeDestinataire() {
return this.typeDestinataire;
}

public void CourrierDocument.setTypeDestinataire(TypeDestinataire typeDestinataire) {
this.typeDestinataire = typeDestinataire;
}

public String CourrierDocument.getIdDestinataire() {
return this.idDestinataire;
}

public void CourrierDocument.setIdDestinataire(String idDestinataire) {
this.idDestinataire = idDestinataire;
}

public Date CourrierDocument.getAccuse() {
return this.accuse;
}

public void CourrierDocument.setAccuse(Date accuse) {
this.accuse = accuse;
}
}
@@ -0,0 +1,101 @@
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).

package fr.sdis83.remocra.domain.remocra;

import fr.sdis83.remocra.domain.remocra.CourrierDocument;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.transaction.annotation.Transactional;

privileged aspect CourrierDocument_Roo_Jpa_ActiveRecord {

@PersistenceContext
transient EntityManager CourrierDocument.entityManager;

public static final List<String> CourrierDocument.fieldNames4OrderClauseFilter = java.util.Arrays.asList("id", "document", "code", "typeDestinataire", "idDestinataire", "accuse", "dateDoc");

public static final EntityManager CourrierDocument.entityManager() {
EntityManager em = new CourrierDocument().entityManager;
if (em == null) throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)");
return em;
}

public static long CourrierDocument.countCourrierDocuments() {
return entityManager().createQuery("SELECT COUNT(o) FROM CourrierDocument o", Long.class).getSingleResult();
}

public static List<CourrierDocument> CourrierDocument.findAllCourrierDocuments() {
return entityManager().createQuery("SELECT o FROM CourrierDocument o", CourrierDocument.class).getResultList();
}

public static List<CourrierDocument> CourrierDocument.findAllCourrierDocuments(String sortFieldName, String sortOrder) {
String jpaQuery = "SELECT o FROM CourrierDocument o";
if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {
jpaQuery = jpaQuery + " ORDER BY " + sortFieldName;
if ("ASC".equalsIgnoreCase(sortOrder) || "DESC".equalsIgnoreCase(sortOrder)) {
jpaQuery = jpaQuery + " " + sortOrder;
}
}
return entityManager().createQuery(jpaQuery, CourrierDocument.class).getResultList();
}

public static CourrierDocument CourrierDocument.findCourrierDocument(Long id) {
if (id == null) return null;
return entityManager().find(CourrierDocument.class, id);
}

public static List<CourrierDocument> CourrierDocument.findCourrierDocumentEntries(int firstResult, int maxResults) {
return entityManager().createQuery("SELECT o FROM CourrierDocument o", CourrierDocument.class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
}

public static List<CourrierDocument> CourrierDocument.findCourrierDocumentEntries(int firstResult, int maxResults, String sortFieldName, String sortOrder) {
String jpaQuery = "SELECT o FROM CourrierDocument o";
if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {
jpaQuery = jpaQuery + " ORDER BY " + sortFieldName;
if ("ASC".equalsIgnoreCase(sortOrder) || "DESC".equalsIgnoreCase(sortOrder)) {
jpaQuery = jpaQuery + " " + sortOrder;
}
}
return entityManager().createQuery(jpaQuery, CourrierDocument.class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
}

@Transactional
public void CourrierDocument.persist() {
if (this.entityManager == null) this.entityManager = entityManager();
this.entityManager.persist(this);
}

@Transactional
public void CourrierDocument.remove() {
if (this.entityManager == null) this.entityManager = entityManager();
if (this.entityManager.contains(this)) {
this.entityManager.remove(this);
} else {
CourrierDocument attached = CourrierDocument.findCourrierDocument(this.id);
this.entityManager.remove(attached);
}
}

@Transactional
public void CourrierDocument.flush() {
if (this.entityManager == null) this.entityManager = entityManager();
this.entityManager.flush();
}

@Transactional
public void CourrierDocument.clear() {
if (this.entityManager == null) this.entityManager = entityManager();
this.entityManager.clear();
}

@Transactional
public CourrierDocument CourrierDocument.merge() {
if (this.entityManager == null) this.entityManager = entityManager();
CourrierDocument merged = this.entityManager.merge(this);
this.entityManager.flush();
return merged;
}

}
@@ -0,0 +1,13 @@
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).

package fr.sdis83.remocra.domain.remocra;

import fr.sdis83.remocra.domain.remocra.CourrierDocument;
import javax.persistence.Entity;

privileged aspect CourrierDocument_Roo_Jpa_Entity {

declare @type: CourrierDocument: @Entity;

}
@@ -0,0 +1,45 @@
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).

package fr.sdis83.remocra.domain.remocra;

import flexjson.JSONDeserializer;
import flexjson.JSONSerializer;
import fr.sdis83.remocra.domain.remocra.CourrierDocument;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

privileged aspect CourrierDocument_Roo_Json {

public String CourrierDocument.toJson() {
return new JSONSerializer()
.exclude("*.class").serialize(this);
}

public String CourrierDocument.toJson(String[] fields) {
return new JSONSerializer()
.include(fields).exclude("*.class").serialize(this);
}

public static CourrierDocument CourrierDocument.fromJsonToCourrierDocument(String json) {
return new JSONDeserializer<CourrierDocument>()
.use(null, CourrierDocument.class).deserialize(json);
}

public static String CourrierDocument.toJsonArray(Collection<CourrierDocument> collection) {
return new JSONSerializer()
.exclude("*.class").serialize(collection);
}

public static String CourrierDocument.toJsonArray(Collection<CourrierDocument> collection, String[] fields) {
return new JSONSerializer()
.include(fields).exclude("*.class").serialize(collection);
}

public static Collection<CourrierDocument> CourrierDocument.fromJsonArrayToCourrierDocuments(String json) {
return new JSONDeserializer<List<CourrierDocument>>()
.use("values", CourrierDocument.class).deserialize(json);
}

}
@@ -0,0 +1,16 @@
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).

package fr.sdis83.remocra.domain.remocra;

import fr.sdis83.remocra.domain.remocra.CourrierDocument;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

privileged aspect CourrierDocument_Roo_ToString {

public String CourrierDocument.toString() {
return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}

}
@@ -35,7 +35,9 @@
// Blocs (documents génériques)
BLOC,
// "Métiers"
ALERTE, HYDRANT, PERMIS, RCI
ALERTE, HYDRANT, PERMIS, RCI,
// Courrier
COURRIER
}

@Id
Oops, something went wrong.

0 comments on commit 57ce3c6

Please sign in to comment.