use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.
the class ImportSkosHelper method addGroups.
/**
* recupération des groups, subgroups
* @return
*/
public boolean addGroups() {
// récupération des groups ou domaine
GroupHelper groupHelper = new GroupHelper();
for (String idGroup : idGroups) {
groupHelper.insertGroup(ds, idGroup, thesaurus.getId_thesaurus(), "MT", // notation
"", adressSite, useArk, idUser);
}
groupHelper.insertGroup(ds, idGroupDefault, thesaurus.getId_thesaurus(), "MT", // notation
"", adressSite, useArk, idUser);
// ajouter les traductions des Groupes
ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
conceptGroupLabel.setIdgroup(idGroupDefault);
conceptGroupLabel.setIdthesaurus(thesaurus.getId_thesaurus());
conceptGroupLabel.setLang(langueSource);
conceptGroupLabel.setLexicalvalue("groupDefault");
groupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
/*
GroupHelper groupHelper = new GroupHelper();
idGroup = new ArrayList<>();//getGroups();
idGroup.add("1");
groupHelper.insertGroup(ds, idGroup.get(0),
thesaurus.getId_thesaurus(), "MT", "", "", "",
adressSite, useArk, idUser);
// ajouter les traductions des Groupes
ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
conceptGroupLabel.setIdgroup(idGroup.get(0));
conceptGroupLabel.setIdthesaurus(thesaurus.getId_thesaurus());
conceptGroupLabel.setLang(langueSource);
conceptGroupLabel.setLexicalvalue("group1");
groupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
*/
return true;
}
use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.
the class WriteBranchSkosBDD method writeDomaine.
private String writeDomaine(SKOSResource resource, String id_thesaurus, String adressSite, boolean useArk, int idUser) {
GroupHelper conceptGroupHelper = new GroupHelper();
String idConceptGroup = getId(resource.getUri());
conceptGroupHelper.insertGroup(ds, idConceptGroup, id_thesaurus, "D", "", adressSite, useArk, idUser);
// ajouter les traductions des Groupes
ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
for (int i = 0; i < resource.getLabelsList().size(); i++) {
conceptGroupLabel.setIdgroup(idConceptGroup);
conceptGroupLabel.setIdthesaurus(id_thesaurus);
conceptGroupLabel.setLang(resource.getLabelsList().get(i).getLanguage());
conceptGroupLabel.setLexicalvalue(resource.getLabelsList().get(i).getLabel());
conceptGroupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
}
return idConceptGroup;
}
use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.
the class WriteSkosBDD method writeDomaine.
public void writeDomaine(SKOSResource resource, String id_thesaurus, String id_langueSource, String adressSite, boolean useArk, int idUser) {
GroupHelper conceptGroupHelper = new GroupHelper();
String idConceptGroup = getId(resource.getUri());
conceptGroupHelper.insertGroup(ds, idConceptGroup, id_thesaurus, "D", "", adressSite, useArk, idUser);
// ajouter les traductions des Groupes
ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
for (int i = 0; i < resource.getLabelsList().size(); i++) {
conceptGroupLabel.setIdgroup(idConceptGroup);
conceptGroupLabel.setIdthesaurus(id_thesaurus);
conceptGroupLabel.setLang(resource.getLabelsList().get(i).getLanguage());
conceptGroupLabel.setLexicalvalue(resource.getLabelsList().get(i).getLabel());
conceptGroupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
}
ArrayList<SKOSRelation> relationsList = resource.getRelationsList();
for (SKOSRelation relation : relationsList) {
switch(relation.getProperty()) {
// ici on a les identifiants des TopConcepts
case SKOSProperty.narrower:
idsTopConcept.add(getId(relation.getTargetUri()));
break;
default:
break;
}
}
}
use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.
the class ImportTabuleIntoBDD method insertGroup.
private boolean insertGroup(HikariDataSource ds, TabulateDocument tabulateDocument, String idThesaurus, int idUser) {
GroupHelper conceptGroupHelper = new GroupHelper();
if (!conceptGroupHelper.insertGroup(ds, tabulateDocument.getId(), idThesaurus, tabulateDocument.getType(), "", "", false, idUser)) {
return false;
}
// ajouter les traductions des Groupes
ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
for (Label prefLabel : tabulateDocument.getPrefLabels()) {
conceptGroupLabel.setIdgroup(tabulateDocument.getId());
conceptGroupLabel.setIdthesaurus(idThesaurus);
conceptGroupLabel.setLang(prefLabel.getLang());
conceptGroupLabel.setLexicalvalue(prefLabel.getLabel());
conceptGroupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
}
return true;
}
use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.
the class SelectedTerme method editGroupName.
/**
* *************************************** EDITION
* ****************************************
*/
/**
* Permet de modifier le nom d'un Group ou sousGroup
*
* @param idTheso
* @param idGroup
* @param idLangue
* @param value
* @return
* #MR
*/
public boolean editGroupName(String idTheso, String idGroup, String idLangue, String value) {
GroupHelper groupHelper = new GroupHelper();
ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
conceptGroupLabel.setIdthesaurus(idTheso);
conceptGroupLabel.setIdgroup(idGroup);
conceptGroupLabel.setLang(idLangue);
conceptGroupLabel.setLexicalvalue(value);
// vérification si le Groupe est traduit déjà, on fait un update
if (groupHelper.isHaveTraduction(connect.getPoolConnexion(), idGroup, idTheso, idLangue)) {
if (!groupHelper.updateConceptGroupLabel(connect.getPoolConnexion(), conceptGroupLabel, user.getUser().getId())) {
return false;
}
} else {
if (!groupHelper.addGroupTraduction(connect.getPoolConnexion(), conceptGroupLabel, user.getUser().getId())) {
return false;
}
}
return true;
}
Aggregations