264 |
264 |
return page;
|
265 |
265 |
}
|
266 |
266 |
|
267 |
|
public void addPartition(Element corpusElem, String name, String[] queries,
|
268 |
|
String[] names) {
|
269 |
|
Element preBuildElement = this.getPreBuildElement(corpusElem);
|
270 |
|
Element partitionElem = preBuildElement.getOwnerDocument().createElement("partition");//$NON-NLS-1$
|
|
267 |
public Element addPartition(Element corpusElem, String name, String[] queries, String[] names) {
|
|
268 |
|
|
269 |
Element partitionElem = null;
|
|
270 |
|
|
271 |
if (corpusElem.getNodeName().equals("subcorpus")) { // if corpuselement is a subcorpus append the partition element to the subcorpus element children
|
|
272 |
partitionElem = corpusElem.getOwnerDocument().createElement("partition");//$NON-NLS-1$
|
|
273 |
corpusElem.appendChild(partitionElem);
|
|
274 |
} else {
|
|
275 |
Element preBuildElement = this.getPreBuildElement(corpusElem);
|
|
276 |
partitionElem = preBuildElement.getOwnerDocument().createElement("partition");//$NON-NLS-1$
|
|
277 |
preBuildElement.appendChild(partitionElem);
|
|
278 |
}
|
|
279 |
|
|
280 |
|
271 |
281 |
partitionElem.setAttribute(NAME, name);
|
272 |
282 |
for (int i = 0; i < queries.length; i++) {
|
273 |
|
Element partElem = preBuildElement.getOwnerDocument().createElement("part");//$NON-NLS-1$
|
|
283 |
Element partElem = partitionElem.getOwnerDocument().createElement("part");//$NON-NLS-1$
|
274 |
284 |
partElem.setAttribute(NAME, names[i]);
|
275 |
285 |
partElem.setAttribute(QUERY, queries[i]);
|
276 |
286 |
partitionElem.appendChild(partElem);
|
277 |
287 |
}
|
278 |
|
preBuildElement.appendChild(partitionElem);
|
|
288 |
|
|
289 |
|
|
290 |
return partitionElem;
|
279 |
291 |
}
|
280 |
292 |
|
281 |
293 |
public Element addPAttribute(Element corpusElem, String name, String shortname, String longname, String type, String renderer, String tooltip, String pattern, String importB, String mandatory,
|
... | ... | |
334 |
346 |
public Element addSAttribute(Element corpusElem, String name, String shortname, String longname, String type, String renderer, String tooltip, String pattern, String importB, String mandatory,
|
335 |
347 |
String inputFormat, String outputFormat) {
|
336 |
348 |
NodeList sattributesList = corpusElem.getElementsByTagName("sattributes");//$NON-NLS-1$
|
337 |
|
if (sattributesList.getLength() == 0)
|
|
349 |
if (sattributesList.getLength() == 0) {
|
338 |
350 |
return null;
|
|
351 |
}
|
339 |
352 |
|
340 |
353 |
Element sattributes = (Element) sattributesList.item(0);
|
341 |
354 |
Element sattribute = sattributes.getOwnerDocument().createElement("sattribute");//$NON-NLS-1$
|
... | ... | |
355 |
368 |
return sattribute;
|
356 |
369 |
}
|
357 |
370 |
|
358 |
|
public void addSubcorpus(Element corpusElem, String name, String query,
|
359 |
|
String desc) {
|
360 |
|
Element preBuildElement = this.getPreBuildElement(corpusElem);
|
361 |
|
Element subcorpusElem = preBuildElement.getOwnerDocument().createElement("subcorpus");//$NON-NLS-1$
|
|
371 |
public Element addSubcorpus(Element corpusElem, String name, String query, String desc) {
|
|
372 |
|
|
373 |
Element subcorpusElem = null;
|
|
374 |
|
|
375 |
if (corpusElem.getNodeName().equals("subcorpus")) { // if it's a subcorpus element, create the subcorpus as child
|
|
376 |
subcorpusElem = corpusElem.getOwnerDocument().createElement("subcorpus");//$NON-NLS-1$
|
|
377 |
corpusElem.appendChild(subcorpusElem);
|
|
378 |
} else {
|
|
379 |
Element preBuildElement = this.getPreBuildElement(corpusElem);
|
|
380 |
subcorpusElem = preBuildElement.getOwnerDocument().createElement("subcorpus");//$NON-NLS-1$
|
|
381 |
preBuildElement.appendChild(subcorpusElem);
|
|
382 |
}
|
|
383 |
|
362 |
384 |
subcorpusElem.setAttribute(NAME, name);
|
363 |
385 |
subcorpusElem.setAttribute(QUERY, query);
|
364 |
386 |
subcorpusElem.setAttribute(DESC, desc);
|
365 |
|
preBuildElement.appendChild(subcorpusElem);
|
|
387 |
|
|
388 |
return subcorpusElem;
|
366 |
389 |
}
|
367 |
390 |
|
368 |
391 |
/**
|