Révision 1195
| tmp/org.txm.edition.rcp/.settings/org.eclipse.core.resources.prefs (revision 1195) | ||
|---|---|---|
| 1 |
eclipse.preferences.version=1 |
|
| 2 |
encoding//src/org/txm/edition/rcp/messages/messages_fr.properties=UTF-8 |
|
| 0 | 3 | |
| tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages_fr.properties (revision 1195) | ||
|---|---|---|
| 4 | 4 |
BackToText_4 = Pas d'édition disponible. |
| 5 | 5 |
BackToText_5 = Ouverture de l'édition par défaut : |
| 6 | 6 |
|
| 7 |
EditionPanel_0 = Pas d'édition trouvée pour le texte : |
|
| 8 |
EditionPanel_1 = échec de la récupération de la première page d'édition |
|
| 9 |
EditionPanel_2 = \ pour le texte |
|
| 10 |
EditionPanel_5 = \ édition= |
|
| 11 |
EditionPanel_6 = Pas d'édition nommée |
|
| 12 |
EditionPanel_7 = \ disponible pour le texte |
|
| 13 |
|
|
| 14 | 7 |
EditionSelectorDialog_0 = éditions |
| 15 | 8 |
EditionSelectorDialog_1 = Sélectionner une ou plusieurs éditions. |
| 16 | 9 |
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/MetadataPage.java (revision 1195) | ||
|---|---|---|
| 482 | 482 |
metadataFile = Metadatas.findMetadataFile(new File(main.getRootDir())); //$NON-NLS-1$ |
| 483 | 483 |
Metadatas temp = null; |
| 484 | 484 |
if (metadataFile.exists()) {//if their is a metadata file OK
|
| 485 |
if (metadataFile.getName().endsWith(".csv")) { //$NON-NLS-1$
|
|
| 486 | 485 |
String encoding = TBXPreferences.getInstance().getString(TBXPreferences.METADATA_ENCODING); |
| 487 | 486 |
String colsep = TBXPreferences.getInstance().getString(TBXPreferences.METADATA_COLSEPARATOR); |
| 488 | 487 |
String txtsep = TBXPreferences.getInstance().getString(TBXPreferences.METADATA_TXTSEPARATOR); |
| 489 | 488 |
temp = new Metadatas(metadataFile, encoding, colsep, txtsep, 1); |
| 490 |
} else {
|
|
| 491 |
temp = new Metadatas(metadataFile); |
|
| 492 |
} |
|
| 493 | 489 |
} else {
|
| 494 | 490 |
System.out.println(NLS.bind(TXMUIMessages.MetadataPage_7, metadataFile)); |
| 495 | 491 |
return; |
| tmp/org.txm.core/src/java/org/txm/metadatas/Metadatas.java (revision 1195) | ||
|---|---|---|
| 250 | 250 |
// write the other attributes |
| 251 | 251 |
for (int j = 0 ; j < headers.size() ; j++) {
|
| 252 | 252 |
if (!headers.get(j).equals("id")) {
|
| 253 |
writer.writeAttribute(headers.get(j), dataline.get(j)); |
|
| 253 |
// |
|
| 254 |
writer.writeStartElement("entry");
|
|
| 255 |
writer.writeAttribute("id", headers.get(j));
|
|
| 256 |
writer.writeAttribute("value", dataline.get(j));
|
|
| 257 |
writer.writeEndElement(); |
|
| 254 | 258 |
} |
| 255 | 259 |
} |
| 256 | 260 |
writer.writeEndElement(); |
| tmp/org.txm.libs.office/src/org/txm/libs/office/ReadODS.java (revision 1195) | ||
|---|---|---|
| 3 | 3 |
import java.io.File; |
| 4 | 4 |
import java.util.ArrayList; |
| 5 | 5 |
|
| 6 |
import org.odftoolkit.odfdom.dom.element.table.TableTableRowElement; |
|
| 6 | 7 |
import org.odftoolkit.simple.SpreadsheetDocument; |
| 7 | 8 |
import org.odftoolkit.simple.table.Row; |
| 8 | 9 |
import org.odftoolkit.simple.table.Table; |
| 10 |
import org.w3c.dom.NodeList; |
|
| 9 | 11 |
|
| 10 | 12 |
public class ReadODS {
|
| 11 | 13 |
|
| ... | ... | |
| 30 | 32 |
|
| 31 | 33 |
ArrayList<ArrayList<String>> data = new ArrayList<ArrayList<String>>(); |
| 32 | 34 |
|
| 33 |
int rowCount = table.getRowCount(); |
|
| 34 |
|
|
| 35 |
for (int it = 0 ; it < rowCount ; it++) {
|
|
| 35 |
//int rowCount = table.getRowCount(); |
|
| 36 |
for (Row row : table.getRowList()) {
|
|
| 36 | 37 |
ArrayList<String> dataline = new ArrayList<>(); |
| 37 | 38 |
data.add(dataline); |
| 38 |
Row row = table.getRowByIndex(it); |
|
| 39 |
int colCount = row.getCellCount(); |
|
| 40 |
for (int j = 0 ; j < colCount ; j++) {
|
|
| 39 |
//Row row = table.getRowByIndex(it); |
|
| 40 |
//int colCount = row.getCellCount(); |
|
| 41 |
TableTableRowElement elem = row.getOdfElement(); |
|
| 42 |
NodeList children = elem.getChildNodes(); |
|
| 43 |
int s = children.getLength(); //FIXME row.getCellCount() takes too much time |
|
| 44 |
NodeList elems = elem.getElementsByTagName("table:table-cell");
|
|
| 45 |
int size = elems.getLength(); |
|
| 46 |
for (int j = 0 ; j < size ; j++) {
|
|
| 41 | 47 |
String cell = row.getCellByIndex(j).getDisplayText(); |
| 42 | 48 |
if (cell == null) {
|
| 43 | 49 |
dataline.add("");
|
| ... | ... | |
| 51 | 57 |
} |
| 52 | 58 |
|
| 53 | 59 |
public static void main(String[] args) throws Exception {
|
| 54 |
System.out.println(toTable(new File("/home/mdecorde/xml/metadata.ods"), "metadata"));
|
|
| 60 |
File file = new File("/home/mdecorde/xml/minibrown/metadata.ods");
|
|
| 61 |
System.out.println(toTable(file, "metadata")); |
|
| 62 |
//Metadatas m = new Metadatas(file, ) |
|
| 55 | 63 |
} |
| 56 | 64 |
} |
Formats disponibles : Unified diff