Search in sources :

Example 6 with LanguageHelper

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()));
}
Also used : LanguageHelper(mom.trd.opentheso.bdd.helper.LanguageHelper) ArrayList(java.util.ArrayList) Languages_iso639(mom.trd.opentheso.bdd.datas.Languages_iso639)

Example 7 with LanguageHelper

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;
}
Also used : LanguageHelper(mom.trd.opentheso.bdd.helper.LanguageHelper) ArrayList(java.util.ArrayList) NodeLang(mom.trd.opentheso.bdd.helper.nodes.NodeLang) ConceptGroup(mom.trd.opentheso.bdd.datas.ConceptGroup) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) Languages_iso639(mom.trd.opentheso.bdd.datas.Languages_iso639) NodeGroup(mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)

Aggregations

LanguageHelper (mom.trd.opentheso.bdd.helper.LanguageHelper)7 Languages_iso639 (mom.trd.opentheso.bdd.datas.Languages_iso639)5 ArrayList (java.util.ArrayList)4 ThesaurusHelper (mom.trd.opentheso.bdd.helper.ThesaurusHelper)3 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)2 NodeLang (mom.trd.opentheso.bdd.helper.nodes.NodeLang)2 FacesMessage (javax.faces.application.FacesMessage)1 FacesContext (javax.faces.context.FacesContext)1 Concept (mom.trd.opentheso.bdd.datas.Concept)1 ConceptGroup (mom.trd.opentheso.bdd.datas.ConceptGroup)1 Term (mom.trd.opentheso.bdd.datas.Term)1 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)1 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)1 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)1 NodeGroup (mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)1