use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.
the class SelectedTerme method deletGroupTraduction.
/**
* Cette fontion permet de supprimer la traduction d'un group
*
* #MR
* @param lang
*/
public void deletGroupTraduction(String lang) {
GroupHelper groupHelper = new GroupHelper();
if (!groupHelper.deleteGroupTraduction(connect.getPoolConnexion(), idDomaine, idTheso, lang)) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("error") + " :", langueBean.getMsg("error")));
return;
}
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("sTerme.info10")));
majLangueGroup();
}
use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.
the class SelectedThesaurus method addGroup.
/**
* Création d'un domaine avec mise à jour dans l'arbre
*
* @param codeTypeGroup
* @param titleGroup
* @return
*/
// private String typeDom;
public String addGroup(String codeTypeGroup, String titleGroup) {
String idGroup = null;
if (titleGroup.isEmpty()) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("theso.error7")));
} else {
nodeCG.setLexicalValue(titleGroup);
nodeCG.setIdLang(thesaurus.getLanguage());
nodeCG.getConceptGroup().setIdthesaurus(thesaurus.getId_thesaurus());
/*
if(typeDom == null || typeDom.equals("")){
typeDom = getTypeDomainePere();
haveFather = true;
}
if (typeDom != null && haveFather) {
nodeCG.getConceptGroup().setIdtypecode(typeDom);
} else {
nodeCG.getConceptGroup().setIdtypecode(codeTypeGroup);
}*/
if (codeTypeGroup.isEmpty()) {
codeTypeGroup = "MT";
}
nodeCG.getConceptGroup().setIdtypecode(codeTypeGroup);
GroupHelper cgh = new GroupHelper();
int idUser = tree.getSelectedTerme().getUser().getUser().getId();
idGroup = cgh.addGroup(connect.getPoolConnexion(), nodeCG, cheminSite, arkActive, idUser);
nodeCG = new NodeGroup();
vue.setSelectedActionDom(PropertiesNames.noActionDom);
tree.reInit();
tree.initTree(thesaurus.getId_thesaurus(), thesaurus.getLanguage());
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", titleGroup + " " + langueBean.getMsg("theso.info1.2")));
}
return idGroup;
}
use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.
the class SelectedThesaurus method regenIdGroup.
/**
* Cette fonction remplace tout les id des groupes du théso
*
* @param conn
* @param idTheso
* @return la liste des nouveaux id group
*/
private ArrayList<String> regenIdGroup(Connection conn, String idTheso) throws Exception {
/*récup les concepts*/
GroupHelper groupHelper = new GroupHelper();
ArrayList<String> idgroup = groupHelper.getListIdOfGroup(conn, idTheso);
if (idgroup == null || idgroup.isEmpty()) {
throw new Exception("No group in this thesaurus");
}
/*génération des nouveaux id*/
ArrayList<String> newIdGroup = createNewId(idgroup, idgroup.size());
/*maj des tables*/
for (int i = 0; i < idgroup.size(); i++) {
String id = idgroup.get(i);
String newId = newIdGroup.get(i);
// table concept_group
groupHelper.setIdGroup(conn, idTheso, id, newId);
// table concept_group_concept
groupHelper.setIdGroupConcept(conn, idTheso, id, newId);
// table concept_group_historique
groupHelper.setIdGroupHisto(conn, idTheso, id, newId);
// table concept_group_label
groupHelper.setIdGroupLabel(conn, idTheso, id, newId);
// table concept_group_label_historique
groupHelper.setIdGroupLabelHisto(conn, idTheso, id, newId);
// table relation_group
groupHelper.setIdGroupRelation(conn, idTheso, id, newId);
}
return newIdGroup;
}
use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.
the class AutoCompletBean method completOtherGroup.
public List<NodeAutoCompletion> completOtherGroup(String query) {
selectedAtt = new NodeAutoCompletion();
List<NodeAutoCompletion> liste = new ArrayList<>();
if (theso.getThesaurus().getId_thesaurus() != null && theso.getThesaurus().getLanguage() != null) {
liste = new GroupHelper().getAutoCompletionOtherGroup(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), terme.getIdDomaine(), theso.getThesaurus().getLanguage(), query);
}
return liste;
}
use of mom.trd.opentheso.bdd.helper.GroupHelper in project opentheso by miledrousset.
the class AutoCompletBean method completGroup.
public List<NodeAutoCompletion> completGroup(String query) {
selectedAtt = new NodeAutoCompletion();
List<NodeAutoCompletion> liste = new ArrayList<>();
if (theso.getThesaurus().getId_thesaurus() != null && theso.getThesaurus().getLanguage() != null) {
liste = new GroupHelper().getAutoCompletionGroup(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), theso.getThesaurus().getLanguage(), query);
}
return liste;
}
Aggregations