Search in sources :

Example 6 with NodeFacet

use of mom.trd.opentheso.bdd.helper.nodes.NodeFacet 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 7 with NodeFacet

use of mom.trd.opentheso.bdd.helper.nodes.NodeFacet 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

NodeFacet (mom.trd.opentheso.bdd.helper.nodes.NodeFacet)7 FacetHelper (mom.trd.opentheso.bdd.helper.FacetHelper)5 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)5 PrefixString (com.k_int.IR.QueryModels.PrefixString)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 Connection (java.sql.Connection)2 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)2 Statement (java.sql.Statement)2 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)2 NodeConceptTree (mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptTree)2 Term (mom.trd.opentheso.bdd.datas.Term)1