Search in sources :

Example 21 with AlignmentHelper

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

the class SelectedTerme method getAllALignType.

/**
 * Retourne tous les types d'alignements présents
 *
 * @return
 */
public ArrayList<Entry<String, String>> getAllALignType() {
    ArrayList<Entry<String, String>> types = new ArrayList<>();
    if (connect.getPoolConnexion() == null) {
        return types;
    }
    HashMap<String, String> map = new AlignmentHelper().getAlignmentType(connect.getPoolConnexion());
    types.addAll(map.entrySet());
    return types;
}
Also used : Entry(java.util.Map.Entry) ArrayList(java.util.ArrayList) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) PrefixString(com.k_int.IR.QueryModels.PrefixString)

Example 22 with AlignmentHelper

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

the class SelectedTerme method delAlign.

public void delAlign(int id) {
    new AlignmentHelper().deleteAlignment(connect.getPoolConnexion(), id, idTheso);
    align = new AlignmentHelper().getAllAlignmentOfConcept(connect.getPoolConnexion(), idC, idTheso);
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("sTerme.info12")));
}
Also used : AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) FacesMessage(javax.faces.application.FacesMessage)

Example 23 with AlignmentHelper

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

the class SelectedTerme method ajouterAlignAuto.

public void ajouterAlignAuto() {
    if (listAlignValues.isEmpty()) {
        return;
    }
    for (NodeAlignment na : listAlignValues) {
        if (na.isSave()) {
            new AlignmentHelper().addNewAlignment(connect.getPoolConnexion(), user.getUser().getId(), na.getConcept_target(), na.getThesaurus_target(), na.getUri_target(), na.getAlignement_id_type(), idC, idTheso, alignementSource.getId());
        }
    }
    align = new AlignmentHelper().getAllAlignmentOfConcept(connect.getPoolConnexion(), idC, idTheso);
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("sTerme.info11")));
    vue.setAddAlign(0);
}
Also used : NodeAlignment(mom.trd.opentheso.bdd.helper.nodes.NodeAlignment) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) FacesMessage(javax.faces.application.FacesMessage)

Example 24 with AlignmentHelper

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

the class SelectedTerme method getALignType.

/**
 * Retourne les types d'alignements présents pour ce terme
 *
 * @return
 */
public ArrayList<Entry<String, String>> getALignType() {
    ArrayList<Entry<String, String>> types = new ArrayList<>();
    ArrayList<Entry<String, String>> temp = new ArrayList<>();
    if (connect.getPoolConnexion() == null)
        return types;
    HashMap<String, String> map = new AlignmentHelper().getAlignmentType(connect.getPoolConnexion());
    temp.addAll(map.entrySet());
    for (Entry<String, String> e : temp) {
        for (NodeAlignment na : align) {
            if (e.getKey().equals(String.valueOf(na.getAlignement_id_type()))) {
                types.add(e);
                break;
            }
        }
    }
    return types;
}
Also used : Entry(java.util.Map.Entry) NodeAlignment(mom.trd.opentheso.bdd.helper.nodes.NodeAlignment) ArrayList(java.util.ArrayList) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) PrefixString(com.k_int.IR.QueryModels.PrefixString)

Example 25 with AlignmentHelper

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

the class EditAlignementSourceBean method duplicate.

/**
 * dupplique l'alignement sélectioné dans le currentTheso
 *
 * @param currentIdTheso
 * @param id_user
 */
public void duplicate(String currentIdTheso, int id_user) {
    // copie
    AlignementSource dupplicateAlignement = new AlignementSource();
    dupplicateAlignement.setSource(singleAlignementSources.getSource() + " - copy");
    dupplicateAlignement.setAlignement_format(singleAlignementSources.getAlignement_format());
    dupplicateAlignement.setDescription(singleAlignementSources.getDescription());
    dupplicateAlignement.setId(singleAlignementSources.getId());
    dupplicateAlignement.setRequete(singleAlignementSources.getRequete());
    dupplicateAlignement.setTypeRequete(singleAlignementSources.getTypeRequete());
    // ajout
    AlignmentHelper alignementHelper = new AlignmentHelper();
    List<String> selectedTheso = new ArrayList<>();
    selectedTheso.add(currentIdTheso);
    alignementHelper.injenctdansBDAlignement(connect.getPoolConnexion(), selectedTheso, dupplicateAlignement, id_user, currentIdTheso);
    // update
    updateSource(currentIdTheso);
}
Also used : ArrayList(java.util.ArrayList) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) AlignementSource(mom.trd.opentheso.core.alignment.AlignementSource)

Aggregations

AlignmentHelper (mom.trd.opentheso.bdd.helper.AlignmentHelper)42 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)16 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)11 Concept (mom.trd.opentheso.bdd.datas.Concept)10 Term (mom.trd.opentheso.bdd.datas.Term)10 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)10 NodeEM (mom.trd.opentheso.bdd.helper.nodes.NodeEM)9 NodeTerm (mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm)9 NodeNote (mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote)8 ArrayList (java.util.ArrayList)7 NodeAlignment (mom.trd.opentheso.bdd.helper.nodes.NodeAlignment)7 FacesMessage (javax.faces.application.FacesMessage)6 AlignementSource (mom.trd.opentheso.core.alignment.AlignementSource)6 SQLException (java.sql.SQLException)5 SKOSMapping (skos.SKOSMapping)5 SKOSTopConcept (skos.SKOSTopConcept)5 PrefixString (com.k_int.IR.QueryModels.PrefixString)4 HierarchicalRelationship (mom.trd.opentheso.bdd.datas.HierarchicalRelationship)4 GpsHelper (mom.trd.opentheso.bdd.helper.GpsHelper)4 NodeTermTraduction (mom.trd.opentheso.bdd.helper.nodes.term.NodeTermTraduction)4