67 |
67 |
|
68 |
68 |
if (!ParametersDialog.open(this)) return false;
|
69 |
69 |
|
70 |
|
textMetadataColumnList = textMetadataColumnList.split(",").collect { it.trim() }
|
71 |
|
textContentColumnList = textContentColumnList.split(",").collect { it.trim() }
|
72 |
|
structureMetadataColumnList = structureMetadataColumnList.split(",").collect { it.trim() }
|
73 |
|
structureContentColumnList = structureContentColumnList.split(",").collect { it.trim() }
|
74 |
|
dateColumnTypeList = dateColumnTypeList.split(",").collect { it.trim() }
|
75 |
|
prefixesColumnTypeList = prefixesColumnTypeList.split(",").collect { it.trim() }
|
76 |
|
listColumnTypeList = listColumnTypeList.split(",").collect { it.trim() }
|
|
70 |
textMetadataColumnList = textMetadataColumnList.split(",") as List
|
|
71 |
textMetadataColumnList.remove("")
|
|
72 |
textContentColumnList = textContentColumnList.split(",") as List
|
|
73 |
textContentColumnList.remove("")
|
|
74 |
structureMetadataColumnList = structureMetadataColumnList.split(",") as List
|
|
75 |
structureMetadataColumnList.remove("")
|
|
76 |
structureContentColumnList = structureContentColumnList.split(",") as List
|
|
77 |
structureContentColumnList.remove("")
|
|
78 |
dateColumnTypeList = dateColumnTypeList.split(",") as List
|
|
79 |
dateColumnTypeList.remove("")
|
|
80 |
prefixesColumnTypeList = prefixesColumnTypeList.split(",") as List
|
|
81 |
prefixesColumnTypeList.remove("")
|
|
82 |
listColumnTypeList = listColumnTypeList.split(",") as List
|
|
83 |
listColumnTypeList.remove("")
|
|
84 |
|
77 |
85 |
if (textSelector != null && textSelector.contains("=")) {
|
78 |
|
textSelector = textSelector.trim()
|
79 |
|
textSelector = [textSelector.substring(0, textSelector.indexOf("=")).trim(), textSelector.substring(textSelector.indexOf("=")+1).trim()]
|
|
86 |
textSelector = [textSelector.substring(0, textSelector.indexOf("=")), textSelector.substring(textSelector.indexOf("=")+1)]
|
80 |
87 |
} else {
|
81 |
88 |
textSelector = [null, null]
|
82 |
89 |
}
|
83 |
90 |
if (structureSelector != null && structureSelector.contains("=")) {
|
84 |
|
structureSelector = structureSelector.trim()
|
85 |
|
structureSelector = [structureSelector.substring(0, structureSelector.indexOf("=")).trim(), structureSelector.substring(structureSelector.indexOf("=")+1).trim()]
|
|
91 |
structureSelector = [structureSelector.substring(0, structureSelector.indexOf("=")), structureSelector.substring(structureSelector.indexOf("=")+1)]
|
86 |
92 |
} else {
|
87 |
93 |
structureSelector = [null, null]
|
88 |
94 |
}
|
... | ... | |
119 |
125 |
"structureContentColumnList":structureContentColumnList]
|
120 |
126 |
for (def key : hash.keySet()) {
|
121 |
127 |
for (def m : hash[key]) {
|
|
128 |
|
122 |
129 |
if (!headers.contains(m)) {
|
123 |
130 |
println "** Error: missing $key column: $m"
|
124 |
131 |
ok = false
|
125 |
132 |
}
|
|
133 |
}
|
126 |
134 |
}
|
127 |
|
}
|
128 |
135 |
|
129 |
136 |
if (!ok) { return false; }
|
130 |
137 |
|
... | ... | |
139 |
146 |
while (reader.readRecord()) {
|
140 |
147 |
nRecord++
|
141 |
148 |
// println "record="+reader.getRecord().get(textSelector[0])+" "+reader.getRecord().get(structureSelector[0])
|
142 |
|
|
143 |
|
String id = reader.get(textIDColumn).trim()
|
144 |
|
String join = reader.get(textJoinColumn).trim()
|
145 |
|
String textSelectorValue = reader.get(textSelector[0]).trim()
|
146 |
|
String structureSelectorValue = reader.get(structureSelector[0]).trim()
|
147 |
149 |
|
|
150 |
String id = reader.get(textIDColumn)
|
|
151 |
String join = reader.get(textJoinColumn)
|
|
152 |
String textSelectorValue = reader.get(textSelector[0])
|
|
153 |
String structureSelectorValue = reader.get(structureSelector[0])
|
|
154 |
|
148 |
155 |
if (textIDColumn != null && textJoinColumn != null && textIDColumn.length() > 0 && textJoinColumn.length() > 0) {
|
149 |
156 |
if (textSelectorValue != null && structureSelectorValue != null) {
|
150 |
157 |
|
... | ... | |
179 |
186 |
}
|
180 |
187 |
|
181 |
188 |
println "N records: "+nRecord
|
182 |
|
println "N records to write: "+nRecordToWrite
|
|
189 |
println "N records to join: "+nRecordToWrite
|
183 |
190 |
println "N texts to build: "+texts.size()
|
184 |
191 |
if (texts.size() == 0) {
|
185 |
192 |
println "No text found. Aborting."
|
... | ... | |
187 |
194 |
}
|
188 |
195 |
outputDirectory.mkdir()
|
189 |
196 |
|
|
197 |
ConsoleProgressBar cpb = new ConsoleProgressBar(texts.size())
|
190 |
198 |
for (def id : texts.keySet()) {
|
191 |
|
def toWrite = texts[id]
|
192 |
|
def text = toWrite[0]
|
193 |
|
String textSelectorValue = text.get(textSelector[0]).trim()
|
194 |
|
if (textSelectorValue == null || (textSelectorValue != null && textSelectorValue.matches(textSelector[1]))) {
|
195 |
|
if (debug) println "Processing text: $id"
|
196 |
|
|
197 |
|
File outputfile = new File(outputDirectory, id+".xml")
|
198 |
|
|
199 |
|
XMLOutputFactory factory = XMLOutputFactory.newInstance()
|
200 |
|
FileOutputStream output = new FileOutputStream(outputfile)
|
201 |
|
XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8")
|
202 |
|
|
203 |
|
writer.writeStartDocument("UTF-8","1.0")
|
204 |
|
writer.writeCharacters("\n") // simple XML formating
|
205 |
|
writer.writeStartElement("TEI")
|
206 |
|
writer.writeCharacters("\n") // simple XML formating
|
207 |
|
writer.writeStartElement("teiHeader")
|
208 |
|
writer.writeEndElement() // teiHeader
|
209 |
|
writer.writeCharacters("\n") // simple XML formating
|
210 |
|
writer.writeStartElement("text")
|
211 |
|
writer.writeAttribute("id", id)
|
212 |
|
|
213 |
|
for (String att : textMetadataColumnList) {
|
214 |
|
if (att in dateColumnTypeList) {
|
215 |
|
writeMetadataDate(text, att, writer)
|
216 |
|
} else {
|
217 |
|
writer.writeAttribute(AsciiUtils.buildAttributeId(att), text.get(att)) // struct
|
218 |
|
}
|
219 |
|
}
|
220 |
|
|
221 |
|
writer.writeCharacters("\n") // simple XML formating
|
222 |
|
|
223 |
|
writer.writeStartElement("metadata")
|
224 |
|
writer.writeStartElement("list")
|
225 |
|
writer.writeAttribute("type", "unordered")
|
226 |
|
writer.writeCharacters("\n")
|
227 |
|
textMetadataColumnList.each { att ->
|
228 |
|
writer.writeStartElement("item")
|
229 |
|
writer.writeCharacters(att+" : "+text.get(att).replaceAll("\n", ";"))
|
230 |
|
writer.writeEndElement() // item
|
231 |
|
writer.writeCharacters("\n")
|
232 |
|
}
|
233 |
|
writer.writeEndElement() // list
|
234 |
|
writer.writeEndElement() // metadata
|
235 |
|
writer.writeCharacters("\n")
|
236 |
|
|
237 |
|
for (String att : textContentColumnList) {
|
|
199 |
cpb.tick()
|
|
200 |
def toWrite = texts[id]
|
|
201 |
def text = toWrite[0]
|
|
202 |
String textSelectorValue = text.get(textSelector[0])
|
|
203 |
if (textSelectorValue == null || (textSelectorValue != null && textSelectorValue.matches(textSelector[1]))) {
|
|
204 |
if (debug) println "Processing text: $id"
|
238 |
205 |
|
239 |
|
if (att in prefixesColumnTypeList) {
|
240 |
|
|
241 |
|
writePrefixTextContent(text, att, writer)
|
242 |
|
} else if (att in listColumnTypeList) {
|
243 |
|
|
244 |
|
writeListTextContent(text, att, writer)
|
245 |
|
} else {
|
246 |
|
|
247 |
|
writer.writeStartElement("p");
|
248 |
|
writer.writeAttribute("type", att.trim())
|
249 |
|
writer.writeCharacters("\n") // simple XML formating
|
250 |
|
|
251 |
|
writer.writeStartElement("head")
|
252 |
|
writer.writeStartElement("hi")
|
253 |
|
writer.writeCharacters(att+" : ")
|
254 |
|
writer.writeEndElement() // hi
|
255 |
|
writer.writeEndElement() // head
|
256 |
|
|
257 |
|
writer.writeCharacters(text.get(att)) // get textColumnList content
|
258 |
|
writer.writeEndElement() // t
|
259 |
|
writer.writeCharacters("\n") // simple XML formating)
|
260 |
|
}
|
261 |
|
}
|
262 |
|
|
263 |
|
int pb_n = 1;
|
264 |
|
for (int i = 1 ; i < toWrite.size() ; i++) {
|
265 |
|
def record = toWrite[i]
|
|
206 |
File outputfile = new File(outputDirectory, id+".xml")
|
266 |
207 |
|
267 |
|
writer.writeEmptyElement("pb") // <pb/>
|
268 |
|
writer.writeAttribute("n", ""+pb_n++)
|
269 |
|
writer.writeAttribute("type", "record")
|
|
208 |
XMLOutputFactory factory = XMLOutputFactory.newInstance()
|
|
209 |
FileOutputStream output = new FileOutputStream(outputfile)
|
|
210 |
XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8")
|
270 |
211 |
|
271 |
|
writer.writeStartElement(structureTag)
|
|
212 |
writer.writeStartDocument("UTF-8","1.0")
|
|
213 |
writer.writeCharacters("\n") // simple XML formating
|
|
214 |
writer.writeStartElement("TEI")
|
|
215 |
writer.writeCharacters("\n") // simple XML formating
|
|
216 |
writer.writeStartElement("teiHeader")
|
|
217 |
writer.writeEndElement() // teiHeader
|
|
218 |
writer.writeCharacters("\n") // simple XML formating
|
|
219 |
writer.writeStartElement("text")
|
|
220 |
writer.writeAttribute("id", id)
|
272 |
221 |
|
273 |
|
for (String att : structureMetadataColumnList) {
|
|
222 |
for (String att : textMetadataColumnList) {
|
274 |
223 |
if (att in dateColumnTypeList) {
|
275 |
|
writeMetadataDate(record, att, writer)
|
|
224 |
writeMetadataDate(text, att, writer)
|
276 |
225 |
} else {
|
277 |
|
writer.writeAttribute(AsciiUtils.buildAttributeId(att), record.get(att)) // struct
|
|
226 |
writer.writeAttribute(AsciiUtils.buildAttributeId(att), text.get(att)) // struct
|
278 |
227 |
}
|
279 |
228 |
}
|
280 |
|
writer.writeCharacters("\n")
|
281 |
229 |
|
|
230 |
writer.writeCharacters("\n") // simple XML formating
|
|
231 |
|
282 |
232 |
writer.writeStartElement("metadata")
|
283 |
233 |
writer.writeStartElement("list")
|
284 |
234 |
writer.writeAttribute("type", "unordered")
|
285 |
235 |
writer.writeCharacters("\n")
|
286 |
|
structureMetadataColumnList.each { att ->
|
|
236 |
textMetadataColumnList.each { att ->
|
287 |
237 |
writer.writeStartElement("item")
|
288 |
|
writer.writeCharacters(att+" : "+record.get(att).replaceAll("\n", ";"))
|
|
238 |
writer.writeCharacters(att+" : "+text.get(att).replaceAll("\n", ";"))
|
289 |
239 |
writer.writeEndElement() // item
|
290 |
240 |
writer.writeCharacters("\n")
|
291 |
241 |
}
|
... | ... | |
293 |
243 |
writer.writeEndElement() // metadata
|
294 |
244 |
writer.writeCharacters("\n")
|
295 |
245 |
|
296 |
|
for (String att : structureContentColumnList) {
|
|
246 |
for (String att : textContentColumnList) {
|
|
247 |
|
297 |
248 |
if (att in prefixesColumnTypeList) {
|
|
249 |
|
298 |
250 |
writePrefixTextContent(text, att, writer)
|
299 |
251 |
} else if (att in listColumnTypeList) {
|
|
252 |
|
300 |
253 |
writeListTextContent(text, att, writer)
|
301 |
254 |
} else {
|
302 |
|
writer.writeStartElement("p");
|
303 |
|
writer.writeAttribute("type", att.trim())
|
304 |
|
writer.writeAttribute("id", record.get(textIDColumn))
|
305 |
|
writer.writeCharacters("\n") // simple XML formating
|
306 |
255 |
|
307 |
|
writer.writeStartElement("head")
|
308 |
|
writer.writeStartElement("hi")
|
309 |
|
writer.writeCharacters(att+" : ")
|
310 |
|
writer.writeEndElement() // hi
|
311 |
|
writer.writeEndElement() // head
|
312 |
|
|
313 |
|
writer.writeCharacters(record.get(att)) // get textColumnList content
|
314 |
|
writer.writeEndElement() // t
|
315 |
|
writer.writeCharacters("\n") // simple XML formating
|
|
256 |
writeTextContent(text, att, writer)
|
316 |
257 |
}
|
317 |
258 |
}
|
318 |
259 |
|
319 |
|
writer.writeEndElement() // struct
|
|
260 |
int pb_n = 1;
|
|
261 |
for (int i = 1 ; i < toWrite.size() ; i++) {
|
|
262 |
def record = toWrite[i]
|
|
263 |
|
|
264 |
writer.writeEmptyElement("pb") // <pb/>
|
|
265 |
writer.writeAttribute("n", ""+pb_n++)
|
|
266 |
writer.writeAttribute("type", "record")
|
|
267 |
|
|
268 |
writer.writeStartElement(structureTag)
|
|
269 |
|
|
270 |
for (String att : structureMetadataColumnList) {
|
|
271 |
if (att in dateColumnTypeList) {
|
|
272 |
writeMetadataDate(record, att, writer)
|
|
273 |
} else {
|
|
274 |
writer.writeAttribute(AsciiUtils.buildAttributeId(att), record.get(att)) // struct
|
|
275 |
}
|
|
276 |
}
|
|
277 |
writer.writeCharacters("\n")
|
|
278 |
|
|
279 |
writer.writeStartElement("metadata")
|
|
280 |
writer.writeStartElement("list")
|
|
281 |
writer.writeAttribute("type", "unordered")
|
|
282 |
writer.writeCharacters("\n")
|
|
283 |
structureMetadataColumnList.each { att ->
|
|
284 |
writer.writeStartElement("item")
|
|
285 |
writer.writeCharacters(att+" : "+record.get(att).replaceAll("\n", ";"))
|
|
286 |
writer.writeEndElement() // item
|
|
287 |
writer.writeCharacters("\n")
|
|
288 |
}
|
|
289 |
writer.writeEndElement() // list
|
|
290 |
writer.writeEndElement() // metadata
|
|
291 |
writer.writeCharacters("\n")
|
|
292 |
|
|
293 |
for (String att : structureContentColumnList) {
|
|
294 |
if (att in prefixesColumnTypeList) {
|
|
295 |
writePrefixTextContent(record, att, writer)
|
|
296 |
} else if (att in listColumnTypeList) {
|
|
297 |
writeListTextContent(record, att, writer)
|
|
298 |
} else {
|
|
299 |
writeTextContent(record, att, writer)
|
|
300 |
}
|
|
301 |
}
|
|
302 |
|
|
303 |
writer.writeEndElement() // struct
|
|
304 |
writer.writeCharacters("\n") // simple XML formating
|
|
305 |
}
|
|
306 |
|
|
307 |
writer.writeEndElement() // text
|
320 |
308 |
writer.writeCharacters("\n") // simple XML formating
|
|
309 |
writer.writeEndElement() // TEI
|
|
310 |
writer.close()
|
|
311 |
output.close()
|
|
312 |
reader.close()
|
|
313 |
} else {
|
|
314 |
// error
|
|
315 |
println "ERROR: '$id' text group with no text line"
|
321 |
316 |
}
|
322 |
|
|
323 |
|
writer.writeEndElement() // text
|
324 |
|
writer.writeCharacters("\n") // simple XML formating
|
325 |
|
writer.writeEndElement() // TEI
|
326 |
|
writer.close()
|
327 |
|
output.close()
|
328 |
|
reader.close()
|
329 |
|
} else {
|
330 |
|
// error
|
331 |
|
println "ERROR: '$id' text group with no text line"
|
332 |
317 |
}
|
333 |
|
}
|
|
318 |
cpb.done()
|
334 |
319 |
|
|
320 |
|
335 |
321 |
def writeListTextContent(def record, def att, def writer) {
|
336 |
|
writer.writeCharacters("\n")
|
337 |
|
found = false
|
338 |
|
def value = record.get(att)
|
339 |
|
value.findAll( /(?s)([^\n]+?)[\n]/ ).each { desc ->
|
340 |
|
found = true
|
341 |
|
writer.writeCharacters("\t")
|
342 |
|
writer.writeStartElement("p")
|
343 |
|
writer.writeAttribute("rend", "list")
|
344 |
|
matches = (desc =~ /(?s)([^\n]+?)[\n]/)
|
345 |
|
writer.writeCharacters(matches[0][1])
|
346 |
|
writer.writeEndElement() // p
|
|
322 |
|
|
323 |
def value = record.get(att).replaceAll(" ++", " ")
|
|
324 |
if (value.length() <= 1) return
|
|
325 |
|
347 |
326 |
writer.writeCharacters("\n")
|
|
327 |
found = false
|
|
328 |
for (String s : value.split("\n")) {
|
|
329 |
s = s.trim()
|
|
330 |
if (s.length() == 0) continue;
|
|
331 |
if (s.startsWith("-")) s = s.substring(1).trim();
|
|
332 |
if (s.length() == 0) continue;
|
|
333 |
|
|
334 |
found = true
|
|
335 |
writer.writeCharacters("\t")
|
|
336 |
writer.writeStartElement("p")
|
|
337 |
writer.writeAttribute("rend", "list")
|
|
338 |
writer.writeCharacters(s)
|
|
339 |
writer.writeEndElement() // p
|
|
340 |
writer.writeCharacters("\n")
|
|
341 |
}
|
|
342 |
|
|
343 |
if (!found) {
|
|
344 |
println "Warning: '$att' list not found in '$value'"
|
|
345 |
writer.writeCharacters("\t")
|
|
346 |
writer.writeStartElement("p")
|
|
347 |
writer.writeAttribute("rend", "no-list")
|
|
348 |
writer.writeCharacters(value)
|
|
349 |
writer.writeEndElement() // p
|
|
350 |
writer.writeCharacters("\n")
|
|
351 |
}
|
348 |
352 |
}
|
349 |
|
if (!found) {
|
350 |
|
writer.writeCharacters("\t")
|
351 |
|
writer.writeStartElement("p")
|
352 |
|
writer.writeAttribute("rend", "no-list")
|
353 |
|
writer.writeCharacters(value)
|
|
353 |
|
|
354 |
def writeTextContent(def record, def att, def writer) {
|
|
355 |
|
|
356 |
def value = record.get(att).replaceAll(" ++", " ")
|
|
357 |
if (value.length() == 0) return
|
|
358 |
|
|
359 |
writer.writeStartElement("head")
|
|
360 |
writer.writeStartElement("hi")
|
|
361 |
writer.writeCharacters(att)
|
|
362 |
writer.writeEndElement() // hi
|
|
363 |
writer.writeEndElement() // head
|
|
364 |
|
|
365 |
writer.writeStartElement(AsciiUtils.buildAttributeId(att));
|
|
366 |
writer.writeAttribute("type", att.trim())
|
|
367 |
if (record.get(textIDColumn) != null) {
|
|
368 |
writer.writeAttribute("id", record.get(textIDColumn))
|
|
369 |
}
|
|
370 |
writer.writeCharacters("\n") // simple XML formating
|
|
371 |
|
|
372 |
writer.writeCharacters(value) // get textColumnList content
|
354 |
373 |
writer.writeEndElement() // p
|
355 |
|
writer.writeCharacters("\n")
|
|
374 |
writer.writeCharacters("\n") // simple XML formating)
|
356 |
375 |
}
|
357 |
|
}
|
358 |
376 |
|
359 |
377 |
def writePrefixTextContent(def record, def att, def writer) {
|
360 |
|
writer.writeCharacters("\n")
|
361 |
|
writer.writeStartElement("list")
|
362 |
|
writer.writeAttribute("rend", "prefixes")
|
363 |
|
writer.writeAttribute("type", "unordered")
|
364 |
|
writer.writeCharacters("\n")
|
365 |
|
found = false
|
366 |
|
def value = record.get(att)
|
367 |
|
value.findAll( /(?s)[A-Z]{3}:? *([^;\n]+?) +[;\n]/ ).each { desc ->
|
368 |
|
found = true
|
369 |
|
writer.writeCharacters("\t")
|
370 |
|
writer.writeStartElement("item")
|
371 |
|
matches = (desc =~ /(?s)([A-Z]{3}):? *([^;\n]+?) +[;\n]/)
|
372 |
|
writer.writeAttribute("type", matches[0][1])
|
373 |
|
writer.writeStartElement("span")
|
374 |
|
writer.writeCharacters(matches[0][1]+" ")
|
375 |
|
writer.writeEndElement() // span
|
376 |
|
writer.writeCharacters(matches[0][2])
|
377 |
|
writer.writeEndElement() // item
|
|
378 |
def value = record.get(att).replaceAll(" ++", " ")
|
|
379 |
if (value.length() <= 1) return
|
|
380 |
|
378 |
381 |
writer.writeCharacters("\n")
|
|
382 |
writer.writeStartElement("list")
|
|
383 |
writer.writeAttribute("rend", att.trim())
|
|
384 |
writer.writeAttribute("type", "unordered")
|
|
385 |
writer.writeCharacters("\n")
|
|
386 |
found = false
|
|
387 |
|
|
388 |
value.findAll( /(?s)[A-Z]{3}:? *([^;\n]+?) +[;\n]/ ).each { desc ->
|
|
389 |
found = true
|
|
390 |
writer.writeCharacters("\t")
|
|
391 |
writer.writeStartElement("item")
|
|
392 |
matches = (desc =~ /(?s)([A-Z]{3}):? *([^;\n]+?) +[;\n]/)
|
|
393 |
writer.writeAttribute("type", matches[0][1])
|
|
394 |
writer.writeStartElement("span")
|
|
395 |
writer.writeCharacters(matches[0][1]+" ")
|
|
396 |
writer.writeEndElement() // span
|
|
397 |
writer.writeCharacters(matches[0][2])
|
|
398 |
writer.writeEndElement() // item
|
|
399 |
writer.writeCharacters("\n")
|
|
400 |
}
|
|
401 |
if (!found) {
|
|
402 |
println "Warning: '$att' prefixes not found in: '$value'"
|
|
403 |
writer.writeCharacters(value)
|
|
404 |
}
|
|
405 |
writer.writeEndElement() // list
|
|
406 |
writer.writeCharacters("\n")
|
379 |
407 |
}
|
380 |
|
if (!found) {
|
381 |
|
writer.writeCharacters(value)
|
382 |
|
}
|
383 |
|
writer.writeEndElement() // list
|
384 |
|
writer.writeCharacters("\n")
|
385 |
|
}
|
386 |
408 |
|
387 |
409 |
def writeMetadataDate(def record, def att, def writer) {
|
388 |
|
String value = record.get(att)
|
389 |
|
String att_normalized = AsciiUtils.buildAttributeId(att)
|
390 |
|
matches = (value =~ /([0-9]{2})\/([0-9]{2})\/([0-9]{4})/)
|
391 |
|
writer.writeAttribute(att_normalized+"-jour", matches[0][1])
|
392 |
|
writer.writeAttribute(att_normalized+"-joursemaine", new java.text.SimpleDateFormat('EEEE').format(Date.parse("dd/MM/yyyy", value)))
|
393 |
|
writer.writeAttribute(att_normalized+"-mois", matches[0][2])
|
394 |
|
writer.writeAttribute(att_normalized+"-annee", matches[0][3])
|
395 |
|
writer.writeAttribute(att_normalized+"-tri", matches[0][3]+"-"+matches[0][2]+"-"+matches[0][1])
|
|
410 |
String value = record.get(att)
|
|
411 |
if (value.length() == 0) return
|
|
412 |
|
|
413 |
String att_normalized = AsciiUtils.buildAttributeId(att)
|
|
414 |
matches = (value =~ /([0-9]{2})\/([0-9]{2})\/([0-9]{4})/)
|
|
415 |
writer.writeAttribute(att_normalized+"-jour", matches[0][1])
|
|
416 |
writer.writeAttribute(att_normalized+"-joursemaine", new java.text.SimpleDateFormat('EEEE').format(Date.parse("dd/MM/yyyy", value)))
|
|
417 |
writer.writeAttribute(att_normalized+"-mois", matches[0][2])
|
|
418 |
writer.writeAttribute(att_normalized+"-annee", matches[0][3])
|
|
419 |
writer.writeAttribute(att_normalized+"-tri", matches[0][3]+"-"+matches[0][2]+"-"+matches[0][1])
|
396 |
420 |
}
|
397 |
421 |
|
398 |
422 |
/*
|