Search in sources :

Example 46 with GroupHelper

use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.

the class NewTreeBean method changeGroupType.

public void changeGroupType(String type, TreeNode sbn) {
    ((MyTreeNode) sbn).setTypeDomaine(type);
    GroupHelper gh = new GroupHelper();
    gh.updateTypeGroup(this.connect.getPoolConnexion(), type, idThesoSelected, ((MyTreeNode) sbn).getIdConcept());
    this.onNodeExpand(sbn);
    for (TreeNode sn : sbn.getChildren()) {
        if (((MyTreeNode) sn).isIsSubGroup())
            changeGroupType(type, sn);
    }
}
Also used : MyTreeNode(mom.trd.opentheso.bdd.helper.nodes.MyTreeNode) TreeNode(org.primefaces.model.TreeNode) DefaultTreeNode(org.primefaces.model.DefaultTreeNode) MyTreeNode(mom.trd.opentheso.bdd.helper.nodes.MyTreeNode) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 47 with GroupHelper

use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.

the class SearchBean method getNom.

public String getNom(String id) {
    String nom;
    ConceptHelper ch = new ConceptHelper();
    Concept c = ch.getThisConcept(connect.getPoolConnexion(), id, theso.getThesaurus().getId_thesaurus());
    if (c == null) {
        nom = new GroupHelper().getLexicalValueOfGroup(connect.getPoolConnexion(), id, theso.getThesaurus().getId_thesaurus(), theso.getThesaurus().getLanguage());
    } else {
        nom = ch.getLexicalValueOfConcept(connect.getPoolConnexion(), id, theso.getThesaurus().getId_thesaurus(), theso.getThesaurus().getLanguage());
    }
    return nom;
}
Also used : Concept(mom.trd.opentheso.bdd.datas.Concept) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 48 with GroupHelper

use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.

the class SearchBean method research.

public void research() {
    result1 = new ArrayList<>();
    result2 = new ArrayList<>();
    if (typeSearch == 1) {
        // ALPHABETIQUE/HIERARCHIQUE
        if (typeValueSearch == 0) {
            if (onlyNote) {
                result1 = new SearchHelper().searchNote(connect.getPoolConnexion(), entry, langue.trim(), theso.getThesaurus().getId_thesaurus(), idGroup, startByOrContain);
            } else {
                if (onlyNotation) {
                    result1 = new SearchHelper().searchNotation(connect.getPoolConnexion(), entry, langue.trim(), theso.getThesaurus().getId_thesaurus(), idGroup);
                } else {
                    result1 = new SearchHelper().searchTerm(connect.getPoolConnexion(), entry, langue.trim(), theso.getThesaurus().getId_thesaurus(), idGroup, startByOrContain, withNote);
                }
            }
        } else if (typeValueSearch == 1) {
            // idC
            result1 = new SearchHelper().searchIdConcept(connect.getPoolConnexion(), entry, theso.getThesaurus().getId_thesaurus(), theso.getWorkLanguage());
        }
        nbRes = result1.size();
    } else if (typeSearch == 2) {
        // PERMUTEE
        if (typeValueSearch == 0) {
            // Terme
            if (idGroup == null || idGroup.equals("")) {
                result2 = new SearchHelper().getListPermute(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), langue.trim(), entry);
            // result2.addAll(new SearchHelper().getListPermuteNonPreferredTerm(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), langue.trim(), entry));
            } else {
                result2 = new SearchHelper().getListPermute(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), langue.trim(), entry, idGroup);
            // result2.addAll(new SearchHelper().getListPermuteNonPreferredTerm(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), langue.trim(), entry, idGroup));
            }
            nbRes = result2.size();
        } else if (typeValueSearch == 1) {
            // idC
            typeSearch = 1;
            result1 = new SearchHelper().searchIdConcept(connect.getPoolConnexion(), entry, theso.getThesaurus().getId_thesaurus());
            nbRes = result1.size();
        }
    }
    if (!langue.isEmpty()) {
        if (!langue.trim().equals(theso.getThesaurus().getLanguage())) {
            theso.getThesaurus().setLanguage(langue.trim());
            theso.update();
        }
    }
    for (NodeSearch ns : result1) {
        String temp;
        if (typeValueSearch == 1) {
            temp = new GroupHelper().getLexicalValueOfGroup(connect.getPoolConnexion(), ns.getIdGroup(), theso.getThesaurus().getId_thesaurus(), theso.getWorkLanguage());
        } else
            temp = new GroupHelper().getLexicalValueOfGroup(connect.getPoolConnexion(), ns.getIdGroup(), theso.getThesaurus().getId_thesaurus(), theso.getThesaurus().getLanguage());
        ns.setGroupLabel(temp);
    }
    theso.getVue().setOnglet(1);
}
Also used : NodeSearch(mom.trd.opentheso.bdd.helper.nodes.search.NodeSearch) SearchHelper(mom.trd.opentheso.bdd.helper.SearchHelper) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 49 with GroupHelper

use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.

the class SelectedCandidat method showGroup.

/**
 * permet de récupérer les Groups du concept sur lequel il faut accrocher le candidat
 * @param np
 */
private void showGroup(NodeProposition np) {
    boolean first = true;
    ArrayList<NodeGroup> nodeGroups = new GroupHelper().getListGroupOfConcept(connect.getPoolConnexion(), idTheso, np.getIdConceptParent(), langueTheso);
    for (NodeGroup nodeGroup : nodeGroups) {
        if (first) {
            domaine = nodeGroup.getLexicalValue();
            first = false;
        } else {
            domaine = domaine + "; " + nodeGroup.getLexicalValue();
        }
    }
}
Also used : GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) NodeGroup(mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)

Example 50 with GroupHelper

use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.

the class SelectedCandidat method setLevelInfos.

/**
 * permet d'initialiser les Groupes pour le niveau de concept sélectionné dans le thésauurus
 * @param idConcept
 * @param idLang
 * @return
 */
private boolean setLevelInfos(String idConcept, String idLang) {
    GroupHelper groupHelper = new GroupHelper();
    ArrayList<NodeGroup> nodeGroups = groupHelper.getListGroupOfConcept(connect.getPoolConnexion(), idTheso, idConcept, idLang);
    if (nodeGroups == null)
        return false;
    String tmp = "";
    boolean first = true;
    for (NodeGroup nodeGroup : nodeGroups) {
        if (!first)
            tmp = tmp + "; ";
        tmp = tmp + nodeGroup.getLexicalValue();
        first = false;
    }
    selectedNvx.setGroupLexicalValue(tmp);
    return true;
}
Also used : GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) NodeGroup(mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)

Aggregations

GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)79 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)38 ArrayList (java.util.ArrayList)22 NodeGroup (mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)18 SQLException (java.sql.SQLException)16 Connection (java.sql.Connection)14 FacesMessage (javax.faces.application.FacesMessage)13 ThesaurusHelper (mom.trd.opentheso.bdd.helper.ThesaurusHelper)9 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)9 ConceptGroupLabel (mom.trd.opentheso.bdd.datas.ConceptGroupLabel)8 RelationsHelper (mom.trd.opentheso.bdd.helper.RelationsHelper)8 NodeUri (mom.trd.opentheso.bdd.helper.nodes.NodeUri)8 NodeGroupLabel (mom.trd.opentheso.bdd.helper.nodes.group.NodeGroupLabel)8 PrefixString (com.k_int.IR.QueryModels.PrefixString)7 NodeAutoCompletion (mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)6 DefaultTreeNode (org.primefaces.model.DefaultTreeNode)6 HashMap (java.util.HashMap)5 Concept (mom.trd.opentheso.bdd.datas.Concept)5 OrphanHelper (mom.trd.opentheso.bdd.helper.OrphanHelper)5 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)5