OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
41 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.generationDoc;
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.core.common.element.StyleSQLElement;
18
import org.openconcerto.openoffice.ODPackage;
19
import org.openconcerto.openoffice.spreadsheet.MutableCell;
20
import org.openconcerto.openoffice.spreadsheet.Sheet;
21
import org.openconcerto.openoffice.spreadsheet.SpreadSheet;
22
import org.openconcerto.openoffice.spreadsheet.Table;
23
import org.openconcerto.sql.Configuration;
24
import org.openconcerto.sql.model.SQLRow;
25
import org.openconcerto.utils.ExceptionHandler;
26
import org.openconcerto.utils.StreamUtils;
156 ilm 27
import org.openconcerto.utils.io.BOMSkipper;
41 ilm 28
 
29
import java.awt.Point;
156 ilm 30
import java.io.BufferedReader;
41 ilm 31
import java.io.File;
32
import java.io.FileNotFoundException;
33
import java.io.IOException;
34
import java.io.InputStream;
156 ilm 35
import java.io.InputStreamReader;
36
import java.nio.charset.Charset;
41 ilm 37
import java.util.HashMap;
38
import java.util.Iterator;
39
import java.util.List;
40
import java.util.Map;
41
 
42
import javax.swing.JOptionPane;
43
import javax.swing.SwingUtilities;
44
 
132 ilm 45
import org.jdom2.Document;
46
import org.jdom2.Element;
47
import org.jdom2.JDOMException;
48
import org.jdom2.input.SAXBuilder;
41 ilm 49
 
50
public class OOgenerationListeColumnXML {
51
 
52
    // Cache pour la recherche des styles
156 ilm 53
    private static Map<Sheet, Map<String, Map<Integer, String>>> cacheStyle = new HashMap<>();
41 ilm 54
 
55
    public static File genere(String modele, File pathDest, String fileDest, Map<Integer, List<Map<String, Object>>> liste, Map<Integer, Map<String, Object>> values) {
56
        return genere(modele, pathDest, fileDest, liste, values, new HashMap<Integer, Map<Integer, String>>(), null, null);
57
    }
58
 
59
    public static File genere(String templateId, File pathDest, String fileDest, Map<Integer, List<Map<String, Object>>> liste, Map<Integer, Map<String, Object>> values,
60
            Map<Integer, Map<Integer, String>> mapStyle, List<String> sheetName, SQLRow rowLanguage) {
61
        cacheStyle.clear();
62
        final SAXBuilder builder = new SAXBuilder();
63
        try {
64
            InputStream xmlConfiguration = TemplateManager.getInstance().getTemplateConfiguration(templateId, rowLanguage != null ? rowLanguage.getString("CHEMIN") : null, null);
149 ilm 65
            if (xmlConfiguration == null) {
66
                throw new IllegalStateException("Template configuration " + templateId + " not found (" + TemplateManager.getInstance().getClass().getName() + ")");
67
            }
156 ilm 68
            final BufferedReader xmlConfigurationReader = new BufferedReader(new InputStreamReader(xmlConfiguration, Charset.forName("UTF8")));
69
            BOMSkipper.skip(xmlConfigurationReader);
70
            final Document doc = builder.build(xmlConfigurationReader);
71
            xmlConfigurationReader.close();
72
            xmlConfiguration.close();
41 ilm 73
 
74
            // On initialise un nouvel élément racine avec l'élément racine du
75
            // document.
76
            final Element racine = doc.getRootElement();
77
 
78
            // Création et génération du fichier OO
79
            final InputStream template = TemplateManager.getInstance().getTemplate(templateId, rowLanguage != null ? rowLanguage.getString("CHEMIN") : null, null);
149 ilm 80
            if (template == null) {
81
                throw new IllegalStateException("Template " + templateId + " not found (" + TemplateManager.getInstance().getClass().getName() + ")");
82
            }
41 ilm 83
            final SpreadSheet spreadSheet = new ODPackage(template).getSpreadSheet();
84
            Sheet sheet0 = spreadSheet.getSheet(0);
85
            if (sheetName != null && sheetName.size() > 0) {
86
                for (int i = 1; i < sheetName.size(); i++) {
87
                    sheet0.copy(i, (sheetName != null) ? sheetName.get(i) : "Feuille " + i);
88
                }
89
                spreadSheet.getSheet(0).setName(sheetName.get(0));
90
            }
91
 
92
            for (Integer i : liste.keySet()) {
93
                final Sheet sheet = spreadSheet.getSheet(i);
94
                List children = racine.getChildren("element" + i);
156 ilm 95
                if (children.isEmpty()) {
41 ilm 96
                    children = racine.getChildren("element");
97
                }
98
                parseElementsXML(children, sheet, values.get(i));
99
                Element child = racine.getChild("table" + i);
100
                if (child == null) {
101
                    child = racine.getChild("table");
102
                }
103
                parseListeXML(child, liste.get(i), sheet, mapStyle.get(i));
104
            }
105
            // Sauvegarde du fichier
106
            return saveSpreadSheet(spreadSheet, pathDest, fileDest, templateId, rowLanguage);
107
 
108
        } catch (JDOMException e) {
109
            ExceptionHandler.handle("Erreur lors de la génération du fichier " + fileDest, e);
110
        } catch (IOException e) {
111
            ExceptionHandler.handle("Erreur lors de la création du fichier " + fileDest, e);
112
        }
113
        return null;
114
    }
115
 
116
    private static void parseElementsXML(List<Element> elts, Sheet sheet, Map<String, Object> values) {
117
        if (values == null) {
118
            return;
119
        }
120
        for (Element elt : elts) {
121
 
122
            String name = elt.getAttributeValue("ValueName");
123
            Object result = values.get(name);
124
 
125
            if (result != null) {
126
                boolean controlLine = elt.getAttributeValue("controleMultiline") == null ? true : !elt.getAttributeValue("controleMultiline").equalsIgnoreCase("false");
127
                boolean replace = elt.getAttributeValue("type").equalsIgnoreCase("Replace");
128
                String replacePattern = elt.getAttributeValue("replacePattern");
129
                fill(sheet.getCellAt(elt.getAttributeValue("location")), result, sheet, replace, replacePattern, null, false, controlLine);
130
            }
131
        }
132
    }
133
 
134
    /**
135
     * Remplit le tableau
136
     *
137
     * @param tableau
138
     * @param elt
139
     * @param id
140
     * @param sheet
141
     */
142
    private static void parseListeXML(Element tableau, List<Map<String, Object>> liste, Sheet sheet, Map<Integer, String> style) {
143
 
144
        if (liste == null || tableau == null) {
145
            return;
146
        }
147
        Object oLastColTmp = tableau.getAttributeValue("lastColumn");
148
        int lastColumn = -1;
156 ilm 149
        int endPageLine = Integer.parseInt(tableau.getAttributeValue("endPageLine"));
41 ilm 150
        if (oLastColTmp != null) {
151
            lastColumn = sheet.resolveHint(oLastColTmp.toString() + 1).x + 1;
152
        }
153
        Map<String, Map<Integer, String>> mapStyle = searchStyle(sheet, lastColumn, endPageLine);
154
 
155
        // int nbPage = fillTable(tableau, liste, sheet, mapStyle, true, style);
156
        // int firstLine = Integer.valueOf(tableau.getAttributeValue("firstLine"));
157
        // int endLine = Integer.valueOf(tableau.getAttributeValue("endLine"));
158
        // Object printRangeObj = sheet.getPrintRanges();
159
        //
160
        // System.err.println("Nombre de page == " + nbPage);
161
        // if (nbPage == 1) {
162
        // fillTable(tableau, liste, sheet, mapStyle, false, style);
163
        // } else {
164
        //
165
        // if (printRangeObj != null) {
166
        // String s = printRangeObj.toString();
167
        // String[] range = s.split(":");
168
        //
169
        // for (int i = 0; i < range.length; i++) {
170
        // String string = range[i];
171
        // range[i] = string.subSequence(string.indexOf('.') + 1, string.length()).toString();
172
        // }
173
        //
174
        // int rowEnd = -1;
175
        // if (range.length > 1) {
176
        // rowEnd = sheet.resolveHint(range[1]).y + 1;
177
        // int rowEndNew = rowEnd * (nbPage + 1);
178
        // String sNew = s.replaceAll(String.valueOf(rowEnd), String.valueOf(rowEndNew));
179
        // sheet.setPrintRanges(sNew);
142 ilm 180
        // System.err.println(" ****** Replace print ranges; Old:" + rowEnd + "--" + s + " New:" +
41 ilm 181
        // rowEndNew + "--" + sNew);
182
        // }
183
        // }
184
        //
185
        // // le nombre d'éléments ne tient pas dans le tableau du modéle
186
        // sheet.duplicateFirstRows(endLine, 1);
187
        //
188
        // int lineToAdd = endPageLine - endLine;
189
        // sheet.insertDuplicatedRows(firstLine, lineToAdd);
190
        //
191
        // // On duplique la premiere page si on a besoin de plus de deux pages
192
        // System.err.println("nbPage == " + nbPage);
193
        // if (nbPage > 2) {
194
        // sheet.duplicateFirstRows(endPageLine, nbPage - 2);
195
        // }
196
        fillTable(tableau, liste, sheet, mapStyle, false, style);
197
        // }
198
    }
199
 
200
    /**
201
     * Remplit le tableau d'éléments avec les données
202
     *
203
     * @param tableau Element Xml contenant les informations sur le tableau
204
     * @param elt SQLElement (ex : Bon de livraison)
205
     * @param id id de l'élément de la table
206
     * @param sheet feuille calc à remplir
207
     * @param mapStyle styles trouvés dans la page
208
     * @param test remplir ou non avec les valeurs
209
     * @return le nombre de page
210
     */
211
    private static int fillTable(Element tableau, List<Map<String, Object>> liste, Sheet sheet, Map<String, Map<Integer, String>> mapStyle, boolean test, Map<Integer, String> style) {
212
 
156 ilm 213
        int endLine = Integer.parseInt(tableau.getAttributeValue("endLine"));
41 ilm 214
 
215
        List listElts = tableau.getChildren("element");
216
 
217
        Object o = null;
142 ilm 218
        // String columnSousTotal = tableau.getAttributeValue("groupSousTotalColumn");
219
        //
220
        // Map<String, Double> mapSousTotal = new HashMap<String, Double>();
221
        // Map<String, Double> mapTotal = new HashMap<String, Double>();
41 ilm 222
 
223
        // on remplit chaque colonnes à partir des rows recuperées
224
        sheet.setColumnCount(liste.size() + 5);
225
        Integer firstCol = Integer.valueOf(tableau.getAttributeValue("firstLine"));
226
        int currentCol = firstCol;
227
        for (int i = 0; i < liste.size(); i++) {
228
            Map<String, Object> mValues = liste.get(i);
229
            if (currentCol != firstCol) {
230
                for (int k = 0; k < endLine; k++) {
231
                    MutableCell<SpreadSheet> c1 = sheet.getCellAt(firstCol, k);
232
                    if (c1.getFormula() != null && c1.getFormula().trim().length() > 0) {
233
                        String formula = c1.getFormula();
234
                        MutableCell<SpreadSheet> c2 = sheet.getCellAt(currentCol, k);
235
                        System.err.println(formula);
236
                        formula = formula.replaceAll("(" + Table.toStr(c1.getX()) + ")" + "(\\d+)", Table.toStr(c2.getX()) + "$2");
237
                        formula = formula.replaceAll(Table.toStr(c1.getX()) + "\\$", Table.toStr(c2.getX()) + "\\$");
238
                        System.err.println(" replace by " + formula);
239
                        c2.getElement().setAttribute("formula", formula, c2.getElement().getNamespace());
240
                        c2.setStyleName(c1.getStyleName());
241
                    }
242
                }
243
            }
244
 
245
            String styleName = null;
246
            // int nbCellule = 1;
247
            // on remplit chaque cellule de la colonne
248
            for (Iterator j = listElts.iterator(); j.hasNext();) {
249
 
250
                // if ((currentLine - 1 + fill("A1", "test", sheet, false, null, null, true)) >
251
                // (endPageLine * nbPage)) {
252
                // currentLine = currentLineTmp + endPageLine;
253
                // currentLineTmp = currentLine;
254
                // nbPage++;
255
                // }
256
 
257
                Element e = (Element) j.next();
258
                MutableCell<SpreadSheet> cell = sheet.getCellAt(currentCol, Integer.valueOf(e.getAttributeValue("location").trim()));
259
                // String loc = e.getAttributeValue("location").trim() + currentLine;
260
                boolean controlLine = e.getAttributeValue("controleMultiline") == null ? true : !e.getAttributeValue("controleMultiline").equalsIgnoreCase("false");
261
                // Type normaux fill ou replace
262
                if (e.getAttributeValue("type").equalsIgnoreCase("fill") || e.getAttributeValue("type").equalsIgnoreCase("replace")) {
263
 
264
                    Object value = getElementValue(e, mValues);
265
 
266
                    boolean replace = e.getAttributeValue("type").equalsIgnoreCase("replace");
267
 
268
                    if (test || cell.isValid()) {
269
                        // if (style != null) {
270
                        // styleName = style.get(i);
271
                        // }
272
                        // Map mTmp = styleName == null ? null : (Map) mapStyle.get(styleName);
273
                        // String styleOO = null;
274
                        // if (mTmp != null) {
275
                        //
276
                        // Object oTmp = mTmp.get(new Integer(sheet.resolveHint(loc).x));
277
                        // styleOO = oTmp == null ? null : oTmp.toString();
278
                        // System.err.println("Set style " + styleOO);
279
                        // }
280
                        if (currentCol != firstCol) {
281
                            MutableCell<SpreadSheet> c2 = sheet.getCellAt(firstCol, cell.getPoint().y);
282
                            styleName = c2.getStyleName();
283
                        }
284
                        int tmpCelluleAffect = fill(cell, value, sheet, replace, null, styleName, test, controlLine);
285
                        // nbCellule = Math.max(nbCellule, tmpCelluleAffect);
286
                    } else {
287
                        System.err.println("Cell not valid at " + cell);
288
                    }
289
                }
290
            }
291
            // currentLine += nbCellule;
292
            currentCol++;
293
 
294
        }
295
 
296
        return 1;
297
    }
298
 
299
    private static void incrementTotal(String field, Double value, Map<String, Double> map) {
300
        Double d = map.get(field);
301
        if (d == null) {
302
            map.put(field, value);
303
        } else {
304
            map.put(field, d + value);
305
        }
306
    }
307
 
308
    private static Object getElementValue(Element elt, Map<String, Object> mValues) {
309
        Object res = "";
310
 
311
        final List eltFields = elt.getChildren("field");
312
 
313
        if (eltFields != null) {
314
            if (eltFields.size() > 1) {
315
                String result = "";
316
                for (Iterator j = eltFields.iterator(); j.hasNext();) {
317
                    Object o = getValueOfComposant((Element) j.next(), mValues);
318
                    if (o != null) {
319
                        result += o.toString() + " ";
320
                    }
321
                }
322
                res = result;
323
            } else {
324
                res = getValueOfComposant((Element) eltFields.get(0), mValues);
325
            }
326
        }
327
        return res;
328
    }
329
 
330
    /**
331
     * permet d'obtenir la valeur d'un élément field
332
     *
333
     * @param eltField
334
     * @param row
335
     * @param elt
336
     * @param id
337
     * @return value of composant
338
     */
339
    private static Object getValueOfComposant(Element eltField, Map<String, Object> mValues) {
340
 
341
        String field = eltField.getAttributeValue("name");
342
 
343
        return mValues.get(field);
344
    }
345
 
346
    private static int fill(String location, Object value, Sheet sheet, boolean replace, String replacePattern, String styleOO, boolean test) {
347
        return fill(sheet.getCellAt(location), value, sheet, replace, replacePattern, styleOO, test, true);
348
    }
349
 
350
    /**
351
     * Permet de remplir une cellule
352
     *
353
     * @param location position de la cellule exemple : A3
354
     * @param value valeur à insérer dans la cellule
355
     * @param sheet feuille sur laquelle on travaille
356
     * @param replace efface ou non le contenu original de la cellule
357
     * @param styleOO style à appliquer
358
     */
359
    private static int fill(MutableCell<SpreadSheet> cell, Object value, Sheet sheet, boolean replace, String replacePattern, String styleOO, boolean test, boolean controlLine) {
360
 
361
        int nbCellule = 1;
362
        // est ce que la cellule est valide
363
        if (test || cell.isValid()) {
364
 
365
            // on divise en 2 cellules si il y a des retours à la ligne
366
            if (controlLine && (value != null && value.toString().indexOf('\n') >= 0)) {
367
 
368
                if (!test) {
369
                    String firstPart = value.toString().substring(0, value.toString().indexOf('\n'));
370
                    String secondPart = value.toString().substring(value.toString().indexOf('\n') + 1, value.toString().length());
371
                    secondPart = secondPart.replace('\n', ',');
372
                    setCellValue(cell, firstPart, replace, replacePattern);
373
                    if (styleOO != null) {
374
                        cell.setStyleName(styleOO);
375
                    }
376
 
377
                    // Point p = sheet.resolveHint(location);
378
                    Point p = cell.getPoint();
379
                    try {
380
                        MutableCell cellSec = sheet.getCellAt(p.x, p.y + 1);
381
                        setCellValue(cellSec, secondPart, replace, replacePattern);
382
                    } catch (Exception ex) {
383
                        ex.printStackTrace();
384
                    }
385
                }
386
                nbCellule = 2;
387
            } else {
388
                if (!test) {
389
                    // application de la valeur
390
                    setCellValue(cell, value, replace, replacePattern);
391
 
392
                    // Application du style
393
                    if (styleOO != null) {
394
                        cell.setStyleName(styleOO);
395
                    }
396
                }
397
            }
398
        }
399
        return nbCellule;
400
    }
401
 
402
    /**
403
     * remplit une cellule
404
     *
405
     * @param cell
406
     * @param value
407
     * @param replace
408
     */
409
    private static void setCellValue(MutableCell cell, Object value, boolean replace, String replacePattern) {
410
        if (value == null) {
411
            value = "";
412
        }
413
 
414
        if (replace) {
415
            if (replacePattern != null) {
416
                cell.replaceBy(replacePattern, value.toString());
417
            } else {
418
                cell.replaceBy("_", value.toString());
419
            }
420
        } else {
421
            cell.setValue(value);
422
        }
423
    }
424
 
425
    /**
426
     * Sauver le document au format OpenOffice. Si le fichier existe déjà, le fichier existant sera
427
     * renommé sous la forme nomFic_1.sxc.
428
     *
429
     * @param ssheet SpreadSheet à sauvegarder
430
     * @param pathDest répertoire de destination du fichier
431
     * @param fileName nom du fichier à créer
432
     * @return un File pointant sur le fichier créé
433
     * @throws IOException
434
     */
435
    private static File saveSpreadSheet(SpreadSheet ssheet, File pathDest, String fileName, String templateId, SQLRow rowLanguage) throws IOException {
436
 
437
        // Test des arguments
438
        if (ssheet == null || pathDest == null || fileName.trim().length() == 0) {
439
            throw new IllegalArgumentException();
440
        }
441
 
442
        // Renommage du fichier si il existe déja
443
        File fDest = new File(pathDest, fileName + ".ods");
444
 
445
        if (!pathDest.exists()) {
446
            pathDest.mkdirs();
447
        }
448
 
57 ilm 449
        SheetUtils.convertToOldFile(((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete(), fileName, pathDest, fDest);
41 ilm 450
 
451
        // Sauvegarde
452
        try {
453
            ssheet.saveAs(fDest);
454
        } catch (FileNotFoundException e) {
455
            final File F = fDest;
456
            SwingUtilities.invokeLater(new Runnable() {
457
                public void run() {
458
                    try {
459
                        JOptionPane.showMessageDialog(null, "Le fichier " + F.getCanonicalPath() + " n'a pu être créé. \n Vérifiez qu'il n'est pas déjà ouvert.");
460
                    } catch (IOException e) {
461
                        e.printStackTrace();
462
                    }
463
                }
464
            });
465
 
466
            e.printStackTrace();
467
        }
468
 
469
        // Copie de l'odsp
156 ilm 470
        File odspOut = new File(pathDest, fileName + ".odsp");
471
        try (final InputStream odspIn = TemplateManager.getInstance().getTemplatePrintConfiguration(templateId, rowLanguage != null ? rowLanguage.getString("CHEMIN") : null, null);) {
41 ilm 472
            if (odspIn != null) {
473
                StreamUtils.copy(odspIn, odspOut);
474
            }
475
        } catch (FileNotFoundException e) {
476
            System.err.println("Le fichier odsp n'existe pas.");
477
        }
478
 
479
        return fDest;
480
    }
481
 
482
    /**
483
     * parcourt l'ensemble de la feuille pour trouver les style définit
484
     */
485
    private static Map<String, Map<Integer, String>> searchStyle(Sheet sheet, int colEnd, int rowEnd) {
486
 
487
        if (cacheStyle.get(sheet) != null) {
488
            return cacheStyle.get(sheet);
489
        }
490
 
491
        Map<String, Map<Integer, String>> mapStyleDef = StyleSQLElement.getMapAllStyle();
492
 
493
        // on parcourt chaque ligne de la feuille pour recuperer les styles
494
        int columnCount = (colEnd == -1) ? sheet.getColumnCount() : (colEnd + 1);
495
        System.err.println("End column search : " + columnCount);
496
 
497
        int rowCount = (rowEnd > 0) ? rowEnd : sheet.getRowCount();
498
        System.err.println("End row search : " + rowCount);
499
        for (int i = 0; i < rowCount; i++) {
500
            int x = 0;
501
            Map<Integer, String> mapCellStyle = new HashMap<Integer, String>();
502
            String style = "";
503
 
504
            for (int j = 0; j < columnCount; j++) {
505
 
506
                try {
507
                    if (sheet.isCellValid(j, i)) {
508
 
509
                        MutableCell c = sheet.getCellAt(j, i);
510
                        String cellStyle = c.getStyleName();
511
 
512
                        try {
513
                            if (mapStyleDef.containsKey(c.getValue().toString())) {
514
                                style = c.getValue().toString();
515
                                // System.err.println("FIND STYLE " +
516
                                // c.getValue().toString() +
517
                                // " SET VALUE " + cellStyle);
518
                            }
519
                        } catch (IllegalStateException e) {
520
                            e.printStackTrace();
521
                        }
522
                        mapCellStyle.put(Integer.valueOf(x), cellStyle);
523
                        if (style.trim().length() != 0) {
524
                            c.clearValue();
525
                            // c.setStyle("Default");
526
                            if (!style.trim().equalsIgnoreCase("Normal") && mapStyleDef.get("Normal") != null) {
527
                                String styleCell = mapStyleDef.get("Normal").get(Integer.valueOf(x));
528
                                if (styleCell != null && styleCell.length() != 0) {
529
                                    c.setStyleName(styleCell);
530
                                }
531
                            }
532
                        }
533
                    }
534
                } catch (IndexOutOfBoundsException e) {
535
                    System.err.println("Index out of bounds Exception");
536
                }
537
                x++;
538
            }
539
 
540
            if (style.length() > 0) {
541
                mapStyleDef.put(style, mapCellStyle);
542
                // System.err.println("style " + mapCellStyle);
543
            }
544
        }
545
        cacheStyle.put(sheet, mapStyleDef);
546
        return mapStyleDef;
547
    }
548
 
549
    public static void main(String[] args) {
550
        ComptaPropsConfiguration conf = ComptaPropsConfiguration.create();
551
        System.err.println("Conf created");
552
        Configuration.setInstance(conf);
553
        conf.setUpSocieteDataBaseConnexion(36);
554
        System.err.println("Connection Set up");
555
 
556
        System.err.println("Start Genere");
557
        // genere("Devis", "C:\\", "Test", elt, 19);
558
        System.err.println("Stop genere");
559
    }
560
}