diff --git a/.classpath b/.classpath index 148593c..4b5675b 100644 --- a/.classpath +++ b/.classpath @@ -12,6 +12,6 @@ - + diff --git a/analyseWriter.exe b/analyseWriter.exe index 9d76fad..bf3d419 100644 Binary files a/analyseWriter.exe and b/analyseWriter.exe differ diff --git a/analyseWriter.jar b/analyseWriter.jar index adde80b..c1610ad 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/MEPTL/commandes.class b/bin/MEPTL/commandes.class index b23e670..7d56631 100644 Binary files a/bin/MEPTL/commandes.class and b/bin/MEPTL/commandes.class differ diff --git a/bin/MEPTL/ecritureSujet.class b/bin/MEPTL/ecritureSujet.class index 3f0e90b..cf56463 100644 Binary files a/bin/MEPTL/ecritureSujet.class and b/bin/MEPTL/ecritureSujet.class differ diff --git a/bin/MEPTL/meptl.class b/bin/MEPTL/meptl.class index e2a4bed..61884a3 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/evaluer/analyseLesNodesEnfants.class b/bin/evaluer/analyseLesNodesEnfants.class index 19bb981..ff1fa6c 100644 Binary files a/bin/evaluer/analyseLesNodesEnfants.class and b/bin/evaluer/analyseLesNodesEnfants.class differ diff --git a/bin/evaluer/evaluationAttribut.class b/bin/evaluer/evaluationAttribut.class index 8811e62..5e3b2c8 100644 Binary files a/bin/evaluer/evaluationAttribut.class and b/bin/evaluer/evaluationAttribut.class differ diff --git a/bin/fenetres/createPopupMenu.class b/bin/fenetres/createPopupMenu.class index 553259f..7dd35aa 100644 Binary files a/bin/fenetres/createPopupMenu.class and b/bin/fenetres/createPopupMenu.class differ diff --git a/bin/fenetres/create_act/actAttribut.class b/bin/fenetres/create_act/actAttribut.class index 869402d..1ed464a 100644 Binary files a/bin/fenetres/create_act/actAttribut.class and b/bin/fenetres/create_act/actAttribut.class differ diff --git a/bin/fenetres/create_act/actEvaluerStyleTrue.class b/bin/fenetres/create_act/actEvaluerStyleTrue.class index 7eb1a1e..9d6d79a 100644 Binary files a/bin/fenetres/create_act/actEvaluerStyleTrue.class and b/bin/fenetres/create_act/actEvaluerStyleTrue.class differ diff --git a/bin/fenetres/create_act/actNewFichierAnalyse.class b/bin/fenetres/create_act/actNewFichierAnalyse.class index 55cf4de..9ecd867 100644 Binary files a/bin/fenetres/create_act/actNewFichierAnalyse.class and b/bin/fenetres/create_act/actNewFichierAnalyse.class differ diff --git a/bin/list/listeDesNodesAllContent.class b/bin/list/listeDesNodesAllContent.class index 6ac0fa1..024a071 100644 Binary files a/bin/list/listeDesNodesAllContent.class and b/bin/list/listeDesNodesAllContent.class differ diff --git a/bin/list/listeDesNodesAnalyseStyle.class b/bin/list/listeDesNodesAnalyseStyle.class index 7206cec..6533451 100644 Binary files a/bin/list/listeDesNodesAnalyseStyle.class and b/bin/list/listeDesNodesAnalyseStyle.class differ diff --git a/bin/list/listeDesNodesAvecEvalNameNode.class b/bin/list/listeDesNodesAvecEvalNameNode.class deleted file mode 100644 index 00ce420..0000000 Binary files a/bin/list/listeDesNodesAvecEvalNameNode.class and /dev/null differ diff --git a/bin/list/listeDesNodesEvalPlacement.class b/bin/list/listeDesNodesEvalPlacement.class index 102f1b1..5087eea 100644 Binary files a/bin/list/listeDesNodesEvalPlacement.class and b/bin/list/listeDesNodesEvalPlacement.class differ diff --git a/bin/list/listeEvalNameNode.class b/bin/list/listeEvalNameNode.class index 9db6eb1..ea81b8c 100644 Binary files a/bin/list/listeEvalNameNode.class and b/bin/list/listeEvalNameNode.class differ diff --git a/bin/list/listeNodeFormatageDirectDeWriter.class b/bin/list/listeNodeFormatageDirectDeWriter.class index 8db9af8..361364e 100644 Binary files a/bin/list/listeNodeFormatageDirectDeWriter.class and b/bin/list/listeNodeFormatageDirectDeWriter.class differ diff --git a/src/MEPTL/commandes.java b/src/MEPTL/commandes.java index cccc277..b5a4573 100644 --- a/src/MEPTL/commandes.java +++ b/src/MEPTL/commandes.java @@ -34,7 +34,7 @@ public class commandes { //**version public static String version ="V4.4.2"; // La version actuelle public static String branch = "Origin"; - public static String Annee ="2022"; + public static String Annee ="2023"; //*************************************************** //** Les commandes par défaut à travers la console ** diff --git a/src/MEPTL/ecritureSujet.java b/src/MEPTL/ecritureSujet.java index 1afc1ae..0f1a10b 100644 --- a/src/MEPTL/ecritureSujet.java +++ b/src/MEPTL/ecritureSujet.java @@ -6,9 +6,9 @@ import java.util.ArrayList; import cXML.Run; import cXML.node; import list.listeDesNodesAnalyseStyle; -import list.listeDesNodesAvecEvalNameNode; import list.listeDesNodesEvalPlacement; import list.listeDesNodesRechercheByContenu; +import list.listeEvalNameNode; import list.listeRechercheParAnchorPageNumber; @@ -304,7 +304,7 @@ public class ecritureSujet { for(int k=0 ; k < no.size(); k++) { if(no.get(k)!=null) { no.get(k).getAttributs().put("evaluer", "false"); - if( listeDesNodesAvecEvalNameNode.isEvalNameNode(no.get(k))) no.get(k).getAttributs().put("evalNameNode", "0"); + if( listeEvalNameNode.isNodeEvalNameNode(no.get(k))) no.get(k).getAttributs().put("evalNameNode", "0"); if(listeDesNodesSautEtTitre(no.get(k).getNomElt())) {no.get(k).getAttributs().put("saut", "false"); no.get(k).getAttributs().put("titre", "");} if(listeDesNodesRechercheByContenu.isRechercheByContenu(no.get(k))) {no.get(k).getAttributs().put("recherche_index", "false"); no.get(k).getAttributs().put("recherche_contenu_exact", "false");no.get(k).getAttributs().put("recherche_contenu_plus_proche_voisin", "false");no.get(k).getAttributs().put("allContent", "strict0");} if(listeDesNodesEvalPlacement.isPlacement(no.get(k)))no.get(k).getAttributs().put("evalPlacement", "0"); diff --git a/src/MEPTL/meptl.java b/src/MEPTL/meptl.java index 0ef7f99..720757f 100644 --- a/src/MEPTL/meptl.java +++ b/src/MEPTL/meptl.java @@ -564,9 +564,13 @@ public class meptl { nodstyleparagraphe.addNode(a.NodesAyantAttribut(nodstyle, "style:family","text")); nodstyleparagraphe.addNode(a.NodesAyantAttribut(nodstyle, "style:family","section")); nodstyleparagraphe.addNode(a.NodesAyantAttribut(nodstyle, "style:family","graphic")); + nodstyleparagraphe.addNode(nodstyle.retourneEnfantsByName("number:date-style", new ArrayList())); + nodstyleparagraphe.addNode(nodstyle.retourneEnfantsByName("number:time-style", new ArrayList())); nodstyleparagraphe = ajouteValeurLesValeursDuStyleParagraphParent(nodstyleparagraphe); nodstyleparagraphe = ajouteValeurParDefautAuStyleParagraph(nodstyleparagraphe); - + + //Nettoyer des nodes null les styles +// nettoyerDesNoddesNull(nodstyleparagraphe); //Le node numérotation des chapitres node nodnumerochapitre = new node(); @@ -669,6 +673,9 @@ public class meptl { } + //Transformation des node number:date-style et number:time-style en style + transformationNumberDateToStyle(nodstyleparagraphe, nodstructure); + // Struture et composition du document avec les pages // cette boucle utilise le node nodstructure ArrayList nodpage = new ArrayList(); @@ -682,6 +689,7 @@ public class meptl { for(int j = 0 ; j< nodstructure.getNodes().size();j++) { + page = nodpage.get(nodpage.size()-1); // dernière page enregistrer pour insérer des enfants en bas de la boucle //****************************************************************************** @@ -979,6 +987,8 @@ public class meptl { } } + + // ajoute au node de la page les éléments sauf les paragraphes de texte page.getNodes().add(nodstructure.getNodes().get(j)); @@ -1006,7 +1016,7 @@ public class meptl { if(nodpage.get(j).getAttributs().get("type").equals("automatique")) { if(nodpage.get(j-1).getAttributs().get("style:master-page-name")!=null) { node nod5 = a.retourneFirstNodeByNameAttributValue(nodstylepage, "style:master-page", "style:name", nodpage.get(j-1).getAttributs().get("style:master-page-name")); - if(nod5.getAttributs().get("style:next-style-name")!=null) { + if(nod5!=null) if(nod5.getAttributs().get("style:next-style-name")!=null) { nodpage.get(j).getAttributs().put("style:master-page-name", nod5.getAttributs().get("style:next-style-name")); }else { nodpage.get(j).getAttributs().put("style:master-page-name", nodpage.get(j-1).getAttributs().get("style:master-page-name")); @@ -1041,7 +1051,7 @@ public class meptl { if(nodpage.get(j-1).getAttributs().get("style:master-page-name")!=null) { node nod5 = a.retourneFirstNodeByNameAttributValue(nodstylepage, "style:master-page", "style:name", nodpage.get(j-1).getAttributs().get("style:master-page-name")); - if(nod5.getAttributs().get("style:page-layout-name")!=null) { + if(nod5!=null) if(nod5.getAttributs().get("style:page-layout-name")!=null) { node nod6 = a.retourneFirstNodeByNameAttributValue(nodstylepage, "style:page-layout", "style:name", nod5.getAttributs().get("style:page-layout-name")); if(nod6.getAttributs().get("style:page-usage")!=null) { usage2 = nod6.getAttributs().get("style:page-usage"); @@ -1064,7 +1074,7 @@ public class meptl { }else { if(nodpage.get(j).getAttributs().get("style:master-page-name")!=null) { node nod5 = a.retourneFirstNodeByNameAttributValue(nodstylepage, "style:master-page", "style:name", nodpage.get(j).getAttributs().get("style:master-page-name")); - if(nod5.getAttributs().get("style:page-layout-name")!=null) { + if(nod5!=null) if(nod5.getAttributs().get("style:page-layout-name")!=null) { node nod6 = a.retourneFirstNodeByNameAttributValue(nodstylepage, "style:page-layout", "style:name", nod5.getAttributs().get("style:page-layout-name")); if(nod6.getAttributs().get("style:page-usage")!=null) { nodpage.get(j).getAttributs().put("style:page-usage", nod6.getAttributs().get("style:page-usage")); @@ -2654,12 +2664,21 @@ public class meptl { node LesStyleDefaut = null; if(ensembleDesParagraphes.retourneEnfantsByNameExist("style:default-style")) { - LesStyleDefaut = ensembleDesParagraphes.retourneFirstEnfantsByName("style:default-style"); + LesStyleDefaut = ensembleDesParagraphes.retourneFirstNodeByNameAndAttributValue("style:default-style","style:family","paragraph"); + if(LesStyleDefaut==null) return ensembleDesParagraphes; } + + for(int i =0 ; i < ensembleDesParagraphes.getNodes().size(); i++) { node nodStyle = ensembleDesParagraphes.getNodes().get(i); + if(nodStyle.getAttributs().get("style:family")!=null) { + if(!nodStyle.getAttributs().get("style:family").equals("paragraph")) continue; + }else { + continue; + } + //le paragarph properties node nodeStyleParDefautParagraphProperties = LesStyleDefaut.retourneFirstEnfantsByName("style:paragraph-properties"); node LesNodesStyleParagraph = nodStyle.retourneFirstEnfantsByName("style:paragraph-properties"); @@ -2789,8 +2808,50 @@ public class meptl { } + /** + * Transformation des nodes number:date-style en style:style (pour évaluation avec analyseStyle;
+ * @param nodStyles + */ + private static void transformationNumberDateToStyle(node nodStyles, node structure) { + for(int i = 0 ; i < nodStyles.getNodes().size();i++) { + if(nodStyles.getNodes().get(i).getNomElt().equals("number:date-style")) { + nodStyles.getNodes().get(i).setNomElt("style:style"); + nodStyles.getNodes().get(i).getAttributs().put("style:family", "number:date-style"); + String nameStyle= nodStyles.getNodes().get(i).getAttributs().get("style:name"); + node nod = structure.retourneFirstNodeByNameAndAttributValueExactStrict("text:date", "style:data-style-name", nameStyle); + if(nod!=null) { + nod.getAttributs().put("text:style-name", nameStyle); + } + } + if(nodStyles.getNodes().get(i).getNomElt().equals("number:time-style")) { + nodStyles.getNodes().get(i).setNomElt("style:style"); + nodStyles.getNodes().get(i).getAttributs().put("style:family", "number:time-style"); + String nameStyle= nodStyles.getNodes().get(i).getAttributs().get("style:name"); + node nod = structure.retourneFirstNodeByNameAndAttributValueExactStrict("text:time", "style:data-style-name", nameStyle); + if(nod!=null) { + nod.getAttributs().put("text:style-name", nameStyle); + }else{ + nod = structure.retourneFirstNodeByNameAndAttributValueExactStrict("text:editing-duration", "style:data-style-name", nameStyle); + if(nod!=null) { + nod.getAttributs().put("text:style-name", nameStyle); + } + } + } + } + } - +// @SuppressWarnings("unlikely-arg-type") +// private static void nettoyerDesNoddesNull(node nodStyles) { +// ArrayList index = new ArrayList(); +// for(int i = 0 ; i < nodStyles.getNodes().size();i++) { +// if( nodStyles.getNodes().get(i)==null) { +// index.add(i); +// } +// } +// for(int i = index.size()-1 ; i >= 0 ;i--) { +// nodStyles.getNodes().remove(index.get(i)); +// } +// } } diff --git a/src/evaluer/analyseLesNodesEnfants.java b/src/evaluer/analyseLesNodesEnfants.java index 75937b1..1bd0846 100644 --- a/src/evaluer/analyseLesNodesEnfants.java +++ b/src/evaluer/analyseLesNodesEnfants.java @@ -126,6 +126,7 @@ public class analyseLesNodesEnfants { node StyleParagraphSujet = null; node StyleParagraphStudent = null; + if(nodSujet.getAttributs().get("analyseStyle")!=null) { if(nodSujet.getAttributs().get("analyseStyle").equals("true") && nodSujet.getAttributs().get("text:style-name")!=null) { @@ -133,6 +134,8 @@ public class analyseLesNodesEnfants { StyleParagraphSujet = nodSujetParagraphs.retourneFirstNodeStyleByValueAttribut("style:style", "style:name", NameStyleParagrapheSujet); } + + if(nodStudent!=null && StyleParagraphSujet!=null) { if(StyleParagraphSujet.getAttributs().get("evaluer")!=null) { if(StyleParagraphSujet.getAttributs().get("evaluer").equals("true")) { diff --git a/src/evaluer/evaluationAttribut.java b/src/evaluer/evaluationAttribut.java index 7d1754d..c99f073 100644 --- a/src/evaluer/evaluationAttribut.java +++ b/src/evaluer/evaluationAttribut.java @@ -57,106 +57,167 @@ public class evaluationAttribut { } } - if(nodeStyleParagraphStudent!=null) { - if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:paragraph-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:paragraph-properties") ) { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); - if(propertiesSujet.getAttributs().get("evaluer")!=null) { - if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { - - node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:paragraph-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - if(propertiesStudent!=null) { - String valueAttributStudent = propertiesStudent.getAttributs().get(k); - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); - }else { +// if(nodeStyleParagraphStudent!=null) { +// if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:paragraph-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:paragraph-properties") ) { +// node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); +// if(propertiesSujet.getAttributs().get("evaluer")!=null) { +// if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { +// +// node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:paragraph-properties"); +// key = propertiesSujet.getAttributs().keys(); +// while(key.hasMoreElements()) { +// String k = key.nextElement(); +// if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ +// if(propertiesStudent!=null) { +// String valueAttributStudent = propertiesStudent.getAttributs().get(k); +// String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); +// node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); +// retour.getNodes().add(item); +// }else { +// String valueAttributStudent = "null"; +// String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); +// node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); +// retour.getNodes().add(item); +// } +// } +// } +// +// } +// } +// } +// }else { +// node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); +// if(propertiesSujet.getAttributs().get("evaluer")!=null) { +// if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { +// +// key = propertiesSujet.getAttributs().keys(); +// while(key.hasMoreElements()) { +// String k = key.nextElement(); +// if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ +// String valueAttributStudent = "null"; +// String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); +// +// node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); +// retour.getNodes().add(item); +// } +// } +// +// } +// } +// } +// +// if(nodeStyleParagraphStudent!=null) { +// if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:text-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:text-properties") ) { +// node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); +// if(propertiesSujet.getAttributs().get("evaluer")!=null) { +// if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { +// +// node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:text-properties"); +// key = propertiesSujet.getAttributs().keys(); +// while(key.hasMoreElements()) { +// String k = key.nextElement(); +// if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ +// if(propertiesStudent!=null) { +// String valueAttributStudent = propertiesStudent.getAttributs().get(k); +// String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); +// +// node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:text-properties"); +// retour.getNodes().add(item); +// }else { +// String valueAttributStudent = "null"; +// String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); +// +// node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); +// retour.getNodes().add(item); +// } +// } +// } +// +// } +// } +// } +// }else { +// node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); +// if(propertiesSujet.getAttributs().get("evaluer")!=null) { +// if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { +// +// key = propertiesSujet.getAttributs().keys(); +// while(key.hasMoreElements()) { +// String k = key.nextElement(); +// if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ +// String valueAttributStudent = "null"; +// String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); +// +// node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); +// retour.getNodes().add(item); +// } +// } +// +// } +// } +// +// } + + + for(int i = 0 ; i < nodeStyleParagraphSujet.getNodes().size();i++) { + String nameNodeSujet = nodeStyleParagraphSujet.getNodes().get(i).getNomElt(); + if(nodeStyleParagraphStudent!=null) { + if(nodeStyleParagraphSujet.retourneEnfantsByNameExist(nameNodeSujet) && nodeStyleParagraphStudent.retourneEnfantsByNameExist(nameNodeSujet) ) { + node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName(nameNodeSujet); + if(propertiesSujet.getAttributs().get("evaluer")!=null) { + if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { + + node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName(nameNodeSujet); + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + if(propertiesStudent!=null) { + String valueAttributStudent = propertiesStudent.getAttributs().get(k); + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,nameNodeSujet); + retour.getNodes().add(item); + }else { + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameNodeSujet); + retour.getNodes().add(item); + } + } + } + + } + } + } + }else { + if(nodeStyleParagraphSujet.retourneEnfantsByNameExist(nameNodeSujet)) { + node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName(nameNodeSujet); + if(propertiesSujet.getAttributs().get("evaluer")!=null) { + if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { + + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ String valueAttributStudent = "null"; String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameNodeSujet); retour.getNodes().add(item); } } - } - - } - } - } - }else { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); - if(propertiesSujet.getAttributs().get("evaluer")!=null) { - if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { - - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); + } } - } } } - - if(nodeStyleParagraphStudent!=null) { - if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:text-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:text-properties") ) { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); - if(propertiesSujet.getAttributs().get("evaluer")!=null) { - if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { - - node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:text-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - if(propertiesStudent!=null) { - String valueAttributStudent = propertiesStudent.getAttributs().get(k); - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); - }else { - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); - } - } - } - - } - } - } - }else { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); - if(propertiesSujet.getAttributs().get("evaluer")!=null) { - if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { - - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); - } - } - - } - } - - } + + + + return retour; } diff --git a/src/fenetres/createPopupMenu.java b/src/fenetres/createPopupMenu.java index 28215de..4d86843 100644 --- a/src/fenetres/createPopupMenu.java +++ b/src/fenetres/createPopupMenu.java @@ -103,7 +103,6 @@ import fenetres.create_act.mnEvaluerATraversAnalyseStyleTrue; import list.listeDesNodesAllContent; import list.listeDesNodesAnalyseStyle; import list.listeDesNodesAncrable; -import list.listeDesNodesAvecEvalNameNode; import list.listeDesNodesAvecOU; import list.listeDesNodesContientEnfant; import list.listeDesNodesEvalPlacement; @@ -161,7 +160,7 @@ public class createPopupMenu extends JPopupMenu { // Le groupe méthode évaluer le node - if(listeDesNodesAvecEvalNameNode.isEvalNameNode(nod)||listeDesNodesAllContent.isAllContent(nod)|| + if(listeEvalNameNode.isNodeEvalNameNode(nod)||listeDesNodesAllContent.isAllContent(nod)|| listeDesNodesPourEvaluationEntetePage.isEntete(nod) || listeDesNodesPourEvaluerPiedDePage.isPiedDePage(nod)|| listeDesNodesPourEvaluerPage.isPage(nod) || listeDesNotesAEvaluer.isAEvaluer(nod)) { mnPopupTree.addSeparator(); diff --git a/src/fenetres/create_act/actAttribut.java b/src/fenetres/create_act/actAttribut.java index 3e6cc8d..877f993 100644 --- a/src/fenetres/create_act/actAttribut.java +++ b/src/fenetres/create_act/actAttribut.java @@ -12,6 +12,7 @@ import cXML.node; import fenetres.attributs; import fenetres.create; import list.listeAttributsAnalyseWriter; +import list.listeNodesNonModifiableAttribut; public class actAttribut extends AbstractAction{ @@ -42,7 +43,7 @@ public class actAttribut extends AbstractAction{ } if(nbrAttribut>0) { - if(nod.getLevel()>1 && !nod.chemin().contains("setting")) { + if(listeNodesNonModifiableAttribut.isModifiableAttribut(nod.getNomElt())) { new attributs(nod,fenetres.create.getTextNodeSelect()); }else { JOptionPane.showMessageDialog(null, "Vous ne pouvez pas modifier les attributs de ce node."); diff --git a/src/fenetres/create_act/actEvaluerStyleTrue.java b/src/fenetres/create_act/actEvaluerStyleTrue.java index 2ffb7fa..013b346 100644 --- a/src/fenetres/create_act/actEvaluerStyleTrue.java +++ b/src/fenetres/create_act/actEvaluerStyleTrue.java @@ -33,7 +33,11 @@ public class actEvaluerStyleTrue extends AbstractAction{ //** Place l'attribut EvaluerATraversAnalyseStyle=true au style qui doit être évaluer à travers d'analyseStyle ** //** S'il y a des attributs évaluer avec ‽ alors change par ‼ ** //*************************************************************************************************************** - node nodStyle = commandes.sujet.retourneFirstNodeByNameAndAttributValueExactStrict("style:style", "style:name", nod.getAttributs().get("text:style-name")); + String nameStyle = nod.getAttributs().get("text:style-name"); + + node nodStyle = commandes.sujet.retourneFirstNodeByNameAndAttributValueExactStrict("style:style", "style:name", nameStyle); + + if(nodStyle!=null) { nodStyle.getAttributs().put("EvaluerATraversAnalyseStyle", "true"); nodStyle.evaluerTrue(); diff --git a/src/fenetres/create_act/actNewFichierAnalyse.java b/src/fenetres/create_act/actNewFichierAnalyse.java index ce6587b..65b8366 100644 --- a/src/fenetres/create_act/actNewFichierAnalyse.java +++ b/src/fenetres/create_act/actNewFichierAnalyse.java @@ -94,6 +94,8 @@ public class actNewFichierAnalyse extends AbstractAction{ commandes.sujet = meptl.LectureFichierEtudiantSousFormeDeNode(commandes.sujet,b,0); + + //Pour les sujets, il faut rechercher les nodes en doublons (par exemple : text:p, text:h, text:list-item) //L'information sera portée par l'attribut isDoublon="true" // Cela permet de recherche par le numéro du child. diff --git a/src/list/listeAttributsAnalyseWriter.java b/src/list/listeAttributsAnalyseWriter.java index fbd945f..45bba28 100644 --- a/src/list/listeAttributsAnalyseWriter.java +++ b/src/list/listeAttributsAnalyseWriter.java @@ -85,83 +85,6 @@ public class listeAttributsAnalyseWriter { default: return false; } - - - -// if(attribut.equals("evaluer")) return true; -// if(attribut.equals("addmenu")) return true; -// if(attribut.equals("saut")) return true; -// if(attribut.equals("titre")) return true; -// if(attribut.equals("titre1")) return true; -// if(attribut.equals("titre2")) return true; -// if(attribut.equals("titre3")) return true; -// if(attribut.equals("marquenode")) return true; -// if(attribut.equals("information")) return true; -// if(attribut.equals("poids")) return true; -// if(attribut.equals("analyseStyle")) return true; -// if(attribut.equals("index")) return true; -// if(attribut.equals("recherche_index")) return true; -// if(attribut.equals("recherche_contenu_exact")) return true; -// if(attribut.equals("styletitre")) return true; //ancienne version, il faudra les supprimer au fur plus ajouter depuis la version v4.1.2 -// if(attribut.equals("recherche_anchor-page-number")) return true; -// if(attribut.equals("recherche_contenu_plus_proche_voisin")) return true; -// if(attribut.equals("numero")) return true; -// if(attribut.equals("numeroabsolue")) return true; -// if(attribut.equals("isDoublon")) return true; -// -// -// // Les attributs évaluateurs -// if(attribut.equals("EvaluerATraversAnalyseStyle")) return true; -// if(attribut.equals("evalNameCreator")) return true; -// if(attribut.equals("evalNameInitialCreator")) return true; -// if(attribut.equals("evalNameLegacyStyle")) return true; -// if(attribut.equals("allContent")) return true; -// if(attribut.equals("evalNameNode")) return true; -// if(attribut.equals("evalEntetePasActive")) return true; -// if(attribut.equals("evalEnteteActive")) return true; -// if(attribut.equals("evalPiedPagePasActive")) return true; -// if(attribut.equals("evalPiedPageActive")) return true; -// if(attribut.equals("evalNameSequence")) return true; -// if(attribut.equals("evalNamePage")) return true; -// if(attribut.equals("evalTextUserDefined")) return true; -// if(attribut.equals("evalNumeroAbsoluePage")) return true; -// if(attribut.equals("evalNumeroPage")) return true; -// if(attribut.equals("evalPlacement")) return true; -// if(attribut.equals("evalLastChild")) return true; -// if(attribut.equals("evalFirstChild")) return true; -// if(attribut.equals("evalAncrageNumeroAbsoluePage")) return true; -// -// -// -// //Les attribut placer dans le node fichier du fichier d'analyse -// if(attribut.equals("analysis_filename")) return true; -// if(attribut.equals("auteur")) return true; -// if(attribut.equals("baremeABC")) return true; -// if(attribut.equals("controleDateCreation")) return true; -// if(attribut.equals("controle_Initial_Creator")) return true; -// if(attribut.equals("creationDate")) return true; -// if(attribut.equals("date")) return true; -// if(attribut.equals("dateModification")) return true; -// if(attribut.equals("dureeEdition")) return true; -// if(attribut.equals("filename")) return true; -// if(attribut.equals("hash")) return true; -// if(attribut.equals("historiquePresent")) return true; -// if(attribut.equals("link_help")) return true; -// if(attribut.equals("link_sujet")) return true; -// if(attribut.equals("metaSujet")) return true; -// if(attribut.equals("notefrom")) return true; -// if(attribut.equals("presenceMetaSujet")) return true; -// if(attribut.equals("producteur")) return true; -// if(attribut.equals("progression")) return true; -// if(attribut.equals("version")) return true; -// -// //Le node OU -// if(attribut.equals("OU")) return true; -// -//// if(attribut.equals("page_start:text_contenu_index")) return true; -// -// -// return false; } } diff --git a/src/list/listeDesNodesAllContent.java b/src/list/listeDesNodesAllContent.java index e1ed353..ef819f3 100644 --- a/src/list/listeDesNodesAllContent.java +++ b/src/list/listeDesNodesAllContent.java @@ -10,18 +10,26 @@ public class listeDesNodesAllContent { * @return */ public static boolean isAllContent(node nod) { - if(nod.getNomElt().equals("text:title")) return true; - if(nod.getNomElt().equals("text:subject")) return true; - if(nod.getNomElt().equals("page")) return true; - if(nod.getNomElt().equals("text:page-number")) return false; - if(nod.getNomElt().equals("text:page-count")) return false; - if(nod.getNomElt().equals("OU")) return false; - if(nod.getNomElt().equals("text:conditional-text")) return false; - if(nod.getNomElt().contains("text:bookmark")) return false; + String nameNode = nod.getNomElt(); + + + + if(nameNode.equals("text:title")) return true; + if(nameNode.equals("text:subject")) return true; + if(nameNode.equals("page")) return true; + if(nameNode.equals("text:date")) return true; + if(nameNode.equals("text:time")) return true; + + if(nameNode.equals("number:text")) return false; + if(nameNode.equals("text:page-number")) return false; + if(nameNode.equals("text:page-count")) return false; + if(nameNode.equals("OU")) return false; + if(nameNode.equals("text:conditional-text")) return false; + if(nameNode.contains("text:bookmark")) return false; if(nod.retourneLesContenusEnfants("").length()<=0) return false; - if(nod.getNomElt().contains("text:")) return true; + if(nameNode.contains("text:")) return true; return true; diff --git a/src/list/listeDesNodesAnalyseStyle.java b/src/list/listeDesNodesAnalyseStyle.java index 09fd5f3..4ddb0d8 100644 --- a/src/list/listeDesNodesAnalyseStyle.java +++ b/src/list/listeDesNodesAnalyseStyle.java @@ -11,16 +11,6 @@ public class listeDesNodesAnalyseStyle { */ public static Boolean isAnalyseStyle(node nod) { if(nod.getAttributs().get("text:style-name")!=null) return true; - -// if(nod.getAttributs().get("text:style-name")!=null) return true; -// if(nod.getNomElt().contains("text:database-display")) return false; -// if(nod.getNomElt().contains("text:bookmark")) return false; -// -// if(nod.getNomElt().contains("text:p")) return true; -// if(nod.getNomElt().contains("text:list")) return true; -// if(nod.getNomElt().contains("text:span")) return true; - - return false; } } diff --git a/src/list/listeDesNodesAncrable.java b/src/list/listeDesNodesAncrable.java index 04a80d2..b1b4e2c 100644 --- a/src/list/listeDesNodesAncrable.java +++ b/src/list/listeDesNodesAncrable.java @@ -31,6 +31,8 @@ public class listeDesNodesAncrable { case "text:creator": return true; case "text:editing-cycles": return true; case "draw:frame": return true; + case "text:date":return true; + case "text:time":return true; default: return false; diff --git a/src/list/listeDesNodesAvecEvalNameNode.java b/src/list/listeDesNodesAvecEvalNameNode.java deleted file mode 100644 index 2d97432..0000000 --- a/src/list/listeDesNodesAvecEvalNameNode.java +++ /dev/null @@ -1,19 +0,0 @@ -package list; - -import cXML.node; - -public class listeDesNodesAvecEvalNameNode { - - /** - * Retourne TRUE si on peut utiliser la procédure evalNameNode.
- * @param nod - * @return - */ - public static boolean isEvalNameNode(node nod) { - if(nod.getNomElt().contains("meta:")) return true; - if(nod.getNomElt().contains("dc:")) return true; - if(nod.getNomElt().contains("text:")) return true; - return false; - } - -} diff --git a/src/list/listeDesNodesEvalPlacement.java b/src/list/listeDesNodesEvalPlacement.java index 914b1ee..8c215e5 100644 --- a/src/list/listeDesNodesEvalPlacement.java +++ b/src/list/listeDesNodesEvalPlacement.java @@ -23,8 +23,10 @@ public class listeDesNodesEvalPlacement { case "text:tab":return true; case "text:page-number":return true; case "draw:frame": return true; + case "text:date": return true; + case "text:time": return true; + case "text:editing-duration": return true; - default: return false; } diff --git a/src/list/listeEvalNameNode.java b/src/list/listeEvalNameNode.java index bce01b5..c2f0dbf 100644 --- a/src/list/listeEvalNameNode.java +++ b/src/list/listeEvalNameNode.java @@ -14,6 +14,7 @@ public class listeEvalNameNode { if(nod.getNomElt().contains("dc:")) return true; if(nod.getNomElt().contains("text:")) return true; if(nod.getNomElt().contains("draw:")) return true; + return false; } diff --git a/src/list/listeNodeFormatageDirectDeWriter.java b/src/list/listeNodeFormatageDirectDeWriter.java index 767ae3b..0bbd824 100644 --- a/src/list/listeNodeFormatageDirectDeWriter.java +++ b/src/list/listeNodeFormatageDirectDeWriter.java @@ -17,13 +17,14 @@ public class listeNodeFormatageDirectDeWriter { //** Si le nom du style est P1, P2, ...Pxx, (les paragraphes) //** ou T1, T2, ..., Txx (Les caractères) //** ou L1, L2,.... (les listes) + //** ou N1, N2, ..., (format des number date) //** Alors retourne true. if(nod.chemin().contains("style:paragraph")) { node nodStyleParent = nod.retourneParentAyantLAttribut("style:name"); String nomDuStle = nodStyleParent.getAttributs().get("style:name"); - Pattern p = Pattern.compile("^P[0-9]{1,}$|^T[0-9]{1,}$|^L[0-9]{1,}$"); + Pattern p = Pattern.compile("^P[0-9]{1,}$|^T[0-9]{1,}$|^L[0-9]{1,}$|^N[0-9]{1,}$"); Matcher m = p.matcher(nomDuStle); if(m.find()) return true; } diff --git a/src/list/listeNodesNonModifiableAttribut.java b/src/list/listeNodesNonModifiableAttribut.java new file mode 100644 index 0000000..844a943 --- /dev/null +++ b/src/list/listeNodesNonModifiableAttribut.java @@ -0,0 +1,29 @@ +package list; + + +public class listeNodesNonModifiableAttribut { + + public static boolean isModifiableAttribut(String nameNode){ + switch (nameNode) { + case "setting": return false; + case "style:default-style": return false; + case "structurepage": return false; + case "office:meta":return false; + case "style:page":return false; + case "style:paragraph":return false; + case "sequences":return false; + case "numerotationchapitre":return false; + case "frames":return false; + case "sections":return false; + case "tableaux":return false; + case "biblio":return false; + case "tablematieres":return false; + case "tableillustrations":return false; + case "page":return false; + default: return true; + } + } + } + + +