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;
}
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")));
}
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);
}
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;
}
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);
}
Aggregations