188 |
188 |
*/
|
189 |
189 |
public Element addEdition(Element textElem, String name, String index, String type)
|
190 |
190 |
{
|
191 |
|
NodeList editionsList = textElem.getElementsByTagName("editions");
|
|
191 |
NodeList editionsList = textElem.getElementsByTagName("editions");//$NON-NLS-1$
|
192 |
192 |
Element editions = null;
|
193 |
193 |
if (editionsList.getLength() == 0) {
|
194 |
|
editions = textElem.getOwnerDocument().createElement("editions");
|
|
194 |
editions = textElem.getOwnerDocument().createElement("editions");//$NON-NLS-1$
|
195 |
195 |
textElem.appendChild(editions);
|
196 |
196 |
} else {
|
197 |
197 |
editions = (Element) editionsList.item(0);
|
198 |
198 |
}
|
199 |
199 |
|
200 |
|
Element editionElement = editions.getOwnerDocument().createElement("edition");
|
|
200 |
Element editionElement = editions.getOwnerDocument().createElement("edition");//$NON-NLS-1$
|
201 |
201 |
editionElement.setAttribute(NAME, name);
|
202 |
|
editionElement.setAttribute("index", index);
|
203 |
|
editionElement.setAttribute("type", type);
|
|
202 |
editionElement.setAttribute("index", index);//$NON-NLS-1$
|
|
203 |
editionElement.setAttribute("type", type);//$NON-NLS-1$
|
204 |
204 |
editions.appendChild(editionElement);
|
205 |
205 |
|
206 |
206 |
return editionElement;
|
... | ... | |
216 |
216 |
*/
|
217 |
217 |
public Element addEditionDefinition(Element corpusElem, String name, String mode, String script) {
|
218 |
218 |
Element editionsElement = getEditionsElement(corpusElem);
|
219 |
|
Element editionElement = editionsElement.getOwnerDocument().createElement("edition");
|
|
219 |
Element editionElement = editionsElement.getOwnerDocument().createElement("edition");//$NON-NLS-1$
|
220 |
220 |
editionElement.setAttribute(NAME, name);
|
221 |
|
editionElement.setAttribute("build_edition", ""+DEFAULT_DOEDITION);
|
222 |
|
editionElement.setAttribute("page_break_tag", ""+DEFAULT_PAGEELEMENT);
|
223 |
|
editionElement.setAttribute("words_per_page", ""+DEFAULT_WORDSPERPAGE);
|
224 |
|
editionElement.setAttribute("mode", mode);
|
225 |
|
editionElement.setAttribute("script", script);
|
226 |
|
editionElement.setAttribute("type", "html");
|
227 |
|
editionElement.setAttribute("index", ".");
|
|
221 |
editionElement.setAttribute("build_edition", ""+DEFAULT_DOEDITION);//$NON-NLS-1$
|
|
222 |
editionElement.setAttribute("page_break_tag", ""+DEFAULT_PAGEELEMENT);//$NON-NLS-1$
|
|
223 |
editionElement.setAttribute("words_per_page", ""+DEFAULT_WORDSPERPAGE);//$NON-NLS-1$
|
|
224 |
editionElement.setAttribute("mode", mode);//$NON-NLS-1$
|
|
225 |
editionElement.setAttribute("script", script);//$NON-NLS-1$
|
|
226 |
editionElement.setAttribute("type", "html");//$NON-NLS-1$
|
|
227 |
editionElement.setAttribute("index", ".");//$NON-NLS-1$
|
228 |
228 |
editionsElement.appendChild(editionElement);
|
229 |
229 |
|
230 |
230 |
return editionElement;
|
... | ... | |
232 |
232 |
|
233 |
233 |
public Element addPage(Element edition, String idx, String wordid)
|
234 |
234 |
{
|
235 |
|
Element page = edition.getOwnerDocument().createElement("page");
|
236 |
|
page.setAttribute("id", idx);
|
237 |
|
page.setAttribute("wordid", wordid);
|
|
235 |
Element page = edition.getOwnerDocument().createElement("page");//$NON-NLS-1$
|
|
236 |
page.setAttribute("id", idx);//$NON-NLS-1$
|
|
237 |
page.setAttribute("wordid", wordid);//$NON-NLS-1$
|
238 |
238 |
edition.appendChild(page);
|
239 |
239 |
return page;
|
240 |
240 |
}
|
... | ... | |
242 |
242 |
public void addPartition(Element corpusElem, String name, String[] queries,
|
243 |
243 |
String[] names) {
|
244 |
244 |
Element preBuildElement = this.getPreBuildElement(corpusElem);
|
245 |
|
Element partitionElem = preBuildElement.getOwnerDocument().createElement("partition");
|
|
245 |
Element partitionElem = preBuildElement.getOwnerDocument().createElement("partition");//$NON-NLS-1$
|
246 |
246 |
partitionElem.setAttribute(NAME, name);
|
247 |
247 |
for (int i = 0 ; i < queries.length ; i++) {
|
248 |
|
Element partElem = preBuildElement.getOwnerDocument().createElement("part");
|
|
248 |
Element partElem = preBuildElement.getOwnerDocument().createElement("part");//$NON-NLS-1$
|
249 |
249 |
partElem.setAttribute(NAME, names[i]);
|
250 |
250 |
partElem.setAttribute(QUERY, queries[i]);
|
251 |
251 |
partitionElem.appendChild(partElem);
|
... | ... | |
255 |
255 |
|
256 |
256 |
public Element addPAttribute(Element corpusElem, String name, String shortname, String longname, String type, String renderer, String tooltip, String pattern, String importB, String mandatory, String inputFormat, String outputFormat)
|
257 |
257 |
{
|
258 |
|
NodeList pattributesList = corpusElem.getElementsByTagName("pattributes");
|
|
258 |
NodeList pattributesList = corpusElem.getElementsByTagName("pattributes");//$NON-NLS-1$
|
259 |
259 |
if(pattributesList.getLength() == 0)
|
260 |
260 |
return null;
|
261 |
261 |
|
262 |
262 |
Element pattributes = (Element) pattributesList.item(0);
|
263 |
|
Element pattribute = pattributes.getOwnerDocument().createElement("pattribute");
|
264 |
|
pattribute.setAttribute("id", name);
|
265 |
|
pattribute.setAttribute("shortname", shortname);
|
266 |
|
pattribute.setAttribute("longname", longname);
|
267 |
|
pattribute.setAttribute("type", type);
|
268 |
|
pattribute.setAttribute("renderer", renderer);
|
269 |
|
pattribute.setAttribute("tooltip", tooltip);
|
270 |
|
pattribute.setAttribute("pattern", pattern);
|
271 |
|
pattribute.setAttribute("import", importB);
|
272 |
|
pattribute.setAttribute("mandatory", mandatory);
|
273 |
|
pattribute.setAttribute("inputFormat", inputFormat);
|
274 |
|
pattribute.setAttribute("outputFormat", outputFormat);
|
|
263 |
Element pattribute = pattributes.getOwnerDocument().createElement("pattribute");//$NON-NLS-1$
|
|
264 |
pattribute.setAttribute("id", name);//$NON-NLS-1$
|
|
265 |
pattribute.setAttribute("shortname", shortname);//$NON-NLS-1$
|
|
266 |
pattribute.setAttribute("longname", longname);//$NON-NLS-1$
|
|
267 |
pattribute.setAttribute("type", type);//$NON-NLS-1$
|
|
268 |
pattribute.setAttribute("renderer", renderer);//$NON-NLS-1$
|
|
269 |
pattribute.setAttribute("tooltip", tooltip);//$NON-NLS-1$
|
|
270 |
pattribute.setAttribute("pattern", pattern);//$NON-NLS-1$
|
|
271 |
pattribute.setAttribute("import", importB);//$NON-NLS-1$
|
|
272 |
pattribute.setAttribute("mandatory", mandatory);//$NON-NLS-1$
|
|
273 |
pattribute.setAttribute("inputFormat", inputFormat);//$NON-NLS-1$
|
|
274 |
pattribute.setAttribute("outputFormat", outputFormat);//$NON-NLS-1$
|
275 |
275 |
pattributes.appendChild(pattribute);
|
276 |
276 |
|
277 |
277 |
return pattribute;
|
... | ... | |
279 |
279 |
|
280 |
280 |
public Element addPreBuildCorpus(Element corpusElem, String name, String query, String exemple)
|
281 |
281 |
{
|
282 |
|
NodeList prebuildsList = corpusElem.getElementsByTagName("preBuild");
|
|
282 |
NodeList prebuildsList = corpusElem.getElementsByTagName("preBuild");//$NON-NLS-1$
|
283 |
283 |
if(prebuildsList.getLength() == 0)
|
284 |
284 |
return null;
|
285 |
285 |
|
286 |
286 |
Element preBuild = (Element) prebuildsList.item(0);
|
287 |
|
Element subcorpus = preBuild.getOwnerDocument().createElement("subcorpus");
|
|
287 |
Element subcorpus = preBuild.getOwnerDocument().createElement("subcorpus");//$NON-NLS-1$
|
288 |
288 |
subcorpus.setAttribute(NAME, name);
|
289 |
289 |
subcorpus.setAttribute(QUERY, query);
|
290 |
290 |
|
... | ... | |
294 |
294 |
|
295 |
295 |
public Element addQuery(Element corpusElem, String name, String query, String desc)
|
296 |
296 |
{
|
297 |
|
NodeList queriesList = corpusElem.getElementsByTagName("queries");
|
|
297 |
NodeList queriesList = corpusElem.getElementsByTagName("queries");//$NON-NLS-1$
|
298 |
298 |
if(queriesList.getLength() == 0)
|
299 |
299 |
return null;
|
300 |
300 |
|
... | ... | |
310 |
310 |
|
311 |
311 |
public Element addSAttribute(Element corpusElem, String name, String shortname, String longname, String type, String renderer, String tooltip, String pattern, String importB, String mandatory, String inputFormat, String outputFormat)
|
312 |
312 |
{
|
313 |
|
NodeList sattributesList = corpusElem.getElementsByTagName("sattributes");
|
|
313 |
NodeList sattributesList = corpusElem.getElementsByTagName("sattributes");//$NON-NLS-1$
|
314 |
314 |
if(sattributesList.getLength() == 0)
|
315 |
315 |
return null;
|
316 |
316 |
|
317 |
317 |
Element sattributes = (Element) sattributesList.item(0);
|
318 |
|
Element sattribute = sattributes.getOwnerDocument().createElement("sattribute");
|
319 |
|
sattribute.setAttribute("id", name);
|
320 |
|
sattribute.setAttribute("shortname", shortname);
|
321 |
|
sattribute.setAttribute("longname", longname);
|
322 |
|
sattribute.setAttribute("type", type);
|
323 |
|
sattribute.setAttribute("renderer", renderer);
|
324 |
|
sattribute.setAttribute("tooltip", tooltip);
|
325 |
|
sattribute.setAttribute("pattern", pattern);
|
326 |
|
sattribute.setAttribute("import", importB);
|
327 |
|
sattribute.setAttribute("mandatory", mandatory);
|
328 |
|
sattribute.setAttribute("inputFormat", inputFormat);
|
329 |
|
sattribute.setAttribute("outputFormat", outputFormat);
|
|
318 |
Element sattribute = sattributes.getOwnerDocument().createElement("sattribute");//$NON-NLS-1$
|
|
319 |
sattribute.setAttribute("id", name);//$NON-NLS-1$
|
|
320 |
sattribute.setAttribute("shortname", shortname);//$NON-NLS-1$
|
|
321 |
sattribute.setAttribute("longname", longname);//$NON-NLS-1$
|
|
322 |
sattribute.setAttribute("type", type);//$NON-NLS-1$
|
|
323 |
sattribute.setAttribute("renderer", renderer);//$NON-NLS-1$
|
|
324 |
sattribute.setAttribute("tooltip", tooltip);//$NON-NLS-1$
|
|
325 |
sattribute.setAttribute("pattern", pattern);//$NON-NLS-1$
|
|
326 |
sattribute.setAttribute("import", importB);//$NON-NLS-1$
|
|
327 |
sattribute.setAttribute("mandatory", mandatory);//$NON-NLS-1$
|
|
328 |
sattribute.setAttribute("inputFormat", inputFormat);//$NON-NLS-1$
|
|
329 |
sattribute.setAttribute("outputFormat", outputFormat);//$NON-NLS-1$
|
330 |
330 |
sattributes.appendChild(sattribute);
|
331 |
331 |
|
332 |
332 |
return sattribute;
|
... | ... | |
335 |
335 |
public void addSubcorpus(Element corpusElem, String name, String query,
|
336 |
336 |
String desc) {
|
337 |
337 |
Element preBuildElement = this.getPreBuildElement(corpusElem);
|
338 |
|
Element subcorpusElem = preBuildElement.getOwnerDocument().createElement("subcorpus");
|
|
338 |
Element subcorpusElem = preBuildElement.getOwnerDocument().createElement("subcorpus");//$NON-NLS-1$
|
339 |
339 |
subcorpusElem.setAttribute(NAME, name);
|
340 |
340 |
subcorpusElem.setAttribute(QUERY, query);
|
341 |
341 |
subcorpusElem.setAttribute(DESC, desc);
|
... | ... | |
351 |
351 |
*/
|
352 |
352 |
public Element addText(Element corpusElem, String name, File sourceFile)
|
353 |
353 |
{
|
354 |
|
NodeList textsList = corpusElem.getElementsByTagName("texts");
|
|
354 |
NodeList textsList = corpusElem.getElementsByTagName("texts");//$NON-NLS-1$
|
355 |
355 |
Element texts = null;
|
356 |
356 |
if (textsList.getLength() == 0) {
|
357 |
|
texts = corpusElem.getOwnerDocument().createElement("texts");
|
|
357 |
texts = corpusElem.getOwnerDocument().createElement("texts");//$NON-NLS-1$
|
358 |
358 |
corpusElem.appendChild(texts);
|
359 |
359 |
} else {
|
360 |
360 |
texts = (Element) textsList.item(0);
|
361 |
361 |
}
|
362 |
362 |
|
363 |
|
Element text = texts.getOwnerDocument().createElement("text");
|
|
363 |
Element text = texts.getOwnerDocument().createElement("text");//$NON-NLS-1$
|
364 |
364 |
text.setAttribute(NAME, name);
|
365 |
365 |
texts.appendChild(text);
|
366 |
366 |
|
367 |
|
Element source = texts.getOwnerDocument().createElement("source");
|
368 |
|
source.setAttribute("file", sourceFile.getAbsolutePath());
|
369 |
|
source.setAttribute("type", ".xml");
|
|
367 |
Element source = texts.getOwnerDocument().createElement("source");//$NON-NLS-1$
|
|
368 |
source.setAttribute("file", sourceFile.getAbsolutePath());//$NON-NLS-1$
|
|
369 |
source.setAttribute("type", ".xml");//$NON-NLS-1$
|
370 |
370 |
text.appendChild(source);
|
371 |
|
text.appendChild(texts.getOwnerDocument().createElement("editions"));
|
|
371 |
text.appendChild(texts.getOwnerDocument().createElement("editions"));//$NON-NLS-1$
|
372 |
372 |
|
373 |
373 |
return text;
|
374 |
374 |
}
|
375 |
375 |
|
376 |
376 |
|
377 |
377 |
public Element getTextsElement(Element corpusElement) {
|
378 |
|
NodeList textsList = corpusElement.getElementsByTagName("texts");
|
|
378 |
NodeList textsList = corpusElement.getElementsByTagName("texts");//$NON-NLS-1$
|
379 |
379 |
if(textsList.getLength() == 0) {
|
380 |
|
Element texts = corpusElement.getOwnerDocument().createElement("texts");
|
|
380 |
Element texts = corpusElement.getOwnerDocument().createElement("texts");//$NON-NLS-1$
|
381 |
381 |
corpusElement.appendChild(texts);
|
382 |
382 |
return texts;
|
383 |
383 |
} else {
|
... | ... | |
399 |
399 |
}
|
400 |
400 |
|
401 |
401 |
public Element getTextElement(Element textsElement, String name) {
|
402 |
|
NodeList textsList = textsElement.getElementsByTagName("text");
|
|
402 |
NodeList textsList = textsElement.getElementsByTagName("text");//$NON-NLS-1$
|
403 |
403 |
|
404 |
404 |
for (int i = 0 ; i < textsList.getLength() ;i++) {
|
405 |
405 |
Element text = (Element) textsList.item(i);
|
406 |
|
if (name.equals(text.getAttribute("name"))) return text;
|
|
406 |
if (name.equals(text.getAttribute("name"))) return text;//$NON-NLS-1$
|
407 |
407 |
}
|
408 |
408 |
return null;
|
409 |
409 |
|
410 |
410 |
}
|
411 |
411 |
|
412 |
412 |
public Element getEditionElement(Element textElement, String name) {
|
413 |
|
NodeList editionsList = textElement.getElementsByTagName("edition");
|
|
413 |
NodeList editionsList = textElement.getElementsByTagName("edition");//$NON-NLS-1$
|
414 |
414 |
|
415 |
415 |
for (int i = 0 ; i < editionsList.getLength() ;i++) {
|
416 |
416 |
Element editionElement = (Element) editionsList.item(i);
|
417 |
|
if (name.equals(editionElement.getAttribute("name"))) {
|
|
417 |
if (name.equals(editionElement.getAttribute("name"))) {//$NON-NLS-1$
|
418 |
418 |
return editionElement;
|
419 |
419 |
}
|
420 |
420 |
}
|
... | ... | |
443 |
443 |
public void addTokenizerTest(Element corpusElem, String regex,
|
444 |
444 |
String type, String before, String hit, String after) {
|
445 |
445 |
Element tokenizer = getTokenizerElement(corpusElem);
|
446 |
|
Element test = tokenizer.getOwnerDocument().createElement("test");
|
|
446 |
Element test = tokenizer.getOwnerDocument().createElement("test");//$NON-NLS-1$
|
447 |
447 |
test.setAttribute(TYPE, type);
|
448 |
448 |
test.setAttribute(VALUE, regex);
|
449 |
|
test.setAttribute("before", before);
|
450 |
|
test.setAttribute("hit", hit);
|
451 |
|
test.setAttribute("after", after);
|
|
449 |
test.setAttribute("before", before);//$NON-NLS-1$
|
|
450 |
test.setAttribute("hit", hit);//$NON-NLS-1$
|
|
451 |
test.setAttribute("after", after);//$NON-NLS-1$
|
452 |
452 |
tokenizer.appendChild(test);
|
453 |
453 |
}
|
454 |
454 |
|
... | ... | |
467 |
467 |
}
|
468 |
468 |
|
469 |
469 |
public Element getBibliosElement(Element corpusElem) {
|
470 |
|
return getElement(corpusElem, "biblios");
|
|
470 |
return getElement(corpusElem, "biblios");//$NON-NLS-1$
|
471 |
471 |
}
|
472 |
472 |
|
473 |
473 |
public boolean getCleanTEMPDirectories(Element corpusElem) {
|
... | ... | |
497 |
497 |
}
|
498 |
498 |
|
499 |
499 |
public Element getCQLLimitElement(Element uiElement) {
|
500 |
|
NodeList uiList = uiElement.getElementsByTagName("context_limits");
|
|
500 |
NodeList uiList = uiElement.getElementsByTagName("context_limits");//$NON-NLS-1$
|
501 |
501 |
if (uiList.getLength() > 0) {
|
502 |
502 |
return (Element)(uiList.item(0));
|
503 |
503 |
} else {
|
504 |
|
Element context_limitsElement = uiElement.getOwnerDocument().createElement("context_limits");
|
505 |
|
context_limitsElement.setAttribute("type", "list");
|
|
504 |
Element context_limitsElement = uiElement.getOwnerDocument().createElement("context_limits");//$NON-NLS-1$
|
|
505 |
context_limitsElement.setAttribute("type", "list");//$NON-NLS-1$ $NON-NLS-2$
|
506 |
506 |
context_limitsElement.setTextContent(DEFAULT_CQPLIMITS);
|
507 |
507 |
uiElement.appendChild(context_limitsElement);
|
508 |
508 |
return context_limitsElement;
|
... | ... | |
511 |
511 |
|
512 |
512 |
public Element getWordElement() {
|
513 |
513 |
Element textualPlanEelement = getTextualPlans();
|
514 |
|
NodeList uiList = textualPlanEelement.getElementsByTagName("word");
|
|
514 |
NodeList uiList = textualPlanEelement.getElementsByTagName("word");//$NON-NLS-1$
|
515 |
515 |
if (uiList.getLength() > 0) {
|
516 |
516 |
return (Element)(uiList.item(0));
|
517 |
517 |
} else {
|
518 |
|
Element wordElement = textualPlanEelement.getOwnerDocument().createElement("word");
|
519 |
|
wordElement.setTextContent("w");
|
|
518 |
Element wordElement = textualPlanEelement.getOwnerDocument().createElement("word");//$NON-NLS-1$
|
|
519 |
wordElement.setTextContent("w");//$NON-NLS-1$
|
520 |
520 |
textualPlanEelement.appendChild(wordElement);
|
521 |
521 |
return wordElement;
|
522 |
522 |
}
|
523 |
523 |
}
|
524 |
524 |
|
525 |
|
|
526 |
525 |
public Element getMilestonesElement() {
|
527 |
526 |
Element textualPlanEelement = getTextualPlans();
|
528 |
|
NodeList uiList = textualPlanEelement.getElementsByTagName("milestones");
|
|
527 |
NodeList uiList = textualPlanEelement.getElementsByTagName("milestones");//$NON-NLS-1$
|
529 |
528 |
if (uiList.getLength() > 0) {
|
530 |
529 |
return (Element)(uiList.item(0));
|
531 |
530 |
} else {
|
532 |
|
Element wordElement = textualPlanEelement.getOwnerDocument().createElement("milestones");
|
|
531 |
Element wordElement = textualPlanEelement.getOwnerDocument().createElement("milestones");//$NON-NLS-1$
|
533 |
532 |
wordElement.setTextContent("");
|
534 |
533 |
textualPlanEelement.appendChild(wordElement);
|
535 |
534 |
return wordElement;
|
... | ... | |
547 |
546 |
|
548 |
547 |
public Element getOutSideTextTagsElement() {
|
549 |
548 |
Element textualPlanEelement = getTextualPlans();
|
550 |
|
NodeList uiList = textualPlanEelement.getElementsByTagName("outsidetexttags");
|
|
549 |
NodeList uiList = textualPlanEelement.getElementsByTagName("outsidetexttags");//$NON-NLS-1$
|
551 |
550 |
if (uiList.getLength() > 0) {
|
552 |
551 |
return (Element)(uiList.item(0));
|
553 |
552 |
} else {
|
554 |
|
Element context_limitsElement = textualPlanEelement.getOwnerDocument().createElement("outsidetexttags");
|
555 |
|
context_limitsElement.setAttribute("type", "list");
|
556 |
|
context_limitsElement.setTextContent("");
|
|
553 |
Element context_limitsElement = textualPlanEelement.getOwnerDocument().createElement("outsidetexttags");//$NON-NLS-1$
|
|
554 |
context_limitsElement.setAttribute("type", "list");//$NON-NLS-1$ $NON-NLS-2$
|
|
555 |
context_limitsElement.setTextContent("");//$NON-NLS-1$
|
557 |
556 |
textualPlanEelement.appendChild(context_limitsElement);
|
558 |
557 |
return context_limitsElement;
|
559 |
558 |
}
|
... | ... | |
561 |
560 |
|
562 |
561 |
public Element getOutSideTextTagsAndKeepContentElement() {
|
563 |
562 |
Element textualPlanEelement = getTextualPlans();
|
564 |
|
NodeList uiList = textualPlanEelement.getElementsByTagName("outside_text_tags_and_keep_content");
|
|
563 |
NodeList uiList = textualPlanEelement.getElementsByTagName("outside_text_tags_and_keep_content");//$NON-NLS-1$
|
565 |
564 |
if (uiList.getLength() > 0) {
|
566 |
565 |
return (Element)(uiList.item(0));
|
567 |
566 |
} else {
|
568 |
|
Element element = textualPlanEelement.getOwnerDocument().createElement("outside_text_tags_and_keep_content");
|
569 |
|
element.setAttribute("type", "list");
|
570 |
|
element.setTextContent("");
|
|
567 |
Element element = textualPlanEelement.getOwnerDocument().createElement("outside_text_tags_and_keep_content");//$NON-NLS-1$
|
|
568 |
element.setAttribute("type", "list");//$NON-NLS-1$ $NON-NLS-2$
|
|
569 |
element.setTextContent("");//$NON-NLS-1$
|
571 |
570 |
textualPlanEelement.appendChild(element);
|
572 |
571 |
return element;
|
573 |
572 |
}
|
... | ... | |
575 |
574 |
|
576 |
575 |
public Element getNoteElement() {
|
577 |
576 |
Element textualPlanElement = getTextualPlans();
|
578 |
|
NodeList noteList = textualPlanElement.getElementsByTagName("note");
|
|
577 |
NodeList noteList = textualPlanElement.getElementsByTagName("note");//$NON-NLS-1$
|
579 |
578 |
if (noteList.getLength() > 0) {
|
580 |
579 |
return (Element)(noteList.item(0));
|
581 |
580 |
} else {
|
582 |
|
Element element = textualPlanElement.getOwnerDocument().createElement("note");
|
583 |
|
element.setAttribute("type", "list");
|
584 |
|
element.setTextContent("");
|
|
581 |
Element element = textualPlanElement.getOwnerDocument().createElement("note");//$NON-NLS-1$
|
|
582 |
element.setAttribute("type", "list");//$NON-NLS-1$
|
|
583 |
element.setTextContent("");//$NON-NLS-1$
|
585 |
584 |
textualPlanElement.appendChild(element);
|
586 |
585 |
return element;
|
587 |
586 |
}
|
... | ... | |
595 |
594 |
Element editionElement = getEditionDefinitionElement(editionsElement, edition);
|
596 |
595 |
if (editionElement == null) return DEFAULT_DOEDITION;
|
597 |
596 |
|
598 |
|
String value = editionElement.getAttribute("build_edition");
|
|
597 |
String value = editionElement.getAttribute("build_edition");//$NON-NLS-1$
|
599 |
598 |
if (value == null | value.length() == 0) return DEFAULT_DOEDITION;
|
600 |
599 |
|
601 |
600 |
return TRUE.equals(value);
|
... | ... | |
608 |
607 |
* @return the edition Element corresponding to the asked edition name
|
609 |
608 |
*/
|
610 |
609 |
public Element getEditionDefinitionElement(Element editionsElem, String name) {
|
611 |
|
NodeList editionList = editionsElem.getElementsByTagName("edition");
|
|
610 |
NodeList editionList = editionsElem.getElementsByTagName("edition");//$NON-NLS-1$
|
612 |
611 |
for (int i = 0 ; i < editionList.getLength() ; i++) {
|
613 |
612 |
Element elem = (Element)editionList.item(i);
|
614 |
|
if (name.equals(elem.getAttribute("name")))
|
|
613 |
if (name.equals(elem.getAttribute("name")))//$NON-NLS-1$
|
615 |
614 |
return elem;
|
616 |
615 |
}
|
617 |
616 |
//
|
... | ... | |
634 |
633 |
* @return the element that list the declared editions in a corpus
|
635 |
634 |
*/
|
636 |
635 |
public Element getEditionsElement(Element corpusElem) {
|
637 |
|
Element elem = getElement(corpusElem, "editions");
|
|
636 |
Element elem = getElement(corpusElem, "editions");//$NON-NLS-1$
|
638 |
637 |
if (elem == null) {
|
639 |
|
elem = corpusElem.getOwnerDocument().createElement("editions");
|
|
638 |
elem = corpusElem.getOwnerDocument().createElement("editions");//$NON-NLS-1$
|
640 |
639 |
}
|
641 |
640 |
if (!elem.hasAttribute(DEFAULT))
|
642 |
641 |
elem.setAttribute(DEFAULT, DEFAULT);
|
... | ... | |
663 |
662 |
public ArrayList<String> getExcludeXpaths() {
|
664 |
663 |
Element filter = getFilterElement();
|
665 |
664 |
ArrayList<String> xpaths = new ArrayList<String>();
|
666 |
|
NodeList excludeList = filter.getElementsByTagName("exclude");
|
|
665 |
NodeList excludeList = filter.getElementsByTagName("exclude");//$NON-NLS-1$
|
667 |
666 |
for (int i = 0 ; i < excludeList.getLength() ; i++) {
|
668 |
667 |
Element exclude = (Element) excludeList.item(i);
|
669 |
|
if ("xpath".equals(exclude.getAttribute("type")))
|
|
668 |
if ("xpath".equals(exclude.getAttribute("type")))//$NON-NLS-1$ $NON-NLS-2$
|
670 |
669 |
xpaths.add(exclude.getTextContent().trim());
|
671 |
670 |
}
|
672 |
671 |
return xpaths;
|
... | ... | |
674 |
673 |
|
675 |
674 |
public Element getFilterElement() {
|
676 |
675 |
Element corpusElem = corpora.get(getCorpusName());
|
677 |
|
return getElement(corpusElem, "xmlfilter");
|
|
676 |
return getElement(corpusElem, "xmlfilter");//$NON-NLS-1$
|
678 |
677 |
}
|
679 |
678 |
|
680 |
679 |
public String getLang(Element corpusElem) {
|
681 |
680 |
String str = corpusElem.getAttribute(LANG);
|
682 |
|
if (str == null) str = System.getProperty("user.locale");
|
|
681 |
if (str == null) str = System.getProperty("user.locale");//$NON-NLS-1$
|
683 |
682 |
return str;
|
684 |
683 |
}
|
685 |
684 |
|
... | ... | |
691 |
690 |
Element editionElement = getEditionDefinitionElement(editionsElement, edition);
|
692 |
691 |
if (editionElement == null) return DEFAULT_PAGEELEMENT;
|
693 |
692 |
|
694 |
|
String value = editionElement.getAttribute("page_break_tag");
|
|
693 |
String value = editionElement.getAttribute("page_break_tag");//$NON-NLS-1$
|
695 |
694 |
if (value == null || value.length() == 0) return DEFAULT_PAGEELEMENT;
|
696 |
695 |
|
697 |
696 |
return value;
|
698 |
697 |
}
|
699 |
698 |
|
700 |
699 |
public NodeList getPAttributes(Element corpusElem) {
|
701 |
|
NodeList pattributesList = corpusElem.getElementsByTagName("pattributes");
|
|
700 |
NodeList pattributesList = corpusElem.getElementsByTagName("pattributes");//$NON-NLS-1$
|
702 |
701 |
if(pattributesList.getLength() == 0)
|
703 |
702 |
return null;
|
704 |
|
return ((Element)pattributesList.item(0)).getElementsByTagName("pattribute");
|
|
703 |
return ((Element)pattributesList.item(0)).getElementsByTagName("pattribute");//$NON-NLS-1$
|
705 |
704 |
}
|
706 |
705 |
|
707 |
706 |
public Element getPAttributesElement(Element corpusElem) {
|
708 |
|
return getElement(corpusElem, "pattributes");
|
|
707 |
return getElement(corpusElem, "pattributes");//$NON-NLS-1$
|
709 |
708 |
}
|
710 |
709 |
|
711 |
710 |
public Element getPreBuildElement() {
|
712 |
711 |
Element corpusElem = corpora.get(getCorpusName());
|
713 |
|
return getElement(corpusElem, "preBuild");
|
|
712 |
return getElement(corpusElem, "preBuild");//$NON-NLS-1$
|
714 |
713 |
}
|
715 |
714 |
|
716 |
715 |
public Element getPreBuildElement(Element corpusElem) {
|
717 |
|
return getElement(corpusElem, "preBuild");
|
|
716 |
return getElement(corpusElem, "preBuild");//$NON-NLS-1$
|
718 |
717 |
}
|
719 |
718 |
|
720 |
719 |
public Element getQueriesElement(Element corpusElem) {
|
721 |
|
return getElement(corpusElem, "queries");
|
|
720 |
return getElement(corpusElem, "queries");//$NON-NLS-1$
|
722 |
721 |
}
|
723 |
722 |
|
724 |
723 |
public Element getSAttributesElement(Element corpusElem) {
|
725 |
|
return getElement(corpusElem, "sattributes");
|
|
724 |
return getElement(corpusElem, "sattributes");//$NON-NLS-1$
|
726 |
725 |
}
|
727 |
726 |
|
728 |
727 |
public Element getTokenizerElement(Element corpusElem) {
|
729 |
|
return getElement(corpusElem, "tokenizer");
|
|
728 |
return getElement(corpusElem, "tokenizer");//$NON-NLS-1$
|
730 |
729 |
}
|
731 |
730 |
|
732 |
731 |
public Element getUIElement(Element corpusElem, String command) {
|
733 |
732 |
Element uisElement = getUIsElement(corpusElem);
|
734 |
733 |
Element uiElement = null;
|
735 |
|
NodeList uiList = uisElement.getElementsByTagName("ui");
|
|
734 |
NodeList uiList = uisElement.getElementsByTagName("ui");//$NON-NLS-1$
|
736 |
735 |
if (uiList.getLength() > 0) {
|
737 |
736 |
for (int i = 0 ; i < uiList.getLength() ; i++ ) {
|
738 |
737 |
Element ui = (Element)(uiList.item(i));
|
739 |
|
if (command.equals(ui.getAttribute("command"))) {
|
|
738 |
if (command.equals(ui.getAttribute("command"))) {//$NON-NLS-1$
|
740 |
739 |
return ui;
|
741 |
740 |
}
|
742 |
741 |
}
|
743 |
742 |
}
|
744 |
743 |
if (uiElement == null){
|
745 |
|
uiElement = uisElement.getOwnerDocument().createElement("ui");
|
746 |
|
uiElement.setAttribute("command", command);
|
|
744 |
uiElement = uisElement.getOwnerDocument().createElement("ui");//$NON-NLS-1$
|
|
745 |
uiElement.setAttribute("command", command);//$NON-NLS-1$
|
747 |
746 |
uisElement.appendChild(uiElement);
|
748 |
747 |
}
|
749 |
748 |
return uiElement;
|
... | ... | |
761 |
760 |
Element editionElement = getEditionDefinitionElement(editionsElement, edition);
|
762 |
761 |
if (editionElement == null) return DEFAULT_WORDSPERPAGE;
|
763 |
762 |
|
764 |
|
String value = editionElement.getAttribute("words_per_page");
|
|
763 |
String value = editionElement.getAttribute("words_per_page");//$NON-NLS-1$
|
765 |
764 |
if (value == null) return DEFAULT_WORDSPERPAGE;
|
766 |
765 |
|
767 |
766 |
try {
|
768 |
767 |
return Integer.parseInt(value);
|
769 |
768 |
} catch (NumberFormatException e) {
|
770 |
|
Log.fine("words_per_page value is not an Integer value: "+value);
|
|
769 |
Log.fine("words_per_page value is not an Integer value: "+value);//$NON-NLS-1$
|
771 |
770 |
return DEFAULT_WORDSPERPAGE;
|
772 |
771 |
}
|
773 |
772 |
}
|
774 |
773 |
|
775 |
774 |
public Element getXsltElement(Element corpusElem) {
|
776 |
|
Element elem = getElement(corpusElem, "xslt");
|
777 |
|
if (!elem.hasAttribute("xsl"))
|
778 |
|
elem.setAttribute("xsl", "");
|
|
775 |
Element elem = getElement(corpusElem, "xslt");//$NON-NLS-1$
|
|
776 |
if (!elem.hasAttribute("xsl"))//$NON-NLS-1$
|
|
777 |
elem.setAttribute("xsl", "");//$NON-NLS-1$
|
779 |
778 |
return elem;
|
780 |
779 |
}
|
781 |
780 |
|
782 |
781 |
public HashMap<String, String> getXsltParams(Element corpusElem) {
|
783 |
|
Element elem = getElement(corpusElem, "xslt");
|
784 |
|
if (!elem.hasAttribute("xsl"))
|
785 |
|
elem.setAttribute("xsl", "");
|
|
782 |
Element elem = getElement(corpusElem, "xslt");//$NON-NLS-1$
|
|
783 |
if (!elem.hasAttribute("xsl"))//$NON-NLS-1$
|
|
784 |
elem.setAttribute("xsl", "");//$NON-NLS-1$
|
786 |
785 |
HashMap<String, String> hash = new HashMap<String, String>();
|
787 |
|
NodeList params = elem.getElementsByTagName("param");
|
|
786 |
NodeList params = elem.getElementsByTagName("param");//$NON-NLS-1$
|
788 |
787 |
for(int i = 0 ; i < params.getLength() ; i++) {
|
789 |
788 |
Element paramElem = (Element) params.item(i);
|
790 |
|
String name = paramElem.getAttribute("name");
|
791 |
|
String value = paramElem.getAttribute("value");
|
|
789 |
String name = paramElem.getAttribute("name");//$NON-NLS-1$
|
|
790 |
String value = paramElem.getAttribute("value");//$NON-NLS-1$
|
792 |
791 |
if (name != null && value != null && name.length() > 0) {
|
793 |
792 |
hash.put(name, value);
|
794 |
793 |
}
|
... | ... | |
798 |
797 |
|
799 |
798 |
public void loadKeyValueParameters(Element parametersElem) {
|
800 |
799 |
//HashMap<String, String> hash = new HashMap<String, String>();
|
801 |
|
NodeList params = parametersElem.getElementsByTagName("param");
|
|
800 |
NodeList params = parametersElem.getElementsByTagName("param");//$NON-NLS-1$
|
802 |
801 |
for (int i = 0 ; i < params.getLength() ; i++) {
|
803 |
802 |
Element paramElem = (Element) params.item(i);
|
804 |
803 |
String name = paramElem.getAttribute(PARAMETERKEY);
|
... | ... | |
812 |
811 |
public void saveKeyValueParameters(Element parametersElem) {
|
813 |
812 |
//HashMap<String, String> hash = new HashMap<String, String>();
|
814 |
813 |
|
815 |
|
NodeList params = parametersElem.getElementsByTagName("param");
|
|
814 |
NodeList params = parametersElem.getElementsByTagName("param");//$NON-NLS-1$
|
816 |
815 |
HashSet<String> existingNames = new HashSet<String>();
|
817 |
816 |
for (int i = 0 ; i < params.getLength() ; i++) {
|
818 |
817 |
Element paramElem = (Element) params.item(i);
|
... | ... | |
828 |
827 |
|
829 |
828 |
for (String name : keyValueParameters.keySet()) {
|
830 |
829 |
if (!existingNames.contains(name)) { // create the element
|
831 |
|
Element paramElem = parametersElem.getOwnerDocument().createElement("param");
|
|
830 |
Element paramElem = parametersElem.getOwnerDocument().createElement("param");//$NON-NLS-1$
|
832 |
831 |
paramElem.setAttribute(PARAMETERKEY, name);
|
833 |
832 |
paramElem.setAttribute(PARAMETERVALUE, keyValueParameters.get(name).toString());
|
834 |
833 |
parametersElem.appendChild(paramElem);
|
... | ... | |
851 |
850 |
if (root == null) return false;
|
852 |
851 |
// import general infos
|
853 |
852 |
try {
|
854 |
|
if (root.getAttribute(DATE).matches("....-..-..")) {
|
|
853 |
if (root.getAttribute(DATE).matches("....-..-..")) {//$NON-NLS-1$
|
855 |
854 |
this.date = dateformat.parse(root.getAttribute(DATE));
|
856 |
855 |
} else { // try with DateFormat.getDateInstance(DateFormat.SHORT, Locale.UK)
|
857 |
856 |
this.date = shortUKDateformat.parse(root.getAttribute(DATE));
|
... | ... | |
859 |
858 |
}
|
860 |
859 |
} catch (ParseException e) {
|
861 |
860 |
this.date = new Date(0);
|
862 |
|
System.out.println("Warning: can't parse date '"+root.getAttribute(DATE)+"' in file "+paramFile+": "+e);
|
|
861 |
System.out.println("Warning: can't parse date '"+root.getAttribute(DATE)+"' in file "+paramFile+": "+e);//$NON-NLS-1$
|
863 |
862 |
}
|
864 |
|
this.version = root.getAttribute("version");
|
|
863 |
this.version = root.getAttribute("version");//$NON-NLS-1$
|
865 |
864 |
this.name = root.getAttribute(NAME).toUpperCase();
|
866 |
865 |
root.setAttribute(NAME, name);// force UPPERCASED NAME
|
867 |
|
this.author = root.getAttribute("author");
|
|
866 |
this.author = root.getAttribute("author");//$NON-NLS-1$
|
868 |
867 |
this.description = root.getAttribute(DESC);
|
869 |
|
this.rootDir = root.getAttribute("rootDir");
|
870 |
|
this.scriptFile = root.getAttribute("script");
|
|
868 |
this.rootDir = root.getAttribute("rootDir");//$NON-NLS-1$
|
|
869 |
this.scriptFile = root.getAttribute("script");//$NON-NLS-1$
|
871 |
870 |
|
872 |
871 |
// get Alignements
|
873 |
872 |
NodeList alignNodes = root.getElementsByTagName("linkGrp");
|
... | ... | |
877 |
876 |
for (int i = 0 ; i < linkNodes.getLength() ; i++) {
|
878 |
877 |
Element link = (Element)linkNodes.item(i);
|
879 |
878 |
String target = link.getAttribute(TARGET);
|
880 |
|
String[] split = target.split("#");
|
|
879 |
String[] split = target.split("#");//$NON-NLS-1$
|
881 |
880 |
if (split.length != 3) {
|
882 |
|
System.out.println("Error: linkGrp/link/@target malformed: "+target);
|
|
881 |
System.out.println("Error: linkGrp/link/@target malformed: "+target);//$NON-NLS-1$
|
883 |
882 |
continue;
|
884 |
883 |
}
|
885 |
884 |
String from = split[1].trim();
|
886 |
885 |
String to = split[2].trim();
|
887 |
886 |
|
888 |
|
links.put("#"+to+" #"+from, link);
|
|
887 |
links.put("#"+to+" #"+from, link);//$NON-NLS-1$
|
889 |
888 |
}
|
890 |
889 |
}
|
891 |
890 |
|
892 |
891 |
// corpora
|
893 |
|
NodeList corporaNodes = root.getElementsByTagName("corpora");
|
|
892 |
NodeList corporaNodes = root.getElementsByTagName("corpora");//$NON-NLS-1$
|
894 |
893 |
if (corporaNodes.getLength() > 0) {
|
895 |
894 |
corporaElement = (Element) corporaNodes.item(0);
|
896 |
895 |
NodeList corpusNodes = corporaElement.getElementsByTagName(CORPUS);
|
... | ... | |
919 |
918 |
this.saveKeyValueParameters(getParametersElement(getCorpusElement())); // save additional parameters
|
920 |
919 |
return DomUtils.save(root.getOwnerDocument(), paramFile);
|
921 |
920 |
} catch (Exception e) {
|
922 |
|
System.out.println("Fail to save parameters in "+paramFile+". Reason: "+e);
|
|
921 |
System.out.println("Fail to save parameters in "+paramFile+". Reason: "+e);//$NON-NLS-1$
|
923 |
922 |
org.txm.utils.logger.Log.printStackTrace(e);
|
924 |
923 |
}
|
925 |
924 |
return false;
|
... | ... | |
928 |
927 |
public void saveToElement() {
|
929 |
928 |
root.setAttribute(NAME, name);
|
930 |
929 |
root.setAttribute(DESC, description);
|
931 |
|
root.setAttribute("script", scriptFile);
|
932 |
|
root.setAttribute("rootDir", rootDir);
|
|
930 |
root.setAttribute("script", scriptFile);//$NON-NLS-1$
|
|
931 |
root.setAttribute("rootDir", rootDir);//$NON-NLS-1$
|
933 |
932 |
}
|
934 |
933 |
|
935 |
934 |
/* (non-Javadoc)
|
... | ... | |
944 |
943 |
}
|
945 |
944 |
|
946 |
945 |
public String getCQPLimits() {
|
947 |
|
Element concordanceElement = this.getUIElement(getCorpusElement(), "concordance");
|
|
946 |
Element concordanceElement = this.getUIElement(getCorpusElement(), "concordance");//$NON-NLS-1$
|
948 |
947 |
if (concordanceElement != null) {
|
949 |
948 |
Element context_limitsElement = this.getCQLLimitElement(concordanceElement);
|
950 |
949 |
if (context_limitsElement != null) {
|
... | ... | |
956 |
955 |
return DEFAULT_CQPLIMITS;
|
957 |
956 |
}
|
958 |
957 |
public Element getTextualPlans() {
|
959 |
|
Element uiElement = this.getUIElement(this.getCorpusElement(), "textualplans");
|
|
958 |
Element uiElement = this.getUIElement(this.getCorpusElement(), "textualplans");//$NON-NLS-1$
|
960 |
959 |
if (uiElement == null) {
|
961 |
960 |
Element uisElement = getUIsElement(this.getCorpusElement());
|
962 |
|
uiElement = uisElement.getOwnerDocument().createElement("ui");
|
963 |
|
uiElement.setAttribute("command", "textualplans");
|
|
961 |
uiElement = uisElement.getOwnerDocument().createElement("ui");//$NON-NLS-1$
|
|
962 |
uiElement.setAttribute("command", "textualplans");//$NON-NLS-1$
|
964 |
963 |
uisElement.appendChild(uiElement);
|
965 |
964 |
}
|
966 |
965 |
return uiElement;
|
... | ... | |
972 |
971 |
*/
|
973 |
972 |
public String getFacsEditionImageDirectory() {
|
974 |
973 |
Element corpusElement = getCorpusElement();
|
975 |
|
if (corpusElement == null) return "";
|
|
974 |
if (corpusElement == null) return "";//$NON-NLS-1$
|
976 |
975 |
Element editionsElement = getEditionsElement(corpusElement);
|
977 |
976 |
if (editionsElement == null) return "";
|
978 |
977 |
Element editionElement = getEditionDefinitionElement(editionsElement, "facs"); //$NON-NLS-1$
|
979 |
978 |
if (editionElement == null) return "";
|
980 |
979 |
|
981 |
|
String value = editionElement.getAttribute("images_directory");
|
|
980 |
String value = editionElement.getAttribute("images_directory");//$NON-NLS-1$
|
982 |
981 |
if (value == null || value.length() == 0) return "";
|
983 |
982 |
|
984 |
983 |
return value;
|
... | ... | |
992 |
991 |
Element editionElement = getEditionDefinitionElement(editionsElement, "facs"); //$NON-NLS-1$
|
993 |
992 |
if (editionElement == null) return false;
|
994 |
993 |
|
995 |
|
String value = editionElement.getAttribute("build_edition");
|
|
994 |
String value = editionElement.getAttribute("build_edition"); //$NON-NLS-1$
|
996 |
995 |
if (value == null | value.length() == 0) return DEFAULT_DOEDITION;
|
997 |
996 |
|
998 |
997 |
return TRUE.equals(value);
|
999 |
998 |
}
|
1000 |
999 |
|
1001 |
1000 |
public boolean getSkipTokenization() {
|
1002 |
|
return "true".equals(getTokenizerElement(getCorpusElement()).getAttribute("skip"));
|
|
1001 |
return "true".equals(getTokenizerElement(getCorpusElement()).getAttribute("skip")); // $NON-NLS-1$ $NON-NLS-2$
|
1003 |
1002 |
}
|
1004 |
1003 |
|
1005 |
1004 |
public void setSkipTokenization(boolean skip) {
|
1006 |
|
getTokenizerElement(getCorpusElement()).setAttribute("skip", Boolean.toString(skip));
|
|
1005 |
getTokenizerElement(getCorpusElement()).setAttribute("skip", Boolean.toString(skip));//$NON-NLS-1$
|
1007 |
1006 |
}
|
1008 |
1007 |
|
1009 |
1008 |
public void setDoAnnotation(boolean annotate) {
|
... | ... | |
1032 |
1031 |
Element milestonesElement = getMilestonesElement();
|
1033 |
1032 |
milestonesElement.setTextContent(milestoneElements.trim());
|
1034 |
1033 |
} else {
|
1035 |
|
System.out.println("Error: Textual plan parameters not saved.");
|
|
1034 |
System.out.println("Error: Textual plan parameters not saved."); //$NON-NLS-1$
|
1036 |
1035 |
}
|
1037 |
1036 |
}
|
1038 |
1037 |
|
... | ... | |
1057 |
1056 |
}
|
1058 |
1057 |
}
|
1059 |
1058 |
}
|
|
1059 |
|
|
1060 |
public void initializeProject(Project project) {
|
|
1061 |
EditionDefinition defaultEditionDef = project.getEditionDefinition("default"); //$NON-NLS-1$
|
|
1062 |
defaultEditionDef.setBuildEdition(this.getDoEdition("default")); //$NON-NLS-1$
|
|
1063 |
defaultEditionDef.setWordsPerPage(this.getWordsPerPage("default")); //$NON-NLS-1$
|
|
1064 |
defaultEditionDef.setPageBreakTag(this.getPageElement("default")); //$NON-NLS-1$
|
|
1065 |
|
|
1066 |
project.setTextualPlan("MileStones", this.getMilestonesElement().getTextContent()); //$NON-NLS-1$
|
|
1067 |
project.setTextualPlan("OutSideTextTags", this.getOutSideTextTagsElement().getTextContent()); //$NON-NLS-1$
|
|
1068 |
project.setTextualPlan("OutSideTextTagsAndKeepContent", this.getOutSideTextTagsAndKeepContentElement().getTextContent()); //$NON-NLS-1$
|
|
1069 |
project.setTextualPlan("Note", this.getNoteElement().getTextContent()); //$NON-NLS-1$
|
|
1070 |
|
|
1071 |
EditionDefinition facsEditionDef = project.getEditionDefinition("facs"); //$NON-NLS-1$
|
|
1072 |
facsEditionDef.setBuildEdition(this.getDoEdition("facs")); //$NON-NLS-1$
|
|
1073 |
facsEditionDef.setWordsPerPage(this.getWordsPerPage("facs")); //$NON-NLS-1$
|
|
1074 |
facsEditionDef.setPageBreakTag(this.getPageElement("facs")); //$NON-NLS-1$
|
|
1075 |
facsEditionDef.setImagesDirectory(this.getFacsEditionImageDirectory()); //$NON-NLS-1$
|
|
1076 |
|
|
1077 |
if (this.getCorpusElement().getAttribute("font") != null) { //$NON-NLS-1$
|
|
1078 |
project.setFont(this.getCorpusElement().getAttribute("font")); //$NON-NLS-1$
|
|
1079 |
}
|
|
1080 |
if (this.getCorpusElement().getAttribute("lang") != null) { //$NON-NLS-1$
|
|
1081 |
project.setLang(this.getCorpusElement().getAttribute("lang")); //$NON-NLS-1$
|
|
1082 |
}
|
|
1083 |
if (this.getCorpusElement().getAttribute("encoding") != null) { //$NON-NLS-1$
|
|
1084 |
project.setEncoding(this.getCorpusElement().getAttribute("encoding")); //$NON-NLS-1$
|
|
1085 |
}
|
|
1086 |
|
|
1087 |
if (this.getCQPLimits() != null) {
|
|
1088 |
project.getCommandPreferences("concordance").set("context_limits_type", "list"); //$NON-NLS-1$ $NON-NLS-2$
|
|
1089 |
project.getCommandPreferences("concordance").set("context_limits", this.getCQPLimits()); //$NON-NLS-1$ $NON-NLS-2$
|
|
1090 |
}
|
|
1091 |
|
|
1092 |
NodeList nodes = this.getTokenizerElement(this.getCorpusElement()).getElementsByTagName("param"); //$NON-NLS-1$
|
|
1093 |
for (int i = 0 ; i < nodes.getLength() ; i++) {
|
|
1094 |
Element paramElement = (Element) nodes.item(i);
|
|
1095 |
project.addTokenizerParameter(paramElement.getAttribute("name"), paramElement.getTextContent()); //$NON-NLS-1$
|
|
1096 |
}
|
|
1097 |
project.addTokenizerParameter("word_tags", this.getWordElement().getTextContent()); //$NON-NLS-1$
|
|
1098 |
project.addTokenizerParameter("onlyThoseTests", "false"); //$NON-NLS-1$ $NON-NLS-2$
|
|
1099 |
project.addTokenizerParameter("doTokenizeStep", Boolean.toString(!this.getSkipTokenization())); //$NON-NLS-1$
|
|
1100 |
|
|
1101 |
project.setXslt(this.getXsltElement(this.getCorpusElement()).getAttribute("xsl")); //$NON-NLS-1$
|
|
1102 |
project.setAnnotate("true".equals(this.getCorpusElement().getAttribute("annotate"))); //$NON-NLS-1$ $NON-NLS-2$
|
|
1103 |
project.setCleanAfterBuild(this.getCleanTEMPDirectories(this.getCorpusElement()));
|
|
1104 |
}
|
1060 |
1105 |
}
|