Refactoring
This commit is contained in:
@@ -11,7 +11,7 @@ import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
import org.jboss.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Named("documentsBean")
|
||||
@@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
||||
public class DocumentsBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger LOGGER = Logger.getLogger(DocumentsBean.class.getName());
|
||||
private static final Logger LOG = Logger.getLogger(DocumentsBean.class);
|
||||
|
||||
// Constantes de navigation outcomes (WOU/DRY - réutilisables)
|
||||
private static final String OUTCOME_DOCUMENTS_VERSIONS = "documentsVersionsPage";
|
||||
@@ -66,7 +66,7 @@ public class DocumentsBean implements Serializable {
|
||||
statistiques.setEspaceUtilise("0 GB");
|
||||
statistiques.setPartagesMois(0);
|
||||
} catch (Exception e) {
|
||||
LOGGER.severe("Erreur lors du calcul des statistiques: " + e.getMessage());
|
||||
LOG.errorf(e, "Erreur lors du calcul des statistiques");
|
||||
statistiques.setTotalDocuments(0);
|
||||
statistiques.setTotalDossiers(0);
|
||||
statistiques.setEspaceUtilise("0 GB");
|
||||
@@ -233,19 +233,19 @@ public class DocumentsBean implements Serializable {
|
||||
tousLesDocuments.add(nouveau);
|
||||
appliquerFiltres();
|
||||
|
||||
LOGGER.info("Document téléchargé: " + nouveau.getNom());
|
||||
LOG.infof("Document téléchargé: %s", nouveau.getNom());
|
||||
initializeNouveauDocument();
|
||||
}
|
||||
|
||||
public void telechargerDocument(Document document) {
|
||||
document.setNombreTelecharements(document.getNombreTelecharements() + 1);
|
||||
LOGGER.info("Téléchargement du document: " + document.getNom());
|
||||
LOG.infof("Téléchargement du document: %s", document.getNom());
|
||||
}
|
||||
|
||||
public void supprimerDocument(Document document) {
|
||||
tousLesDocuments.remove(document);
|
||||
appliquerFiltres();
|
||||
LOGGER.info("Document supprimé: " + document.getNom());
|
||||
LOG.infof("Document supprimé: %s", document.getNom());
|
||||
}
|
||||
|
||||
public void dupliquerDocument() {
|
||||
@@ -268,14 +268,14 @@ public class DocumentsBean implements Serializable {
|
||||
|
||||
tousLesDocuments.add(copie);
|
||||
appliquerFiltres();
|
||||
LOGGER.info("Document dupliqué: " + copie.getNom());
|
||||
LOG.infof("Document dupliqué: %s", copie.getNom());
|
||||
}
|
||||
}
|
||||
|
||||
public void archiverDocument() {
|
||||
if (documentSelectionne != null) {
|
||||
documentSelectionne.setStatut("ARCHIVE");
|
||||
LOGGER.info("Document archivé: " + documentSelectionne.getNom());
|
||||
LOG.infof("Document archivé: %s", documentSelectionne.getNom());
|
||||
appliquerFiltres();
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public class DocumentsBean implements Serializable {
|
||||
if (documentSelectionne != null) {
|
||||
tousLesDocuments.remove(documentSelectionne);
|
||||
appliquerFiltres();
|
||||
LOGGER.info("Document supprimé définitivement: " + documentSelectionne.getNom());
|
||||
LOG.infof("Document supprimé définitivement: %s", documentSelectionne.getNom());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -633,4 +633,4 @@ public class DocumentsBean implements Serializable {
|
||||
public UUID getDossierId() { return dossierId; }
|
||||
public void setDossierId(UUID dossierId) { this.dossierId = dossierId; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user