entry : firstStudent.getAttributes().entrySet()) {
String key = entry.getKey();
if(chckToutesLesColonnes.isSelected() ) {
headTable.put(key, indexCol);
indexCol++;
}else {
- if(key.equals("Individu_-_Nom") || key.equals("Individu_-_Prenom") || key.equals("Individu_-_Code_Etudiant")) {
+ if(key.equals(commandes.nomColonneNomEtudiant) || key.equals(commandes.nomColonnePrenomEtudiant) || key.equals(commandes.nomColonneCodeEtudiant)) {
headTable.put(key, indexCol);
indexCol++;
}
@@ -1362,7 +1370,7 @@ public class Window_gestionnaire extends JFrame {
if(!textPaneNom.getText().isEmpty()) {
searchStudent=true;
- nameStudent = nStudent.getAttributes("Individu_-_Nom").toLowerCase();
+ nameStudent = nStudent.getAttributes(commandes.nomColonneNomEtudiant).toLowerCase();
String nameSearch = textPaneNom.getText().toLowerCase();
boolean commencePar = nameStudent.matches("^"+nameSearch+".*");
if(commencePar) containNameStudent=true;
@@ -1386,10 +1394,10 @@ public class Window_gestionnaire extends JFrame {
if(headTable.get(entry.getKey())!=null) {
String key = entry.getKey();
if(chckToutesLesColonnes.isSelected() ) {
- data[indexRow][headTable.get(key)] = entry.getValue();
+ if(!key.equals(commandes.nomColonneFormation)) data[indexRow][headTable.get(key)] = entry.getValue();
}else {
int indexColumn = headTable.get(key);
- if(key.equals("Individu_-_Nom") || key.equals("Individu_-_Prenom") || key.equals("Individu_-_Code_Etudiant")) {
+ if(key.equals(commandes.nomColonneNomEtudiant) || key.equals(commandes.nomColonnePrenomEtudiant) || key.equals(commandes.nomColonneCodeEtudiant)) {
data[indexRow][indexColumn] = entry.getValue();
}
if(chckGroupePrincipal.isSelected() && key.equals("Groupe_Principal") ) {
@@ -1479,8 +1487,8 @@ public class Window_gestionnaire extends JFrame {
if (row != -1 && column != -1) {
String key = getColumnsName()[column];
- if(key.equals("IAE_-_Etape_lib.") || key.equals("Individu_-_Code_Etudiant")
- || key.equals("Individu_-_Email")) {
+ if(key.equals(commandes.nomColonneFormation) || key.equals(commandes.nomColonneCodeEtudiant)
+ || key.equals(commandes.nomColonneMailUnivEtudiant)) {
JOptionPane.showMessageDialog(null, "Impossible de modifier ce contenu.
"
+ "Actualisez la table pour ne plus voir votre saisie.", "Erreur", JOptionPane.ERROR_MESSAGE);
return;
@@ -1489,7 +1497,7 @@ public class Window_gestionnaire extends JFrame {
String value = (String) table.getValueAt(row, column);
// Obtenir l'indice de la colonne "Individu_-_Code_Etudiant"
- int columnIndex = table.getColumnModel().getColumnIndex("Individu_-_Code_Etudiant");
+ int columnIndex = table.getColumnModel().getColumnIndex(commandes.nomColonneCodeEtudiant);
String numeroEtudiant = (String) table.getModel().getValueAt(row, columnIndex);
noeud nF = commandes.nBase.getChild(defautYear).getChild(cFormations.getSelectedItem().toString());
diff --git a/src/base/base.java b/src/base/base.java
index 44b1375..2fd56fd 100644
--- a/src/base/base.java
+++ b/src/base/base.java
@@ -30,6 +30,32 @@ public class base {
nBase.setAttribut("date_derniere_modification",DateEnClairFR(aujourdhui));
nBase.setAttribut("version",commandes.version);
+ // Chargement des noms des colonnes par défaut pour inscrire des étudiants.
+ correspondanceNomDeColonneInscription.chargementParDefaut();
+
+ nBase.setAttribut("Formation",commandes.nomColonneFormation);
+ nBase.setAttribut(commandes.nomColonneCodeEtudiant,commandes.nomColonneCodeEtudiant);
+ nBase.setAttribut(commandes.nomColonneNomEtudiant,commandes.nomColonneNomEtudiant);
+ nBase.setAttribut(commandes.nomColonnePrenomEtudiant,commandes.nomColonnePrenomEtudiant);
+ nBase.setAttribut(commandes.nomColonneProfilEtudiant,commandes.nomColonneProfilEtudiant);
+ nBase.setAttribut(commandes.nomColonneBacEtudiant,commandes.nomColonneBacEtudiant);
+ nBase.setAttribut(commandes.nomColonnePortableEtudiant,commandes.nomColonnePortableEtudiant);
+ nBase.setAttribut(commandes.nomColonneMailPersoEtudiant,commandes.nomColonneMailPersoEtudiant);
+ nBase.setAttribut(commandes.nomColonneMailUnivEtudiant,commandes.nomColonneMailUnivEtudiant);
+
+ nBase.setAttribut("Excel_Formation",commandes.nomColonneExcel_Formation);
+ nBase.setAttribut("Excel_"+commandes.nomColonneCodeEtudiant,commandes.nomColonneExcel_CodeEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneNomEtudiant,commandes.nomColonneExcel_NomEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonnePrenomEtudiant,commandes.nomColonneExcel_PrenomEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneProfilEtudiant,commandes.nomColonneExcel_ProfilEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneBacEtudiant,commandes.nomColonneExcel_BacEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonnePortableEtudiant,commandes.nomColonneExcel_PortableEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneMailPersoEtudiant,commandes.nomColonneExcel_MailPersoEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneMailUnivEtudiant,commandes.nomColonneExcel_MailUnivEtudiant);
+
+
+
+
String defaultValue = "2022-2023";
String userInput = JOptionPane.showInputDialog("Quelle est l'année universitaire ? ",defaultValue);
@@ -58,16 +84,14 @@ public class base {
} else {
- System.out.println("Le format est valide, mais le premier nombre n'est pas inférieur au second nombre.");
JPanel panel = new JPanel();
- JLabel message = new JLabel("Le format est valide, la première année n'est pas inférieure à la seconde année.
"
+ JLabel message = new JLabel("Le format est valide, la première année n'est pas inférieure à la seconde année d'une année.
"
+ "Exemple de format : 2023-2024
");
panel.add(message);
JOptionPane.showMessageDialog(null, panel, "Erreur", JOptionPane.ERROR_MESSAGE);
}
} else {
- System.out.println("Le format est invalide.");
JPanel panel = new JPanel();
JLabel message = new JLabel("Le format est invalide.
"
+ "Exemple de format : 2023-2024
");
diff --git a/src/base/correspondanceNomDeColonneInscription.java b/src/base/correspondanceNomDeColonneInscription.java
new file mode 100644
index 0000000..d639708
--- /dev/null
+++ b/src/base/correspondanceNomDeColonneInscription.java
@@ -0,0 +1,88 @@
+package base;
+
+import java.util.HashMap;
+
+import outils.commandes;
+import outils.supprimeCaracatresSpeciaux;
+
+public class correspondanceNomDeColonneInscription {
+
+ public static void chargement() {
+ // Valeurs par défaut
+ commandes.nomColonneFormation = commandes.nBase.getAttributes("Formation");
+ commandes.nomColonneNomEtudiant = commandes.nBase.getAttributes("Individu_-_Nom");
+ commandes.nomColonnePrenomEtudiant = commandes.nBase.getAttributes("Individu_-_Prenom");
+ commandes.nomColonneCodeEtudiant = commandes.nBase.getAttributes("Individu_-_Code_Etudiant");
+ commandes.nomColonneProfilEtudiant = commandes.nBase.getAttributes("Profil_etudiant_lib.");
+ commandes.nomColonneBacEtudiant = commandes.nBase.getAttributes("Bac_ou_equivalence_lib.");
+ commandes.nomColonnePortableEtudiant = commandes.nBase.getAttributes("Individu_-_Tel._portable");
+ commandes.nomColonneMailPersoEtudiant = commandes.nBase.getAttributes("Individu_-_Email_personnel");
+ commandes.nomColonneMailUnivEtudiant = commandes.nBase.getAttributes("Individu_-_Email");
+
+ commandes.nomColonneExcel_Formation = commandes.nBase.getAttributes("Excel_Formation");
+ commandes.nomColonneExcel_NomEtudiant = commandes.nBase.getAttributes("Excel_Individu_-_Nom");
+ commandes.nomColonneExcel_PrenomEtudiant = commandes.nBase.getAttributes("Excel_Individu_-_Prenom");
+ commandes.nomColonneExcel_CodeEtudiant = commandes.nBase.getAttributes("Excel_Individu_-_Code_Etudiant");
+ commandes.nomColonneExcel_ProfilEtudiant = commandes.nBase.getAttributes("Excel_Profil_etudiant_lib.");
+ commandes.nomColonneExcel_BacEtudiant = commandes.nBase.getAttributes("Excel_Bac_ou_equivalence_lib.");
+ commandes.nomColonneExcel_PortableEtudiant = commandes.nBase.getAttributes("Excel_Individu_-_Tel._portable");
+ commandes.nomColonneExcel_MailPersoEtudiant = commandes.nBase.getAttributes("Excel_Individu_-_Email_personnel");
+ commandes.nomColonneExcel_MailUnivEtudiant = commandes.nBase.getAttributes("Excel_Individu_-_Email");
+
+ }
+
+ /**
+ * chargement des noms des colonnes dans le classeur des inscriptions.
+ * Ce classeur est fourni par le service administratif DSI qui le transmet au secrétarait de chaque UFR.
+ * Ce classeur doit contenir ces colonnes après traitement des caractères.
+ */
+ public static void chargementParDefaut() {
+
+ commandes.nomColonneExcel_Formation = "IAE - Version d'étape (lib. web)";
+ commandes.nomColonneExcel_NomEtudiant = "Individu - Nom";
+ commandes.nomColonneExcel_PrenomEtudiant = "Individu - Prénom";
+ commandes.nomColonneExcel_CodeEtudiant = "Individu - Code Etudiant";
+ commandes.nomColonneExcel_ProfilEtudiant = "Profil étudiant (lib.)";
+ commandes.nomColonneExcel_BacEtudiant = "Bac ou équivalence (lib.)";
+ commandes.nomColonneExcel_PortableEtudiant = "Individu - Tél. portable";
+ commandes.nomColonneExcel_MailPersoEtudiant = "Individu - Email personnel";
+ commandes.nomColonneExcel_MailUnivEtudiant = "Individu - Email";
+
+ commandes.nomColonneFormation = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_Formation);//"IAE_-_Version_detape_lib._web";
+ commandes.nomColonneNomEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_NomEtudiant);//"Individu_-_Nom";
+ commandes.nomColonnePrenomEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_PrenomEtudiant);; //"Individu_-_Prenom";
+ commandes.nomColonneCodeEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_CodeEtudiant);//"Individu_-_Code_Etudiant";
+ commandes.nomColonneProfilEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_ProfilEtudiant); //"Profil_etudiant_lib.";
+ commandes.nomColonneBacEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_BacEtudiant);//"Bac_ou_equivalence_lib.";
+ commandes.nomColonnePortableEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_PortableEtudiant);//"Individu_-_Tel._portable";
+ commandes.nomColonneMailPersoEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_MailPersoEtudiant);//"Individu_-_Email_personnel";
+ commandes.nomColonneMailUnivEtudiant = supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(commandes.nomColonneExcel_MailUnivEtudiant);//"Individu_-_Email";
+ }
+
+ public static void modifierLesNoms(HashMap nomColonne) {
+
+ String nomColonneFormationDansBase = commandes.nBase.getAttributes("Formation");
+
+
+ commandes.nomColonneFormation = nomColonne.get("Formation");
+// commandes.nomColonneNomEtudiant = nomColonne.get("Individu_-_Nom");
+// commandes.nomColonneNomEtudiant = nomColonne.get("Individu_-_Prenom");
+// commandes.nomColonneCodeEtudiant = nomColonne.get("Individu_-_Code_Etudiant");
+// commandes.nomColonneProfilEtudiant = nomColonne.get("Profil étudiant (lib.)");
+// commandes.nomColonneProfilEtudiant = nomColonne.get("Bac ou équivalence (lib.)");
+// commandes.nomColonnePortableEtudiant = nomColonne.get("Individu - Tél. portable");
+// commandes.nomColonneMailPersoEtudiant = nomColonne.get("Individu - Email personnel");
+// commandes.nomColonneMailUnivEtudiant = nomColonne.get("Individu - Email");
+
+ String baseString = commandes.nBase.toWrite();
+
+ String regex = "\\s"+nomColonneFormationDansBase + "=";
+ String texte = " " + nomColonne.get("Formation") + "=";
+ baseString = baseString.replaceAll(regex,texte);
+
+
+
+ }
+
+
+}
diff --git a/src/exportations/CreateCalcWorkbook.java b/src/exportations/CreateCalcWorkbook.java
index 16d10cd..ff6ea62 100644
--- a/src/exportations/CreateCalcWorkbook.java
+++ b/src/exportations/CreateCalcWorkbook.java
@@ -4,6 +4,8 @@ import java.awt.BorderLayout;
import java.awt.Dimension;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
import javax.swing.JFrame;
import javax.swing.JLabel;
@@ -88,6 +90,8 @@ public class CreateCalcWorkbook extends JFrame{
try (Workbook workbook = new XSSFWorkbook()) {
int rows = data.length; // Nombre de lignes
int columns = data[0].length;
+ List nomDesFeuillesPresentes = new ArrayList();
+ int compteurNom = 1;
// Créer un style de cellule avec des bordures
CellStyle cellStyle = workbook.createCellStyle();
@@ -103,8 +107,19 @@ public class CreateCalcWorkbook extends JFrame{
String nameFormation = new String((String) data[i][0]);
String[][] data1 = (String[][]) data[i][columns-1];
-
+
String nomFeuille = new String(nameFormation);
+
+ if(nomFeuille.length()>26) {
+ nomFeuille = nomFeuille.substring(0, 26);
+ }
+ if(!nomDesFeuillesPresentes.contains(nomFeuille)) {
+ nomDesFeuillesPresentes.add(nomFeuille);
+ }else {
+ nomFeuille = nomFeuille + "_" +String.valueOf(compteurNom++);
+ nomDesFeuillesPresentes.add(nomFeuille);
+ }
+
Sheet sheet = workbook.createSheet(nomFeuille);
//Entête de la première ligne
@@ -119,19 +134,21 @@ public class CreateCalcWorkbook extends JFrame{
// Boucle pour insérer les données dans les colonnes
int rowNum = 1;
- for (Object[] rowData : data1) {
- Row row = sheet.createRow(rowNum++);
-
- int colNum = 0;
- for (Object cellData : rowData) {
- Cell cell = row.createCell(colNum++);
- if (cellData instanceof String) {
- cell.setCellValue((String) cellData);
- } else if (cellData instanceof Integer) {
- cell.setCellValue((Integer) cellData);
- }
- cell.setCellStyle(cellStyle);
- }
+ if(data1!=null) {
+ for (Object[] rowData : data1) {
+ Row row = sheet.createRow(rowNum++);
+
+ int colNum = 0;
+ for (Object cellData : rowData) {
+ Cell cell = row.createCell(colNum++);
+ if (cellData instanceof String) {
+ cell.setCellValue((String) cellData);
+ } else if (cellData instanceof Integer) {
+ cell.setCellValue((Integer) cellData);
+ }
+ cell.setCellStyle(cellStyle);
+ }
+ }
}
for(int j = 0 ; j < tailleHead; j++) {
diff --git a/src/exportations/exportBaseToExcel.java b/src/exportations/exportBaseToExcel.java
index 87ce07d..0094a54 100644
--- a/src/exportations/exportBaseToExcel.java
+++ b/src/exportations/exportBaseToExcel.java
@@ -20,29 +20,25 @@ public class exportBaseToExcel {
}
-
-
public static void exportBase() {
// Données
Object[][] data = new Object[commandes.nBase.getChild(commandes.nBase.getAttributes("defaut_Year")).getNumberChildren()][33];
-
int indexFormation = 0 ;
for(noeud formation : commandes.nBase.getChild(commandes.nBase.getAttributes("defaut_Year")).getChildren()) {
-
- data[indexFormation][0] = formation.getFirstChild().getAttributes("IAE_-_Version_detape_lib._web");
+ data[indexFormation][0] = formation.getName();
data[indexFormation][1] = "Formation";
- data[indexFormation][2] = "Individu_-_Code_Etudiant";
- data[indexFormation][3] = "Individu_-_Prenom";
- data[indexFormation][4] = "Individu_-_Nom";
- data[indexFormation][5] = "Profil_etudiant_lib.";
- data[indexFormation][6] = "Individu_-_Tel._portable";
- data[indexFormation][7] = "Individu_-_Email_personnel";
- data[indexFormation][8] = "Individu_-_Email";
+ data[indexFormation][2] = commandes.nomColonneCodeEtudiant; //.nBase.getAttributes("Individu_-_Code_Etudiant");
+ data[indexFormation][3] = commandes.nomColonnePrenomEtudiant; //nBase.getAttributes("Individu_-_Prenom");
+ data[indexFormation][4] = commandes.nomColonneNomEtudiant; //nBase.getAttributes("Individu_-_Nom");
+ data[indexFormation][5] = commandes.nomColonneProfilEtudiant; //nBase.getAttributes("Profil_etudiant_lib.");
+ data[indexFormation][6] = commandes.nomColonnePortableEtudiant; //nBase.getAttributes("Individu_-_Tel._portable");
+ data[indexFormation][7] = commandes.nomColonneMailPersoEtudiant; //nBase.getAttributes("Individu_-_Email_personnel");
+ data[indexFormation][8] = commandes.nomColonneMailUnivEtudiant; //nBase.getAttributes("Individu_-_Email");
data[indexFormation][9] = "Groupe_Principal";
data[indexFormation][10] = "Groupe_TD";
data[indexFormation][11] = "Groupe_LV1";
@@ -67,42 +63,41 @@ public class exportBaseToExcel {
data[indexFormation][30] = "Num_convention_2";
data[indexFormation][31] = "Periode_2";
- String[][] data1 = new String[formation.getNumberChildren()][32];
+ String[][] data1 = new String[formation.getNumberChildren()][31];
int indexStudent = 0;
for(noeud nStudent : formation.getChildren()) {
- data1[indexStudent][0] = nStudent.getAttributes("IAE_-_Version_detape_lib._web");;
- data1[indexStudent][1] = nStudent.getAttributes("Individu_-_Code_Etudiant");
- data1[indexStudent][2] = nStudent.getAttributes("Individu_-_Prenom");
- data1[indexStudent][3] = nStudent.getAttributes("Individu_-_Nom");
- data1[indexStudent][4] = nStudent.getAttributes("Profil_etudiant_lib.");
- data1[indexStudent][5] = nStudent.getAttributes("Individu_-_Tel._portable");
- data1[indexStudent][6] = nStudent.getAttributes("Individu_-_Email_personnel");
- data1[indexStudent][7] = nStudent.getAttributes("Individu_-_Email");
- data1[indexStudent][8] = nStudent.getAttributes("Groupe");
- data1[indexStudent][9] = nStudent.getAttributes("Groupe_Principal");
- data1[indexStudent][10] = nStudent.getAttributes("Groupe_TD");
- data1[indexStudent][11] = nStudent.getAttributes("Groupe_LV1");
- data1[indexStudent][12] = nStudent.getAttributes("Groupe_LV2");
- data1[indexStudent][13] = nStudent.getAttributes("LV1");
- data1[indexStudent][14] = nStudent.getAttributes("LV2");
- data1[indexStudent][15] = nStudent.getAttributes("Regime");
- data1[indexStudent][16] = nStudent.getAttributes("Groupe_TP");
- data1[indexStudent][17] = nStudent.getAttributes("Groupe_Informatique");
- data1[indexStudent][18] = nStudent.getAttributes("Groupe_Projet");
- data1[indexStudent][19] = nStudent.getAttributes("Groupe_Doc");
- data1[indexStudent][20] = nStudent.getAttributes("Atelier-rentree_horaire");
- data1[indexStudent][21] = nStudent.getAttributes("Atelier_pre-rentree_enseignant");
- data1[indexStudent][22] = nStudent.getAttributes("Atelier_pre-rentree_salle");
- data1[indexStudent][23] = nStudent.getAttributes("UE_Libre");
- data1[indexStudent][24] = nStudent.getAttributes("Covoiturage");
- data1[indexStudent][25] = nStudent.getAttributes("Etudiant_Covoiturage");
- data1[indexStudent][26] = nStudent.getAttributes("Stage_1");
- data1[indexStudent][27] = nStudent.getAttributes("Num_convention_1");
- data1[indexStudent][28] = nStudent.getAttributes("Periode_1");
- data1[indexStudent][29] = nStudent.getAttributes("Stage_2");
- data1[indexStudent][30] = nStudent.getAttributes("Num_convention_2");
- data1[indexStudent][31] = nStudent.getAttributes("Periode_2");
+ data1[indexStudent][0] = nStudent.getAttributes(commandes.nomColonneFormation);
+ data1[indexStudent][1] = nStudent.getAttributes(commandes.nomColonneCodeEtudiant);
+ data1[indexStudent][2] = nStudent.getAttributes(commandes.nomColonnePrenomEtudiant);
+ data1[indexStudent][3] = nStudent.getAttributes(commandes.nomColonneNomEtudiant);
+ data1[indexStudent][4] = nStudent.getAttributes(commandes.nomColonneProfilEtudiant);
+ data1[indexStudent][5] = nStudent.getAttributes(commandes.nomColonnePortableEtudiant);
+ data1[indexStudent][6] = nStudent.getAttributes(commandes.nomColonneMailPersoEtudiant);
+ data1[indexStudent][7] = nStudent.getAttributes(commandes.nomColonneMailUnivEtudiant);
+ data1[indexStudent][8] = nStudent.getAttributes("Groupe_Principal");
+ data1[indexStudent][9] = nStudent.getAttributes("Groupe_TD");
+ data1[indexStudent][10] = nStudent.getAttributes("Groupe_LV1");
+ data1[indexStudent][11] = nStudent.getAttributes("Groupe_LV2");
+ data1[indexStudent][12] = nStudent.getAttributes("LV1");
+ data1[indexStudent][13] = nStudent.getAttributes("LV2");
+ data1[indexStudent][14] = nStudent.getAttributes("Regime");
+ data1[indexStudent][15] = nStudent.getAttributes("Groupe_TP");
+ data1[indexStudent][16] = nStudent.getAttributes("Groupe_Informatique");
+ data1[indexStudent][17] = nStudent.getAttributes("Groupe_Projet");
+ data1[indexStudent][18] = nStudent.getAttributes("Groupe_Doc");
+ data1[indexStudent][19] = nStudent.getAttributes("Atelier-rentree_horaire");
+ data1[indexStudent][20] = nStudent.getAttributes("Atelier_pre-rentree_enseignant");
+ data1[indexStudent][21] = nStudent.getAttributes("Atelier_pre-rentree_salle");
+ data1[indexStudent][22] = nStudent.getAttributes("UE_Libre");
+ data1[indexStudent][23] = nStudent.getAttributes("Covoiturage");
+ data1[indexStudent][24] = nStudent.getAttributes("Etudiant_Covoiturage");
+ data1[indexStudent][25] = nStudent.getAttributes("Stage_1");
+ data1[indexStudent][26] = nStudent.getAttributes("Num_convention_1");
+ data1[indexStudent][27] = nStudent.getAttributes("Periode_1");
+ data1[indexStudent][28] = nStudent.getAttributes("Stage_2");
+ data1[indexStudent][29] = nStudent.getAttributes("Num_convention_2");
+ data1[indexStudent][30] = nStudent.getAttributes("Periode_2");
data[indexFormation][32] = data1;
@@ -153,13 +148,13 @@ public class exportBaseToExcel {
data[0][0] = nTable.getFirstChild().getAttributes("IAE_-_Version_detape_lib._web");
data[0][1] = "Formation";
- data[0][2] = "Individu_-_Code_Etudiant";
- data[0][3] = "Individu_-_Prenom";
- data[0][4] = "Individu_-_Nom";
- data[0][5] = "Profil_etudiant_lib.";
- data[0][6] = "Individu_-_Tel._portable";
- data[0][7] = "Individu_-_Email_personnel";
- data[0][8] = "Individu_-_Email";
+ data[0][2] = commandes.nomColonneFormation; //"Individu_-_Code_Etudiant";
+ data[0][3] = commandes.nomColonnePrenomEtudiant;//"Individu_-_Prenom";
+ data[0][4] = commandes.nomColonneNomEtudiant;//"Individu_-_Nom";
+ data[0][5] = commandes.nomColonneProfilEtudiant;//"Profil_etudiant_lib.";
+ data[0][6] = commandes.nomColonnePortableEtudiant; //"Individu_-_Tel._portable";
+ data[0][7] = commandes.nomColonneMailPersoEtudiant; //"Individu_-_Email_personnel";
+ data[0][8] = commandes.nomColonneMailUnivEtudiant; //"Individu_-_Email";
data[0][9] = "Groupe_Principal";
data[0][10] = "Groupe_TD";
data[0][11] = "Groupe_LV1";
@@ -189,14 +184,14 @@ public class exportBaseToExcel {
int indexStudent = 0;
for(noeud nStudent : nTable.getChildren()) {
- data1[indexStudent][0] = nStudent.getAttributes("IAE_-_Version_detape_lib._web");;
- data1[indexStudent][1] = nStudent.getAttributes("Individu_-_Code_Etudiant");
- data1[indexStudent][2] = nStudent.getAttributes("Individu_-_Prenom");
- data1[indexStudent][3] = nStudent.getAttributes("Individu_-_Nom");
- data1[indexStudent][4] = nStudent.getAttributes("Profil_etudiant_lib.");
- data1[indexStudent][5] = nStudent.getAttributes("Individu_-_Tel._portable");
- data1[indexStudent][6] = nStudent.getAttributes("Individu_-_Email_personnel");
- data1[indexStudent][7] = nStudent.getAttributes("Individu_-_Email");
+ data1[indexStudent][0] = nStudent.getAttributes(commandes.nomColonneFormation);;
+ data1[indexStudent][1] = nStudent.getAttributes(commandes.nomColonneCodeEtudiant);
+ data1[indexStudent][2] = nStudent.getAttributes(commandes.nomColonnePrenomEtudiant);
+ data1[indexStudent][3] = nStudent.getAttributes(commandes.nomColonneNomEtudiant);
+ data1[indexStudent][4] = nStudent.getAttributes(commandes.nomColonneProfilEtudiant);
+ data1[indexStudent][5] = nStudent.getAttributes(commandes.nomColonnePortableEtudiant);
+ data1[indexStudent][6] = nStudent.getAttributes(commandes.nomColonneMailPersoEtudiant);
+ data1[indexStudent][7] = nStudent.getAttributes(commandes.nomColonneMailUnivEtudiant);
data1[indexStudent][8] = nStudent.getAttributes("Groupe_Principal");
data1[indexStudent][9] = nStudent.getAttributes("Groupe_TD");
data1[indexStudent][10] = nStudent.getAttributes("Groupe_LV1");
diff --git a/src/gestion_version/VersionChecker.java b/src/gestion_version/VersionChecker.java
index aafdca4..5a47c44 100644
--- a/src/gestion_version/VersionChecker.java
+++ b/src/gestion_version/VersionChecker.java
@@ -10,6 +10,7 @@ import java.util.regex.Pattern;
import javax.swing.JOptionPane;
+import base.correspondanceNomDeColonneInscription;
import base.recupeBases;
import base.sauvegardeXMLBase;
import base.sauvegardeXMLBase.saveType;
@@ -189,12 +190,36 @@ public class VersionChecker {
if(versionDeLaBase.equals("1.0.4")) {
+ correspondanceNomDeColonneInscription.chargementParDefaut();
+
+ nBase.setAttribut("Formation",commandes.nomColonneFormation);
+ nBase.setAttribut(commandes.nomColonneCodeEtudiant,commandes.nomColonneCodeEtudiant);
+ nBase.setAttribut(commandes.nomColonneNomEtudiant,commandes.nomColonneNomEtudiant);
+ nBase.setAttribut(commandes.nomColonnePrenomEtudiant,commandes.nomColonnePrenomEtudiant);
+ nBase.setAttribut(commandes.nomColonneProfilEtudiant,commandes.nomColonneProfilEtudiant);
+ nBase.setAttribut(commandes.nomColonneBacEtudiant,commandes.nomColonneBacEtudiant);
+ nBase.setAttribut(commandes.nomColonnePortableEtudiant,commandes.nomColonnePortableEtudiant);
+ nBase.setAttribut(commandes.nomColonneMailPersoEtudiant,commandes.nomColonneMailPersoEtudiant);
+ nBase.setAttribut(commandes.nomColonneMailUnivEtudiant,commandes.nomColonneMailUnivEtudiant);
+
+ nBase.setAttribut("Excel_Formation",commandes.nomColonneExcel_Formation);
+ nBase.setAttribut("Excel_"+commandes.nomColonneCodeEtudiant,commandes.nomColonneExcel_CodeEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneNomEtudiant,commandes.nomColonneExcel_NomEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonnePrenomEtudiant,commandes.nomColonneExcel_PrenomEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneProfilEtudiant,commandes.nomColonneExcel_ProfilEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneBacEtudiant,commandes.nomColonneExcel_BacEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonnePortableEtudiant,commandes.nomColonneExcel_PortableEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneMailPersoEtudiant,commandes.nomColonneExcel_MailPersoEtudiant);
+ nBase.setAttribut("Excel_"+commandes.nomColonneMailUnivEtudiant,commandes.nomColonneExcel_MailUnivEtudiant);
+
+
for(noeud nFormation : nBase.getFirstChild().getChildren()) {
nFormation.setAttribut("Colonne_Groupe_TP", "true");
for(noeud nStudent : nFormation.getChildren()) {
nStudent.addAttribute("Groupe_TP", "");
}
}
+
}
diff --git a/src/importations/importAllBaseToExcel.java b/src/importations/importAllBaseToExcel.java
index 96b2d33..7d77b5d 100644
--- a/src/importations/importAllBaseToExcel.java
+++ b/src/importations/importAllBaseToExcel.java
@@ -19,6 +19,11 @@ import outils.commandes;
import outils.noeud;
import outils.supprimeCaracatresSpeciaux;
+/**
+ * Mise à jour de la base depuis un classeur Ms Excel.
+ * @author pabr6
+ *
+ */
public class importAllBaseToExcel {
public static void lecture(File file) {
diff --git a/src/outils/commandes.java b/src/outils/commandes.java
index 9f38a18..f7c54c2 100644
--- a/src/outils/commandes.java
+++ b/src/outils/commandes.java
@@ -5,6 +5,30 @@ public class commandes {
public static noeud nBase = null; // La base de données sous forme de noeud.
public static String version = "1.0.5"; // La version actuelle
+
+ // nom des colonnes après traitement des caractères (Accès à la base XML)
+ public static String nomColonneFormation = null;
+ public static String nomColonneNomEtudiant = null;
+ public static String nomColonnePrenomEtudiant = null;
+ public static String nomColonneCodeEtudiant = null;
+ public static String nomColonneProfilEtudiant = null;
+ public static String nomColonneBacEtudiant = null;
+ public static String nomColonnePortableEtudiant = null;
+ public static String nomColonneMailPersoEtudiant = null;
+ public static String nomColonneMailUnivEtudiant = null;
+
+ // nom des colonnes avant traitement des caractères (Accès au classeur des inscriptions)
+ public static String nomColonneExcel_Formation = null;
+ public static String nomColonneExcel_NomEtudiant = null;
+ public static String nomColonneExcel_PrenomEtudiant = null;
+ public static String nomColonneExcel_CodeEtudiant = null;
+ public static String nomColonneExcel_ProfilEtudiant = null;
+ public static String nomColonneExcel_BacEtudiant = null;
+ public static String nomColonneExcel_PortableEtudiant = null;
+ public static String nomColonneExcel_MailPersoEtudiant = null;
+ public static String nomColonneExcel_MailUnivEtudiant = null;
+
+
// Messages et sécurité
public static Boolean newVersion = false; //Permet de vérifier l'existance d'un nouvelle version.
public static Boolean helpme1 = false; //M'aider à compléter mon service annuel.
diff --git a/src/outils/noeud.java b/src/outils/noeud.java
index acbcec2..91bcbe2 100644
--- a/src/outils/noeud.java
+++ b/src/outils/noeud.java
@@ -233,6 +233,7 @@ public class noeud implements Cloneable{
/**
* Clone de l'objet.
+ * Le noeud cloné n'a pas de Parent.
*/
public noeud clone() throws CloneNotSupportedException {
noeud cloned = (noeud) super.clone();
@@ -242,10 +243,19 @@ public class noeud implements Cloneable{
if(this.content!=null) cloned.content = new String(this.content);
cloned.attributes = new TreeMap(this.attributes);
cloned.children = new ArrayList(this.children);
-// if(this.Parent!=null) cloned.Parent = this.Parent.clone();
-
-
return cloned;
+ }
+
+ /**
+ * Changement du nom d'un attribut.
+ * @param oldName
+ * @param newName
+ */
+ public void changeAttributName(String oldName, String newName) {
+ if(attributes.get(oldName)==null) return;
+ String value = attributes.get(oldName);
+ attributes.remove(oldName);
+ attributes.put(newName, value);
}
diff --git a/src/resources/parametreImportationIncriptions.png b/src/resources/parametreImportationIncriptions.png
new file mode 100644
index 0000000..c7f66a1
Binary files /dev/null and b/src/resources/parametreImportationIncriptions.png differ