Search in sources :

Example 11 with FacetHelper

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

the class SelectedTerme method getArrayFacette.

public ArrayList<Entry<String, String>> getArrayFacette() {
    if (connect.getPoolConnexion() == null) {
        return null;
    }
    ArrayList<Integer> temp = new FacetHelper().getIdFacetOfConcept(connect.getPoolConnexion(), idC, idTheso);
    Map<String, String> mapTemp = new HashMap<>();
    for (Integer i : temp) {
        NodeFacet nf = new FacetHelper().getThisFacet(connect.getPoolConnexion(), i, idTheso, idlangue);
        String value = new TermHelper().getThisTerm(connect.getPoolConnexion(), nf.getIdConceptParent(), idTheso, idlangue).getLexical_value();
        mapTemp.put(String.valueOf(nf.getIdFacet()), nf.getLexicalValue() + " (" + value + ")");
    }
    arrayFacette = new ArrayList<>(mapTemp.entrySet());
    return arrayFacette;
}
Also used : HashMap(java.util.HashMap) FacetHelper(mom.trd.opentheso.bdd.helper.FacetHelper) NodeFacet(mom.trd.opentheso.bdd.helper.nodes.NodeFacet) PrefixString(com.k_int.IR.QueryModels.PrefixString) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper)

Example 12 with FacetHelper

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

the class SelectedTerme method insertInFacet.

public void insertInFacet() {
    new FacetHelper().addConceptToFacet(connect.getPoolConnexion(), Integer.parseInt(valueEdit), idTheso, idC);
    valueEdit = "";
    reInitFacette();
    initTree();
    vue.setAddFacette(false);
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("sTerme.info10")));
}
Also used : FacetHelper(mom.trd.opentheso.bdd.helper.FacetHelper) FacesMessage(javax.faces.application.FacesMessage)

Example 13 with FacetHelper

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

the class SelectedTerme method getArrayFacetteInclure.

public ArrayList<Entry<String, String>> getArrayFacetteInclure() {
    if (connect.getPoolConnexion() == null) {
        return null;
    }
    ArrayList<NodeFacet> temp = new FacetHelper().getAllFacetsOfThesaurus(connect.getPoolConnexion(), idTheso, idlangue);
    ArrayList<Integer> temp2 = new FacetHelper().getIdFacetOfConcept(connect.getPoolConnexion(), idC, idTheso);
    Map<String, String> mapTemp = new HashMap<>();
    for (NodeFacet nf : temp) {
        if (!temp2.contains(nf.getIdFacet())) {
            String value = new TermHelper().getThisTerm(connect.getPoolConnexion(), nf.getIdConceptParent(), idTheso, idlangue).getLexical_value();
            mapTemp.put(String.valueOf(nf.getIdFacet()), nf.getLexicalValue() + " (" + value + ")");
        }
    }
    arrayFacette = new ArrayList<>(mapTemp.entrySet());
    return arrayFacette;
}
Also used : HashMap(java.util.HashMap) NodeFacet(mom.trd.opentheso.bdd.helper.nodes.NodeFacet) FacetHelper(mom.trd.opentheso.bdd.helper.FacetHelper) PrefixString(com.k_int.IR.QueryModels.PrefixString) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper)

Aggregations

FacetHelper (mom.trd.opentheso.bdd.helper.FacetHelper)13 FacesMessage (javax.faces.application.FacesMessage)6 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)5 NodeFacet (mom.trd.opentheso.bdd.helper.nodes.NodeFacet)5 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)4 NodeConceptTree (mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptTree)4 PrefixString (com.k_int.IR.QueryModels.PrefixString)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 DefaultTreeNode (org.primefaces.model.DefaultTreeNode)2 TreeNode (org.primefaces.model.TreeNode)2 Term (mom.trd.opentheso.bdd.datas.Term)1