use of mom.trd.opentheso.bdd.helper.LanguageHelper in project opentheso by miledrousset.
the class SelectedThesaurus method getTradForSearch.
/**
* Récupération des traductions du thésaurus
*
* @return une liste des traductions
*/
public ArrayList<Languages_iso639> getTradForSearch() {
thesaurus.getLanguage();
ArrayList<Languages_iso639> languages_iso639s = new ArrayList<>();
ArrayList<Languages_iso639> languages_iso639s_temp = new LanguageHelper().getLanguagesOfThesaurus(connect.getPoolConnexion(), thesaurus.getId_thesaurus());
// on replace la langue sélectionnée en premier
for (Languages_iso639 languages_iso639 : languages_iso639s_temp) {
if (languages_iso639.getId_iso639_1().equalsIgnoreCase(thesaurus.getLanguage())) {
languages_iso639s.add(0, languages_iso639);
} else {
languages_iso639s.add(languages_iso639);
}
}
Languages_iso639 languages_iso639_all = new Languages_iso639();
languages_iso639_all.setFrench_name("");
languages_iso639_all.setEnglish_name("");
languages_iso639_all.setId_iso639_1("");
languages_iso639_all.setId_iso639_1("");
languages_iso639s.add(languages_iso639_all);
return languages_iso639s;
// return (new LanguageHelper().getLanguagesOfThesaurus(connect.getPoolConnexion(), thesaurus.getId_thesaurus()));
}
use of mom.trd.opentheso.bdd.helper.LanguageHelper in project opentheso by miledrousset.
the class BackgroundTimeJob method synchroSparql.
private Runnable synchroSparql(int key) {
SynchroSparql run = new SynchroSparql();
run.setSparqlStruct(this.SparqlSyn.get(key));
ArrayList<Languages_iso639> listeLang = new LanguageHelper().getLanguagesOfThesaurus(this.connect.getPoolConnexion(), this.SparqlSyn.get(key).getThesaurus());
ArrayList<NodeLang> nol = new ArrayList<>();
for (Languages_iso639 lang : listeLang) {
NodeLang nd = new NodeLang();
nd.setValue(lang.getId_iso639_1());
nd.setCode(lang.getId_iso639_1());
nol.add(nd);
}
run.setListe_lang(nol);
ArrayList<String> nog = new GroupHelper().getListIdOfGroup(this.connect.getPoolConnexion(), this.SparqlSyn.get(key).getThesaurus());
ArrayList<NodeGroup> groupes = new ArrayList<>();
for (String group : nog) {
NodeGroup ng1 = new NodeGroup();
ng1.setId_group(group);
ConceptGroup cg = new ConceptGroup();
cg.setIdgroup(group);
ng1.setConceptGroup(cg);
groupes.add(ng1);
}
run.setListe_group(groupes);
run.setConn(this.connect);
return run;
}
Aggregations