Feature #1044

Updated by Matthieu Decorde over 4 years ago

Currently, the number of words per page is hardcoded in each @*Loader.groovy@ script:
(output of '# grep 'new pager(' org.txm.toolbox/src/groovy/org/txm/importer/*/*Loader.groovy')
<pre>
bfm/bfmLoader.groovy: def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter,600, corpusname, metadataXPath);
bvh/bvhLoader.groovy: def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,600);
corptef/corptefLoader.groovy: def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,600);
csv/csvLoader.groovy: def ed = new pager(srcfile, resultfile, NoSpaceBefore, NoSpaceAfter, 500, imp.getMetaDatas(), basename);
discours/discoursLoader.groovy: def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
doc/docLoader.groovy: def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 99999, basename, "pb");
factiva/factivaLoader.groovy: def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
fleurs/fleursLoader.groovy: def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,500,basename);
frantext/frantextLoader.groovy: def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter,600, corpusname, metadataXPath);
hyperbase/hyperbaseLoader.groovy: def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
hyperprince/hyperprinceLoader.groovy: def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,500);
perrault/perraultLoader.groovy: def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,600);
quick/quickLoader.groovy: def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, null);
RGAQCJ/rgaqcjLoader.groovy: def ed = new pager(srcfile, resultfile, NoSpaceBefore, NoSpaceAfter, 600);
tigersearch/tigersearchLoader.groovy: def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
tmx/tmxLoader.groovy: def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 140, basename, null,splitTUs);
transcriber/transcriberLoader.groovy: def ed = new pager(txmFile, htmlDir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb", metadatas);
wtc/wtcLoader.groovy:def ed = new pager(binWtcFile, outdir, NoSpaceBefore, NoSpaceAfter, 500, basename, registryFile !=null, c.pAttributesList);
xmltxm/xmltxmLoader.groovy: def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
xml/xmlLoader.groovy: def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 300, basename, "pb");</pre>
(possible values for words per page are currently: 140, 300, 500, 600)

We need to allow the user to choose the number of words per page, especially if we want to allow her to also use pagebreak XML tags.

*Target*
A) For a first step, for only the 'TXT+CSV' and 'XML/w+CSV' import modules, create a 'pageSize' groovy variable initialized by the import.xml file, initialized by default with the old hardcoded value.

B) Add a 'pageSize' import parameter in the import.xml parameters file, initialized by default with the old hardcoded value.

h3. Validation step

* Run an import module and set the "pageSize" parameter to "5"
* check created edition pages

MD : **OK** tested with TXT+CSV and XML/W+CSV imports


Back