// Create the number of languageTreeMaps that are in the db
int nrOfLanguages = availableLanguages.size();
if (nrOfLanguages <= 0) {
throw new LanguageHandlerException("No languages found in db");
}
// Get all languages and id's
Map<String, String> tm;
// Iterator textIterator = TextFinderBase.findAll(con).iterator();
// Text text = null;
// while (textIterator.hasNext()) {
// text = (Text)textIterator.next();
// Get text documents in correct order
Collection<DocumentorderBean> doCol = DocumentorderFinder
.findAllOrderByOrdernumber(con);
// loop all texts in all documents (in right order) and put them in
// the treemap will lead to the ones existing in more than one document
// beeing overwritten in correct order
for (DocumentorderBean doBean : doCol) {
// for (Text text : TextFinderBase.findAll(con)) {
for (Text text : TextFinder.findByDocument(con,
doBean.getDocument())) {
// tm is treemap for the current lang
tm = languageKeeper.get(text.getLanguageid());
if (tm == null) {
throw new LanguageHandlerException(
"Could not find mapping for language: "
+ text.getLanguageid());
}
tm.put(text.getId(), text.getText());
}